From gitlab at gitlab.haskell.org Mon Jul 1 00:31:53 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Sun, 30 Jun 2024 20:31:53 -0400 Subject: [Git][ghc/ghc][wip/fabu/T24452-confusing-error] 8 commits: Bump array submodule Message-ID: <6681f8f98d4f2_133ad119837708486@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T24452-confusing-error at Glasgow Haskell Compiler / GHC Commits: 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 5e82094b by Fabricio de Sousa Nascimento at 2024-07-01T09:31:45+09:00 compiler: Fix emitting a confusing error for non visible class method Changes the error message when trying to lookup names on GRE that `must_have_parent` but we get an `AmbiguousOccurrence`. The new behavior now points the user to the missing name, instead of the name clash which would be unhelpful in solving their compiling issue. Fixes #24452 - - - - - 30 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - + compiler/GHC/Iface/Warnings.hs - compiler/GHC/Rename/Env.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Settings/Builders/GenPrimopCode.hs - libraries/array - libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs - libraries/ghci/GHCi/BinaryArray.hs - + testsuite/tests/rename/T24452/AmbigPatSynA.hs - + testsuite/tests/rename/T24452/AmbigPatSynB.hs - + testsuite/tests/rename/T24452/T24452a.hs - + testsuite/tests/rename/T24452/T24452b.hs - + testsuite/tests/rename/T24452/T24452b.stderr - + testsuite/tests/rename/T24452/T24452c.hs - + testsuite/tests/rename/T24452/T24452c.stderr - + testsuite/tests/rename/T24452/T24452d.hs - + testsuite/tests/rename/T24452/T24452d.stderr - + testsuite/tests/rename/T24452/T24452e.hs - + testsuite/tests/rename/T24452/T24452e.stderr - + testsuite/tests/rename/T24452/T24452f.hs - + testsuite/tests/rename/T24452/T24452f.stderr - + testsuite/tests/rename/T24452/all.T - testsuite/tests/th/T12403.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/996ccf58b82650071135a10539db45e830a0b414...5e82094bb524c7b6df784ef50f751fb9d9fe81e3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/996ccf58b82650071135a10539db45e830a0b414...5e82094bb524c7b6df784ef50f751fb9d9fe81e3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 00:36:49 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Sun, 30 Jun 2024 20:36:49 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] 10 commits: Bump array submodule Message-ID: <6681fa21c9815_133ad11b60e30939e@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 5e82094b by Fabricio de Sousa Nascimento at 2024-07-01T09:31:45+09:00 compiler: Fix emitting a confusing error for non visible class method Changes the error message when trying to lookup names on GRE that `must_have_parent` but we get an `AmbiguousOccurrence`. The new behavior now points the user to the missing name, instead of the name clash which would be unhelpful in solving their compiling issue. Fixes #24452 - - - - - 87003cc4 by Fabricio de Sousa Nascimento at 2024-07-01T09:32:50+09:00 wip - - - - - d3284aa3 by Fabricio de Sousa Nascimento at 2024-07-01T09:33:10+09:00 wip - - - - - 30 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - + compiler/GHC/Iface/Warnings.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Settings/Builders/GenPrimopCode.hs - libraries/array - libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs - libraries/ghci/GHCi/BinaryArray.hs - + testsuite/tests/rename/T24452/AmbigPatSynA.hs - + testsuite/tests/rename/T24452/AmbigPatSynB.hs - + testsuite/tests/rename/T24452/T24452a.hs - + testsuite/tests/rename/T24452/T24452b.hs - + testsuite/tests/rename/T24452/T24452b.stderr - + testsuite/tests/rename/T24452/T24452c.hs - + testsuite/tests/rename/T24452/T24452c.stderr - + testsuite/tests/rename/T24452/T24452d.hs - + testsuite/tests/rename/T24452/T24452d.stderr - + testsuite/tests/rename/T24452/T24452e.hs - + testsuite/tests/rename/T24452/T24452e.stderr - + testsuite/tests/rename/T24452/T24452f.hs - + testsuite/tests/rename/T24452/T24452f.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9a3a62ce6858661631f9ce9a6279b97ef9e084b5...d3284aa33a12cb246005c45352298e9364050337 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9a3a62ce6858661631f9ce9a6279b97ef9e084b5...d3284aa33a12cb246005c45352298e9364050337 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 07:00:38 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Mon, 01 Jul 2024 03:00:38 -0400 Subject: [Git][ghc/ghc][ghc-9.6] 20 commits: NCG: Fix a bug where we errounously removed a required jump instruction. Message-ID: <66825416838d3_34473a1031c583549@gitlab.mail> Zubin pushed to branch ghc-9.6 at Glasgow Haskell Compiler / GHC Commits: 9045ab5d by Andreas Klebinger at 2024-06-25T14:33:16+05:30 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 (cherry picked from commit 0fe2b410ac0d8951f07ffcc9f3c6c97bc312df48) - - - - - 1b0f0c1b by Zubin Duggal at 2024-06-25T16:50:35+05:30 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. (cherry picked from commit a933aff37992ea311a60be878379e7abf650e9fb) - - - - - bf9b110b by Matthew Pickering at 2024-06-25T16:58:37+05:30 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. (cherry picked from commit 3fff09779d5830549ae455a15907b7bb9fe7859a) - - - - - 8ebc906a by Teo Camarasu at 2024-06-25T16:59:10+05:30 doc: Fix type error in hs_try_putmvar example (cherry picked from commit 06f7db4001e4eee0f3076d949876f8f4af0eb6fb) - - - - - 659a0b8b by Cheng Shao at 2024-06-25T17:00:44+05:30 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. (cherry picked from commit d2b17f3258b4d9db1de89c872f1b7cee0a3f9b74) - - - - - 8ae9b4fb by Cheng Shao at 2024-06-25T17:00:53+05:30 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ (cherry picked from commit 631cefec222e2db951c58db0b15a8d80ef5549cb) - - - - - 0619129e by Torsten Schmits at 2024-06-25T17:02:54+05:30 refactor quadratic search in warnMissingHomeModules (cherry picked from commit bc672166acd8f2815d58b6d214e69373abec4486) - - - - - 942ddb2a by Sylvain Henry at 2024-06-28T15:34:28+05:30 Reverse arguments to stgCallocBytes (fix #24828) (cherry picked from commit 6838a7c32ca29b5d44adc9d6280d3a960f31be7c) - - - - - 05e4b390 by Ryan Scott at 2024-06-28T15:34:28+05:30 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. (cherry picked from commit a3cd3a1d0d186f2aa4d0273c6b3e74a442de2ef0) - - - - - e0ff189b by Cheng Shao at 2024-06-28T15:34:28+05:30 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. (cherry picked from commit 0cff083abb24701530974872b21cf897c9955a9a) - - - - - 52235ada by Cheng Shao at 2024-06-28T15:34:28+05:30 hadrian: fix no_dynamic_libs flavour transformer This patch fixes the no_dynamic_libs flavour transformer and make fully_static reuse it. Previously building with no_dynamic_libs fails since ghc program is still dynamic and transitively brings in dyn ways of rts which are produced by no rules. (cherry picked from commit 1bb24432ff77e11a0340a7d8586e151e15bba2a1) - - - - - 2b1fd267 by Cheng Shao at 2024-06-28T15:34:28+05:30 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. (cherry picked from commit 7a660042395614e4b19534baf5b779f65059861e) - - - - - 33584ad7 by Cheng Shao at 2024-06-28T15:34:28+05:30 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. (cherry picked from commit c77a48af6e1f38337b305fec794e8c999f1c7f3a) - - - - - deb5497a by Ian-Woo Kim at 2024-06-28T15:34:28+05:30 Add missing BCO handling in scavenge_one. (cherry picked from commit 902ebcc2b95707319d37a19d6b23c342cc14b162) - - - - - 5a203d10 by Peter Trommler at 2024-06-28T15:34:28+05:30 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 (cherry picked from commit 7fe85b1354a13749f14d588e3cc742b8ae2d8da9) - - - - - 7d6907c8 by Zubin Duggal at 2024-06-28T15:34:28+05:30 Bump directory submodule to 1.3.8.5 - - - - - 86afa784 by Sebastian Graf at 2024-06-28T15:34:28+05:30 exprIsTrivial: Factor out shared implementation The duplication between `exprIsTrivial` and `getIdFromTrivialExpr_maybe` has been bugging me for a long time. This patch introduces an inlinable worker function `trivial_expr_fold` acting as the single, shared decision procedure of triviality. It "returns" a Church-encoded `Maybe (Maybe Id)`, so when it is inlined, it fuses to similar code as before. (Better code, even, in the case of `getIdFromTrivialExpr` which presently allocates a `Just` constructor that cancels away after this patch.) (cherry picked from commit 9cb7e73a632bb570dd5d9100ea45536a5f13e182) - - - - - d0438f66 by Sebastian Graf at 2024-06-28T15:34:28+05:30 Some cherry-picked bits of 59202c8 to fix #24718 As noted in f3225ed4b3f3c4, the test below is flaky on Darwin. Metric Decrease: MultiLayerModulesTH_Make (cherry picked from commit 78a253543d466ac511a1664a3e6aff032ca684d5) - - - - - 51b77722 by Andreas Klebinger at 2024-07-01T04:00:07+05:30 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. (cherry picked from commit 1bfa91115b8320ed99a5e946147528e21ca4f3e1) - - - - - 3a18c0fa by Zubin Duggal at 2024-07-01T04:00:07+05:30 Prepare release 9.6.6 - - - - - 30 changed files: - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/X86.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/ThToHs.hs - configure.ac - docs/users_guide/9.6.5-notes.rst - + docs/users_guide/9.6.6-notes.rst - docs/users_guide/exts/ffi.rst - docs/users_guide/release-notes.rst - hadrian/src/Flavour.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - libraries/directory - rts/Interpreter.c - rts/linker/Elf.c - rts/sm/GC.c - rts/sm/NonMovingMark.c The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/650c34ab4e1cefb521209b143ecd75367ec03ee1...3a18c0fa2edcd61b0c3b470661791b09501c4c2b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/650c34ab4e1cefb521209b143ecd75367ec03ee1...3a18c0fa2edcd61b0c3b470661791b09501c4c2b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 07:25:57 2024 From: gitlab at gitlab.haskell.org (Hannes Siebenhandl (@fendor)) Date: Mon, 01 Jul 2024 03:25:57 -0400 Subject: [Git][ghc/ghc][wip/perf-ci] 2 commits: gitlab-ci: Add nightly job for running the testsuite with perf profiling support Message-ID: <66825a054eec1_2e11c425a6e8443@gitlab.mail> Hannes Siebenhandl pushed to branch wip/perf-ci at Glasgow Haskell Compiler / GHC Commits: 8bc17070 by Fendor at 2024-07-01T09:25:15+02:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 739f7146 by Fendor at 2024-07-01T09:25:15+02:00 Enable perf profiling for compiler performance tests - - - - - 3 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - testsuite/tests/perf/compiler/all.T Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -154,6 +154,7 @@ data BuildConfig , noSplitSections :: Bool , validateNonmovingGc :: Bool , textWithSIMDUTF :: Bool + , testsuiteUsePerf :: Bool } -- Extra arguments to pass to ./configure due to the BuildConfig @@ -215,6 +216,7 @@ vanilla = BuildConfig , noSplitSections = False , validateNonmovingGc = False , textWithSIMDUTF = False + , testsuiteUsePerf = False } splitSectionsBroken :: BuildConfig -> BuildConfig @@ -267,6 +269,9 @@ tsan = vanilla { threadSanitiser = True } noTntc :: BuildConfig noTntc = vanilla { tablesNextToCode = False } +usePerfProfilingTestsuite :: BuildConfig -> BuildConfig +usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } + ----------------------------------------------------------------------------- -- Platform specific variables ----------------------------------------------------------------------------- @@ -287,6 +292,9 @@ runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use +runnerPerfTag :: Arch -> Opsys -> String +runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" + -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String @@ -767,6 +775,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } | validateNonmovingGc buildConfig ] in "RUNTEST_ARGS" =: unwords runtestArgs + , if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty ] jobArtifacts = Artifacts @@ -889,6 +898,12 @@ highCompression = addVariable "XZ_OPT" "-9" useHashUnitIds :: Job -> Job useHashUnitIds = addVariable "HADRIAN_ARGS" "--hash-unit-ids" +-- | Change the tag of the job to make sure the job is scheduled on a +-- runner that has the necessary capabilties to run the job with 'perf' +-- profiling counters. +perfProfilingJobTag :: Arch -> Opsys -> Job -> Job +perfProfilingJobTag arch opsys j = j { jobTags = [ runnerPerfTag arch opsys ] } + -- | Mark the validate job to run in fast-ci mode -- This is default way, to enable all jobs you have to apply the `full-ci` label. fastCI :: JobGroup Job -> JobGroup Job @@ -1028,6 +1043,8 @@ job_groups = make_wasm_jobs wasm_build_config {unregisterised = True} , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + -- Run the 'perf' profiling nightly job in the release config. + , perfProfilingJob Amd64 (Linux Debian12) releaseConfig ] where @@ -1040,6 +1057,12 @@ job_groups = -- (see Note [Object unloading]). fullyStaticBrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "ghcilink002 linker_unload_native") + perfProfilingJob arch sys buildConfig = + -- Rename the job to avoid conflicts + rename (<> "-perf") + $ modifyJobs (perfProfilingJobTag arch sys) + $ disableValidate (validateBuilds arch sys $ usePerfProfilingTestsuite buildConfig) + hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") tsan_jobs = ===================================== .gitlab/jobs.yaml ===================================== @@ -1917,6 +1917,69 @@ "XZ_OPT": "-9" } }, + "nightly-x86_64-linux-deb12-release-perf": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-x86_64-linux-deb12-release.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux-perf" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-release", + "BUILD_FLAVOUR": "release", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": " --config perf_path=perf", + "TEST_ENV": "x86_64-linux-deb12-release", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -8,7 +8,7 @@ test('T1969', extra_run_opts('+RTS -A64k -RTS'), # The default RESIDENCY_OPTS is 256k and we need higher sampling # frequency. Incurs a slow-down by about 2. - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), only_ways(['normal']), extra_hc_opts('-dcore-lint -static'), @@ -32,14 +32,14 @@ else: test('T3294', [collect_compiler_residency(15), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), conf_3294, ], compile, ['']) test('T4801', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']), extra_hc_opts('-static'), when(arch('wasm32') and unregisterised(), fragile(23290)) @@ -49,7 +49,7 @@ test('T4801', test('T3064', [collect_compiler_residency(20), - collect_compiler_stats('bytes allocated',2), + collect_compiler_runtime(2), only_ways(['normal']), ], compile, @@ -59,7 +59,7 @@ test('T3064', test('T4007', normal, makefile_test, ['T4007']) test('T5030', - [collect_compiler_stats('bytes allocated', 2), + [collect_compiler_runtime(2), only_ways(['normal']) ], @@ -67,14 +67,14 @@ test('T5030', ['-freduction-depth=300']) test('T5631', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']) ], compile, ['']) test('parsing001', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']), ], compile_fail, ['']) @@ -82,27 +82,27 @@ test('parsing001', test('T783', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2), + collect_compiler_runtime(2), extra_hc_opts('-static') ], compile,['']) test('T5321Fun', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) test('T5321FD', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) test('T5642', [ only_ways(['normal']), normal, - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['-O']) @@ -114,7 +114,7 @@ test('T5837', test('T6048', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) @@ -134,7 +134,7 @@ test('T9675', test('T9872a', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, @@ -142,28 +142,28 @@ test('T9872a', test('T9872b', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, ['']) test('T9872b_defer', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile, ['-fdefer-type-errors']) test('T9872c', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, ['']) test('T9872d', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['']) @@ -227,14 +227,14 @@ test ('LargeRecord', test('T9961', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['-O']) test('T9233', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], multimod_compile, ['T9233', '-v0 -O2 -fno-spec-constr']) @@ -249,14 +249,14 @@ test('T10370', test('T11068', normal, makefile_test, ['T11068']) test('T10547', - [ collect_compiler_stats('bytes allocated', 4), + [ collect_compiler_runtime(4), ], compile_fail, ['-fprint-expanded-synonyms']) test('T12227', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, # Use `-M1G` to prevent memory thrashing with ghc-8.0.1. @@ -264,14 +264,14 @@ test('T12227', test('T12425', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['']) test('T12234', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 2), + collect_compiler_runtime(2), ], compile, ['']) @@ -279,14 +279,14 @@ test('T12234', # See Note [Sensitivity to unique increment] in T12545.hs; spread was 4.8% test('T12545', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 10), # + collect_compiler_runtime(10), # ], multimod_compile, ['T12545', '-v0'] ) test('T13035', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), ], compile, [''] ) @@ -299,7 +299,7 @@ test('T13056', ['-O1']) test('T12707', - [ collect_compiler_stats('bytes allocated', 1), + [ collect_compiler_runtime(1), ], compile, ['']) @@ -311,7 +311,7 @@ test('T12707', # to avoid spurious errors. test('T12150', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 2) + collect_compiler_runtime(2) ], compile, ['']) @@ -483,7 +483,7 @@ test('MultiLayerModulesNoCode', ['MultiLayerModulesNoCode.script']) test('MultiComponentModulesRecomp', - [ collect_compiler_stats('bytes allocated', 2), + [ collect_compiler_runtime(2), pre_cmd('$MAKE -s --no-print-directory MultiComponentModulesRecomp'), extra_files(['genMultiComp.py']), compile_timeout_multiplier(5) @@ -492,7 +492,7 @@ test('MultiComponentModulesRecomp', [['unitp%d' % n for n in range(20)], '-fno-code -fwrite-interface -v0']) test('MultiComponentModules', - [ collect_compiler_stats('bytes allocated', 2), + [ collect_compiler_runtime(2), pre_cmd('$PYTHON ./genMultiComp.py'), extra_files(['genMultiComp.py']), compile_timeout_multiplier(5) @@ -565,7 +565,7 @@ test('T14683', test ('T9630', [ collect_compiler_residency(15), - collect_compiler_stats('bytes allocated', 2), + collect_compiler_runtime(2), ], multimod_compile, ['T9630', '-v0 -O']) @@ -611,7 +611,7 @@ test ('T16473', ['-O2 -flate-specialise']) test('T17516', - [ collect_compiler_stats('bytes allocated', 5), + [ collect_compiler_runtime(5), ], multimod_compile, ['T17516', '-O -v0']) @@ -635,13 +635,13 @@ test ('T18140', ['-v0 -O']) test('T10421', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], multimod_compile, ['T10421', '-v0 -O']) test('T10421a', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 10) + collect_compiler_runtime(10) ], multimod_compile, ['T10421a', '-v0 -O']) @@ -700,13 +700,13 @@ test ('T19695', ['-v0 -O2']) test('hard_hole_fits', # Testing multiple hole-fits with lots in scope for #16875 - collect_compiler_stats('bytes allocated', 2), # 1 is 300s, 0.010 is 3s. Without hole-fits it takes 1s + collect_compiler_runtime(2), # 1 is 300s, 0.010 is 3s. Without hole-fits it takes 1s compile, ['-fdefer-type-errors -fno-max-valid-hole-fits -package ghc']) test('T16875', # Testing one hole-fit with a lot in scope for #16875 # This test is very sensitive to environmental differences.. we should fix # that but for now the failure threshold is 4% (see #21557) - collect_compiler_stats('bytes allocated', 4), + collect_compiler_runtime(4), compile, ['-fdefer-type-errors -fno-max-valid-hole-fits -package ghc']) test ('T20261', @@ -720,7 +720,7 @@ test ('T20261', # a compile-time and a run-time performance test test('T21839c', [ collect_compiler_stats('all', 10), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), only_ways(['normal'])], compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c2356628e6dea6f2b6e695bdaaefd80fd7e1e432...739f71468c45ecdebc12b350f946c661facef53b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c2356628e6dea6f2b6e695bdaaefd80fd7e1e432...739f71468c45ecdebc12b350f946c661facef53b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 08:49:45 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 01 Jul 2024 04:49:45 -0400 Subject: [Git][ghc/ghc][wip/hadrian-ghci-multi] 4530 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <66826da99eeca_2e11c4db0e48234cc@gitlab.mail> Matthew Pickering pushed to branch wip/hadrian-ghci-multi at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * Main change: make the error message generated by mkFunTysMsg more accurate by changing "value arguments" to "visible arguments". * Refactor: define a new type synonym VisArity and use it instead of Arity in a few places. It might be the case that there other places in the compiler that should talk about visible arguments rather than value arguments, but I haven't tried to find them all, focusing only on the error message reported in the ticket. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - fd751494 by Matthew Pickering at 2024-07-01T08:49:13+00:00 ci: Try using multi repl in ghc-in-ghci test This should be quite a bit faster than the ./hadrian/ghci command as it doesn't properly build all the dependencies. - - - - - 30 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/default.nix - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/README.mkd - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitlab/rel_eng/upload_ghc_libs.py - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/PrimOps.hs-boot - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Linker.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e196f1f02163d055db784048a5727dbf01c68f0f...fd75149450d3f3567f4c89b7c0789b4e90db5a65 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e196f1f02163d055db784048a5727dbf01c68f0f...fd75149450d3f3567f4c89b7c0789b4e90db5a65 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 08:57:26 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 04:57:26 -0400 Subject: [Git][ghc/ghc][wip/T24978] Fix glitch Message-ID: <66826f76d6e73_2e11c411fda645445a@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 2a272b3e by Simon Peyton Jones at 2024-07-01T09:56:59+01:00 Fix glitch - - - - - 2 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/FamInstEnv.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -1,7 +1,7 @@ {-# LANGUAGE LambdaCase #-} module GHC.Builtin.Types.Literals - ( tryInteractInertFam, tryInteractTopFam + ( tryInteractInertFam, tryInteractTopFam, tryMatchFam , typeNatTyCons , typeNatCoAxiomRules @@ -70,6 +70,7 @@ import GHC.Utils.Outputable import Control.Monad ( guard ) import Data.List ( isPrefixOf, isSuffixOf ) +import Data.Maybe ( listToMaybe ) import qualified Data.Char as Char {- @@ -163,15 +164,25 @@ tryInteractInertFam :: BuiltInSynFamily -> TyCon -> [Type] -> Type -- F tys1 ~ ty1 -> [Type] -> Type -- F tys2 ~ ty2 -> [(CoAxiomRule, TypeEqn)] -tryInteractInertFam fam fam_tc tys1 ty1 tys2 ty2 +tryInteractInertFam builtin_fam fam_tc tys1 ty1 tys2 ty2 = [(BuiltInFamInteract ax_rule, eqn) - | ax_rule <- sfInteractInert fam + | ax_rule <- sfInteractInert builtin_fam , Just eqn <- [bifint_proves ax_rule [eqn1,eqn2]] ] where eqn1 = Pair (mkTyConApp fam_tc tys1) ty1 eqn2 = Pair (mkTyConApp fam_tc tys2) ty2 - +tryMatchFam :: BuiltInSynFamily -> TyCon -> [Type] + -> Maybe (CoAxiomRule, [Type], Type) +-- Does this reduce on the given arguments? +-- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) +-- That is: mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) +-- :: F tys ~r rhs, +tryMatchFam builtin_fam fam_tc arg_tys + = listToMaybe $ -- Pick first rule to match + [ (BuiltInFamRewrite rw_ax, [inst_tys], res_ty) + | rw_ax <- sfMatchFam builtin_fam + , Just ([inst_tys],res_ty) <- [bifrw_match rw_ax arg_tys] ] ------------------------------------------------------------------------------- -- Built-in type constructors for functions on type-level nats ===================================== compiler/GHC/Core/FamInstEnv.hs ===================================== @@ -49,26 +49,30 @@ import GHC.Core.Coercion.Axiom import GHC.Core.Reduction import GHC.Core.RoughMap import GHC.Core.FVs( orphNamesOfAxiomLHS ) + +import GHC.Builtin.Types.Literals( tryMatchFam ) + import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Types.Name -import GHC.Data.FastString -import GHC.Data.Maybe import GHC.Types.Var import GHC.Types.SrcLoc -import Control.Monad -import Data.List( mapAccumL ) -import Data.Array( Array, assocs ) +import GHC.Types.Name.Set import GHC.Utils.Misc import GHC.Utils.Outputable import GHC.Utils.Panic -import GHC.Types.Name.Set +import GHC.Data.FastString +import GHC.Data.Maybe import GHC.Data.Bag import GHC.Data.List.Infinite (Infinite (..)) import qualified GHC.Data.List.Infinite as Inf +import Control.Monad +import Data.List( mapAccumL ) +import Data.Array( Array, assocs ) + {- ************************************************************************ * * @@ -1192,8 +1196,8 @@ reduceTyFamApp_maybe envs role tc tys = let co = mkAxInstCo role ax ind inst_tys inst_cos in Just $ coercionRedn co - | Just ax <- isBuiltInSynFamTyCon_maybe tc - , Just (coax,ts,ty) <- sfMatchFam ax tys + | Just builtin_fam <- isBuiltInSynFamTyCon_maybe tc + , Just (coax,ts,ty) <- tryMatchFam builtin_fam tc tys , role == coaxrRole coax = let co = mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) in Just $ mkReduction co ty View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2a272b3ef10720fdb95dce0bdaeb9bfe95dcda51 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2a272b3ef10720fdb95dce0bdaeb9bfe95dcda51 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 08:58:24 2024 From: gitlab at gitlab.haskell.org (Ryan Scott (@RyanGlScott)) Date: Mon, 01 Jul 2024 04:58:24 -0400 Subject: [Git][ghc/ghc][wip/T24894] 155 commits: hadrian: disable PIC for in-tree GMP on wasm32 Message-ID: <66826fb0a313c_2e11c412e6c78564c2@gitlab.mail> Ryan Scott pushed to branch wip/T24894 at Glasgow Haskell Compiler / GHC Commits: f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 9b0e65d1 by Ryan Scott at 2024-07-01T08:58:16+00:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3a5485f49736cf404e1354ea0529b0a52b7280e...9b0e65d1d4058f76abf107716817aa1e637cea67 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3a5485f49736cf404e1354ea0529b0a52b7280e...9b0e65d1d4058f76abf107716817aa1e637cea67 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 09:14:18 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Mon, 01 Jul 2024 05:14:18 -0400 Subject: [Git][ghc/ghc] Pushed new tag ghc-9.6.6-release Message-ID: <6682736a4bea2_11a5d91a93d41798f@gitlab.mail> Zubin pushed new tag ghc-9.6.6-release at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/ghc-9.6.6-release You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 10:27:31 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 01 Jul 2024 06:27:31 -0400 Subject: [Git][ghc/ghc][wip/amg/module-cycle-error] 2 commits: Use structured errors for a Backpack instantiation error Message-ID: <6682849361cf7_11a5d9a2588c51564@gitlab.mail> sheaf pushed to branch wip/amg/module-cycle-error at Glasgow Haskell Compiler / GHC Commits: 81527ee1 by sheaf at 2024-07-01T12:21:00+02:00 Use structured errors for a Backpack instantiation error - - - - - 803bfbfc by sheaf at 2024-07-01T12:21:18+02:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 8 changed files: - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Unit/Module/Location.hs - + compiler/ghc-llvm-version.h Changes: ===================================== compiler/GHC/Driver/Errors/Ppr.hs ===================================== @@ -264,7 +264,10 @@ instance Diagnostic DriverMessage where ppr_ms :: ModSummary -> SDoc ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+> (parens (text (msHsFilePath ms))) - + DriverInstantiationNodeInDependencyGeneration node -> + mkSimpleDecorated $ + vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" + , nest 2 $ ppr node ] diagnosticReason = \case DriverUnknownMessage m @@ -332,6 +335,8 @@ instance Diagnostic DriverMessage where -> WarningWithFlag Opt_WarnDeprecatedFlags DriverModuleGraphCycle {} -> ErrorWithoutFlag + DriverInstantiationNodeInDependencyGeneration {} + -> ErrorWithoutFlag diagnosticHints = \case DriverUnknownMessage m @@ -401,5 +406,7 @@ instance Diagnostic DriverMessage where -> noHints DriverModuleGraphCycle {} -> noHints + DriverInstantiationNodeInDependencyGeneration {} + -> noHints diagnosticCode = constructorCode ===================================== compiler/GHC/Driver/Errors/Types.hs ===================================== @@ -385,7 +385,7 @@ data DriverMessage where DriverDeprecatedFlag :: String -> String -> DriverMessage - {- | DriverModuleGraphCycle is an error that occurs if the module graph + {-| DriverModuleGraphCycle is an error that occurs if the module graph contains cyclic imports. Test cases: @@ -397,6 +397,11 @@ data DriverMessage where -} DriverModuleGraphCycle :: [ModuleGraphNode] -> DriverMessage + {- | DriverInstantiationNodeInDependencyGeneration is an error that occurs + if the module graph used for dependency generation contains + Backpack 'InstantiationNode's. -} + DriverInstantiationNodeInDependencyGeneration :: InstantiatedUnit -> DriverMessage + deriving instance Generic DriverMessage data DriverMessageOpts = ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -1264,7 +1264,7 @@ upsweep n_jobs hsc_env hmi_cache diag_wrapper mHscMessage old_hpt build_plan = d -- of the upsweep. case cycle of Just mss -> do - cyclicModuleErr mss + throwOneError $ cyclicModuleErr mss Nothing -> do let success_flag = successIf (all isJust res) return (success_flag, completed) @@ -2385,16 +2385,15 @@ multiRootsErr summs@(summ1:_) mod = ms_mod summ1 files = map (expectJust "checkDup" . ml_hs_file . ms_location) summs -cyclicModuleErr :: [ModuleGraphNode] -> IO a +cyclicModuleErr :: [ModuleGraphNode] -> MsgEnvelope GhcMessage -- From a strongly connected component we find -- a single cycle to report cyclicModuleErr mss = assert (not (null mss)) $ case findCycle graph of Nothing -> pprPanic "Unexpected non-cycle" (ppr mss) - Just path -> throwOneError $ mkPlainErrorMsgEnvelope src_span - $ GhcDriverMessage - $ DriverModuleGraphCycle path + Just path -> mkPlainErrorMsgEnvelope src_span $ + GhcDriverMessage $ DriverModuleGraphCycle path where src_span = maybe noSrcSpan (mkFileSrcSpan . ms_location) (moduleGraphNodeModSum (head path)) where @@ -2408,13 +2407,6 @@ cyclicModuleErr mss | ms <- mss ] -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - - cleanCurrentModuleTempFilesMaybe :: MonadIO m => Logger -> TmpFs -> DynFlags -> m () cleanCurrentModuleTempFilesMaybe logger tmpfs dflags = if gopt Opt_KeepTmpFiles dflags ===================================== compiler/GHC/Driver/MakeFile.hs ===================================== @@ -19,7 +19,6 @@ import qualified GHC import GHC.Driver.Make import GHC.Driver.Monad import GHC.Driver.DynFlags -import GHC.Driver.Ppr import GHC.Utils.Misc import GHC.Driver.Env import GHC.Driver.Errors.Types @@ -212,14 +211,14 @@ processDeps :: DynFlags processDeps _ _ _ _ _ (CyclicSCC nodes) = -- There shouldn't be any cycles; report them - cyclicModuleErr nodes + throwOneError $ cyclicModuleErr nodes -processDeps dflags _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) +processDeps _ _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) = -- There shouldn't be any backpack instantiations; report them as well - throwGhcExceptionIO $ ProgramError $ - showSDoc dflags $ - vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" - , nest 2 $ ppr node ] + throwOneError $ + mkPlainErrorMsgEnvelope noSrcSpan $ + GhcDriverMessage $ DriverInstantiationNodeInDependencyGeneration node + processDeps _dflags _ _ _ _ (AcyclicSCC (LinkNode {})) = return () processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC (ModuleNode _ node)) ===================================== compiler/GHC/HsToCore.hs ===================================== @@ -64,7 +64,6 @@ import GHC.Builtin.Names import GHC.Builtin.Types.Prim import GHC.Builtin.Types -import GHC.Data.FastString import GHC.Data.Maybe ( expectJust ) import GHC.Data.OrdList import GHC.Data.SizedSeq ( sizeSS ) @@ -289,12 +288,6 @@ deSugar hsc_env ; return (msgs, Just mod_guts) }}}} -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - dsImpSpecs :: [LTcSpecPrag] -> DsM (OrdList (Id,CoreExpr), [CoreRule]) dsImpSpecs imp_specs = do { spec_prs <- mapMaybeM (dsSpec Nothing) imp_specs ===================================== compiler/GHC/Types/Error/Codes.hs ===================================== @@ -319,6 +319,7 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "DriverUnrecognisedFlag" = 93741 GhcDiagnosticCode "DriverDeprecatedFlag" = 53692 GhcDiagnosticCode "DriverModuleGraphCycle" = 92213 + GhcDiagnosticCode "DriverInstantiationNodeInDependencyGeneration" = 74284 -- Constraint solver diagnostic codes GhcDiagnosticCode "BadTelescope" = 97739 ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -7,12 +7,15 @@ module GHC.Unit.Module.Location , addBootSuffixLocn , addBootSuffixLocnOut , removeBootSuffix + , mkFileSrcSpan ) where import GHC.Prelude import GHC.Unit.Types +import GHC.Types.SrcLoc import GHC.Utils.Outputable +import GHC.Data.FastString (mkFastString) -- | Module Location -- @@ -113,4 +116,8 @@ addBootSuffixLocnOut locn , ml_hie_file = addBootSuffix (ml_hie_file locn) } - +mkFileSrcSpan :: ModLocation -> SrcSpan +mkFileSrcSpan mod_loc + = case ml_hs_file mod_loc of + Just file_path -> mkGeneralSrcSpan (mkFastString file_path) + Nothing -> interactiveSrcSpan -- Presumably ===================================== compiler/ghc-llvm-version.h ===================================== @@ -0,0 +1,11 @@ +/* compiler/ghc-llvm-version.h. Generated from ghc-llvm-version.h.in by configure. */ +#if !defined(__GHC_LLVM_VERSION_H__) +#define __GHC_LLVM_VERSION_H__ + +/* The maximum supported LLVM version number */ +#define sUPPORTED_LLVM_VERSION_MAX (16) + +/* The minimum supported LLVM version number */ +#define sUPPORTED_LLVM_VERSION_MIN (13) + +#endif /* __GHC_LLVM_VERSION_H__ */ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/407640d39aba1a20bf8aebe64ec63942394ce24c...803bfbfc141ff5a7f17354be69fbb1fcb8272a7c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/407640d39aba1a20bf8aebe64ec63942394ce24c...803bfbfc141ff5a7f17354be69fbb1fcb8272a7c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 10:31:16 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 01 Jul 2024 06:31:16 -0400 Subject: [Git][ghc/ghc][wip/amg/module-cycle-error] 2 commits: Use structured errors for a Backpack instantiation error Message-ID: <6682857477829_11a5d9b36938521af@gitlab.mail> sheaf pushed to branch wip/amg/module-cycle-error at Glasgow Haskell Compiler / GHC Commits: 247fa673 by sheaf at 2024-07-01T12:31:06+02:00 Use structured errors for a Backpack instantiation error - - - - - 747c3220 by sheaf at 2024-07-01T12:31:06+02:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 7 changed files: - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Unit/Module/Location.hs Changes: ===================================== compiler/GHC/Driver/Errors/Ppr.hs ===================================== @@ -264,7 +264,10 @@ instance Diagnostic DriverMessage where ppr_ms :: ModSummary -> SDoc ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+> (parens (text (msHsFilePath ms))) - + DriverInstantiationNodeInDependencyGeneration node -> + mkSimpleDecorated $ + vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" + , nest 2 $ ppr node ] diagnosticReason = \case DriverUnknownMessage m @@ -332,6 +335,8 @@ instance Diagnostic DriverMessage where -> WarningWithFlag Opt_WarnDeprecatedFlags DriverModuleGraphCycle {} -> ErrorWithoutFlag + DriverInstantiationNodeInDependencyGeneration {} + -> ErrorWithoutFlag diagnosticHints = \case DriverUnknownMessage m @@ -401,5 +406,7 @@ instance Diagnostic DriverMessage where -> noHints DriverModuleGraphCycle {} -> noHints + DriverInstantiationNodeInDependencyGeneration {} + -> noHints diagnosticCode = constructorCode ===================================== compiler/GHC/Driver/Errors/Types.hs ===================================== @@ -385,7 +385,7 @@ data DriverMessage where DriverDeprecatedFlag :: String -> String -> DriverMessage - {- | DriverModuleGraphCycle is an error that occurs if the module graph + {-| DriverModuleGraphCycle is an error that occurs if the module graph contains cyclic imports. Test cases: @@ -397,6 +397,11 @@ data DriverMessage where -} DriverModuleGraphCycle :: [ModuleGraphNode] -> DriverMessage + {- | DriverInstantiationNodeInDependencyGeneration is an error that occurs + if the module graph used for dependency generation contains + Backpack 'InstantiationNode's. -} + DriverInstantiationNodeInDependencyGeneration :: InstantiatedUnit -> DriverMessage + deriving instance Generic DriverMessage data DriverMessageOpts = ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -1264,7 +1264,7 @@ upsweep n_jobs hsc_env hmi_cache diag_wrapper mHscMessage old_hpt build_plan = d -- of the upsweep. case cycle of Just mss -> do - cyclicModuleErr mss + throwOneError $ cyclicModuleErr mss Nothing -> do let success_flag = successIf (all isJust res) return (success_flag, completed) @@ -2385,16 +2385,15 @@ multiRootsErr summs@(summ1:_) mod = ms_mod summ1 files = map (expectJust "checkDup" . ml_hs_file . ms_location) summs -cyclicModuleErr :: [ModuleGraphNode] -> IO a +cyclicModuleErr :: [ModuleGraphNode] -> MsgEnvelope GhcMessage -- From a strongly connected component we find -- a single cycle to report cyclicModuleErr mss = assert (not (null mss)) $ case findCycle graph of Nothing -> pprPanic "Unexpected non-cycle" (ppr mss) - Just path -> throwOneError $ mkPlainErrorMsgEnvelope src_span - $ GhcDriverMessage - $ DriverModuleGraphCycle path + Just path -> mkPlainErrorMsgEnvelope src_span $ + GhcDriverMessage $ DriverModuleGraphCycle path where src_span = maybe noSrcSpan (mkFileSrcSpan . ms_location) (moduleGraphNodeModSum (head path)) where @@ -2408,13 +2407,6 @@ cyclicModuleErr mss | ms <- mss ] -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - - cleanCurrentModuleTempFilesMaybe :: MonadIO m => Logger -> TmpFs -> DynFlags -> m () cleanCurrentModuleTempFilesMaybe logger tmpfs dflags = if gopt Opt_KeepTmpFiles dflags ===================================== compiler/GHC/Driver/MakeFile.hs ===================================== @@ -19,7 +19,6 @@ import qualified GHC import GHC.Driver.Make import GHC.Driver.Monad import GHC.Driver.DynFlags -import GHC.Driver.Ppr import GHC.Utils.Misc import GHC.Driver.Env import GHC.Driver.Errors.Types @@ -212,14 +211,14 @@ processDeps :: DynFlags processDeps _ _ _ _ _ (CyclicSCC nodes) = -- There shouldn't be any cycles; report them - cyclicModuleErr nodes + throwOneError $ cyclicModuleErr nodes -processDeps dflags _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) +processDeps _ _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) = -- There shouldn't be any backpack instantiations; report them as well - throwGhcExceptionIO $ ProgramError $ - showSDoc dflags $ - vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" - , nest 2 $ ppr node ] + throwOneError $ + mkPlainErrorMsgEnvelope noSrcSpan $ + GhcDriverMessage $ DriverInstantiationNodeInDependencyGeneration node + processDeps _dflags _ _ _ _ (AcyclicSCC (LinkNode {})) = return () processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC (ModuleNode _ node)) ===================================== compiler/GHC/HsToCore.hs ===================================== @@ -64,7 +64,6 @@ import GHC.Builtin.Names import GHC.Builtin.Types.Prim import GHC.Builtin.Types -import GHC.Data.FastString import GHC.Data.Maybe ( expectJust ) import GHC.Data.OrdList import GHC.Data.SizedSeq ( sizeSS ) @@ -289,12 +288,6 @@ deSugar hsc_env ; return (msgs, Just mod_guts) }}}} -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - dsImpSpecs :: [LTcSpecPrag] -> DsM (OrdList (Id,CoreExpr), [CoreRule]) dsImpSpecs imp_specs = do { spec_prs <- mapMaybeM (dsSpec Nothing) imp_specs ===================================== compiler/GHC/Types/Error/Codes.hs ===================================== @@ -319,6 +319,7 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "DriverUnrecognisedFlag" = 93741 GhcDiagnosticCode "DriverDeprecatedFlag" = 53692 GhcDiagnosticCode "DriverModuleGraphCycle" = 92213 + GhcDiagnosticCode "DriverInstantiationNodeInDependencyGeneration" = 74284 -- Constraint solver diagnostic codes GhcDiagnosticCode "BadTelescope" = 97739 ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -7,12 +7,15 @@ module GHC.Unit.Module.Location , addBootSuffixLocn , addBootSuffixLocnOut , removeBootSuffix + , mkFileSrcSpan ) where import GHC.Prelude import GHC.Unit.Types +import GHC.Types.SrcLoc import GHC.Utils.Outputable +import GHC.Data.FastString (mkFastString) -- | Module Location -- @@ -113,4 +116,8 @@ addBootSuffixLocnOut locn , ml_hie_file = addBootSuffix (ml_hie_file locn) } - +mkFileSrcSpan :: ModLocation -> SrcSpan +mkFileSrcSpan mod_loc + = case ml_hs_file mod_loc of + Just file_path -> mkGeneralSrcSpan (mkFastString file_path) + Nothing -> interactiveSrcSpan -- Presumably View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/803bfbfc141ff5a7f17354be69fbb1fcb8272a7c...747c3220d45937b409d168a7691fc694bdefbe99 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/803bfbfc141ff5a7f17354be69fbb1fcb8272a7c...747c3220d45937b409d168a7691fc694bdefbe99 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 10:32:20 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 06:32:20 -0400 Subject: [Git][ghc/ghc][wip/T24978] Complete family-matching stuff Message-ID: <668285b45ff0_11a5d9c174c45256c@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: f9e4c870 by Simon Peyton Jones at 2024-07-01T11:31:51+01:00 Complete family-matching stuff - - - - - 2 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/FamInstEnv.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -- See calls to mkTemplateTyVars module GHC.Builtin.Types.Literals ( tryInteractInertFam, tryInteractTopFam, tryMatchFam @@ -11,7 +12,6 @@ module GHC.Builtin.Types.Literals -- from here as well. -- See Note [Adding built-in type families] , typeNatAddTyCon -{- , typeNatMulTyCon , typeNatExpTyCon , typeNatSubTyCon @@ -26,7 +26,6 @@ module GHC.Builtin.Types.Literals , typeUnconsSymbolTyCon , typeCharToNatTyCon , typeNatToCharTyCon --} ) where import GHC.Prelude @@ -172,97 +171,49 @@ tryInteractInertFam builtin_fam fam_tc tys1 ty1 tys2 ty2 eqn1 = Pair (mkTyConApp fam_tc tys1) ty1 eqn2 = Pair (mkTyConApp fam_tc tys2) ty2 -tryMatchFam :: BuiltInSynFamily -> TyCon -> [Type] +tryMatchFam :: BuiltInSynFamily -> [Type] -> Maybe (CoAxiomRule, [Type], Type) -- Does this reduce on the given arguments? -- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) -- That is: mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) -- :: F tys ~r rhs, -tryMatchFam builtin_fam fam_tc arg_tys +tryMatchFam builtin_fam arg_tys = listToMaybe $ -- Pick first rule to match [ (BuiltInFamRewrite rw_ax, [inst_tys], res_ty) | rw_ax <- sfMatchFam builtin_fam , Just ([inst_tys],res_ty) <- [bifrw_match rw_ax arg_tys] ] ------------------------------------------------------------------------------- --- Built-in type constructors for functions on type-level nats -------------------------------------------------------------------------------- - --- The list of built-in type family TyCons that GHC uses. --- If you define a built-in type family, make sure to add it to this list. --- See Note [Adding built-in type families] -typeNatTyCons :: [TyCon] -typeNatTyCons = - [ typeNatAddTyCon -{- - , typeNatMulTyCon - , typeNatExpTyCon - , typeNatSubTyCon - , typeNatDivTyCon - , typeNatModTyCon - , typeNatLogTyCon - , typeNatCmpTyCon - , typeSymbolCmpTyCon - , typeSymbolAppendTyCon - , typeCharCmpTyCon - , typeConsSymbolTyCon - , typeUnconsSymbolTyCon - , typeCharToNatTyCon - , typeNatToCharTyCon --} - ] - - -tyConAxiomRules :: TyCon -> [CoAxiomRule] -tyConAxiomRules tc - | Just ops <- isBuiltInSynFamTyCon_maybe tc - = map BuiltInFamInteract (sfInteractTop ops) - ++ map BuiltInFamInteract (sfInteractInert ops) - ++ map BuiltInFamRewrite (sfMatchFam ops) - | otherwise - = [] - --- The list of built-in type family axioms that GHC uses. --- If you define new axioms, make sure to include them in this list. --- See Note [Adding built-in type families] -typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule -typeNatCoAxiomRules = listToUFM $ map (\x -> (coaxrName x, x)) $ - concatMap tyConAxiomRules typeNatTyCons - -------------------------------------------------------------------------------- --- Addition (+) +-- Constructing BuiltInFamInteract, BuiltInFamRewrite ------------------------------------------------------------------------------- -typeNatAddTyCon :: TyCon -typeNatAddTyCon = mkTypeNatFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axAddMatches - , sfInteractTop = axAddTops - , sfInteractInert = axAddInteracts - } - where - name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "+") - typeNatAddTyFamNameKey typeNatAddTyCon - - -nr,ns,nt :: TyVar -- Of kind Natural -(nr: ns: nt: _) = mkTemplateTyVars (repeat naturalTy) - -axAddMatches :: [BuiltInFamRewrite] -axAddMatches - = [ mkRewriteAxiom tc "Add0L" [nt] [num 0, var nt] (var nt) -- 0 + t --> t - , mkRewriteAxiom tc "Add0R" [ns] [var ns, num 0] (var ns) -- s + 0 --> s - , mkConstFoldAxiom tc "AddDef" isNumLitTy isNumLitTy $ -- 3 + 4 --> 7 - \x y -> Just $ num (x + y) ] - where - tc = typeNatAddTyCon +mkUnaryConstFoldAxiom :: TyCon -> String + -> (Type -> Maybe a) + -> (a -> Maybe Type) + -> BuiltInFamRewrite +-- For the definitional axioms, like (3+4 --> 7) +mkUnaryConstFoldAxiom tc str isReqTy f + = BIF_Rewrite + { bifrw_name = fsLit str + , bifrw_arg_roles = [Nominal] + , bifrw_res_role = Nominal + , bifrw_match = \ts -> do { [t1] <- return ts + ; t1' <- isReqTy t1 + ; res <- f t1' + ; return ([t1], res) } + , bifrw_proves = \cs -> do { [Pair s1 s2] <- return cs + ; s2' <- isReqTy s2 + ; z <- f s2' + ; return (mkTyConApp tc [s1] === z) } + } -mkConstFoldAxiom :: TyCon -> String - -> (Type -> Maybe a) - -> (Type -> Maybe b) - -> (a -> b -> Maybe Type) -> BuiltInFamRewrite +mkBinConstFoldAxiom :: TyCon -> String + -> (Type -> Maybe a) + -> (Type -> Maybe b) + -> (a -> b -> Maybe Type) + -> BuiltInFamRewrite -- For the definitional axioms, like (3+4 --> 7) -mkConstFoldAxiom tc str isReqTy1 isReqTy2 f +mkBinConstFoldAxiom tc str isReqTy1 isReqTy2 f = BIF_Rewrite { bifrw_name = fsLit str , bifrw_arg_roles = [Nominal, Nominal] @@ -304,18 +255,50 @@ mkRewriteAxiom tc str tpl_tvs lhs_tys rhs_ty where (tys1, tys2) = unzipPairs inst_eqns +mkTopUnaryFamDeduction :: String -> TyCon + -> (Type -> Type -> Maybe TypeEqn) + -> BuiltInFamInteract +-- Deduction from (F s ~ r) where `F` is a unary type function +mkTopUnaryFamDeduction str fam_tc f + = BIF_Interact + { bifint_name = fsLit str + , bifint_arg_roles = [Nominal] + , bifint_res_role = Nominal + , bifint_proves = \cs -> do { [Pair lhs rhs] <- return cs + ; (tc, [a]) <- splitTyConApp_maybe lhs + ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) + ; f a rhs } } + mkTopBinFamDeduction :: String -> TyCon -> (Type -> Type -> Type -> Maybe TypeEqn) -> BuiltInFamInteract +-- Deduction from (F s t ~ r) where `F` is a binary type function mkTopBinFamDeduction str fam_tc f = BIF_Interact { bifint_name = fsLit str , bifint_arg_roles = [Nominal] , bifint_res_role = Nominal , bifint_proves = \cs -> do { [Pair lhs rhs] <- return cs - ; (tc, [a,b]) <- splitTyConApp_maybe lhs - ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) - ; f a b rhs } } + ; (tc, [a,b]) <- splitTyConApp_maybe lhs + ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) + ; f a b rhs } } + +mkInteractUnaryFamDeduction :: String -> TyCon + -> (Type -> Type -> -- F x1 ~ r1 + Type -> Type -> -- F x2 ~ r2 + Maybe TypeEqn) + -> BuiltInFamInteract +mkInteractUnaryFamDeduction str fam_tc f + = BIF_Interact + { bifint_name = fsLit str + , bifint_arg_roles = [Nominal, Nominal] + , bifint_res_role = Nominal + , bifint_proves = \cs -> do { [Pair lhs1 rhs1, Pair lhs2 rhs2] <- return cs + ; (tc1, [x1]) <- splitTyConApp_maybe lhs1 + ; (tc2, [x2]) <- splitTyConApp_maybe lhs2 + ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) + ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) + ; f x1 rhs1 x2 rhs2 } } mkInteractBinFamDeduction :: String -> TyCon -> (Type -> Type -> Type -> -- F x1 y1 ~ r1 @@ -334,6 +317,78 @@ mkInteractBinFamDeduction str fam_tc f ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) ; f x1 y1 rhs1 x2 y2 rhs2 } } + +------------------------------------------------------------------------------- +-- Built-in type constructors for functions on type-level nats +------------------------------------------------------------------------------- + +-- The list of built-in type family TyCons that GHC uses. +-- If you define a built-in type family, make sure to add it to this list. +-- See Note [Adding built-in type families] +typeNatTyCons :: [TyCon] +typeNatTyCons = + [ typeNatAddTyCon + , typeNatMulTyCon + , typeNatExpTyCon + , typeNatSubTyCon + , typeNatDivTyCon + , typeNatModTyCon + , typeNatLogTyCon + , typeNatCmpTyCon + , typeSymbolCmpTyCon + , typeSymbolAppendTyCon + , typeCharCmpTyCon + , typeConsSymbolTyCon + , typeUnconsSymbolTyCon + , typeCharToNatTyCon + , typeNatToCharTyCon + ] + + +tyConAxiomRules :: TyCon -> [CoAxiomRule] +tyConAxiomRules tc + | Just ops <- isBuiltInSynFamTyCon_maybe tc + = map BuiltInFamInteract (sfInteractTop ops) + ++ map BuiltInFamInteract (sfInteractInert ops) + ++ map BuiltInFamRewrite (sfMatchFam ops) + | otherwise + = [] + +-- The list of built-in type family axioms that GHC uses. +-- If you define new axioms, make sure to include them in this list. +-- See Note [Adding built-in type families] +typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule +typeNatCoAxiomRules = listToUFM $ map (\x -> (coaxrName x, x)) $ + concatMap tyConAxiomRules typeNatTyCons + +------------------------------------------------------------------------------- +-- Addition (+) +------------------------------------------------------------------------------- + +typeNatAddTyCon :: TyCon +typeNatAddTyCon = mkTypeNatFunTyCon2 name + BuiltInSynFamily + { sfMatchFam = axAddMatches + , sfInteractTop = axAddTops + , sfInteractInert = axAddInteracts + } + where + name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "+") + typeNatAddTyFamNameKey typeNatAddTyCon + + +sn,tn :: TyVar -- Of kind Natural +(sn: tn: _) = mkTemplateTyVars (repeat typeSymbolKind) + +axAddMatches :: [BuiltInFamRewrite] +axAddMatches + = [ mkRewriteAxiom tc "Add0L" [tn] [num 0, var tn] (var tn) -- 0 + t --> t + , mkRewriteAxiom tc "Add0R" [sn] [var sn, num 0] (var sn) -- s + 0 --> s + , mkBinConstFoldAxiom tc "AddDef" isNumLitTy isNumLitTy $ -- 3 + 4 --> 7 + \x y -> Just $ num (x + y) ] + where + tc = typeNatAddTyCon + axAddTops :: [BuiltInFamInteract] axAddTops = [ -- (s + t ~ 0) => (s ~ 0) @@ -368,7 +423,6 @@ axAddInteracts mk_ax (str, fun) = mkInteractBinFamDeduction str typeNatAddTyCon fun -{- ------------------------------------------------------------------------------- -- Subtraction (-) ------------------------------------------------------------------------------- @@ -376,7 +430,7 @@ axAddInteracts typeNatSubTyCon :: TyCon typeNatSubTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamSub + { sfMatchFam = axSubMatches , sfInteractTop = axSubTops , sfInteractInert = axSubInteracts } @@ -384,22 +438,21 @@ typeNatSubTyCon = mkTypeNatFunTyCon2 name name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "-") typeNatSubTyFamNameKey typeNatSubTyCon -matchFamSub :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamSub [s,t] - | Just 0 <- mbY = Just (axSub0R, [s], s) - | Just x <- mbX, Just y <- mbY, Just z <- minus x y = - Just (axSubDef, [s,t], num z) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamSub _ = Nothing +axSubMatches :: [BuiltInFamRewrite] +axSubMatches + = [ mkRewriteAxiom tc "Sub0R" [sn] [var sn, num 0] (var sn) -- s - 0 --> s + , mkBinConstFoldAxiom tc "SubDef" isNumLitTy isNumLitTy $ -- 4 - 3 --> 1 if x>=y + \x y -> fmap num (minus x y) ] + where + tc = typeNatSubTyCon -axSubTops :: [CoAxiomRule] +axSubTops :: [BuiltInFamInteract] axSubTops -- (a - b ~ 5) => (5 + b ~ a) = [ mkTopBinFamDeduction "SubT" typeNatSubTyCon $ \ a b r -> do { _ <- isNumLitTy r; return (Pair (r .+. b) a) } ] -axSubInteracts :: [CoAxiomRule] +axSubInteracts :: [BuiltInFamInteract] axSubInteracts = [ -- (x-y1 ~ z, x-y2 ~ z) => (y1 ~ y2) mkInteractBinFamDeduction "SubI-2" typeNatSubTyCon $ \ x1 y1 z1 x2 y2 z2 -> @@ -447,7 +500,7 @@ something more general. typeNatMulTyCon :: TyCon typeNatMulTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamMul + { sfMatchFam = axMulMatches , sfInteractTop = axMulTops , sfInteractInert = axMulInteracts } @@ -455,19 +508,18 @@ typeNatMulTyCon = mkTypeNatFunTyCon2 name name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "*") typeNatMulTyFamNameKey typeNatMulTyCon -matchFamMul :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamMul [s,t] - | Just 0 <- mbX = Just (axMul0L, [t], num 0) - | Just 0 <- mbY = Just (axMul0R, [s], num 0) - | Just 1 <- mbX = Just (axMul1L, [t], t) - | Just 1 <- mbY = Just (axMul1R, [s], s) - | Just x <- mbX, Just y <- mbY = - Just (axMulDef, [s,t], num (x * y)) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamMul _ = Nothing - -axMulTops :: [CoAxiomRule] +axMulMatches :: [BuiltInFamRewrite] +axMulMatches + = [ mkRewriteAxiom tc "Mul0L" [tn] [num 0, var tn] (num 0) -- 0 * t --> 0 + , mkRewriteAxiom tc "Mul0R" [sn] [var sn, num 0] (num 0) -- s * 0 --> 0 + , mkRewriteAxiom tc "Mul1L" [tn] [num 1, var tn] (var tn) -- 1 * t --> t + , mkRewriteAxiom tc "Mul1R" [sn] [var sn, num 1] (var sn) -- s * 1 --> s + , mkBinConstFoldAxiom tc "MulDef" isNumLitTy isNumLitTy $ -- 3 + 4 --> 12 + \x y -> Just $ num (x * y) ] + where + tc = typeNatMulTyCon + +axMulTops :: [BuiltInFamInteract] axMulTops = [ -- (s * t ~ 1) => (s ~ 1) mkTopBinFamDeduction "MulT1" typeNatMulTyCon $ \ s _t r -> @@ -485,7 +537,7 @@ axMulTops mkTopBinFamDeduction "MulT4" typeNatMulTyCon $ \ s t r -> do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- divide nr nt; return (Pair s (num y)) } ] -axMulInteracts :: [CoAxiomRule] +axMulInteracts :: [BuiltInFamInteract] axMulInteracts = [ -- (x*y1 ~ z, x*y2 ~ z) => (y1~y2) if x/=0 mkInteractBinFamDeduction "MulI1" typeNatMulTyCon $ \ x1 y1 z1 x2 y2 z2 -> @@ -503,7 +555,7 @@ axMulInteracts typeNatDivTyCon :: TyCon typeNatDivTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamDiv + { sfMatchFam = axDivMatches , sfInteractTop = [] , sfInteractInert = [] } @@ -514,7 +566,7 @@ typeNatDivTyCon = mkTypeNatFunTyCon2 name typeNatModTyCon :: TyCon typeNatModTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamMod + { sfMatchFam = axModMatches , sfInteractTop = [] , sfInteractInert = [] } @@ -522,21 +574,21 @@ typeNatModTyCon = mkTypeNatFunTyCon2 name name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "Mod") typeNatModTyFamNameKey typeNatModTyCon -matchFamDiv :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamDiv [s,t] - | Just 1 <- mbY = Just (axDiv1, [s], s) - | Just x <- mbX, Just y <- mbY, y /= 0 = Just (axDivDef, [s,t], num (div x y)) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamDiv _ = Nothing - -matchFamMod :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamMod [s,t] - | Just 1 <- mbY = Just (axMod1, [s], num 0) - | Just x <- mbX, Just y <- mbY, y /= 0 = Just (axModDef, [s,t], num (mod x y)) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamMod _ = Nothing +axDivMatches :: [BuiltInFamRewrite] +axDivMatches + = [ mkRewriteAxiom tc "Div1" [sn] [var sn, num 1] (var sn) -- s `div` 1 --> s + , mkBinConstFoldAxiom tc "DivDef" isNumLitTy isNumLitTy $ -- 8 `div` 4 --> 2 + \x y -> do { guard (y /= 0); return (num (div x y)) } ] + where + tc = typeNatModTyCon + +axModMatches :: [BuiltInFamRewrite] +axModMatches + = [ mkRewriteAxiom tc "Mod1" [sn] [var sn, num 1] (num 0) -- s `mod` 1 --> 0 + , mkBinConstFoldAxiom tc "ModDef" isNumLitTy isNumLitTy $ -- 8 `mod` 3 --> 2 + \x y -> do { guard (y /= 0); return (num (mod x y)) } ] + where + tc = typeNatModTyCon ------------------------------------------------------------------------------- -- Exponentiation: Exp @@ -545,7 +597,7 @@ matchFamMod _ = Nothing typeNatExpTyCon :: TyCon -- Exponentiation typeNatExpTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamExp + { sfMatchFam = axExpMatches , sfInteractTop = axExpTops , sfInteractInert = axExpInteracts } @@ -553,18 +605,17 @@ typeNatExpTyCon = mkTypeNatFunTyCon2 name name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "^") typeNatExpTyFamNameKey typeNatExpTyCon -matchFamExp :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamExp [s,t] - | Just 0 <- mbY = Just (axExp0R, [s], num 1) - | Just 1 <- mbX = Just (axExp1L, [t], num 1) - | Just 1 <- mbY = Just (axExp1R, [s], s) - | Just x <- mbX, Just y <- mbY = - Just (axExpDef, [s,t], num (x ^ y)) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamExp _ = Nothing - -axExpTops :: [CoAxiomRule] +axExpMatches :: [BuiltInFamRewrite] +axExpMatches + = [ mkRewriteAxiom tc "Exp0R" [sn] [var sn, num 0] (num 1) -- s ^ 0 --> 1 + , mkRewriteAxiom tc "Exp1L" [tn] [num 1, var tn] (num 1) -- 1 ^ t --> 1 + , mkRewriteAxiom tc "Exp1R" [sn] [var sn, num 1] (var sn) -- s ^ 1 --> s + , mkBinConstFoldAxiom tc "ExpDef" isNumLitTy isNumLitTy $ -- 2 ^ 3 --> 8 + \x y -> Just (num (x ^ y)) ] + where + tc = typeNatExpTyCon + +axExpTops :: [BuiltInFamInteract] axExpTops = [ -- (s ^ t ~ 0) => (s ~ 0) mkTopBinFamDeduction "ExpT1" typeNatExpTyCon $ \ s _t r -> @@ -578,7 +629,7 @@ axExpTops mkTopBinFamDeduction "ExpT3" typeNatExpTyCon $ \ s t r -> do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- rootExact nr nt; return (Pair s (num y)) } ] -axExpInteracts :: [CoAxiomRule] +axExpInteracts :: [BuiltInFamInteract] axExpInteracts = [ -- (x1^y1 ~ z, x2^y2 ~ z) {x1=x2, x1>1}=> (y1~y2) mkInteractBinFamDeduction "ExpI1" typeNatExpTyCon $ \ x1 y1 z1 x2 y2 z2 -> @@ -594,7 +645,7 @@ axExpInteracts typeNatLogTyCon :: TyCon typeNatLogTyCon = mkTypeNatFunTyCon1 name BuiltInSynFamily - { sfMatchFam = matchFamLog + { sfMatchFam = axLogMatches , sfInteractTop = [] , sfInteractInert = [] } @@ -602,12 +653,12 @@ typeNatLogTyCon = mkTypeNatFunTyCon1 name name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "Log2") typeNatLogTyFamNameKey typeNatLogTyCon -matchFamLog :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamLog [s] - | Just x <- mbX, Just (n,_) <- genLog x 2 = Just (axLogDef, [s], num n) - where mbX = isNumLitTy s -matchFamLog _ = Nothing - +axLogMatches :: [BuiltInFamRewrite] +axLogMatches + = [ mkUnaryConstFoldAxiom tc "LogDef" isNumLitTy $ -- log 8 --> 3 + \x -> do { (a,_) <- genLog x 2; return (num a) } ] + where + tc = typeNatLogTyCon ------------------------------------------------------------------------------- -- Comparision of Nats: CmpNat @@ -627,20 +678,19 @@ typeNatCmpTyCon name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS_INTERNAL (fsLit "CmpNat") typeNatCmpTyFamNameKey typeNatCmpTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamCmpNat + { sfMatchFam = axCmpNatMatches , sfInteractTop = axCmpNatTops , sfInteractInert = [] } -matchFamCmpNat :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamCmpNat [s,t] - | Just x <- mbX, Just y <- mbY = - Just (axCmpNatDef, [s,t], ordering (compare x y)) - | tcEqType s t = Just (axCmpNatRefl, [s], ordering EQ) - where mbX = isNumLitTy s - mbY = isNumLitTy t -matchFamCmpNat _ = Nothing +axCmpNatMatches :: [BuiltInFamRewrite] +axCmpNatMatches + = [ mkRewriteAxiom tc "CmpNatRefl" [sn] [var sn, var sn] (ordering EQ) -- s `cmp` s --> EQ + , mkBinConstFoldAxiom tc "CmpNatDef" isNumLitTy isNumLitTy $ -- 2 `cmp` 3 --> LT + \x y -> Just (ordering (compare x y)) ] + where + tc = typeNatCmpTyCon -axCmpNatTops :: [CoAxiomRule] +axCmpNatTops :: [BuiltInFamInteract] axCmpNatTops = [ mkTopBinFamDeduction "CmpNatT3" typeNatCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] @@ -648,10 +698,11 @@ axCmpNatTops ------------------------------------------------------------------------------- -- Comparsion of Symbols: CmpSymbol ------------------------------------------------------------------------------- + typeSymbolCmpTyCon :: TyCon typeSymbolCmpTyCon = mkFamilyTyCon name - (mkTemplateAnonTyConBinders [ typeSymbolKind, typeSymbolKind ]) + (mkTemplateAnonTyConBinders [typeSymbolKind, typeSymbolKind]) orderingKind Nothing (BuiltInSynFamTyCon ops) @@ -662,21 +713,23 @@ typeSymbolCmpTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS_INTERNAL (fsLit "CmpSymbol") typeSymbolCmpTyFamNameKey typeSymbolCmpTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamCmpSymbol - , sfInteractTop = axCmpSymbolTops + { sfMatchFam = axSymbolCmpMatches + , sfInteractTop = axSymbolCmpTops , sfInteractInert = [] } -matchFamCmpSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamCmpSymbol [s,t] - | Just x <- mbX, Just y <- mbY = - Just (axCmpSymbolDef, [s,t], ordering (lexicalCompareFS x y)) - | tcEqType s t = Just (axCmpSymbolRefl, [s], ordering EQ) - where mbX = isStrLitTy s - mbY = isStrLitTy t -matchFamCmpSymbol _ = Nothing - -axCmpSymbolTops :: [CoAxiomRule] -axCmpSymbolTops +ss,ts :: TyVar -- Of kind Symbol +(ss: ts: _) = mkTemplateTyVars (repeat typeSymbolKind) + +axSymbolCmpMatches :: [BuiltInFamRewrite] +axSymbolCmpMatches + = [ mkRewriteAxiom tc "CmpSymbolRefl" [ss] [var ss, var ss] (ordering EQ) -- s `cmp` s --> EQ + , mkBinConstFoldAxiom tc "CmpSymbolDef" isStrLitTy isStrLitTy $ -- "a" `cmp` "b" --> LT + \x y -> Just (ordering (lexicalCompareFS x y)) ] + where + tc = typeSymbolCmpTyCon + +axSymbolCmpTops :: [BuiltInFamInteract] +axSymbolCmpTops = [ mkTopBinFamDeduction "CmpSymbolT" typeSymbolCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] @@ -688,25 +741,23 @@ axCmpSymbolTops typeSymbolAppendTyCon :: TyCon typeSymbolAppendTyCon = mkTypeSymbolFunTyCon2 name BuiltInSynFamily - { sfMatchFam = matchFamAppendSymbol + { sfMatchFam = axAppendMatches , sfInteractTop = axAppendTops , sfInteractInert = axAppendInteracts } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "AppendSymbol") typeSymbolAppendFamNameKey typeSymbolAppendTyCon -matchFamAppendSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamAppendSymbol [s,t] - | Just x <- mbX, nullFS x = Just (axAppendSymbol0R, [t], t) - | Just y <- mbY, nullFS y = Just (axAppendSymbol0L, [s], s) - | Just x <- mbX, Just y <- mbY = - Just (axAppendSymbolDef, [s,t], mkStrLitTy (appendFS x y)) +axAppendMatches :: [BuiltInFamRewrite] +axAppendMatches + = [ mkRewriteAxiom tc "Concat0R" [ts] [nullStrLitTy, var ts] (var ts) -- "" ++ t --> t + , mkRewriteAxiom tc "Concat0L" [ss] [var ss, nullStrLitTy] (var ss) -- s ++ "" --> s + , mkBinConstFoldAxiom tc "AppendSymbolDef" isStrLitTy isStrLitTy $ -- "a" ++ "b" --> "ab" + \x y -> Just (mkStrLitTy (appendFS x y)) ] where - mbX = isStrLitTy s - mbY = isStrLitTy t -matchFamAppendSymbol _ = Nothing + tc = typeSymbolAppendTyCon -axAppendTops :: [CoAxiomRule] +axAppendTops :: [BuiltInFamInteract] axAppendTops = [ -- (AppendSymbol a b ~ "") => (a ~ "") mkTopBinFamDeduction "AppendSymbolT1" typeSymbolAppendTyCon $ \ a _b r -> @@ -726,7 +777,7 @@ axAppendTops do { bs <- isStrLitTyS b; rs <- isStrLitTyS r; guard (bs `isSuffixOf` rs) ; return (Pair a (mkStrLitTyS (take (length rs - length bs) rs))) } ] -axAppendInteracts :: [CoAxiomRule] +axAppendInteracts :: [BuiltInFamInteract] axAppendInteracts = [ -- (AppendSymbol x1 y1 ~ z, AppendSymbol x2 y2 ~ z) {x1=x2}=> (y1 ~ y2) mkInteractBinFamDeduction "AppI1" typeSymbolAppendTyCon $ \ x1 y1 z1 x2 y2 z2 -> @@ -752,20 +803,18 @@ typeConsSymbolTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "ConsSymbol") typeConsSymbolTyFamNameKey typeConsSymbolTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamConsSymbol + { sfMatchFam = axConsMatches , sfInteractTop = axConsTops , sfInteractInert = axConsInteracts } -matchFamConsSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamConsSymbol [s,t] - | Just x <- mbX, Just y <- mbY = - Just (axConsSymbolDef, [s,t], mkStrLitTy (consFS x y)) +axConsMatches :: [BuiltInFamRewrite] +axConsMatches + = [ mkBinConstFoldAxiom tc "ConsSymbolDef" isCharLitTy isStrLitTy $ -- 'a' : "bc" --> "abc" + \x y -> Just $ mkStrLitTy (consFS x y) ] where - mbX = isCharLitTy s - mbY = isStrLitTy t -matchFamConsSymbol _ = Nothing + tc = typeConsSymbolTyCon -axConsTops :: [CoAxiomRule] +axConsTops :: [BuiltInFamInteract] axConsTops = [ -- ConsSymbol a b ~ "blah" => (a ~ 'b') mkTopBinFamDeduction "ConsSymbolT1" typeConsSymbolTyCon $ \ a _b r -> @@ -775,7 +824,7 @@ axConsTops mkTopBinFamDeduction "ConsSymbolT2" typeConsSymbolTyCon $ \ _a b r -> do { rs <- isStrLitTy r; (_,xs) <- unconsFS rs; return (Pair b (mkStrLitTy xs)) } ] -axConsInteracts :: [CoAxiomRule] +axConsInteracts :: [BuiltInFamInteract] axConsInteracts = [ -- (ConsSymbol x1 y1 ~ z, ConsSymbol x2 y2 ~ z) {x1=x2}=> (y1 ~ y2) mkInteractBinFamDeduction "AppI1" typeConsSymbolTyCon $ \ x1 y1 z1 x2 y2 z2 -> @@ -801,24 +850,25 @@ typeUnconsSymbolTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "UnconsSymbol") typeUnconsSymbolTyFamNameKey typeUnconsSymbolTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamUnconsSymbol + { sfMatchFam = axUnconsMatches , sfInteractTop = axUnconsTops , sfInteractInert = axUnconsInteracts } computeUncons :: FastString -> Type -computeUncons str = mkPromotedMaybeTy charSymbolPairKind (fmap reifyCharSymbolPairTy (unconsFS str)) - where reifyCharSymbolPairTy :: (Char, FastString) -> Type - reifyCharSymbolPairTy (c, s) = charSymbolPair (mkCharLitTy c) (mkStrLitTy s) - -matchFamUnconsSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamUnconsSymbol [s] - | Just x <- mbX = - Just (axUnconsSymbolDef, [s], computeUncons x) +computeUncons str + = mkPromotedMaybeTy charSymbolPairKind (fmap reify (unconsFS str)) + where + reify :: (Char, FastString) -> Type + reify (c, s) = charSymbolPair (mkCharLitTy c) (mkStrLitTy s) + +axUnconsMatches :: [BuiltInFamRewrite] +axUnconsMatches + = [ mkUnaryConstFoldAxiom tc "ConsSymbolDef" isStrLitTy $ -- 'a' : "bc" --> "abc" + \x -> Just $ computeUncons x ] where - mbX = isStrLitTy s -matchFamUnconsSymbol _ = Nothing + tc = typeUnconsSymbolTyCon -axUnconsTops :: [CoAxiomRule] +axUnconsTops :: [BuiltInFamInteract] axUnconsTops = [ -- (UnconsSymbol b ~ Nothing) => (b ~ "") mkTopUnaryFamDeduction "UnconsSymbolT1" typeUnconsSymbolTyCon $ \b r -> @@ -832,7 +882,7 @@ axUnconsTops ; str <- isStrLitTy s ; return (Pair b (mkStrLitTy (consFS chr str))) } ] -axUnconsInteracts :: [CoAxiomRule] +axUnconsInteracts :: [BuiltInFamInteract] axUnconsInteracts = [ -- (UnconsSymbol x1 ~ z, UnconsSymbol x2 ~ z) => (x1 ~ x2) mkInteractUnaryFamDeduction "UnconsI1" typeUnconsSymbolTyCon $ \ x1 z1 x2 z2 -> @@ -855,20 +905,19 @@ typeCharToNatTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "CharToNat") typeCharToNatTyFamNameKey typeCharToNatTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamCharToNat + { sfMatchFam = axCharToNatMatches , sfInteractTop = axCharToNatTops , sfInteractInert = [] } -matchFamCharToNat :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamCharToNat [c] - | Just c' <- isCharLitTy c, n <- charToInteger c' - = Just (axCharToNatDef, [c], mkNumLitTy n) - | otherwise = Nothing -matchFamCharToNat _ = Nothing - +axCharToNatMatches :: [BuiltInFamRewrite] +axCharToNatMatches + = [ mkUnaryConstFoldAxiom tc "CharToNatDef" isCharLitTy $ -- CharToNat 'a' --> 97 + \x -> Just $ num (charToInteger x) ] + where + tc = typeCharToNatTyCon -axCharToNatTops :: [CoAxiomRule] +axCharToNatTops :: [BuiltInFamInteract] axCharToNatTops = [ -- (CharToNat c ~ 122) => (c ~ 'z') mkTopUnaryFamDeduction "CharToNatT1" typeCharToNatTyCon $ \c r -> @@ -891,19 +940,18 @@ typeNatToCharTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "NatToChar") typeNatToCharTyFamNameKey typeNatToCharTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamNatToChar + { sfMatchFam = axNatToCharMatches , sfInteractTop = axNatToCharTops , sfInteractInert = [] } -matchFamNatToChar :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamNatToChar [n] - | Just n' <- isNumLitTy n, Just c <- integerToChar n' - = Just (axNatToCharDef, [n], mkCharLitTy c) - | otherwise = Nothing -matchFamNatToChar _ = Nothing - +axNatToCharMatches :: [BuiltInFamRewrite] +axNatToCharMatches + = [ mkUnaryConstFoldAxiom tc "NatToCharDef" isNumLitTy $ -- NatToChar 97 --> 'a' + \n -> fmap mkCharLitTy (integerToChar n) ] + where + tc = typeNatToCharTyCon -axNatToCharTops :: [CoAxiomRule] +axNatToCharTops :: [BuiltInFamInteract] axNatToCharTops = [ -- (NatToChar n ~ 'z') => (n ~ 122) mkTopUnaryFamDeduction "CharToNatT1" typeNatToCharTyCon $ \n r -> @@ -927,142 +975,29 @@ typeCharCmpTyCon = name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS_INTERNAL (fsLit "CmpChar") typeCharCmpTyFamNameKey typeCharCmpTyCon ops = BuiltInSynFamily - { sfMatchFam = matchFamCmpChar - , sfInteractTop = axCmpCharTops + { sfMatchFam = axCharCmpMatches + , sfInteractTop = axCharCmpTops , sfInteractInert = [] } -matchFamCmpChar :: [Type] -> Maybe (CoAxiomRule, [Type], Type) -matchFamCmpChar [s,t] - | Just x <- mbX, Just y <- mbY = - Just (axCmpCharDef, [s,t], ordering (compare x y)) - | tcEqType s t = Just (axCmpCharRefl, [s], ordering EQ) - where mbX = isCharLitTy s - mbY = isCharLitTy t -matchFamCmpChar _ = Nothing - -cmpChar :: Type -> Type -> Type -cmpChar s t = mkTyConApp typeCharCmpTyCon [s,t] - -axCmpCharDef, axCmpCharRefl :: CoAxiomRule -axCmpCharDef = mkBinAxiom "CmpCharDef" typeCharCmpTyCon isCharLitTy isCharLitTy $ - \chr1 chr2 -> Just $ ordering $ compare chr1 chr2 -axCmpCharRefl = mkAxiom1 "CmpCharRefl" $ - \(Pair s _) -> (cmpChar s s) === ordering EQ - -axCmpCharTops :: [CoAxiomRule] -axCmpCharTops +sc :: TyVar -- Of kind Char +(sc: _) = mkTemplateTyVars (repeat charTy) + +axCharCmpMatches :: [BuiltInFamRewrite] +axCharCmpMatches + = [ mkRewriteAxiom tc "CmpCharRefl" [sc] [var sc, var sc] (ordering EQ) -- s `cmp` s --> EQ + , mkBinConstFoldAxiom tc "CmpCharDef" isCharLitTy isCharLitTy $ -- 'a' `cmp` 'b' --> LT + \chr1 chr2 -> Just $ ordering $ compare chr1 chr2 ] + where + tc = typeCharCmpTyCon + +axCharCmpTops :: [BuiltInFamInteract] +axCharCmpTops = [ -- (CmpChar s t ~ EQ) => s ~ t mkTopBinFamDeduction "CmpCharT" typeCharCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] - -{------------------------------------------------------------------------------- -Built-in rules axioms --------------------------------------------------------------------------------} - --- If you add additional rules, please remember to add them to --- `typeNatCoAxiomRules` also. --- See Note [Adding built-in type families] -axAddDef - , axMulDef - , axExpDef - , axCmpNatDef - , axCmpSymbolDef - , axAppendSymbolDef - , axConsSymbolDef - , axUnconsSymbolDef - , axCharToNatDef - , axNatToCharDef - , axAdd0L - , axAdd0R - , axMul0L - , axMul0R - , axMul1L - , axMul1R - , axExp1L - , axExp0R - , axExp1R - , axCmpNatRefl - , axCmpSymbolRefl - , axSubDef - , axSub0R - , axAppendSymbol0R - , axAppendSymbol0L - , axDivDef - , axDiv1 - , axModDef - , axMod1 - , axLogDef - :: CoAxiomRule - -axAddDef = mkBinAxiom "AddDef" typeNatAddTyCon isNumLitTy isNumLitTy $ - \x y -> Just $ num (x + y) - -axMulDef = mkBinAxiom "MulDef" typeNatMulTyCon isNumLitTy isNumLitTy $ - \x y -> Just $ num (x * y) - -axExpDef = mkBinAxiom "ExpDef" typeNatExpTyCon isNumLitTy isNumLitTy $ - \x y -> Just $ num (x ^ y) - -axCmpNatDef = mkBinAxiom "CmpNatDef" typeNatCmpTyCon isNumLitTy isNumLitTy $ - \x y -> Just $ ordering (compare x y) - -axCmpSymbolDef = mkBinAxiom "CmpSymbolDef" typeSymbolCmpTyCon isStrLitTy isStrLitTy $ - \s2' t2' -> Just (ordering (lexicalCompareFS s2' t2')) - -axAppendSymbolDef = mkBinAxiom "AppendSymbolDef" typeSymbolAppendTyCon isStrLitTy isStrLitTy $ - \s2' t2' -> Just (mkStrLitTy (appendFS s2' t2')) - -axConsSymbolDef = mkBinAxiom "ConsSymbolDef" typeConsSymbolTyCon isCharLitTy isStrLitTy $ - \c str -> Just $ mkStrLitTy (consFS c str) - -axUnconsSymbolDef = mkUnAxiom "UnconsSymbolDef" typeUnconsSymbolTyCon isStrLitTy $ - \str -> Just $ computeUncons str - -axCharToNatDef = mkUnAxiom "CharToNatDef" typeCharToNatTyCon isCharLitTy $ - \c -> Just $ num (charToInteger c) - -axNatToCharDef = mkUnAxiom "NatToCharDef" typeNatToCharTyCon isNumLitTy $ - \n -> fmap mkCharLitTy (integerToChar n) - -axSubDef = mkBinAxiom "SubDef" typeNatSubTyCon isNumLitTy isNumLitTy $ - \x y -> fmap num (minus x y) - -axDivDef = mkBinAxiom "DivDef" typeNatDivTyCon isNumLitTy isNumLitTy $ - \x y -> do { guard (y /= 0); return (num (div x y)) } - -axModDef = mkBinAxiom "ModDef" typeNatModTyCon isNumLitTy isNumLitTy $ - \x y -> do { guard (y /= 0); return (num (mod x y)) } - -axLogDef = mkUnAxiom "LogDef" typeNatLogTyCon isNumLitTy $ - \x -> do { (a,_) <- genLog x 2; return (num a) } - -axAdd0L = mkAxiom1 "Add0L" $ \(Pair s t) -> (num 0 .+. s) === t -axAdd0R = mkAxiom1 "Add0R" $ \(Pair s t) -> (s .+. num 0) === t -axSub0R = mkAxiom1 "Sub0R" $ \(Pair s t) -> (s .-. num 0) === t -axMul0L = mkAxiom1 "Mul0L" $ \(Pair s _) -> (num 0 .*. s) === num 0 -axMul0R = mkAxiom1 "Mul0R" $ \(Pair s _) -> (s .*. num 0) === num 0 -axMul1L = mkAxiom1 "Mul1L" $ \(Pair s t) -> (num 1 .*. s) === t -axMul1R = mkAxiom1 "Mul1R" $ \(Pair s t) -> (s .*. num 1) === t -axDiv1 = mkAxiom1 "Div1" $ \(Pair s t) -> (tDiv s (num 1) === t) -axMod1 = mkAxiom1 "Mod1" $ \(Pair s _) -> (tMod s (num 1) === num 0) - -- XXX: Shouldn't we check that _ is 0? -axExp1L = mkAxiom1 "Exp1L" $ \(Pair s _) -> (num 1 .^. s) === num 1 -axExp0R = mkAxiom1 "Exp0R" $ \(Pair s _) -> (s .^. num 0) === num 1 -axExp1R = mkAxiom1 "Exp1R" $ \(Pair s t) -> (s .^. num 1) === t -axCmpNatRefl = mkAxiom1 "CmpNatRefl" - $ \(Pair s _) -> (cmpNat s s) === ordering EQ -axCmpSymbolRefl = mkAxiom1 "CmpSymbolRefl" - $ \(Pair s _) -> (cmpSymbol s s) === ordering EQ -axAppendSymbol0R = mkAxiom1 "Concat0R" - $ \(Pair s t) -> (mkStrLitTy nilFS `appendSymbol` s) === t -axAppendSymbol0L = mkAxiom1 "Concat0L" - $ \(Pair s t) -> (s `appendSymbol` mkStrLitTy nilFS) === t - --} - {------------------------------------------------------------------------------- Various utilities for making axioms and types -------------------------------------------------------------------------------} @@ -1173,62 +1108,6 @@ mkTypeSymbolFunTyCon2 op tcb = Nothing NotInjective - -{- -mkAxiom1 :: String -> (TypeEqn -> TypeEqn) -> CoAxiomRule -mkAxiom1 str f = - CoAxiomRule - { coaxrName = fsLit str - , coaxrAsmpRoles = [Nominal] - , coaxrRole = Nominal - , coaxrProves = \case [eqn] -> Just (f eqn) - _ -> Nothing - } - -mkUnAxiom :: String -> TyCon -> (Type -> Maybe a) -> (a -> Maybe Type) -> CoAxiomRule -mkUnAxiom str tc isReqTy f = - CoAxiomRule - { coaxrName = fsLit str - , coaxrAsmpRoles = [Nominal] - , coaxrRole = Nominal - , coaxrProves = \cs -> - do [Pair s1 s2] <- return cs - s2' <- isReqTy s2 - z <- f s2' - return (mkTyConApp tc [s1] === z) - } - -mkTopUnaryFamDeduction :: String -> TyCon - -> (Type -> Type -> Maybe TypeEqn) - -> CoAxiomRule -mkTopUnaryFamDeduction str fam_tc f - = CoAxiomRule - { coaxrName = fsLit str - , coaxrAsmpRoles = [Nominal] - , coaxrRole = Nominal - , coaxrProves = \cs -> do { [Pair lhs rhs] <- return cs - ; (tc, [a]) <- splitTyConApp_maybe lhs - ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) - ; f a rhs } } - -mkInteractUnaryFamDeduction :: String -> TyCon - -> (Type -> Type -> -- F x1 ~ r1 - Type -> Type -> -- F x2 ~ r2 - Maybe TypeEqn) - -> CoAxiomRule -mkInteractUnaryFamDeduction str fam_tc f - = CoAxiomRule - { coaxrName = fsLit str - , coaxrAsmpRoles = [Nominal, Nominal] - , coaxrRole = Nominal - , coaxrProves = \cs -> do { [Pair lhs1 rhs1, Pair lhs2 rhs2] <- return cs - ; (tc1, [x1]) <- splitTyConApp_maybe lhs1 - ; (tc2, [x2]) <- splitTyConApp_maybe lhs2 - ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) - ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) - ; f x1 rhs1 x2 rhs2 } } - --} injCheck :: Type -> Type -> Type -> Type -> Type -> Type -> Maybe TypeEqn -- If x1=x2 and y1=y2, emit z1=z2 injCheck x1 x2 y1 y2 z1 z2 @@ -1249,14 +1128,6 @@ integerToChar n | inBounds = Just (Char.chr (fromInteger n)) n <= charToInteger maxBound integerToChar _ = Nothing -------------------------------------------------------------------------------- --- Axioms for arithmetic -------------------------------------------------------------------------------- - - - - - {- ----------------------------------------------------------------------------- These inverse functions are used for simplifying propositions using ===================================== compiler/GHC/Core/FamInstEnv.hs ===================================== @@ -1197,7 +1197,7 @@ reduceTyFamApp_maybe envs role tc tys in Just $ coercionRedn co | Just builtin_fam <- isBuiltInSynFamTyCon_maybe tc - , Just (coax,ts,ty) <- tryMatchFam builtin_fam tc tys + , Just (coax,ts,ty) <- tryMatchFam builtin_fam tys , role == coaxrRole coax = let co = mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) in Just $ mkReduction co ty View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f9e4c870f936eac18614f31b6477413f598deed1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f9e4c870f936eac18614f31b6477413f598deed1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 10:33:17 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 01 Jul 2024 06:33:17 -0400 Subject: [Git][ghc/ghc][wip/amg/module-cycle-error] 152 commits: Migrate `Finder` component to `OsPath`, fixed #24616 Message-ID: <668285ed7b4bd_11a5d9cc2f1852988@gitlab.mail> sheaf pushed to branch wip/amg/module-cycle-error at Glasgow Haskell Compiler / GHC Commits: c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 4188a024 by Adam Gundry at 2024-07-01T12:32:05+02:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 996c7a05 by Adam Gundry at 2024-07-01T12:32:05+02:00 Use structured error representation when reloading a nonexistent module - - - - - c7025d76 by sheaf at 2024-07-01T12:32:05+02:00 Use structured errors for a Backpack instantiation error - - - - - 7500a74c by sheaf at 2024-07-01T12:33:01+02:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/747c3220d45937b409d168a7691fc694bdefbe99...7500a74cf3dac8a0479016fc19f5d2729a5c868d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/747c3220d45937b409d168a7691fc694bdefbe99...7500a74cf3dac8a0479016fc19f5d2729a5c868d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 10:56:43 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 06:56:43 -0400 Subject: [Git][ghc/ghc][wip/T24978] 122 commits: haddock: Correct the Makefile to take into account Darwin systems Message-ID: <66828b6b7fe8d_11a5d910dba1467437@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 4d56cc8c by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Refactor UnivCo Addresses #24978 - - - - - faeba71c by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Wibbles - - - - - 17ee378c by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Wibble - - - - - b71de1b1 by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Put [Coercion] in UnivCo - - - - - eeec6462 by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Wibble - - - - - 02590cd4 by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Wibbles - - - - - ff01e746 by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Add Given builtin deductions Addresses #24845. Needs documentation - - - - - b2b02d1b by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Onward with AxiomRule ..won't compile - - - - - cf3a0b61 by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 Progress - - - - - ae6e36ef by Simon Peyton Jones at 2024-07-01T11:49:21+01:00 More WIP does not compile - - - - - bee3780d by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 More - - - - - 703b4fd5 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Big reorg of the file - - - - - 19ed25d4 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Add axiomrules to the list - - - - - bc6e154d by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 More updates - - - - - 4b9ccaa9 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Wibbles - - - - - b50eba24 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Wibble - - - - - f61e4579 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 More Refactor CoAxRule - - - - - 8aff3f74 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Fix glitch - - - - - 4fada4d8 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Complete family-matching stuff - - - - - 3cfb57fb by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Docs - - - - - 0f4e6b31 by Simon Peyton Jones at 2024-07-01T11:50:31+01:00 Wibble imports again - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f9e4c870f936eac18614f31b6477413f598deed1...0f4e6b318955201a483a736612ce1ee8d63bea32 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f9e4c870f936eac18614f31b6477413f598deed1...0f4e6b318955201a483a736612ce1ee8d63bea32 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 13:06:34 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 09:06:34 -0400 Subject: [Git][ghc/ghc][wip/T24978] Wibble Message-ID: <6682a9dac1255_11a5d923320b4112161@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: e5210eaa by Simon Peyton Jones at 2024-07-01T14:06:25+01:00 Wibble - - - - - 1 changed file: - compiler/GHC/Builtin/Types/Literals.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -226,7 +226,7 @@ mkRewriteAxiom :: TyCon -> String mkRewriteAxiom tc str tpl_tvs lhs_tys rhs_ty = BIF_Rewrite { bifrw_name = fsLit str - , bifrw_arg_roles = [Nominal, Nominal] + , bifrw_arg_roles = [Nominal | _ <- tpl_tvs] , bifrw_res_role = Nominal , bifrw_match = match_fn , bifrw_proves = inst_fn } @@ -240,7 +240,9 @@ mkRewriteAxiom tc str tpl_tvs lhs_tys rhs_ty inst_fn :: [TypeEqn] -> Maybe TypeEqn inst_fn inst_eqns = assertPpr (inst_eqns `equalLength` tpl_tvs) (text str $$ ppr inst_eqns) $ - Just (mkTyConApp tc tys1 === substTy (zipTCvSubst tpl_tvs tys2) rhs_ty) + Just (mkTyConApp tc (substTys (zipTCvSubst tpl_tvs tys1) lhs_tys) + === + substTy (zipTCvSubst tpl_tvs tys2) rhs_ty) where (tys1, tys2) = unzipPairs inst_eqns View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e5210eaa37f8f6fe8f3d6eacb8d34514ed5b3560 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e5210eaa37f8f6fe8f3d6eacb8d34514ed5b3560 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 13:53:04 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 01 Jul 2024 09:53:04 -0400 Subject: [Git][ghc/ghc][wip/andreask/bound_cmm_folding] Cmm constant folding: Narrow results to operations bitwidth. Message-ID: <6682b4c098f4d_1e01492f580031737@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/bound_cmm_folding at Glasgow Haskell Compiler / GHC Commits: eae742da by Andreas Klebinger at 2024-07-01T15:37:32+02:00 Cmm constant folding: Narrow results to operations bitwidth. When constant folding operations on literals ensure the result is still within bounds by explicitly narrowing the results. Not doing so results in a lot of spurious assembler warnings especially when testing primops. - - - - - 3 changed files: - compiler/GHC/Cmm/Opt.hs - + testsuite/tests/cmm/opt/T24556.cmm - testsuite/tests/cmm/opt/all.T Changes: ===================================== compiler/GHC/Cmm/Opt.hs ===================================== @@ -50,6 +50,7 @@ constantFoldExprOpt e = wrapRecExpOpt f e CmmMachOp op' args' -> fromMaybe (CmmMachOp op' args') <$> cmmMachOpFoldOptM cfg op' args' e -> pure e f (CmmRegOff r 0) = pure (CmmReg r) + f (CmmLit (CmmInt x rep)) = pure (CmmLit $ CmmInt (narrowU rep x) rep) f e = pure e constantFoldExpr :: Platform -> CmmExpr -> CmmExpr @@ -82,7 +83,7 @@ cmmMachOpFoldM cmmMachOpFoldM _ op [CmmLit (CmmInt x rep)] = Just $! case op of - MO_S_Neg _ -> CmmLit (CmmInt (-x) rep) + MO_S_Neg _ -> CmmLit (CmmInt (narrowS rep (-x)) rep) MO_Not _ -> CmmLit (CmmInt (complement x) rep) -- these are interesting: we must first narrow to the @@ -159,9 +160,9 @@ cmmMachOpFoldM platform mop [CmmLit (CmmInt x xrep), CmmLit (CmmInt y _)] MO_S_Lt _ -> Just $! CmmLit (CmmInt (if x_s < y_s then 1 else 0) (wordWidth platform)) MO_S_Le _ -> Just $! CmmLit (CmmInt (if x_s <= y_s then 1 else 0) (wordWidth platform)) - MO_Add r -> Just $! CmmLit (CmmInt (x + y) r) - MO_Sub r -> Just $! CmmLit (CmmInt (x - y) r) - MO_Mul r -> Just $! CmmLit (CmmInt (x * y) r) + MO_Add r -> Just $! CmmLit (CmmInt (narrowU r $ x + y) r) + MO_Sub r -> Just $! CmmLit (CmmInt (narrowS r $ x - y) r) + MO_Mul r -> Just $! CmmLit (CmmInt (narrowU r $ x * y) r) MO_U_Quot r | y /= 0 -> Just $! CmmLit (CmmInt (x_u `quot` y_u) r) MO_U_Rem r | y /= 0 -> Just $! CmmLit (CmmInt (x_u `rem` y_u) r) MO_S_Quot r | y /= 0 -> Just $! CmmLit (CmmInt (x_s `quot` y_s) r) @@ -171,7 +172,7 @@ cmmMachOpFoldM platform mop [CmmLit (CmmInt x xrep), CmmLit (CmmInt y _)] MO_Or r -> Just $! CmmLit (CmmInt (x .|. y) r) MO_Xor r -> Just $! CmmLit (CmmInt (x `xor` y) r) - MO_Shl r -> Just $! CmmLit (CmmInt (x `shiftL` fromIntegral y) r) + MO_Shl r -> Just $! CmmLit (CmmInt (narrowU r $ x `shiftL` fromIntegral y) r) MO_U_Shr r -> Just $! CmmLit (CmmInt (x_u `shiftR` fromIntegral y) r) MO_S_Shr r -> Just $! CmmLit (CmmInt (x_s `shiftR` fromIntegral y) r) ===================================== testsuite/tests/cmm/opt/T24556.cmm ===================================== @@ -0,0 +1,12 @@ +#include "Cmm.h" + +func(bits64 buffer) { + I8[buffer] = %lobits8(255 + 45); + I8[buffer+1] = %lobits8(310 - 10); + I8[buffer+2] = %lobits8(30 * 10); + I8[buffer+3] = %lobits8(150 << 1); + // This one comes from test-primops + I64[buffer+4] = %zx64(((1 :: bits16) & ((1 :: bits16) & (((516 :: bits16) * (154 :: bits16)) + bits16[buffer + (0 :: bits64)])))); + return(1); +} + ===================================== testsuite/tests/cmm/opt/all.T ===================================== @@ -3,3 +3,8 @@ test('T15188', cmm_src, makefile_test, []) test('T18141', normal, compile, ['']) test('T20142', normal, compile, ['']) + +# Cmm opt should not produce oversized literals in the assembly output. +# We check this by telling the assembler to exit on warnings. +test('T24556', [only_ways('optasm'), cmm_src], compile, ['-O -opta -Xassembler -opta --fatal-warnings']) + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eae742da78e538205ce335ab9f521afcdb390d78 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eae742da78e538205ce335ab9f521afcdb390d78 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 13:54:32 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 01 Jul 2024 09:54:32 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Back LabelMap with deterministic UDFM Message-ID: <6682b518e89c0_1e01493c353433571@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 15d74c89 by Rodrigo Mesquita at 2024-07-01T14:54:18+01:00 Back LabelMap with deterministic UDFM - - - - - 5 changed files: - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Types/Unique/DFM.hs - compiler/GHC/Utils/Outputable.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -45,17 +45,15 @@ module GHC.Cmm.Dataflow.Label , mapAlter , mapAdjust , mapUnion - , mapUnions , mapUnionWithKey + , mapUnions , mapDifference , mapIntersection - , mapIsSubmapOf , mapMap , mapMapWithKey , mapFoldl , mapFoldr , mapFoldlWithKey - , mapFoldMapWithKey , mapFilter , mapFilterWithKey , mapElems @@ -69,7 +67,7 @@ import GHC.Prelude import GHC.Utils.Outputable -import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) +import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily, getKey) -- The code generator will eventually be using all the labels stored in a -- LabelSet and LabelMap. For these reasons we use the strict variants of these @@ -77,12 +75,12 @@ import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) -- to fire. import GHC.Data.Word64Set (Word64Set) import qualified GHC.Data.Word64Set as S -import GHC.Data.Word64Map.Strict (Word64Map) -import qualified GHC.Data.Word64Map.Strict as M import GHC.Data.TrieMap +import GHC.Types.Unique.DFM import Data.Word (Word64) import Data.List (foldl1') +import GHC.Data.Maybe (fromMaybe) ----------------------------------------------------------------------------- @@ -173,115 +171,110 @@ setFromList ks = LS (S.fromList (map lblToUnique ks)) ----------------------------------------------------------------------------- -- LabelMap -newtype LabelMap v = LM (Word64Map v) - deriving newtype (Eq, Ord, Show, Functor, Foldable) +newtype LabelMap v = LM (UniqDFM Word64 v) + deriving newtype (Functor, Foldable) deriving stock Traversable mapNull :: LabelMap a -> Bool -mapNull (LM m) = M.null m +mapNull (LM m) = isNullUDFM m {-# INLINE mapSize #-} mapSize :: LabelMap a -> Int -mapSize (LM m) = M.size m +mapSize (LM m) = sizeUDFM m mapMember :: Label -> LabelMap a -> Bool -mapMember (Label k) (LM m) = M.member k m +mapMember (Label k) (LM m) = elemUDFM k m mapLookup :: Label -> LabelMap a -> Maybe a -mapLookup (Label k) (LM m) = M.lookup k m +mapLookup (Label k) (LM m) = lookupUDFM m k mapFindWithDefault :: a -> Label -> LabelMap a -> a -mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m +mapFindWithDefault def (Label k) (LM m) = fromMaybe def $ lookupUDFM m k mapEmpty :: LabelMap v -mapEmpty = LM M.empty +mapEmpty = LM emptyUDFM mapSingleton :: Label -> v -> LabelMap v -mapSingleton (Label k) v = LM (M.singleton k v) +mapSingleton (Label k) v = LM (unitUDFM k v) mapInsert :: Label -> v -> LabelMap v -> LabelMap v -mapInsert (Label k) v (LM m) = LM (M.insert k v m) +mapInsert (Label k) v (LM m) = LM (addToUDFM m k v) mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v -mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) +mapInsertWith f (Label k) v (LM m) = LM (addToUDFM_C f m k v) mapDelete :: Label -> LabelMap v -> LabelMap v -mapDelete (Label k) (LM m) = LM (M.delete k m) +mapDelete (Label k) (LM m) = LM (delFromUDFM m k) mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v -mapAlter f (Label k) (LM m) = LM (M.alter f k m) +mapAlter f (Label k) (LM m) = LM (alterUDFM f m k) mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v -mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) +mapAdjust f (Label k) (LM m) = LM (adjustUDFM f m k) mapUnion :: LabelMap v -> LabelMap v -> LabelMap v -mapUnion (LM x) (LM y) = LM (M.union x y) +mapUnion (LM x) (LM y) = LM (plusUDFM x y) + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (plusUDFM_CK (f . mkHooplLabel . getKey) x y) {-# INLINE mapUnions #-} mapUnions :: [LabelMap a] -> LabelMap a mapUnions [] = mapEmpty mapUnions maps = foldl1' mapUnion maps -mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v -mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) - mapDifference :: LabelMap v -> LabelMap b -> LabelMap v -mapDifference (LM x) (LM y) = LM (M.difference x y) +mapDifference (LM x) (LM y) = LM (minusUDFM x y) -mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v -mapIntersection (LM x) (LM y) = LM (M.intersection x y) - -mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool -mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y +mapIntersection :: LabelMap v -> LabelMap v -> LabelMap v +mapIntersection (LM x) (LM y) = LM (intersectUDFM x y) mapMap :: (a -> v) -> LabelMap a -> LabelMap v -mapMap f (LM m) = LM (M.map f m) +mapMap f (LM m) = LM (mapUDFM f m) mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v -mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) +mapMapWithKey f (LM m) = LM (mapWithInternalKeyUDFM (f . mkHooplLabel) m) {-# INLINE mapFoldl #-} mapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a -mapFoldl k z (LM m) = M.foldl k z m +mapFoldl k z lm = mapFoldr (\b g x -> g (k x b)) id lm z -- foldl as foldr + -- REVIEW: Is this implementation bad for performance? {-# INLINE mapFoldr #-} mapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b -mapFoldr k z (LM m) = M.foldr k z m +mapFoldr k z (LM m) = foldUDFM k z m {-# INLINE mapFoldlWithKey #-} mapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t -mapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m - -mapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m -mapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m +mapFoldlWithKey k z (LM m) = foldWithKeyUDFM (\t v acc -> k acc (mkHooplLabel $ getKey t) v) z m {-# INLINEABLE mapFilter #-} mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v -mapFilter f (LM m) = LM (M.filter f m) +mapFilter f (LM m) = LM (filterUDFM f m) {-# INLINEABLE mapFilterWithKey #-} mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v -mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) +mapFilterWithKey f (LM m) = LM (filterUDFM_Directly (f . mkHooplLabel . getKey) m) {-# INLINE mapElems #-} mapElems :: LabelMap a -> [a] -mapElems (LM m) = M.elems m +mapElems (LM m) = eltsUDFM m {-# INLINE mapKeys #-} mapKeys :: LabelMap a -> [Label] -mapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) +mapKeys (LM m) = map (mkHooplLabel . getKey . fst) (udfmToList m) {-# INLINE mapToList #-} mapToList :: LabelMap b -> [(Label, b)] -mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] +mapToList (LM m) = [(mkHooplLabel $ getKey k, v) | (k, v) <- udfmToList m] {-# INLINE mapFromList #-} mapFromList :: [(Label, v)] -> LabelMap v -mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromList assocs = LM (listToUDFM_Directly [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) {-# INLINE mapFromListWith #-} mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v -mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromListWith f assocs = LM (listToUDFM_C_Directly f [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -260,7 +260,7 @@ instance OutputableP Platform LiveInfo where = (pdoc env mb_static) $$ text "# entryIds = " <> ppr entryIds $$ text "# liveVRegsOnEntry = " <> ppr liveVRegsOnEntry - $$ text "# liveSlotsOnEntry = " <> text (show liveSlotsOnEntry) + $$ text "# liveSlotsOnEntry = " <> ppr liveSlotsOnEntry ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -205,6 +205,9 @@ instance Uniquable FastString where instance Uniquable Int where getUnique i = mkUniqueIntGrimily i +instance Uniquable Word64 where + getUnique i = mkUniqueGrimily i + instance Uniquable ModuleName where getUnique (ModuleName nm) = getUnique nm ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -40,12 +40,13 @@ module GHC.Types.Unique.DFM ( adjustUDFM_Directly, alterUDFM, mapUDFM, + mapWithInternalKeyUDFM, mapMaybeUDFM, plusUDFM, - plusUDFM_C, + plusUDFM_C, plusUDFM_CK, lookupUDFM, lookupUDFM_Directly, elemUDFM, - foldUDFM, + foldUDFM, foldWithKeyUDFM, eltsUDFM, filterUDFM, filterUDFM_Directly, isNullUDFM, @@ -55,6 +56,7 @@ module GHC.Types.Unique.DFM ( equalKeysUDFM, minusUDFM, listToUDFM, listToUDFM_Directly, + listToUDFM_C_Directly, udfmMinusUFM, ufmMinusUDFM, partitionUDFM, udfmRestrictKeys, @@ -83,6 +85,7 @@ import Data.Function (on) import GHC.Types.Unique.FM (UniqFM, nonDetUFMToList, ufmToIntMap, unsafeIntMapToUFM) import Unsafe.Coerce import qualified GHC.Data.Word64Set as W +import GHC.Word -- Note [Deterministic UniqFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -223,6 +226,12 @@ addListToUDFM_Directly_C addListToUDFM_Directly_C f = foldl' (\m (k, v) -> addToUDFM_C_Directly f m k v) {-# INLINEABLE addListToUDFM_Directly_C #-} +-- | Like 'addListToUDFM_Directly_C' but also passes the unique key to the combine function +addListToUDFM_Directly_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> [(Unique,elt)] -> UniqDFM key elt +addListToUDFM_Directly_CK f = foldl' (\m (k, v) -> addToUDFM_C_Directly (f k) m k v) +{-# INLINEABLE addListToUDFM_Directly_CK #-} + delFromUDFM :: Uniquable key => UniqDFM key elt -> key -> UniqDFM key elt delFromUDFM (UDFM m i) k = UDFM (M.delete (getKey $ getUnique k) m) i @@ -233,6 +242,15 @@ plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) | i > j = insertUDFMIntoLeft_C f udfml udfmr | otherwise = insertUDFMIntoLeft_C f udfmr udfml +-- | Like 'plusUDFM_C' but the combine function also receives the unique key +plusUDFM_CK :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +plusUDFM_CK f udfml@(UDFM _ i) udfmr@(UDFM _ j) + -- we will use the upper bound on the tag as a proxy for the set size, + -- to insert the smaller one into the bigger one + | i > j = insertUDFMIntoLeft_CK f udfml udfmr + | otherwise = insertUDFMIntoLeft_CK f udfmr udfml + + -- Note [Overflow on plusUDFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- There are multiple ways of implementing plusUDFM. @@ -281,6 +299,12 @@ insertUDFMIntoLeft_C insertUDFMIntoLeft_C f udfml udfmr = addListToUDFM_Directly_C f udfml $ udfmToList udfmr +-- | Like 'insertUDFMIntoLeft_C', but the merge function also receives the unique key +insertUDFMIntoLeft_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +insertUDFMIntoLeft_CK f udfml udfmr = + addListToUDFM_Directly_CK f udfml $ udfmToList udfmr + lookupUDFM :: Uniquable key => UniqDFM key elt -> key -> Maybe elt lookupUDFM (UDFM m _i) k = taggedFst `fmap` M.lookup (getKey $ getUnique k) m @@ -297,6 +321,12 @@ foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a -- This INLINE prevents a regression in !10568 foldUDFM k z m = foldr k z (eltsUDFM m) +-- | Like 'foldUDFM' but the function also receives a key +foldWithKeyUDFM :: (Unique -> elt -> a -> a) -> a -> UniqDFM key elt -> a +{-# INLINE foldWithKeyUDFM #-} +-- This INLINE was copied from foldUDFM +foldWithKeyUDFM k z m = foldr (uncurry k) z (udfmToList m) + -- | Performs a nondeterministic strict fold over the UniqDFM. -- It's O(n), same as the corresponding function on `UniqFM`. -- If you use this please provide a justification why it doesn't introduce @@ -396,6 +426,9 @@ listToUDFM = foldl' (\m (k, v) -> addToUDFM m k v) emptyUDFM listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt listToUDFM_Directly = foldl' (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM +listToUDFM_C_Directly :: (elt -> elt -> elt) -> [(Unique, elt)] -> UniqDFM key elt +listToUDFM_C_Directly f = foldl' (\m (u, v) -> addToUDFM_C_Directly f m u v) emptyUDFM + -- | Apply a function to a particular element adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt adjustUDFM f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey $ getUnique k) m) i @@ -429,6 +462,10 @@ mapUDFM f (UDFM m i) = UDFM (MS.map (fmap f) m) i -- in GHCi because all old ModDetails are retained (see pruneHomePackageTable). -- Modify with care. +-- | Map a function over every value in a UniqDFM +mapWithInternalKeyUDFM :: (Word64 -> elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 +mapWithInternalKeyUDFM f (UDFM m i) = UDFM (MS.mapWithKey (fmap . f) m) i + mapMaybeUDFM :: forall elt1 elt2 key. (elt1 -> Maybe elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 mapMaybeUDFM f (UDFM m i) = UDFM (M.mapMaybe (traverse f) m) i ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -142,6 +142,7 @@ import Data.Int import qualified Data.IntMap as IM import Data.Set (Set) import qualified Data.Set as Set +import qualified Data.IntSet as IntSet import qualified GHC.Data.Word64Set as Word64Set import Data.String import Data.Word @@ -991,6 +992,9 @@ instance (Outputable a) => Outputable (Set a) where instance Outputable Word64Set.Word64Set where ppr s = braces (pprWithCommas ppr (Word64Set.toList s)) +instance Outputable IntSet.IntSet where + ppr s = braces (pprWithCommas ppr (IntSet.toList s)) + instance (Outputable a, Outputable b) => Outputable (a, b) where ppr (x,y) = parens (sep [ppr x <> comma, ppr y]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15d74c897b1412eb5c513d1725ad118c79b8192c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/15d74c897b1412eb5c513d1725ad118c79b8192c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 14:21:08 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 01 Jul 2024 10:21:08 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] cleanup Message-ID: <6682bb5435b10_1e014974815038549@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 7cf90ba5 by Rodrigo Mesquita at 2024-07-01T15:21:01+01:00 cleanup - - - - - 3 changed files: - compiler/GHC/Cmm/UniqueRenamer.hs - testsuite/tests/determinism/object/check-standalone.sh - testsuite/tests/determinism/object/check.sh Changes: ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE LambdaCase, MagicHash, UnboxedTuples, PatternSynonyms, ExplicitNamespaces #-} +{-# LANGUAGE LambdaCase, MagicHash, UnboxedTuples, PatternSynonyms, ExplicitNamespaces, TypeFamilies #-} module GHC.Cmm.UniqueRenamer ( detRenameUniques , UniqDSM, runUniqueDSM @@ -23,8 +23,6 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) -import qualified Data.Map as M -import qualified Data.Set as S import GHC.Types.Id {- @@ -72,7 +70,7 @@ renameDetUniq uq = do Nothing -> do new_w <- gets supply -- New deterministic unique in this `DetRnM` let (tag, _) = unpkUnique uq - det_uniq = mkUnique 'Q' new_w + det_uniq = mkUnique tag new_w modify' (\DetUniqFM{mapping, supply} -> -- Update supply and mapping DetUniqFM @@ -184,7 +182,7 @@ instance UniqRenamable CmmLit where CmmBlock bid -> CmmBlock <$> uniqRename bid CmmHighStackMark -> pure CmmHighStackMark --- TODO::: VERY BAD!!! This isn't deterministic since the key is non-deterministic thus the order in which we rename is non deterministic +-- This is fine because LabelMap is backed by a deterministic UDFM instance UniqRenamable a {- for 'Body' and on 'RawCmmStatics' -} => UniqRenamable (LabelMap a) where uniqRename lm = mapFromListWith panicMapKeysNotInjective <$> traverse (\(l,x) -> (,) <$> uniqRename l <*> uniqRename x) (mapToList lm) @@ -270,16 +268,6 @@ instance (UniqRenamable a) => UniqRenamable (Maybe a) where uniqRename Nothing = pure Nothing uniqRename (Just x) = Just <$> uniqRename x --- TODO::: BAD!!! This won't be deterministic if the key is non-deterministic because the order in which we rename is non deterministic -instance (Ord a, UniqRenamable a, UniqRenamable b) => UniqRenamable (M.Map a b) where - uniqRename m = M.fromListWith panicMapKeysNotInjective <$> traverse (\(l,x) -> (,) <$> uniqRename l <*> uniqRename x) (M.toList m) - --- TODO::: BAD!!! This won't be deterministic if the key is non-deterministic because the order in which we rename is non deterministic -instance (Ord a, UniqRenamable a) => UniqRenamable (S.Set a) where - -- Because of renaming being injective the resulting set should have the same - -- size as the intermediate list. - uniqRename s = S.fromList <$> mapM uniqRename (S.toList s) - -- | Utility panic used by UniqRenamable instances for Map-like datatypes panicMapKeysNotInjective :: a -> b -> c panicMapKeysNotInjective _ _ = error "this should be impossible because the function which maps keys should be injective" ===================================== testsuite/tests/determinism/object/check-standalone.sh ===================================== @@ -9,5 +9,7 @@ fi rm -rf objs1 objs2 cabal get Cabal-3.12.0.0 cabal build -w $1 --ghc-options="-fforce-recomp -j4 -ddump-to-file -ddump-asm -ddump-cmm -ddump-stg-final" --ghc-options=-odir=out1 Cabal +# cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out1 Cabal cabal build -w $1 --ghc-options="-fforce-recomp -j4 -dinitial-unique=16777215 -dunique-increment=-1 -ddump-to-file -ddump-asm -ddump-cmm -ddump-stg-final" --ghc-options=-odir=out2 Cabal +# cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out2 Cabal ./check.sh darwin ===================================== testsuite/tests/determinism/object/check.sh ===================================== @@ -21,7 +21,7 @@ fi S1=`find Cabal-3.12.0.0/out1 -name "*.o" | wc -l` S2=`find Cabal-3.12.0.0/out2 -name "*.o" | wc -l` -test $S1 > 0 +test $S1 > 0 || (echo "no files generated" && false) test $S1 == $S2 # $1 = objects View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cf90ba5694710b27b102837aa5ed2e0a6bd5640 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cf90ba5694710b27b102837aa5ed2e0a6bd5640 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 14:50:21 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 10:50:21 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Do proper eqType in findMatchingIrreds Message-ID: <6682c22de446d_1e0149cdcc88446e0@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: e4206ce6 by Simon Peyton Jones at 2024-07-01T15:38:17+01:00 Do proper eqType in findMatchingIrreds I believe that the four calls of `tcEqTypeNoKindCheck` in match_eq_help are bogus; they should be `tcEqType`. The use of `tcEqTypeNoKindCheck` in `match_non_eq` is fine, I think, because `irred` and `irredCtPred` both have type Constraint. Actually even that isn't really true. One might have kind Constraint and the other kind Constraint#. E.g. (a b ~# c d) and (E q ) Maybe that is another bug? Richard replies: Yes I think you're probably right. I could see some ill-typed Core potentially being produced in this way. I think the check for non_eq is OK: I don't think a Constraint# is going to match a regular irred. But maybe it's safer to change it. - - - - - e4d078ab by Simon Peyton Jones at 2024-07-01T15:49:48+01:00 Fix egregious bug - - - - - 2 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Tc/Solver/InertSet.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -168,9 +168,9 @@ tryMatchFam :: BuiltInSynFamily -> [Type] -- :: F tys ~r rhs, tryMatchFam builtin_fam arg_tys = listToMaybe $ -- Pick first rule to match - [ (BuiltInFamRewrite rw_ax, [inst_tys], res_ty) + [ (BuiltInFamRewrite rw_ax, inst_tys, res_ty) | rw_ax <- sfMatchFam builtin_fam - , Just ([inst_tys],res_ty) <- [bifrw_match rw_ax arg_tys] ] + , Just (inst_tys,res_ty) <- [bifrw_match rw_ax arg_tys] ] ------------------------------------------------------------------------------- -- Constructing BuiltInFamInteract, BuiltInFamRewrite ===================================== compiler/GHC/Tc/Solver/InertSet.hs ===================================== @@ -1443,8 +1443,8 @@ findMatchingIrreds irreds ev where pred = ctEvPred ev match_non_eq irred - | irredCtPred irred `tcEqTypeNoKindCheck` pred = Left (irred, NotSwapped) - | otherwise = Right irred + | irredCtPred irred `tcEqType` pred = Left (irred, NotSwapped) + | otherwise = Right irred match_eq eq_rel1 lty1 rty1 irred | EqPred eq_rel2 lty2 rty2 <- classifyPredType (irredCtPred irred) @@ -1455,9 +1455,9 @@ findMatchingIrreds irreds ev = Right irred match_eq_help lty1 rty1 lty2 rty2 - | lty1 `tcEqTypeNoKindCheck` lty2, rty1 `tcEqTypeNoKindCheck` rty2 + | lty1 `tcEqType` lty2, rty1 `tcEqType` rty2 = Just NotSwapped - | lty1 `tcEqTypeNoKindCheck` rty2, rty1 `tcEqTypeNoKindCheck` lty2 + | lty1 `tcEqType` rty2, rty1 `tcEqType` lty2 = Just IsSwapped | otherwise = Nothing View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e5210eaa37f8f6fe8f3d6eacb8d34514ed5b3560...e4d078abb7c84a099c09f54a87669bc3e2a14138 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e5210eaa37f8f6fe8f3d6eacb8d34514ed5b3560...e4d078abb7c84a099c09f54a87669bc3e2a14138 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 15:43:04 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 01 Jul 2024 11:43:04 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/parallel-depanal-downsweep] 4174 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <6682ce87f222c_1e014912e18f464378@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/parallel-depanal-downsweep at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 83f2d87c by Torsten Schmits at 2024-06-28T14:00:02+02:00 Parallelize getRootSummary computations in dep analysis downsweep This reuses the upsweep step's infrastructure to process batches of modules in parallel. I benchmarked this by running `ghc -M` on two sets of 10,000 modules; one with a linear dependency chain and the other with a binary tree. Comparing different values for the number of modules per thread suggested an optimum at `length targets `div` (n_cap * 2)`, with results similar to this one (6 cores, 12 threads): ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 1.775 s ± 0.026 s [User: 1.377 s, System: 0.399 s] Range (min … max): 1.757 s … 1.793 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 876.2 ms ± 20.9 ms [User: 1833.2 ms, System: 518.6 ms] Range (min … max): 856.2 ms … 898.0 ms 3 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 793.5 ms ± 23.2 ms [User: 2318.9 ms, System: 718.6 ms] Range (min … max): 771.9 ms … 818.0 ms 3 runs ``` Results don't differ much when the batch size is reduced to a quarter of that, but there's significant thread scheduling overhead for a size of 1: ``` Benchmark 1: linear 1 jobs Time (mean ± σ): 2.611 s ± 0.029 s [User: 2.851 s, System: 0.783 s] Range (min … max): 2.591 s … 2.632 s 2 runs Benchmark 2: linear 6 jobs Time (mean ± σ): 1.189 s ± 0.007 s [User: 2.707 s, System: 1.103 s] Range (min … max): 1.184 s … 1.194 s 2 runs Benchmark 3: linear 12 jobs Time (mean ± σ): 1.097 s ± 0.006 s [User: 2.938 s, System: 1.300 s] Range (min … max): 1.093 s … 1.101 s 2 runs ``` Larger batches also slightly worsen performance. - - - - - d5cb9c76 by Torsten Schmits at 2024-06-28T15:05:37+02:00 use diag_wrapper argument like upsweep does - - - - - 9cf0ef01 by Torsten Schmits at 2024-06-28T15:34:11+02:00 restructure a bit - - - - - f3c4280a by Torsten Schmits at 2024-07-01T17:24:23+02:00 also pass down the Messager - - - - - c92e6cd9 by Torsten Schmits at 2024-07-01T17:37:06+02:00 propagate exceptions to preserve current behavior - - - - - 9fa47b9c by Torsten Schmits at 2024-07-01T17:38:42+02:00 use fixed bundle size - - - - - 30 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/LRegSet.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/CmmToAsm.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d09c9df74ff2dbed76a22af4a2250ba13a0c2d7...9fa47b9cdd19255e7ca495a615b6c1720e690c4a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d09c9df74ff2dbed76a22af4a2250ba13a0c2d7...9fa47b9cdd19255e7ca495a615b6c1720e690c4a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 16:19:18 2024 From: gitlab at gitlab.haskell.org (Andrei Borzenkov (@sand-witch)) Date: Mon, 01 Jul 2024 12:19:18 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/sand-witch/9.10-fix-notes Message-ID: <6682d70697e2a_1e014918ff6146871d@gitlab.mail> Andrei Borzenkov pushed new branch wip/sand-witch/9.10-fix-notes at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/sand-witch/9.10-fix-notes You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 16:36:19 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 01 Jul 2024 12:36:19 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Comments only Message-ID: <6682db037668e_1e01491b55c7473917@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: b2e767d1 by Simon Peyton Jones at 2024-07-01T17:33:59+01:00 Comments only - - - - - 86fc6631 by Simon Peyton Jones at 2024-07-01T17:36:01+01:00 Clerical error - - - - - 1 changed file: - compiler/GHC/Builtin/Types/Literals.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -302,10 +302,12 @@ mkInteractBinFamDeduction str fam_tc f , bifint_arg_roles = [Nominal, Nominal] , bifint_res_role = Nominal , bifint_proves = \cs -> do { [Pair lhs1 rhs1, Pair lhs2 rhs2] <- return cs +-- ; same rhs1 rhs2 ; (tc1, [x1,y1]) <- splitTyConApp_maybe lhs1 ; (tc2, [x2,y2]) <- splitTyConApp_maybe lhs2 ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) +-- ; f x1 y1 x2 y2 } } ; f x1 y1 rhs1 x2 y2 rhs2 } } @@ -402,13 +404,13 @@ axAddInteracts :: [BuiltInFamInteract] axAddInteracts = map mk_ax $ [ ("AddI-xr", \ x1 y1 z1 x2 y2 z2 -> injCheck x1 x2 z1 z2 y1 y2) - -- (x1+y1~z, x2+y2~z) {x1=x2}=> (y1 ~ y2) + -- (x1+y1~z1, x2+y2~z2) {x1=x2,z1=z2}=> (y1 ~ y2) , ("AddI-xr2", \ x1 y1 z1 x2 y2 z2 -> injCheck x2 y1 z1 z2 x1 y2) - -- (x1+y1~z, x2+y2~z) {x2=y1}=> (x1 ~ y2) + -- (x1+y1~z1, x2+y2~z2) {x2=y1,z1=z2}=> (x1 ~ y2) , ("AddI-yr", \ x1 y1 z1 x2 y2 z2 -> injCheck y1 y2 z1 z2 x1 x2) - -- (x1+y1~z, x2+y2~z) {y1=y2}=> (x1 ~ x2) + -- (x1+y1~z1, x2+y2~z2) {y1=y2,z1=z2}=> (x1 ~ x2) , ("AddI-yr2", \ x1 y1 z1 x2 y2 z2 -> injCheck x1 y2 z1 z2 y1 x2) - -- (x1+y1~z, x2+y2~z) {x1=y2}=> (y1 ~ x2) + -- (x1+y1~z1, x2+y2~z2) {x1=y2,z1=z2}=> (y1 ~ x2) ] where mk_ax (str, fun) = mkInteractBinFamDeduction str typeNatAddTyCon fun @@ -571,7 +573,7 @@ axDivMatches , mkBinConstFoldAxiom tc "DivDef" isNumLitTy isNumLitTy $ -- 8 `div` 4 --> 2 \x y -> do { guard (y /= 0); return (num (div x y)) } ] where - tc = typeNatModTyCon + tc = typeNatDivTyCon axModMatches :: [BuiltInFamRewrite] axModMatches View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e4d078abb7c84a099c09f54a87669bc3e2a14138...86fc6631f87e418e16f5bf852cad9bf5edb966d9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e4d078abb7c84a099c09f54a87669bc3e2a14138...86fc6631f87e418e16f5bf852cad9bf5edb966d9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 17:09:19 2024 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 01 Jul 2024 13:09:19 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 43 commits: ci: Enable strict ghc-toolchain setting for bindists Message-ID: <6682e2bf30c88_1e01491f83e54838f@gitlab.mail> Cheng Shao pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 611a2af0 by Cheng Shao at 2024-07-01T14:53:38+00:00 compiler: always generate dynamic stub objects when generating bytecode When foreign stub objects are compiled during bytecode generation (e.g. when using whole core bindings), ensure they are dynamic so they can be properly loaded. - - - - - 83e82270 by Cheng Shao at 2024-07-01T14:53:38+00:00 compiler: generate stub objects before writing iface This commit promotes foreign stub compilation a bit earlier before we actually write iface, to make it possible to actually serialize them into the final iface when compiling with `-fwrite-if-simplified-core`. Also ensures dynamic stub objects are generated if we're compiling with `-fwrite-if-simplified-core`. - - - - - 6dc70de3 by Cheng Shao at 2024-07-01T14:53:38+00:00 compiler: add mi_stub_objs to ModIface This commit adds the mi_stub_objs field to ModIface, representing serialized foreign stub dynamic objects that can be reloaded later when compiling a downstream module with `-fprefer-byte-code` that loads whole core bindings from an upstream module that requires foreign stubs, see #24634 for such an example. - - - - - 64a7cf70 by Cheng Shao at 2024-07-01T14:53:38+00:00 compiler: serialize foreign stub dynamic objects in interface file when compiling with -fwrite-if-simplified-core This commit makes the compiler serialize foreign stub dynamic objects in mi_stub_objs when compiling with -fwrite-if-simplified-core. This is needed when we compile a downstream module with -fprefer-byte-code, in which case we want to make use of whole core bindings in upstream modules instead of having to load their dynamic objects, but the foreign stub information has been lost across different ghc invocations previously. Hence the fix in this commit. See #24634 for such an example. - - - - - a5f4ccfd by Cheng Shao at 2024-07-01T14:53:38+00:00 testsuite: fix T24634 This commit fixes T24634 and marks it as unbroken. - - - - - 15a02e9c by Cheng Shao at 2024-07-01T14:53:38+00:00 WIP: oneshot bytecode support - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - + compiler/GHC/Driver/Make.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - + compiler/GHC/Iface/Warnings.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Platform.hs - compiler/GHC/Unit/Module/ModIface.hs - compiler/ghc.cabal.in - configure.ac The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0b8fee54d7fdd1f4884e7a27601218c437b8cd73...15a02e9caca2eeaee0629205496a99c90ab1f5a7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0b8fee54d7fdd1f4884e7a27601218c437b8cd73...15a02e9caca2eeaee0629205496a99c90ab1f5a7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 18:46:54 2024 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Mon, 01 Jul 2024 14:46:54 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] WIP Message-ID: <6682f99eb2752_1e01492a5abd489913@gitlab.mail> Cheng Shao pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 3f0167c0 by Cheng Shao at 2024-07-01T18:46:45+00:00 WIP - - - - - 3 changed files: - compiler/GHC/Driver/Main.hs-boot - − compiler/GHC/Driver/Make.hs-boot - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -1,15 +1,11 @@ module GHC.Driver.Main where import GHC.Driver.Env -import GHC.Iface.Recomp import GHC.Linker.Types import GHC.Prelude import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModIface -import GHC.Unit.Module.ModSummary initModDetails :: HscEnv -> ModIface -> IO ModDetails -loadByteCode :: ModIface -> ModSummary -> IO (MaybeValidated Linkable) - initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable ===================================== compiler/GHC/Driver/Make.hs-boot deleted ===================================== @@ -1,33 +0,0 @@ -module GHC.Driver.Make where - -import qualified Data.Map as M -import Data.Time.Clock -import GHC.Data.StringBuffer -import GHC.Driver.Env -import GHC.Driver.Errors.Types -import GHC.Prelude -import GHC.Types.PkgQual -import GHC.Types.SrcLoc -import GHC.Unit.Home -import GHC.Unit.Module.ModSummary -import GHC.Unit.Types -import Language.Haskell.Syntax - -data SummariseResult = - FoundInstantiation InstantiatedUnit - | FoundHomeWithError (UnitId, DriverMessages) - | FoundHome ModSummary - | External UnitId - | NotThere - -summariseModule - :: HscEnv - -> HomeUnit - -> M.Map (UnitId, FilePath) ModSummary - -- ^ Map of old summaries - -> IsBootInterface -- True <=> a {-# SOURCE #-} import - -> Located ModuleName -- Imported module to be summarised - -> PkgQual - -> Maybe (StringBuffer, UTCTime) - -> [ModuleName] -- Modules to exclude - -> IO SummariseResult ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -56,14 +56,10 @@ import qualified Data.Map as M import System.FilePath import System.Directory import GHC.Driver.Env -import GHC.Tc.Utils.Monad -import GHC.IfaceToCore import {-# SOURCE #-} GHC.Driver.Main -import GHC.Unit.Module.ModSummary -import {-# SOURCE #-} GHC.Driver.Make -import GHC.Driver.Session -import GHC.Types.PkgQual import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -293,23 +289,28 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do - Succeeded !iface <- ldLoadIface opts (text "makima") mod - !details <- initModDetails (ldHscEnv opts) iface - -- let home_unit = (ue_unitHomeUnit (homeUnitId_ (hsc_dflags (ldHscEnv opts))) (hsc_unit_env (ldHscEnv opts))) - -- !(FoundHome r) <- summariseModule (ldHscEnv opts) home_unit mempty NotBoot (noLoc (moduleName mod)) (ThisPkg (homeUnitId home_unit)) Nothing [] - --- !bc_linkable <- loadByteCode iface undefined ; - t <- getCurrentTime - !bytecode_ul <- initWholeCoreBindings (ldHscEnv opts) iface details (LM t mod [CoreBindings $ WholeCoreBindings (fromJust $ mi_extra_decls iface) mod undefined]) ; - -- !mod_details <- initIfaceLoadModule (ldHscEnv opts) (mi_module iface) (typecheckIface iface) ; - putStrLn $ "[DEBUG] found " ++ show (moduleName mod) - -- ...and then find the linkable for it - pure bytecode_ul - -- mb_lnk <- findObjectLinkableMaybe mod loc - -- case mb_lnk of { - -- Nothing -> no_obj mod ; - -- Just lnk -> adjust_linkable lnk - --} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "makima") mod + case mi_extra_decls iface of + Just extra_decls -> do + details <- initModDetails hsc_env iface + t <- getCurrentTime + initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f0167c0c8af3c0b30dd00593c72868f86d7bdef -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f0167c0c8af3c0b30dd00593c72868f86d7bdef You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 21:26:47 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Mon, 01 Jul 2024 17:26:47 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/ucrt64/win-reloc-x86_64-pc64 Message-ID: <66831f1740429_1e01493ca2c74102391@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/ucrt64/win-reloc-x86_64-pc64 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/ucrt64/win-reloc-x86_64-pc64 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 1 23:05:58 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Mon, 01 Jul 2024 19:05:58 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole Message-ID: <668336568eeab_9ce8cc32301368@gitlab.mail> Adriaan Leijnse pushed new branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/aidylns/ttg-remove-hsunboundvar-via-hshole You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 09:34:13 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Tue, 02 Jul 2024 05:34:13 -0400 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] Fix hard_hole_fits test expected stderr output for HsHole Message-ID: <6683c995cc068_1362b3ee37c7251f@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: a3ccd9de by Adriaan Leijnse at 2024-07-02T11:32:44+02:00 Fix hard_hole_fits test expected stderr output for HsHole - - - - - 1 changed file: - testsuite/tests/perf/compiler/hard_hole_fits.stderr Changes: ===================================== testsuite/tests/perf/compiler/hard_hole_fits.stderr ===================================== @@ -18,14 +18,12 @@ hard_hole_fits.hs:14:22: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] (imported from ‘Prelude’ at hard_hole_fits.hs:8:8-20 (and originally defined in ‘GHC.Internal.Enum’)) -hard_hole_fits.hs:15:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] - • Found hole: _ :: Int - • In an equation for ‘testMe’: testMe (HsUnboundVar xuv uv) = _ - • Relevant bindings include - uv :: GHC.Types.Name.Reader.RdrName - (bound at hard_hole_fits.hs:15:26) - xuv :: Language.Haskell.Syntax.Extension.XUnboundVar GhcPs - (bound at hard_hole_fits.hs:15:22) +hard_hole_fits.hs:15:21: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] + Found hole: _ :: Int + In an equation for ‘testMe’: testMe (HsHole a) = _ + Relevant bindings include + a :: Language.Haskell.Syntax.Extension.XHole GhcPs + (bound at hard_hole_fits.hs:15:16) testMe :: HsExpr GhcPs -> Int (bound at hard_hole_fits.hs:14:1) Valid hole fits include maxBound :: forall a. Bounded a => a View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3ccd9de2c13a898f662b647796e761a7dbe9201 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3ccd9de2c13a898f662b647796e761a7dbe9201 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 09:58:35 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Tue, 02 Jul 2024 05:58:35 -0400 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] Add missing closing parenthesis in Note Message-ID: <6683cf4b31563_1362b343c2cc756de@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: fc6000cc by Adriaan Leijnse at 2024-07-02T11:57:57+02:00 Add missing closing parenthesis in Note - - - - - 1 changed file: - compiler/GHC/Rename/Expr.hs Changes: ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -822,7 +822,7 @@ See #18151. Note [Reporting unbound names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Faced with an out-of-scope `RdrName` there are two courses of action -A. Report an error immediately (and return a HsUnboundVarRn. This will halt GHC after the renamer is complete +A. Report an error immediately (and return a HsUnboundVarRn). This will halt GHC after the renamer is complete B. Return a HsUnboundVarRn without reporting an error. That will allow the typechecker to run, which in turn can give a better error message, notably giving the type of the variable via the "typed holes" mechanism. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc6000cc6068e0a453b278032e15a721cec70d78 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc6000cc6068e0a453b278032e15a721cec70d78 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 10:13:22 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 02 Jul 2024 06:13:22 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] Add support for building profiled dynamic way Message-ID: <6683d2c2a3029_1362b367813078593@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: bb6a577f by Matthew Pickering at 2024-07-02T11:11:27+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json - hadrian/bootstrap/src/Main.hs - hadrian/build-cabal - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bb6a577ff2b7df4bc512927a811e3cfd9e945042 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bb6a577ff2b7df4bc512927a811e3cfd9e945042 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:02:06 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Tue, 02 Jul 2024 07:02:06 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-missing-symbols-deadbeef Message-ID: <6683de2e35d53_28a0391f64402419@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-missing-symbols-deadbeef at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/musl64/ghc-9.6-missing-symbols-deadbeef You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:12:18 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 02 Jul 2024 07:12:18 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Bump array submodule Message-ID: <6683e092d75fb_28a0393bd990249ec@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - c5200557 by Zubin Duggal at 2024-07-02T07:11:59-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 2aa3c8cb by Oleg Grenrus at 2024-07-02T07:12:01-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 63ce1a14 by Adam Gundry at 2024-07-02T07:12:03-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - e3fdd7ce by Max Ulidtko at 2024-07-02T07:12:05-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - da2bc6be by Matthew Pickering at 2024-07-02T07:12:08-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - 30 changed files: - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - + compiler/GHC/Iface/Warnings.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Finder/Types.hs - compiler/GHC/Utils/TmpFs.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - docs/users_guide/using-warnings.rst - ghc/GHCi/UI.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Settings/Builders/GenPrimopCode.hs - libraries/array - libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs - libraries/ghc-experimental/ghc-experimental.cabal - + libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs - + libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs - libraries/ghci/GHCi/BinaryArray.hs - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs - + testsuite/tests/ghci/should_run/T10920.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a10d42253a1ce874b40d6b1d037ba1219032bd7d...da2bc6be12efa219720984f65c60161aafaca94f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a10d42253a1ce874b40d6b1d037ba1219032bd7d...da2bc6be12efa219720984f65c60161aafaca94f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:16:13 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Tue, 02 Jul 2024 07:16:13 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-0006-Adds-support-for-Hidden-symbols Message-ID: <6683e17d6c509_28a0395805ac3544c@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-0006-Adds-support-for-Hidden-symbols at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/musl64/ghc-9.6-0006-Adds-support-for-Hidden-symbols You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:17:11 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 02 Jul 2024 07:17:11 -0400 Subject: [Git][ghc/ghc][wip/hadddock-libraries] 193 commits: template-haskell: Move wired-ins to ghc-internal Message-ID: <6683e1b765a4b_28a0395e47dc37292@gitlab.mail> Zubin pushed to branch wip/hadddock-libraries at Glasgow Haskell Compiler / GHC Commits: 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - c3a2a553 by Zubin Duggal at 2024-07-02T16:46:54+05:30 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 - - - - - 30 changed files: - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/LRegSet.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6de0f992cb4e55fcaba1fad64bcae446f6c6015f...c3a2a553b6e0057bb70046d5d04fab8a26b7dbf0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6de0f992cb4e55fcaba1fad64bcae446f6c6015f...c3a2a553b6e0057bb70046d5d04fab8a26b7dbf0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:19:55 2024 From: gitlab at gitlab.haskell.org (Peter Trommler (@trommler)) Date: Tue, 02 Jul 2024 07:19:55 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25018 Message-ID: <6683e25b23dbc_28a0396f5a043748f@gitlab.mail> Peter Trommler pushed new branch wip/T25018 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25018 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:20:54 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Tue, 02 Jul 2024 07:20:54 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt Message-ID: <6683e29615a55_28a0397be4cc39161@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/musl64/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/musl64/ghc-9.6-0002-Drop-spurious-8-byte-offset-from-elf_plt You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:26:42 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Tue, 02 Jul 2024 07:26:42 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/aidylns/remove-hsunboundvar-using-hsvar Message-ID: <6683e3f29ff1d_28a039949e18472b4@gitlab.mail> Adriaan Leijnse pushed new branch wip/aidylns/remove-hsunboundvar-using-hsvar at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/aidylns/remove-hsunboundvar-using-hsvar You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:33:55 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Tue, 02 Jul 2024 07:33:55 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug Message-ID: <6683e5a34dc36_28a039bd6e74566a6@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:43:31 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Tue, 02 Jul 2024 07:43:31 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0 Message-ID: <6683e7e3d61c4_28a039d333306007c@gitlab.mail> doyougnu pushed new branch wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 11:48:17 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Tue, 02 Jul 2024 07:48:17 -0400 Subject: [Git][ghc/ghc][wip/clc275] 102 commits: haddock: Correct the Makefile to take into account Darwin systems Message-ID: <6683e901a6f43_28a039dcd9bc620b1@gitlab.mail> Andreas Klebinger pushed to branch wip/clc275 at Glasgow Haskell Compiler / GHC Commits: 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 35d4819a by Ben Gamari at 2024-07-02T13:30:47+02:00 base: Add `HasCallStack` constraint to `ioError` As proposed in core-libraries-committee#275. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Multiplicity.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82d50ec4dc8387ea9ca9a3b601ee8e3e55d3b890...35d4819a5bb61428b5029cd9f35a5e8d16b699ae -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82d50ec4dc8387ea9ca9a3b601ee8e3e55d3b890...35d4819a5bb61428b5029cd9f35a5e8d16b699ae You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 12:17:36 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 02 Jul 2024 08:17:36 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] wip Message-ID: <6683efe0a7fe_28a039123ef8c67836@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 1f015011 by Fabricio de Sousa Nascimento at 2024-07-02T21:17:06+09:00 wip - - - - - 7 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - libraries/array - testsuite/tests/rename/T25014/Ambig1.hs - testsuite/tests/rename/T25014/Ambig2.hs - testsuite/tests/rename/T25014/T25014.hs Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -3,8 +3,6 @@ {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TupleSections #-} -{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} -{-# HLINT ignore "Use camelCase" #-} {- (c) The GRASP/AQUA Project, Glasgow University, 1992-2006 @@ -118,6 +116,7 @@ import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) +import qualified Distribution.Simple as ways {- ********************************************************* @@ -703,9 +702,16 @@ lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = , prioritiseParent = True -- See T23664. } -{- NOTE [Something on Type Class and Instance (better name)] --- TODO --- An specialization of lookupSubBndrOccOnExportList +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. -} lookupSubBndrOccOnTypeClass :: DeprecationWarnings -> Name -- ^ Parent @@ -719,14 +725,15 @@ lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = then return (FoundChild (mkUnboundGRERdr rdr_name)) else do traceTc "lookupSubBndrOccOnTypeClass" (vcat []) - (picked_gres, original_gres) <- lookup_names_on_gres parent rdr_name how_lkup + (picked_gres, original_gres) <- lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup case picked_gres of NoOccurrence -> - noMatchingParentErr parent rdr_name original_gres + return NameNotFound UniqueOccurrence _ -> - -- This unique occurrence will have no parent, and thus can't match the parent + -- Methods on type classes and their instances or type classes require a matching + -- parent -- we are looking for. - noMatchingParentErr parent rdr_name original_gres + noMatchingRecordFieldParentErr parent rdr_name original_gres DisambiguatedOccurrence g -> markUsedAndReturnFoundChild warn_if_deprec g AmbiguousOccurrence _ -> @@ -737,7 +744,30 @@ lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = mkIncorrectParentErr parent (NE.fromList original_gres) {-# INLINEABLE lookupSubBndrOccOnTypeClass #-} --- | Used in export lists to lookup the children. +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +noMatchingRecordFieldParentErr :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +noMatchingRecordFieldParentErr parent rdr_name original_gres = do + traceRn "noMatchingParentErr" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> mkIncorrectParentErr parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then mkIncorrectParentErr parent (NE.fromList gss) + else mkGresNameClashErr rdr_name $ g NE.:| gss' + +-- Used in export lists to lookup the children. See +-- NOTE [ Differences in name lookup for Export List and Type Classes ] lookupSubBndrOccOnExportList :: DeprecationWarnings -> Name -- ^ Parent -> RdrName -- ^ thing we are looking up @@ -750,25 +780,36 @@ lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = then return (FoundChild (mkUnboundGRERdr rdr_name)) else do traceTc "lookupSubBndrOccOnTypeClass" (vcat []) - (picked_gres, original_gres) <- lookup_names_on_gres parent rdr_name how_lkup + (picked_gres, original_gres) <- lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup case picked_gres of NoOccurrence -> - noMatchingParentErr parent rdr_name original_gres + noMatchingRecordFieldParentErr parent rdr_name original_gres UniqueOccurrence g -> + -- It seems counter intuitive that we would accept exporting an occurrence + -- that does not match the parent, but there are cases where we can export + -- a name with a different parent, for example pattern synonyms: + -- + -- module I (foo) where + -- pattern P{foo} = foo + -- + -- module M (S (foo)) where + -- import I + -- data S markUsedAndReturnFoundChild warn_if_deprec g DisambiguatedOccurrence g -> markUsedAndReturnFoundChild warn_if_deprec g AmbiguousOccurrence gres -> - mkGresNameClashErr rdr_name gres -- it seems odd this is used here too + mkGresNameClashErr rdr_name gres --TODO FABU it seems odd this is used here too {-# INLINEABLE lookupSubBndrOccOnExportList #-} --- TODO -lookup_names_on_gres :: Name -- Parent + +-- TODO FABU +lookup_sub_bndr_occ_on_gres :: Name -- Parent -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) -lookup_names_on_gres parent rdr_name how_lkup = do +lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres @@ -780,9 +821,8 @@ lookup_names_on_gres parent rdr_name how_lkup = do return (picked_gres, original_gres) where pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- TODO understand this better - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification + -- For Unqual, find all GREs that are in scope qualified or unqualified + -- For Qual, find only GREs that are in scope with that qualification pick_gres gres | isUnqual rdr_name = mconcat (map right_parent gres) @@ -798,29 +838,7 @@ lookup_names_on_gres parent rdr_name how_lkup = do NoParent -> UniqueOccurrence gre --- Called when we find no matching GREs after disambiguation but --- there are three situations where this happens. --- 1. There were none to begin with. --- 2. None of the matching ones were the parent but --- a. They were from an overloaded record field so we can report --- a better error. --- b. The original lookup was actually ambiguous. --- For example, the case where overloading is off and two --- record fields are in scope from different record --- constructors, neither of which is the parent. -noMatchingParentErr :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult -noMatchingParentErr parent rdr_name original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr parent (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr parent (NE.fromList gss) - else mkGresNameClashErr rdr_name $ g NE.:| gss' - --- TODO explain this better +-- TODO FABU explain this better -- mkGresNameClashErr is one of the exceptions mentioned on -- Not [ Unbound vs Ambiguous Names ]. mkGresNameClashErr :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,7 +698,7 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations + -- Do not report export list declaration deprecations name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOccHelper (RENAME): +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit ba5e9dcf1370190239395b8361b1c92ea9fc7632 +Subproject commit 510456786715d96dfc9e9bc4cead9aace1ce2db6 ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -1,4 +1,4 @@ --- +-- TODO FABU {-# LANGUAGE TypeFamilies #-} module Ambig1 where data family T a ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -1,4 +1,4 @@ --- +-- TODO FABU {-# LANGUAGE TypeFamilies #-} module Ambig2 where import Ambig1 (T) ===================================== testsuite/tests/rename/T25014/T25014.hs ===================================== @@ -1,4 +1,4 @@ --- +-- TODO FABU module T25014 (T(MkT)) where -- which MkT is exported here? import Ambig1 (T(MkT)) import Ambig2 (T(MkT)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f015011b76da6d3563de8e434e5eb0a5c4ab913 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f015011b76da6d3563de8e434e5eb0a5c4ab913 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 14:11:07 2024 From: gitlab at gitlab.haskell.org (josephf (@josephf)) Date: Tue, 02 Jul 2024 10:11:07 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/type-sharing Message-ID: <66840a7b8e41f_28a039227b300938a1@gitlab.mail> josephf pushed new branch wip/type-sharing at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/type-sharing You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 15:05:43 2024 From: gitlab at gitlab.haskell.org (John Ericson (@Ericson2314)) Date: Tue, 02 Jul 2024 11:05:43 -0400 Subject: [Git][ghc/ghc][wip/romes/ttg-zurich] 65 commits: ttg: Use List instead of Bag in AST for LHsBindsLR Message-ID: <6684174792710_28a0392ab08681425ab@gitlab.mail> John Ericson pushed to branch wip/romes/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 576d4dbc by Adriaan Leijnse at 2024-07-02T11:01:24-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - adf0deed by Alexander Foremny at 2024-07-02T11:01:25-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - e8934f35 by Alexander Foremny at 2024-07-02T11:01:25-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - e0080fda by Fabian Kirchner at 2024-07-02T11:01:25-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - e850d55c by Fabian Kirchner at 2024-07-02T11:01:25-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 587d2eb7 by Fabian Kirchner at 2024-07-02T11:04:00-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1a49e340 by Mauricio at 2024-07-02T11:04:01-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - d04ab809 by Fabian Kirchner at 2024-07-02T11:04:01-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 4839d1d0 by Adowrath at 2024-07-02T11:05:22-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - e002f570 by Mauricio at 2024-07-02T11:05:24-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Multiplicity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/20d321fcd690c035018eadc797dbbb71c6182243...e002f5708e63cc91b7e60315ae70b13b21ff358a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/20d321fcd690c035018eadc797dbbb71c6182243...e002f5708e63cc91b7e60315ae70b13b21ff358a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 15:09:03 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 02 Jul 2024 11:09:03 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 6 commits: TSAN uniq rename hard Message-ID: <6684180f4c277_28a0392c141f01510ba@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 7ca5ab30 by Rodrigo Mesquita at 2024-07-02T14:31:43+01:00 TSAN uniq rename hard - - - - - 41fb3073 by Rodrigo Mesquita at 2024-07-02T14:31:49+01:00 Revert "TSAN uniq rename hard" This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda. - - - - - 1eb0bc67 by Rodrigo Mesquita at 2024-07-02T14:32:56+01:00 improvements to uniqdsm - - - - - 6d1861ff by Rodrigo Mesquita at 2024-07-02T14:43:12+01:00 UniqDSM ProcPoint - - - - - 20a34a78 by Rodrigo Mesquita at 2024-07-02T15:25:17+01:00 CmmLayoutStack UniqDet - - - - - acfc9c8a by Rodrigo Mesquita at 2024-07-02T16:08:49+01:00 90% of cpsTop UniqDSM - - - - - 14 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Switch/Implement.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/StgToCmm/Foreign.hs - compiler/GHC/StgToCmm/Monad.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow.hs ===================================== @@ -10,7 +10,7 @@ -- -- This module is a specialised and optimised version of -- Compiler.Hoopl.Dataflow in the hoopl package. In particular it is --- specialised to the UniqSM monad. +-- specialised to the UniqDSM monad. -- module GHC.Cmm.Dataflow @@ -33,7 +33,7 @@ where import GHC.Prelude import GHC.Cmm -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import Data.Array import Data.Maybe @@ -85,14 +85,14 @@ type TransferFun' (n :: Extensibility -> Extensibility -> Type) f = -- | Function for rewriting and analysis combined. To be used with -- @rewriteCmm at . -- --- Currently set to work with @UniqSM@ monad, but we could probably abstract +-- Currently set to work with @UniqDSM@ monad, but we could probably abstract -- that away (if we do that, we might want to specialize the fixpoint algorithms -- to the particular monads through SPECIALIZE). -type RewriteFun f = CmmBlock -> FactBase f -> UniqSM (CmmBlock, FactBase f) +type RewriteFun f = CmmBlock -> FactBase f -> UniqDSM (CmmBlock, FactBase f) -- | `RewriteFun` abstracted over `n` (the node type) type RewriteFun' (n :: Extensibility -> Extensibility -> Type) f = - Block n C C -> FactBase f -> UniqSM (Block n C C, FactBase f) + Block n C C -> FactBase f -> UniqDSM (Block n C C, FactBase f) analyzeCmmBwd, analyzeCmmFwd :: (NonLocal node) @@ -167,7 +167,7 @@ rewriteCmmBwd -> RewriteFun' node f -> GenCmmGraph node -> FactBase f - -> UniqSM (GenCmmGraph node, FactBase f) + -> UniqDSM (GenCmmGraph node, FactBase f) rewriteCmmBwd = rewriteCmm Bwd rewriteCmm @@ -177,7 +177,7 @@ rewriteCmm -> RewriteFun' node f -> GenCmmGraph node -> FactBase f - -> UniqSM (GenCmmGraph node, FactBase f) + -> UniqDSM (GenCmmGraph node, FactBase f) rewriteCmm dir lattice rwFun cmmGraph initFact = {-# SCC rewriteCmm #-} do let entry = g_entry cmmGraph hooplGraph = g_graph cmmGraph @@ -197,7 +197,7 @@ fixpointRewrite -> Label -> LabelMap (Block node C C) -> FactBase f - -> UniqSM (LabelMap (Block node C C), FactBase f) + -> UniqDSM (LabelMap (Block node C C), FactBase f) fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap where -- Sorting the blocks helps to minimize the number of times we need to @@ -216,7 +216,7 @@ fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap :: IntHeap -- Worklist, i.e., blocks to process -> LabelMap (Block node C C) -- Rewritten blocks. -> FactBase f -- Current facts. - -> UniqSM (LabelMap (Block node C C), FactBase f) + -> UniqDSM (LabelMap (Block node C C), FactBase f) loop todo !blocks1 !fbase1 | Just (index, todo1) <- IntSet.minView todo = do -- Note that we use the *original* block here. This is important. @@ -422,10 +422,10 @@ foldNodesBwdOO funOO = go -- Strict in both accumulated parts. foldRewriteNodesBwdOO :: forall f node. - (node O O -> f -> UniqSM (Block node O O, f)) + (node O O -> f -> UniqDSM (Block node O O, f)) -> Block node O O -> f - -> UniqSM (Block node O O, f) + -> UniqDSM (Block node O O, f) foldRewriteNodesBwdOO rewriteOO initBlock initFacts = go initBlock initFacts where go (BCons node1 block1) !fact1 = (rewriteOO node1 `comp` go block1) fact1 ===================================== compiler/GHC/Cmm/Graph.hs ===================================== @@ -37,7 +37,7 @@ import GHC.Data.FastString import GHC.Types.ForeignCall import GHC.Data.OrdList import GHC.Runtime.Heap.Layout (ByteOff) -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import GHC.Utils.Constants (debugIsOn) import GHC.Utils.Panic @@ -169,9 +169,9 @@ outOfLine :: BlockId -> CmmAGraphScoped -> CmmAGraph outOfLine l (c,s) = unitOL (CgFork l c s) -- | allocate a fresh label for the entry point -lgraphOfAGraph :: CmmAGraphScoped -> UniqSM CmmGraph +lgraphOfAGraph :: CmmAGraphScoped -> UniqDSM CmmGraph lgraphOfAGraph g = do - u <- getUniqueM + u <- getUniqueDSM return (labelAGraph (mkBlockId u) g) -- | use the given BlockId as the label of the entry point ===================================== compiler/GHC/Cmm/Info.hs ===================================== @@ -68,7 +68,7 @@ mkEmptyContInfoTable info_lbl cmmToRawCmm :: Logger -> Profile -> Stream IO CmmGroupSRTs a -> IO (Stream IO RawCmmGroup a) cmmToRawCmm logger profile cmms - = do { detUqSupply <- newIORef 1 + = do { detUqSupply <- newIORef (initDUniqSupply 'i' 1) ; let do_one :: [CmmDeclSRTs] -> IO [RawCmmDecl] do_one cmm = do -- NB. strictness fixes a space leak. DO NOT REMOVE. @@ -80,7 +80,7 @@ cmmToRawCmm logger profile cmms -- deterministic supplies starting from the same unique in -- other parts of the Cmm backend -- See Note [Cmm Local Deterministic Uniques] (TODO) - let (a, us) = runUniqueDSM 'i' nextUq $ + let (a, us) = runUniqueDSM nextUq $ concatMapM (mkInfoTable profile) cmm writeIORef detUqSupply us return a ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -889,11 +889,7 @@ doSRTs doSRTs cfg moduleSRTInfo dus procs data_ = do - -- Use local namespace 'u' here. - -- See Note [Cmm Local Deterministic Uniques] - -- in the future, set tag before usign DUniqueSupply - let runUDSM = runUniqueDSM 'u' dus - + let runUDSM = runUniqueDSM dus let profile = cmmProfile cfg -- Ignore the original grouping of decls, and combine all the ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -8,7 +8,7 @@ import GHC.Prelude hiding ((<*>)) import GHC.Platform import GHC.Platform.Profile -import GHC.StgToCmm.Monad ( newTemp ) -- XXX layering violation +import GHC.StgToCmm.Monad ( newTempD ) -- XXX layering violation import GHC.StgToCmm.Utils ( callerSaveVolatileRegs ) -- XXX layering violation import GHC.StgToCmm.Foreign ( saveThreadState, loadThreadState ) -- XXX layering violation @@ -25,7 +25,7 @@ import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import GHC.Data.Maybe import GHC.Types.Unique.FM import GHC.Utils.Misc @@ -235,7 +235,7 @@ instance Outputable StackMap where cmmLayoutStack :: CmmConfig -> ProcPointSet -> ByteOff -> CmmGraph - -> UniqSM (CmmGraph, LabelMap StackMap) + -> UniqDSM (CmmGraph, LabelMap StackMap) cmmLayoutStack cfg procpoints entry_args graph@(CmmGraph { g_entry = entry }) = do @@ -271,7 +271,7 @@ layout :: CmmConfig -> [CmmBlock] -- [in] blocks - -> UniqSM + -> UniqDSM ( LabelMap StackMap -- [out] stack maps , ByteOff -- [out] Sp high water mark , [CmmBlock] -- [out] new blocks @@ -436,7 +436,7 @@ handleLastNode -> LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C - -> UniqSM + -> UniqDSM ( [CmmNode O O] -- nodes to go *before* the Sp adjustment , ByteOff -- amount to adjust Sp , CmmNode O C -- new last node @@ -502,7 +502,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- proc point, we have to set up the stack to match what the proc -- point is expecting. -- - handleBranches :: UniqSM ( [CmmNode O O] + handleBranches :: UniqDSM ( [CmmNode O O] , ByteOff , CmmNode O C , [CmmBlock] @@ -535,7 +535,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) -- For each successor of this block - handleBranch :: BlockId -> UniqSM (BlockId, BlockId, StackMap, [CmmBlock]) + handleBranch :: BlockId -> UniqDSM (BlockId, BlockId, StackMap, [CmmBlock]) handleBranch l -- (a) if the successor already has a stackmap, we need to -- shuffle the current stack to make it look the same. @@ -570,11 +570,11 @@ handleLastNode cfg procpoints liveness cont_info stackmaps makeFixupBlock :: CmmConfig -> ByteOff -> Label -> StackMap -> CmmTickScope -> [CmmNode O O] - -> UniqSM (Label, [CmmBlock]) + -> UniqDSM (Label, [CmmBlock]) makeFixupBlock cfg sp0 l stack tscope assigs | null assigs && sp0 == sm_sp stack = return (l, []) | otherwise = do - tmp_lbl <- newBlockId + tmp_lbl <- mkBlockId <$> getUniqueDSM {- todo: newBlockId -} let sp_off = sp0 - sm_sp stack block = blockJoin (CmmEntry tmp_lbl tscope) ( maybeAddSpAdj cfg sp0 sp_off @@ -1047,7 +1047,7 @@ insertReloadsAsNeeded -> LabelMap StackMap -> BlockId -> [CmmBlock] - -> UniqSM [CmmBlock] + -> UniqDSM [CmmBlock] insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = toBlockList . fst <$> rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) mapEmpty @@ -1133,15 +1133,15 @@ expecting them (see Note [safe foreign call convention]). Note also that safe foreign call is replace by an unsafe one in the Cmm graph. -} -lowerSafeForeignCall :: Profile -> CmmBlock -> UniqSM CmmBlock +lowerSafeForeignCall :: Profile -> CmmBlock -> UniqDSM CmmBlock lowerSafeForeignCall profile block | (entry@(CmmEntry _ tscp), middle, CmmForeignCall { .. }) <- blockSplit block = do let platform = profilePlatform profile -- Both 'id' and 'new_base' are KindNonPtr because they're -- RTS-only objects and are not subject to garbage collection - id <- newTemp (bWord platform) - new_base <- newTemp (cmmRegType $ baseReg platform) + id <- newTempD (bWord platform) + new_base <- newTempD (cmmRegType $ baseReg platform) let (caller_save, caller_load) = callerSaveVolatileRegs platform save_state_code <- saveThreadState profile load_state_code <- loadThreadState profile ===================================== compiler/GHC/Cmm/Opt.hs ===================================== @@ -22,8 +22,8 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Utils import GHC.Cmm import GHC.Cmm.Config - -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer +import GHC.Types.Unique import GHC.Utils.Misc import GHC.Utils.Panic @@ -664,7 +664,7 @@ cmmMachOpFoldOptM _ _ _ = pure Nothing intoRegister :: CmmExpr -> CmmType -> Opt CmmExpr intoRegister e@(CmmReg _) _ = pure e intoRegister expr ty = do - u <- getUniqueM + u <- getUniqueOpt let reg = LocalReg u ty CmmReg (CmmLocal reg) <$ prependNode (CmmAssign (CmmLocal reg) expr) @@ -754,7 +754,7 @@ generateDivisionBySigned platform _cfg rep n divisor = do mul2 n -- Using mul2 for sub-word sizes regresses for signed integers only | rep == wordWidth platform = do - (r1, r2, r3) <- (,,) <$> getUniqueM <*> getUniqueM <*> getUniqueM + (r1, r2, r3) <- (,,) <$> getUniqueOpt <*> getUniqueOpt <*> getUniqueOpt let rg1 = LocalReg r1 resRep resReg = LocalReg r2 resRep rg3 = LocalReg r3 resRep @@ -845,7 +845,7 @@ generateDivisionByUnsigned platform cfg rep n divisor = do -- generate the multiply with the magic number mul2 n | rep == wordWidth platform || (cmmAllowMul2 cfg && needsAdd) = do - (r1, r2) <- (,) <$> getUniqueM <*> getUniqueM + (r1, r2) <- (,) <$> getUniqueOpt <*> getUniqueOpt let rg1 = LocalReg r1 resRep resReg = LocalReg r2 resRep res <- CmmReg (CmmLocal resReg) <$ prependNode (CmmUnsafeForeignCall (PrimTarget (MO_U_Mul2 rep)) [resReg, rg1] [n, CmmLit $ CmmInt magic rep]) @@ -897,16 +897,16 @@ divisionMagicU rep doPreShift divisor = (toInteger zeros, magic, needsAdd, toInt -- ----------------------------------------------------------------------------- -- Opt monad -newtype Opt a = OptI { runOptI :: CmmConfig -> [CmmNode O O] -> UniqSM ([CmmNode O O], a) } +newtype Opt a = OptI { runOptI :: CmmConfig -> [CmmNode O O] -> UniqDSM ([CmmNode O O], a) } -- | Pattern synonym for 'Opt', as described in Note [The one-shot state -- monad trick]. -pattern Opt :: (CmmConfig -> [CmmNode O O] -> UniqSM ([CmmNode O O], a)) -> Opt a +pattern Opt :: (CmmConfig -> [CmmNode O O] -> UniqDSM ([CmmNode O O], a)) -> Opt a pattern Opt f <- OptI f where Opt f = OptI . oneShot $ \cfg -> oneShot $ \out -> f cfg out {-# COMPLETE Opt #-} -runOpt :: CmmConfig -> Opt a -> UniqSM ([CmmNode O O], a) +runOpt :: CmmConfig -> Opt a -> UniqDSM ([CmmNode O O], a) runOpt cf (Opt g) = g cf [] getConfig :: Opt CmmConfig @@ -926,10 +926,8 @@ instance Monad Opt where (ys, a) <- g cf xs runOptI (f a) cf ys -instance MonadUnique Opt where - getUniqueSupplyM = Opt $ \_ xs -> (xs,) <$> getUniqueSupplyM - getUniqueM = Opt $ \_ xs -> (xs,) <$> getUniqueM - getUniquesM = Opt $ \_ xs -> (xs,) <$> getUniquesM +getUniqueOpt :: Opt Unique +getUniqueOpt = Opt $ \_ xs -> (xs,) <$> getUniqueDSM mapForeignTargetOpt :: (CmmExpr -> Opt CmmExpr) -> ForeignTarget -> Opt ForeignTarget mapForeignTargetOpt exp (ForeignTarget e c) = flip ForeignTarget c <$> exp e ===================================== compiler/GHC/Cmm/Pipeline.hs ===================================== @@ -25,12 +25,13 @@ import GHC.Types.Unique.Supply import GHC.Utils.Error import GHC.Utils.Logger import GHC.Utils.Outputable -import GHC.Utils.Misc ( partitionWithM ) +import GHC.Utils.Misc ( partitionWith ) import GHC.Platform import Control.Monad import GHC.Cmm.UniqueRenamer +import GHC.Utils.Monad (mapAccumLM) ----------------------------------------------------------------------------- -- | Top level driver for C-- pipeline @@ -47,12 +48,13 @@ cmmPipeline -> CmmGroup -- Input C-- with Procedures -> IO (ModuleSRTInfo, DUniqSupply, CmmGroupSRTs) -- Output CPS transformed C-- -cmmPipeline logger cmm_config srtInfo dus prog = do +cmmPipeline logger cmm_config srtInfo dus0 prog = do let forceRes (info, us, group) = info `seq` us `seq` foldr seq () group let platform = cmmPlatform cmm_config withTimingSilent logger (text "Cmm pipeline") forceRes $ do - (procs, data_) <- {-# SCC "tops" #-} partitionWithM (cpsTop logger platform cmm_config {-TODO: dus argument too -}) prog - (srtInfo, dus, cmms) <- {-# SCC "doSRTs" #-} doSRTs cmm_config srtInfo dus procs data_ + (dus1, prog') <- {-# SCC "tops" #-} mapAccumLM (cpsTop logger platform cmm_config) dus0 prog + let (procs, data_) = partitionWith id prog' + (srtInfo, dus, cmms) <- {-# SCC "doSRTs" #-} doSRTs cmm_config srtInfo dus1 procs data_ dumpWith logger Opt_D_dump_cmm_cps "Post CPS Cmm" FormatCMM (pdoc platform cmms) return (srtInfo, dus, cmms) @@ -65,12 +67,12 @@ cmmPipeline logger cmm_config srtInfo dus prog = do -- [SRTs]. -- -- - in the case of a `CmmData`, the unmodified 'CmmDecl' and a 'CAFSet' containing -cpsTop :: Logger -> Platform -> CmmConfig -> CmmDecl -> IO (Either (CAFEnv, [CmmDecl]) (CAFSet, CmmDataDecl)) -cpsTop logger platform _ (CmmData section statics) = do +cpsTop :: Logger -> Platform -> CmmConfig -> DUniqSupply -> CmmDecl -> IO (DUniqSupply, Either (CAFEnv, [CmmDecl]) (CAFSet, CmmDataDecl)) +cpsTop logger platform _ dus (CmmData section statics) = do dumpWith logger Opt_D_dump_cmm_verbose "Pre CPS Data" FormatCMM (pdoc platform (CmmData section statics :: CmmDataDecl)) dumpWith logger Opt_D_dump_cmm_verbose "Post CPS Data" FormatCMM (pdoc platform (cafAnalData platform statics)) - return (Right (cafAnalData platform statics, CmmData section statics)) -cpsTop logger platform cfg proc = + return (dus, Right (cafAnalData platform statics, CmmData section statics)) +cpsTop logger platform cfg dus proc = do ----------- Control-flow optimisations ---------------------------------- @@ -94,16 +96,21 @@ cpsTop logger platform cfg proc = -- elimCommonBlocks ----------- Implement switches ------------------------------------------ - g <- if cmmDoCmmSwitchPlans cfg + (g, dus) <- if cmmDoCmmSwitchPlans cfg then {-# SCC "createSwitchPlans" #-} - runUniqSM $ cmmImplementSwitchPlans platform g - else pure g + pure $ runUniqueDSM dus $ cmmImplementSwitchPlans platform g + else pure (g, dus) dump Opt_D_dump_cmm_switch "Post switch plan" g ----------- ThreadSanitizer instrumentation ----------------------------- g <- {-# SCC "annotateTSAN" #-} if cmmOptThreadSanitizer cfg - then runUniqSM $ annotateTSAN platform g + then do + -- romes: hard to support deterministic here without changing too + -- much in graph, maybe we can skip it. + us <- mkSplitUniqSupply 'u' + return $ initUs_ us $ + annotateTSAN platform g else return g dump Opt_D_dump_cmm_thread_sanitizer "ThreadSanitizer instrumentation" g @@ -111,30 +118,30 @@ cpsTop logger platform cfg proc = let call_pps :: ProcPointSet -- LabelMap call_pps = {-# SCC "callProcPoints" #-} callProcPoints g - proc_points <- + (proc_points, dus) <- if splitting_proc_points then do - pp <- {-# SCC "minimalProcPointSet" #-} runUniqSM $ - minimalProcPointSet platform call_pps g + let (pp, dus) = {-# SCC "minimalProcPointSet" #-} runUniqueDSM dus $ + minimalProcPointSet platform call_pps g dumpWith logger Opt_D_dump_cmm_proc "Proc points" FormatCMM (pdoc platform l $$ ppr pp $$ pdoc platform g) - return pp + return (pp, dus) else - return call_pps + return (call_pps, dus) ----------- Layout the stack and manifest Sp ---------------------------- - (g, stackmaps) <- - {-# SCC "layoutStack" #-} - if do_layout - then runUniqSM $ cmmLayoutStack cfg proc_points entry_off g - else return (g, mapEmpty) + ((g, stackmaps), dus) <- pure $ + {-# SCC "layoutStack" #-} + if do_layout + then runUniqueDSM dus $ cmmLayoutStack cfg proc_points entry_off g + else ((g, mapEmpty), dus) dump Opt_D_dump_cmm_sp "Layout Stack" g ----------- Sink and inline assignments -------------------------------- - g <- {-# SCC "sink" #-} -- See Note [Sinking after stack layout] + (g, dus) <- {-# SCC "sink" #-} -- See Note [Sinking after stack layout] if cmmOptSink cfg - then runUniqSM $ cmmSink cfg g - else return g + then pure $ runUniqueDSM dus $ cmmSink cfg g + else return (g, dus) dump Opt_D_dump_cmm_sink "Sink assignments" g @@ -142,21 +149,21 @@ cpsTop logger platform cfg proc = let cafEnv = {-# SCC "cafAnal" #-} cafAnal platform call_pps l g dumpWith logger Opt_D_dump_cmm_caf "CAFEnv" FormatText (pdoc platform cafEnv) - g <- if splitting_proc_points + (g, dus) <- if splitting_proc_points then do ------------- Split into separate procedures ----------------------- let pp_map = {-# SCC "procPointAnalysis" #-} procPointAnalysis proc_points g dumpWith logger Opt_D_dump_cmm_procmap "procpoint map" FormatCMM (ppr pp_map) - g <- {-# SCC "splitAtProcPoints" #-} runUniqSM $ + (g, dus) <- {-# SCC "splitAtProcPoints" #-} pure $ runUniqueDSM dus $ splitAtProcPoints platform l call_pps proc_points pp_map (CmmProc h l v g) dumps Opt_D_dump_cmm_split "Post splitting" g - return g + return (g, dus) else -- attach info tables to return points - return $ [attachContInfoTables call_pps (CmmProc h l v g)] + return ([attachContInfoTables call_pps (CmmProc h l v g)], dus) ------------- Populate info tables with stack info ----------------- g <- {-# SCC "setInfoTableStackMap" #-} @@ -172,7 +179,7 @@ cpsTop logger platform cfg proc = -- See Note [unreachable blocks] dumps Opt_D_dump_cmm_cfg "Post control-flow optimisations (2)" g - return (Left (cafEnv, g)) + return (dus, Left (cafEnv, g)) where dump = dumpGraph logger platform (cmmDoLinting cfg) @@ -356,12 +363,6 @@ generator later. -} --- ROMESTODO: MAKE THIS DETERMINISTIC!!!!!! -runUniqSM :: UniqSM a -> IO a -runUniqSM m = do - us <- mkSplitUniqSupply 'u' - return (initUs_ us m) - dumpGraph :: Logger -> Platform -> Bool -> DumpFlag -> String -> CmmGraph -> IO () dumpGraph logger platform do_linting flag name g = do when do_linting $ do_lint g ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -24,7 +24,7 @@ import Control.Monad import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph @@ -185,14 +185,14 @@ callProcPoints g = foldlGraphBlocks add (setSingleton (g_entry g)) g _ -> set minimalProcPointSet :: Platform -> ProcPointSet -> CmmGraph - -> UniqSM ProcPointSet + -> UniqDSM ProcPointSet -- Given the set of successors of calls (which must be proc-points) -- figure out the minimal set of necessary proc-points minimalProcPointSet platform callProcPoints g = extendPPSet platform g (revPostorder g) callProcPoints extendPPSet - :: Platform -> CmmGraph -> [CmmBlock] -> ProcPointSet -> UniqSM ProcPointSet + :: Platform -> CmmGraph -> [CmmBlock] -> ProcPointSet -> UniqDSM ProcPointSet extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block @@ -236,7 +236,7 @@ extendPPSet platform g blocks procPoints = -- ToDo: use the _ret naming convention that the old code generator -- used. -- EZY splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> LabelMap Status -> CmmDecl - -> UniqSM [CmmDecl] + -> UniqDSM [CmmDecl] splitAtProcPoints _ _ _ _ _ t@(CmmData _ _) = return [t] splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do -- Build a map from procpoints to the blocks they reach @@ -286,9 +286,9 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do -- and replace branches to procpoints with branches to the jump-off blocks let add_jump_block :: (LabelMap Label, [CmmBlock]) -> (Label, CLabel) - -> UniqSM (LabelMap Label, [CmmBlock]) + -> UniqDSM (LabelMap Label, [CmmBlock]) add_jump_block (env, bs) (pp, l) = do - bid <- liftM mkBlockId getUniqueM + bid <- liftM mkBlockId getUniqueDSM let b = blockJoin (CmmEntry bid GlobalScope) emptyBlock jump live = ppLiveness pp jump = CmmCall (CmmLit (CmmLabel l)) Nothing live 0 0 0 @@ -317,7 +317,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do CmmSwitch _ ids -> foldr add_if_pp rst $ switchTargetsToList ids _ -> rst - let add_jumps :: LabelMap CmmGraph -> (Label, LabelMap CmmBlock) -> UniqSM (LabelMap CmmGraph) + let add_jumps :: LabelMap CmmGraph -> (Label, LabelMap CmmBlock) -> UniqDSM (LabelMap CmmGraph) add_jumps newGraphEnv (ppId, blockEnv) = do -- find which procpoints we currently branch to let needed_jumps = mapFoldr add_if_branch_to_pp [] blockEnv ===================================== compiler/GHC/Cmm/Sink.hs ===================================== @@ -20,7 +20,7 @@ import GHC.Platform.Regs import GHC.Platform import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import GHC.Cmm.Config import Data.List (partition) @@ -152,7 +152,7 @@ type Assignments = [Assignment] -- y = e2 -- x = e1 -cmmSink :: CmmConfig -> CmmGraph -> UniqSM CmmGraph +cmmSink :: CmmConfig -> CmmGraph -> UniqDSM CmmGraph cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink mapEmpty blocks where platform = cmmPlatform cfg @@ -163,7 +163,7 @@ cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink mapEmpty blocks join_pts = findJoinPoints blocks - sink :: LabelMap Assignments -> [CmmBlock] -> UniqSM [CmmBlock] + sink :: LabelMap Assignments -> [CmmBlock] -> UniqDSM [CmmBlock] sink _ [] = pure [] sink sunk (b:bs) = do -- Now sink and inline in this block @@ -312,7 +312,7 @@ walk :: CmmConfig -- Earlier assignments may refer -- to later ones. - -> UniqSM ( Block CmmNode O O -- The new block + -> UniqDSM ( Block CmmNode O O -- The new block , Assignments -- Assignments to sink further ) @@ -598,7 +598,7 @@ improveConditional other = other -- Now we can go ahead and inline x. -- -- For now we do nothing, because this would require putting --- everything inside UniqSM. +-- everything inside UniqDSM. -- -- One more variant of this (#7366): -- ===================================== compiler/GHC/Cmm/Switch/Implement.hs ===================================== @@ -12,8 +12,8 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.Switch -import GHC.Types.Unique.Supply import GHC.Utils.Monad (concatMapM) +import GHC.Cmm.UniqueRenamer -- -- This module replaces Switch statements as generated by the Stg -> Cmm @@ -31,14 +31,14 @@ import GHC.Utils.Monad (concatMapM) -- | Traverses the 'CmmGraph', making sure that 'CmmSwitch' are suitable for -- code generation. -cmmImplementSwitchPlans :: Platform -> CmmGraph -> UniqSM CmmGraph +cmmImplementSwitchPlans :: Platform -> CmmGraph -> UniqDSM CmmGraph cmmImplementSwitchPlans platform g = -- Switch generation done by backend (LLVM/C) do blocks' <- concatMapM (visitSwitches platform) (toBlockList g) return $ ofBlockList (g_entry g) blocks' -visitSwitches :: Platform -> CmmBlock -> UniqSM [CmmBlock] +visitSwitches :: Platform -> CmmBlock -> UniqDSM [CmmBlock] visitSwitches platform block | (entry@(CmmEntry _ scope), middle, CmmSwitch vanillaExpr ids) <- blockSplit block = do @@ -69,15 +69,15 @@ visitSwitches platform block -- This happened in parts of the handwritten RTS Cmm code. See also #16933 -- See Note [Floating switch expressions] -floatSwitchExpr :: Platform -> CmmExpr -> UniqSM (Block CmmNode O O, CmmExpr) +floatSwitchExpr :: Platform -> CmmExpr -> UniqDSM (Block CmmNode O O, CmmExpr) floatSwitchExpr _ reg@(CmmReg {}) = return (emptyBlock, reg) floatSwitchExpr platform expr = do - (assign, expr') <- cmmMkAssign platform expr <$> getUniqueM + (assign, expr') <- cmmMkAssign platform expr <$> getUniqueDSM return (BMiddle assign, expr') -- Implementing a switch plan (returning a tail block) -implementSwitchPlan :: Platform -> CmmTickScope -> CmmExpr -> SwitchPlan -> UniqSM (Block CmmNode O C, [CmmBlock]) +implementSwitchPlan :: Platform -> CmmTickScope -> CmmExpr -> SwitchPlan -> UniqDSM (Block CmmNode O C, [CmmBlock]) implementSwitchPlan platform scope expr = go where width = typeWidth $ cmmExprType platform expr @@ -111,7 +111,7 @@ implementSwitchPlan platform scope expr = go = return (l, []) go' p = do - bid <- mkBlockId `fmap` getUniqueM + bid <- mkBlockId `fmap` getUniqueDSM (last, newBlocks) <- go p let block = CmmEntry bid scope `blockJoinHead` last return (bid, block: newBlocks) ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -1,16 +1,19 @@ -{-# LANGUAGE LambdaCase, MagicHash, UnboxedTuples, PatternSynonyms, ExplicitNamespaces, TypeFamilies #-} +{-# LANGUAGE LambdaCase, RecordWildCards, MagicHash, UnboxedTuples, PatternSynonyms, ExplicitNamespaces #-} module GHC.Cmm.UniqueRenamer ( detRenameUniques , UniqDSM, runUniqueDSM - , DUniqSupply, getUniqueDSM + , DUniqSupply, getUniqueDSM, takeUniqueFromDSupply, initDUniqSupply, newTagDUniqSupply + , MonadGetUnique(..) -- Careful! Not for general use! - , DetUniqFM, emptyDetUFM) + , DetUniqFM, emptyDetUFM + ) where import Data.Bits import Prelude import Control.Monad.Trans.State +import Control.Monad.Fix import GHC.Word import GHC.Cmm import GHC.Cmm.CLabel @@ -24,6 +27,7 @@ import GHC.Types.Unique.FM import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) import GHC.Types.Id +import qualified GHC.Types.Unique.Supply as USM {- -------------------------------------------------------------------------------- @@ -70,7 +74,7 @@ renameDetUniq uq = do Nothing -> do new_w <- gets supply -- New deterministic unique in this `DetRnM` let (tag, _) = unpkUnique uq - det_uniq = mkUnique tag new_w + det_uniq = mkUnique 'Q' new_w modify' (\DetUniqFM{mapping, supply} -> -- Update supply and mapping DetUniqFM @@ -284,7 +288,7 @@ panicMapKeysNotInjective _ _ = error "this should be impossible because the func -- there, but without the unboxing it feels? Maybe not, since we carry the -- mappings too. -type DUniqSupply = Word64 -- supply uniques iteratively +newtype DUniqSupply = DUS Word64 -- supply uniques iteratively type DUniqResult result = (# result, DUniqSupply #) pattern DUniqResult :: a -> b -> (# a, b #) @@ -293,35 +297,58 @@ pattern DUniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's deterministically. -- There's no splitting. -newtype UniqDSM result = UDSM { unUDSM :: Word64 {- tag -} -> DUniqSupply -> DUniqResult result } +newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } deriving Functor instance Monad UniqDSM where - (>>=) (UDSM f) cont = UDSM $ \tag us0 -> case f tag us0 of - DUniqResult result us1 -> unUDSM (cont result) tag us1 + (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of + DUniqResult result us1 -> unUDSM (cont result) us1 (>>) = (*>) {-# INLINE (>>=) #-} {-# INLINE (>>) #-} instance Applicative UniqDSM where - pure result = UDSM (\_tag us -> DUniqResult result us) - (UDSM f) <*> (UDSM x) = UDSM $ \tag us0 -> case f tag us0 of - DUniqResult ff us1 -> case x tag us1 of + pure result = UDSM (DUniqResult result) + (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of + DUniqResult ff us1 -> case x us1 of DUniqResult xx us2 -> DUniqResult (ff xx) us2 - (*>) (UDSM expr) (UDSM cont) = UDSM $ \tag us0 -> case expr tag us0 of - DUniqResult _ us1 -> cont tag us1 + (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of + DUniqResult _ us1 -> cont us1 {-# INLINE pure #-} {-# INLINE (*>) #-} +instance MonadFix UniqDSM where + mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) + getUniqueDSM :: UniqDSM Unique -getUniqueDSM = UDSM (\tag us0 -> DUniqResult (mkUniqueGrimily $ tag .|. us0) (us0+1)) - -runUniqueDSM :: Char {- tag -} -> DUniqSupply {- first unique -} - -> UniqDSM a -> (a, DUniqSupply) -runUniqueDSM c firstUniq (UDSM f) = - let !tag = mkTag c - in case f tag firstUniq of - DUniqResult uq us -> (uq, us) +getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) + +takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) +takeUniqueFromDSupply d = + case unUDSM getUniqueDSM d of + DUniqResult x y -> (x, y) + +initDUniqSupply :: Char -> Word64 -> DUniqSupply +initDUniqSupply c firstUniq = + let !tag = mkTag 'Q' {- TODO: c -} + in DUS (tag .|. firstUniq) + +newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply +newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c + +runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) +runUniqueDSM ds (UDSM f) = + case f ds of + DUniqResult uq us -> (uq, us) + +class Monad m => MonadGetUnique m where + getUniqueM :: m Unique + +instance MonadGetUnique UniqDSM where + getUniqueM = getUniqueDSM + +instance MonadGetUnique USM.UniqSM where + getUniqueM = USM.getUniqueM {- Note [Cmm Local Deterministic Uniques] ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -2098,7 +2098,7 @@ hscCompileCmmFile hsc_env original_filename filename output_filename = runHsc hs cmmgroup <- concat . snd <$> mapAccumLM (\(msrt0, dus0) cmm -> do (msrt1, dus1, cmm') <- cmmPipeline logger cmm_config msrt0 dus0 [cmm] - return ((msrt1, dus1), cmm')) (emptySRT cmm_mod, 1) cmm + return ((msrt1, dus1), cmm')) (emptySRT cmm_mod, initDUniqSupply 'u' 1) cmm unless (null cmmgroup) $ putDumpFileMaybe logger Opt_D_dump_cmm "Output Cmm" @@ -2198,7 +2198,7 @@ doCodeGen hsc_env this_mod denv data_tycons pipeline_stream = do ((mod_srt_info, ipes, ipe_stats, dus), lf_infos) <- {-# SCC "cmmPipeline" #-} - Stream.mapAccumL_ (pipeline_action logger cmm_config) (emptySRT this_mod, M.empty, mempty, 1) ppr_stream1 + Stream.mapAccumL_ (pipeline_action logger cmm_config) (emptySRT this_mod, M.empty, mempty, initDUniqSupply 'u' 1) ppr_stream1 let nonCaffySet = srtMapNonCAFs (moduleSRTMap mod_srt_info) cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus) return cmmCgInfos ===================================== compiler/GHC/StgToCmm/Foreign.hs ===================================== @@ -48,7 +48,7 @@ import GHC.Runtime.Heap.Layout import GHC.Types.ForeignCall import GHC.Data.Maybe import GHC.Utils.Panic -import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer import GHC.Types.Basic import GHC.Unit.Types @@ -354,7 +354,7 @@ emitSaveThreadState = do emit code -- | Produce code to save the current thread state to @CurrentTSO@ -saveThreadState :: MonadUnique m => Profile -> m CmmAGraph +saveThreadState :: MonadGetUnique m => Profile -> m CmmAGraph saveThreadState profile = do let platform = profilePlatform profile tso <- newTemp (gcWord platform) @@ -493,7 +493,7 @@ Closing the nursery corresponds to the following code: cn->free = Hp + WDS(1); @ -} -closeNursery :: MonadUnique m => Profile -> LocalReg -> m CmmAGraph +closeNursery :: MonadGetUnique m => Profile -> LocalReg -> m CmmAGraph closeNursery profile tso = do let tsoreg = CmmLocal tso platform = profilePlatform profile @@ -526,7 +526,7 @@ emitLoadThreadState = do emit code -- | Produce code to load the current thread state from @CurrentTSO@ -loadThreadState :: MonadUnique m => Profile -> m CmmAGraph +loadThreadState :: MonadGetUnique m => Profile -> m CmmAGraph loadThreadState profile = do let platform = profilePlatform profile tso <- newTemp (gcWord platform) @@ -591,7 +591,7 @@ Opening the nursery corresponds to the following code: HpLim = bdstart + CurrentNursery->blocks*BLOCK_SIZE_W - 1; @ -} -openNursery :: MonadUnique m => Profile -> LocalReg -> m CmmAGraph +openNursery :: MonadGetUnique m => Profile -> LocalReg -> m CmmAGraph openNursery profile tso = do let tsoreg = CmmLocal tso platform = profilePlatform profile ===================================== compiler/GHC/StgToCmm/Monad.hs ===================================== @@ -24,7 +24,7 @@ module GHC.StgToCmm.Monad ( emitOutOfLine, emitAssign, emitStore, emitStore', emitComment, emitTick, emitUnwind, - newTemp, + newTemp, newTempD, getCmm, aGraphToGraph, getPlatform, getProfile, getCodeR, getCode, getCodeScoped, getHeapUsage, @@ -85,6 +85,8 @@ import GHC.Data.OrdList import GHC.Types.Basic( ConTagZ ) import GHC.Types.Unique import GHC.Types.Unique.Supply +import GHC.Cmm.UniqueRenamer ( UniqDSM, getUniqueDSM, MonadGetUnique ) +import qualified GHC.Cmm.UniqueRenamer as UR import GHC.Data.FastString import GHC.Utils.Outputable import GHC.Utils.Panic @@ -170,6 +172,9 @@ instance MonadUnique FCode where let (u, us') = takeUniqFromSupply (cgs_uniqs st) in (u, st { cgs_uniqs = us' }) +instance MonadGetUnique FCode where + getUniqueM = GHC.Types.Unique.Supply.getUniqueM + initC :: IO CgState initC = do { uniqs <- mkSplitUniqSupply 'c' ; return (initCgState uniqs) } @@ -450,10 +455,14 @@ newUnique = do setState $ state { cgs_uniqs = us' } return u -newTemp :: MonadUnique m => CmmType -> m LocalReg -newTemp rep = do { uniq <- getUniqueM +newTemp :: MonadGetUnique m => CmmType -> m LocalReg +newTemp rep = do { uniq <- UR.getUniqueM ; return (LocalReg uniq rep) } +newTempD :: CmmType -> UniqDSM LocalReg +newTempD rep = do { uniq <- getUniqueDSM + ; return (LocalReg uniq rep) } + ------------------ initFCodeState :: Platform -> FCodeState initFCodeState p = View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7cf90ba5694710b27b102837aa5ed2e0a6bd5640...acfc9c8a5faccd828c2aa06888856d9a4237009b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7cf90ba5694710b27b102837aa5ed2e0a6bd5640...acfc9c8a5faccd828c2aa06888856d9a4237009b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 15:40:19 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 02 Jul 2024 11:40:19 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Fix bug caused by ignoring namespace w det uniqus Message-ID: <66841f63acba9_28a03930ec7901586c2@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: fde0cc55 by Rodrigo Mesquita at 2024-07-02T16:40:04+01:00 Fix bug caused by ignoring namespace w det uniqus - - - - - 1 changed file: - compiler/GHC/Cmm/UniqueRenamer.hs Changes: ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -328,9 +328,19 @@ takeUniqueFromDSupply d = case unUDSM getUniqueDSM d of DUniqResult x y -> (x, y) +-- Write Note about the importance of locality in uniques that are deterministic +-- +-- If you use a tag which collides with other names, you'll get a uniques +-- deterministically colliding with existing symbols. +-- +-- (e.g. easy to observe if you do this wrong) +-- +-- Ideally, we'd thread the same deterministic unique supply all the way +-- throughout the Cmm pipeline, starting off from hte deterministic rename +-- pass. initDUniqSupply :: Char -> Word64 -> DUniqSupply initDUniqSupply c firstUniq = - let !tag = mkTag 'Q' {- TODO: c -} + let !tag = mkTag c in DUS (tag .|. firstUniq) newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fde0cc552c5ec71578fec940986fbd11802d8666 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fde0cc552c5ec71578fec940986fbd11802d8666 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 16:00:31 2024 From: gitlab at gitlab.haskell.org (Bryan R (@chreekat)) Date: Tue, 02 Jul 2024 12:00:31 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/b/ci-var-readme Message-ID: <6684241f988ae_28a0393460f0c1610f4@gitlab.mail> Bryan R pushed new branch wip/b/ci-var-readme at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/b/ci-var-readme You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 2 17:58:56 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 02 Jul 2024 13:58:56 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66843fe0b45f1_3bf2831ae6406492c@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 9da3948a by Zubin Duggal at 2024-07-02T13:58:24-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - aa3236e3 by Oleg Grenrus at 2024-07-02T13:58:26-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - febb2766 by Adam Gundry at 2024-07-02T13:58:28-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 7c5be613 by Max Ulidtko at 2024-07-02T13:58:29-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 906bf796 by Mike Pilgrem at 2024-07-02T13:58:36-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 19b24877 by Matthew Pickering at 2024-07-02T13:58:36-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - 29 changed files: - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Finder/Types.hs - compiler/GHC/Utils/TmpFs.hs - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/ffi.rst - docs/users_guide/using-warnings.rst - ghc/GHCi/UI.hs - libraries/ghc-experimental/ghc-experimental.cabal - + libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs - + libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs - + testsuite/tests/ghci/should_run/T10920.hs - + testsuite/tests/ghci/should_run/T10920.script - + testsuite/tests/ghci/should_run/T10920.stderr - + testsuite/tests/ghci/should_run/T10920.stdout - testsuite/tests/ghci/should_run/all.T - testsuite/tests/interface-stability/ghc-experimental-exports.stdout - + testsuite/tests/numeric/should_run/T24245.hs - + testsuite/tests/numeric/should_run/T24245.stdout - testsuite/tests/numeric/should_run/all.T - testsuite/tests/overloadedrecflds/should_fail/DRFPartialFields.stderr - testsuite/tests/typecheck/should_compile/T7169.stderr Changes: ===================================== .gitlab/darwin/nix/sources.json ===================================== @@ -12,15 +12,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "nixos-unstable", + "branch": "nixpkgs-24.05-darwin", "description": "Nix Packages collection", "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", - "sha256": "1anwxmjpm21msnnlrjdz19w31bxnbpn4kgf93sn3npihi7wf4a8h", + "rev": "66f253e5b2d6b03a67dfbf68a3b3be99db5f517f", + "sha256": "08zz89dhqbf3h87kixwrs2f1813lbkn7ckm3ijndhn1rzq412a70", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/66f253e5b2d6b03a67dfbf68a3b3be99db5f517f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } ===================================== compiler/GHC.hs ===================================== @@ -365,6 +365,7 @@ import GHC.Parser.Lexer import GHC.Parser.Annotation import GHC.Parser.Utils +import GHC.Iface.Env ( trace_if ) import GHC.Iface.Load ( loadSysInterface ) import GHC.Hs import GHC.Builtin.Types.Prim ( alphaTyVars ) @@ -1713,6 +1714,7 @@ findModule mod_name maybe_pkg = do findQualifiedModule :: GhcMonad m => PkgQual -> ModuleName -> m Module findQualifiedModule pkgqual mod_name = withSession $ \hsc_env -> do + liftIO $ trace_if (hsc_logger hsc_env) (text "findQualifiedModule" <+> ppr mod_name <+> ppr pkgqual) let mhome_unit = hsc_home_unit_maybe hsc_env let dflags = hsc_dflags hsc_env case pkgqual of @@ -1775,7 +1777,8 @@ lookupQualifiedModule NoPkgQual mod_name = withSession $ \hsc_env -> do lookupQualifiedModule pkgqual mod_name = findQualifiedModule pkgqual mod_name lookupLoadedHomeModule :: GhcMonad m => UnitId -> ModuleName -> m (Maybe Module) -lookupLoadedHomeModule uid mod_name = withSession $ \hsc_env -> +lookupLoadedHomeModule uid mod_name = withSession $ \hsc_env -> do + liftIO $ trace_if (hsc_logger hsc_env) (text "lookupLoadedHomeModule" <+> ppr mod_name <+> ppr uid) case lookupHug (hsc_HUG hsc_env) uid mod_name of Just mod_info -> return (Just (mi_module (hm_iface mod_info))) _not_a_home_module -> return Nothing ===================================== compiler/GHC/Iface/Env.hs ===================================== @@ -269,9 +269,9 @@ newIfaceNames occs | (occ,uniq) <- occs `zip` uniqs] } trace_if :: Logger -> SDoc -> IO () -{-# INLINE trace_if #-} +{-# INLINE trace_if #-} -- see Note [INLINE conditional tracing utilities] trace_if logger doc = when (logHasDumpFlag logger Opt_D_dump_if_trace) $ putMsg logger doc trace_hi_diffs :: Logger -> SDoc -> IO () -{-# INLINE trace_hi_diffs #-} +{-# INLINE trace_hi_diffs #-} -- see Note [INLINE conditional tracing utilities] trace_hi_diffs logger doc = when (logHasDumpFlag logger Opt_D_dump_hi_diffs) $ putMsg logger doc ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -444,9 +444,6 @@ loadInterface doc_str mod from ; case lookupIfaceByModule hug (eps_PIT eps) mod of { Just iface -> return (Succeeded iface) ; -- Already loaded - -- The (src_imp == mi_boot iface) test checks that the already-loaded - -- interface isn't a boot iface. This can conceivably happen, - -- if an earlier import had a before we got to real imports. I think. _ -> do { -- READ THE MODULE IN ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -1501,8 +1501,9 @@ instance Diagnostic TcRnMessage where text "You may define an abstract closed type family" $$ text "only in a .hs-boot file" TcRnPartialFieldSelector fld -> mkSimpleDecorated $ - sep [text "Use of partial record field selector" <> colon, - nest 2 $ quotes (ppr (occName fld))] + vcat [ sep [ text "Definition of partial record field" <> colon + , nest 2 $ quotes (ppr (occName fld)) ] + , text "Record selection and update using this field will be partial." ] TcRnHasFieldResolvedIncomplete name -> mkSimpleDecorated $ text "The invocation of `getField` on the record field" <+> quotes (ppr name) <+> text "may produce an error since it is not defined for all data constructors" ===================================== compiler/GHC/Tc/Errors/Types.hs ===================================== @@ -3503,7 +3503,7 @@ data TcRnMessage where -} TcRnAbstractClosedTyFamDecl :: TcRnMessage - {-| TcRnPartialFieldSelector is a warning indicating that a record selector + {-| TcRnPartialFieldSelector is a warning indicating that a record field was not defined for all constructors of a data type. Test cases: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -5,15 +5,15 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE RecordWildCards #-} -- | Module finder module GHC.Unit.Finder ( FindResult(..), InstalledFindResult(..), FinderOpts(..), - FinderCache, + FinderCache(..), initFinderCache, - flushFinderCaches, findImportedModule, findPluginModule, findExactModule, @@ -26,14 +26,10 @@ module GHC.Unit.Finder ( mkObjPath, addModuleToFinder, addHomeModuleToFinder, - uncacheModule, mkStubPaths, findObjectLinkableMaybe, findObjectLinkable, - - -- Hash cache - lookupFileCache ) where import GHC.Prelude @@ -91,41 +87,35 @@ type BaseName = OsPath -- Basename of file initFinderCache :: IO FinderCache -initFinderCache = FinderCache <$> newIORef emptyInstalledModuleEnv - <*> newIORef M.empty - --- remove all the home modules from the cache; package modules are --- assumed to not move around during a session; also flush the file hash --- cache -flushFinderCaches :: FinderCache -> UnitEnv -> IO () -flushFinderCaches (FinderCache ref file_ref) ue = do - atomicModifyIORef' ref $ \fm -> (filterInstalledModuleEnv is_ext fm, ()) - atomicModifyIORef' file_ref $ \_ -> (M.empty, ()) - where - is_ext mod _ = not (isUnitEnvInstalledModule ue mod) - -addToFinderCache :: FinderCache -> InstalledModule -> InstalledFindResult -> IO () -addToFinderCache (FinderCache ref _) key val = - atomicModifyIORef' ref $ \c -> (extendInstalledModuleEnv c key val, ()) - -removeFromFinderCache :: FinderCache -> InstalledModule -> IO () -removeFromFinderCache (FinderCache ref _) key = - atomicModifyIORef' ref $ \c -> (delInstalledModuleEnv c key, ()) - -lookupFinderCache :: FinderCache -> InstalledModule -> IO (Maybe InstalledFindResult) -lookupFinderCache (FinderCache ref _) key = do - c <- readIORef ref - return $! lookupInstalledModuleEnv c key - -lookupFileCache :: FinderCache -> FilePath -> IO Fingerprint -lookupFileCache (FinderCache _ ref) key = do - c <- readIORef ref - case M.lookup key c of - Nothing -> do - hash <- getFileHash key - atomicModifyIORef' ref $ \c -> (M.insert key hash c, ()) - return hash - Just fp -> return fp +initFinderCache = do + mod_cache <- newIORef emptyInstalledModuleEnv + file_cache <- newIORef M.empty + let flushFinderCaches :: UnitEnv -> IO () + flushFinderCaches ue = do + atomicModifyIORef' mod_cache $ \fm -> (filterInstalledModuleEnv is_ext fm, ()) + atomicModifyIORef' file_cache $ \_ -> (M.empty, ()) + where + is_ext mod _ = not (isUnitEnvInstalledModule ue mod) + + addToFinderCache :: InstalledModule -> InstalledFindResult -> IO () + addToFinderCache key val = + atomicModifyIORef' mod_cache $ \c -> (extendInstalledModuleEnv c key val, ()) + + lookupFinderCache :: InstalledModule -> IO (Maybe InstalledFindResult) + lookupFinderCache key = do + c <- readIORef mod_cache + return $! lookupInstalledModuleEnv c key + + lookupFileCache :: FilePath -> IO Fingerprint + lookupFileCache key = do + c <- readIORef file_cache + case M.lookup key c of + Nothing -> do + hash <- getFileHash key + atomicModifyIORef' file_cache $ \c -> (M.insert key hash c, ()) + return hash + Just fp -> return fp + return FinderCache{..} -- ----------------------------------------------------------------------------- -- The three external entry points @@ -343,11 +333,6 @@ addHomeModuleToFinder fc home_unit mod_name loc = do addToFinderCache fc mod (InstalledFound loc mod) return (mkHomeModule home_unit mod_name) -uncacheModule :: FinderCache -> HomeUnit -> ModuleName -> IO () -uncacheModule fc home_unit mod_name = do - let mod = mkHomeInstalledModule home_unit mod_name - removeFromFinderCache fc mod - -- ----------------------------------------------------------------------------- -- The internal workers ===================================== compiler/GHC/Unit/Finder/Types.hs ===================================== @@ -1,6 +1,7 @@ module GHC.Unit.Finder.Types ( FinderCache (..) , FinderCacheState + , FileCacheState , FindResult (..) , InstalledFindResult (..) , FinderOpts(..) @@ -13,8 +14,8 @@ import GHC.Data.OsPath import qualified Data.Map as M import GHC.Fingerprint import GHC.Platform.Ways +import GHC.Unit.Env -import Data.IORef import GHC.Data.FastString import qualified Data.Set as Set @@ -25,8 +26,17 @@ import qualified Data.Set as Set -- type FinderCacheState = InstalledModuleEnv InstalledFindResult type FileCacheState = M.Map FilePath Fingerprint -data FinderCache = FinderCache { fcModuleCache :: (IORef FinderCacheState) - , fcFileCache :: (IORef FileCacheState) +data FinderCache = FinderCache { flushFinderCaches :: UnitEnv -> IO () + -- ^ remove all the home modules from the cache; package modules are + -- assumed to not move around during a session; also flush the file hash + -- cache. + , addToFinderCache :: InstalledModule -> InstalledFindResult -> IO () + -- ^ Add a found location to the cache for the module. + , lookupFinderCache :: InstalledModule -> IO (Maybe InstalledFindResult) + -- ^ Look for a location in the cache. + , lookupFileCache :: FilePath -> IO Fingerprint + -- ^ Look for the hash of a file in the cache. This should add it to the + -- cache. If the file doesn't exist, raise an IOException. } data InstalledFindResult ===================================== compiler/GHC/Utils/TmpFs.hs ===================================== @@ -377,18 +377,27 @@ the process id). This is ok, as the temporary directory used contains the pid (see getTempDir). -} + +manyWithTrace :: Logger -> String -> ([FilePath] -> IO ()) -> [FilePath] -> IO () +manyWithTrace _ _ _ [] = pure () -- do silent nothing on zero filepaths +manyWithTrace logger phase act paths + = traceCmd logger phase ("Deleting: " ++ unwords paths) (act paths) + removeTmpDirs :: Logger -> [FilePath] -> IO () -removeTmpDirs logger ds - = traceCmd logger "Deleting temp dirs" - ("Deleting: " ++ unwords ds) - (mapM_ (removeWith logger removeDirectory) ds) +removeTmpDirs logger + = manyWithTrace logger "Deleting temp dirs" + (mapM_ (removeWith logger removeDirectory)) + +removeTmpSubdirs :: Logger -> [FilePath] -> IO () +removeTmpSubdirs logger + = manyWithTrace logger "Deleting temp subdirs" + (mapM_ (removeWith logger removeDirectory)) removeTmpFiles :: Logger -> [FilePath] -> IO () removeTmpFiles logger fs = warnNon $ - traceCmd logger "Deleting temp files" - ("Deleting: " ++ unwords deletees) - (mapM_ (removeWith logger removeFile) deletees) + manyWithTrace logger "Deleting temp files" + (mapM_ (removeWith logger removeFile)) deletees where -- Flat out refuse to delete files that are likely to be source input -- files (is there a worse bug than having a compiler delete your source @@ -405,12 +414,6 @@ removeTmpFiles logger fs (non_deletees, deletees) = partition isHaskellUserSrcFilename fs -removeTmpSubdirs :: Logger -> [FilePath] -> IO () -removeTmpSubdirs logger fs - = traceCmd logger "Deleting temp subdirs" - ("Deleting: " ++ unwords fs) - (mapM_ (removeWith logger removeDirectory) fs) - removeWith :: Logger -> (FilePath -> IO ()) -> FilePath -> IO () removeWith logger remover f = remover f `Exception.catchIO` (\e -> ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -85,6 +85,9 @@ Compiler GHCi ~~~~ +- Fix a bug where GHCi would not start alongside a local file called ``Prelude.hs`` + or ``Prelude.lhs`` (:ghc-ticket:`10920`). + Runtime system ~~~~~~~~~~~~~~ ===================================== docs/users_guide/exts/ffi.rst ===================================== @@ -764,7 +764,7 @@ calls across module and package boundaries: there's no need for the header file to be available when compiling an inlined version of a foreign call, so the compiler is free to inline foreign calls in any context. -The ``-#include`` option is now deprecated, and the ``include-files`` +The ``-#include`` option is now deprecated, and the ``includes`` field in a Cabal package specification is ignored. Memory Allocation ===================================== docs/users_guide/using-warnings.rst ===================================== @@ -2154,7 +2154,7 @@ of ``-W(no-)*``. The option :ghc-flag:`-Wpartial-fields` warns about a record field ``f`` that is defined in some, but not all, of the constructors of a - data type, as such selector functions are partial. For example, when + data type, as record selection and update will be partial. For example, when :ghc-flag:`-Wpartial-fields` is enabled the compiler will emit a warning at the definition of ``Foo`` below: :: @@ -2164,8 +2164,9 @@ of ``-W(no-)*``. data Foo = Foo { _f :: Int } | Bar - Another related warning is :ghc-flag:`-Wincomplete-record-selectors`, - which warns at use sites rather than definition sites. + Related warnings are :ghc-flag:`-Wincomplete-record-selectors` and + :ghc-flag:`-Wincomplete-record-updates`, + which warn at use sites rather than definition sites. .. ghc-flag:: -Wunused-packages :shortdesc: warn when package is requested on command line, but not needed. ===================================== ghc/GHCi/UI.hs ===================================== @@ -2255,7 +2255,7 @@ keepPackageImports = filterM is_pkg_import is_pkg_import :: GHC.GhcMonad m => InteractiveImport -> m Bool is_pkg_import (IIModule _) = return False is_pkg_import (IIDecl d) - = do pkgqual <- GHC.renameRawPkgQualM (unLoc $ ideclName d) (ideclPkgQual d) + = do pkgqual <- GHC.renameRawPkgQualM mod_name (ideclPkgQual d) e <- MC.try $ GHC.findQualifiedModule pkgqual mod_name case e :: Either SomeException Module of Left _ -> return False @@ -2263,7 +2263,30 @@ keepPackageImports = filterM is_pkg_import where mod_name = unLoc (ideclName d) +{- Note [GHCi and local Preludes] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +GHC's compilation manager has no issues when the package being compiled +defines its own local Prelude module. It'll just shadow the Prelude from base. +GHCi however must check this condition, when it calls setContext ["Prelude"] +to prepopulate the interactive session's scope. This is because of two facts. + +1. setContext must use previously compiled .hi interfaces only; it cannot +recurse into compiling .hs modules (even with LinkIntoMemory), simply because +it's not the right phase to do it. Import resolution happens way before GHC +properly "loads" modules (GHC.Linker.Loader.loadModule, GHC.load & siblings); +or in other words, at time of setContext the linker isn't even initialized yet. + +2. The local Prelude.hs (or .lhs) may've never been compiled before, so its +interface file Prelude.hi can be outdated or altogether missing. + +Thankfully, there's a simple solution: just let CM load the local Prelude normally +(either as a :load target, or as a dependency of another target) later. To do that, +detect if the implicit `import Prelude` resolves to the "home unit" (i.e. not base), +and if so, omit it from the early setContext call. + +If we don't, a HomeModError will be (correctly) thrown. See #10920. +-} modulesLoadedMsg :: GHC.GhcMonad m => SuccessFlag -> [GHC.ModSummary] -> LoadType -> m () modulesLoadedMsg ok mods load_type = do @@ -2827,7 +2850,7 @@ checkAdd ii = do m <- GHC.lookupQualifiedModule pkgqual modname when safe $ do t <- GHC.isModuleTrusted m - when (not t) $ throwGhcException $ ProgramError $ "" + unless t $ throwGhcException $ ProgramError $ "" -- ----------------------------------------------------------------------------- -- Update the GHC API's view of the context @@ -2881,7 +2904,8 @@ getImplicitPreludeImports iidecls = do , not (any (sameImpModule imp) iidecls) ] else [] - return prel_iidecls + -- See Note [GHCi and local Preludes] + keepPackageImports prel_iidecls -- ----------------------------------------------------------------------------- -- Utils on InteractiveImport ===================================== libraries/ghc-experimental/ghc-experimental.cabal ===================================== @@ -23,9 +23,11 @@ common warnings library import: warnings exposed-modules: - GHC.Profiling.Eras - Data.Tuple.Experimental Data.Sum.Experimental + Data.Tuple.Experimental + GHC.Profiling.Eras + GHC.TypeLits.Experimental + GHC.TypeNats.Experimental Prelude.Experimental if arch(wasm32) exposed-modules: GHC.Wasm.Prim ===================================== libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs ===================================== @@ -0,0 +1,24 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE NoStarIsType #-} +{-# LANGUAGE TypeOperators #-} +module GHC.TypeLits.Experimental ( + appendSSymbol, + consSSymbol, + sCharToSNat, + sNatToSChar, +) where + +import GHC.Internal.TypeLits +import Data.Char (ord, chr) + +appendSSymbol :: SSymbol a -> SSymbol b -> SSymbol (AppendSymbol a b) +appendSSymbol (UnsafeSSymbol a) (UnsafeSSymbol b) = UnsafeSSymbol (a ++ b) + +consSSymbol :: SChar a -> SSymbol b -> SSymbol (ConsSymbol a b) +consSSymbol (UnsafeSChar a) (UnsafeSSymbol b) = UnsafeSSymbol (a : b) + +sCharToSNat :: SChar a -> SNat (CharToNat a) +sCharToSNat (UnsafeSChar a) = UnsafeSNat (fromIntegral (ord a)) + +sNatToSChar :: (n <= 1114111) => SNat n -> SChar (NatToChar n) +sNatToSChar (UnsafeSNat n) = UnsafeSChar (chr (fromIntegral n)) ===================================== libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs ===================================== @@ -0,0 +1,36 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE NoStarIsType #-} +{-# LANGUAGE TypeOperators #-} +module GHC.TypeNats.Experimental ( + plusSNat, + timesSNat, + powerSNat, + minusSNat, + divSNat, + modSNat, + log2SNat, +) where + +import GHC.Internal.TypeNats +import GHC.Num.Natural (naturalLog2) + +plusSNat :: SNat n -> SNat m -> SNat (n + m) +plusSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n + m) + +timesSNat :: SNat n -> SNat m -> SNat (n * m) +timesSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n * m) + +powerSNat :: SNat n -> SNat m -> SNat (n ^ m) +powerSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n ^ m) + +minusSNat :: (m <= n) => SNat n -> SNat m -> SNat (n - m) +minusSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n - m) + +divSNat :: (1 <= m) => SNat n -> SNat m -> SNat (Div n m) +divSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (div n m) + +modSNat :: (1 <= m) => SNat n -> SNat m -> SNat (Mod n m) +modSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (mod n m) + +log2SNat :: (1 <= n) => SNat n -> SNat (Log2 n) +log2SNat (UnsafeSNat n) = UnsafeSNat (fromIntegral (naturalLog2 n)) ===================================== testsuite/tests/diagnostic-codes/codes.stdout ===================================== @@ -92,7 +92,6 @@ [GHC-41843] is untested (constructor = IOResultExpected) [GHC-07641] is untested (constructor = AtLeastOneArgExpected) [GHC-64852] is untested (constructor = BadSourceImport) -[GHC-58427] is untested (constructor = HomeModError) [GHC-94559] is untested (constructor = CouldntFindInFiles) [GHC-22211] is untested (constructor = MissingPackageFiles) [GHC-88719] is untested (constructor = MissingPackageWayFiles) ===================================== testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs ===================================== @@ -0,0 +1,9 @@ +module Prelude + (storefront, module Reexport) where + +import Data.Semigroup as Reexport ((<>)) +import System.IO as Reexport (putStrLn) + +storefront = "A project-local Prelude" + +backyard = "unexported local definition -- shall be visible only after *-import" ===================================== testsuite/tests/ghci/should_run/T10920.hs ===================================== @@ -0,0 +1,5 @@ +module Main where + +-- implicitly imports a custom Prelude module under LocalPrelude/ + +main = putStrLn ("it's fine: " <> storefront) ===================================== testsuite/tests/ghci/should_run/T10920.script ===================================== @@ -0,0 +1,47 @@ +-- +-- Tests that we can don't crash with a local Prelude module present (bug #10920). +-- + +-- this is default, but the test makes zero sense with NoImplicitPrelude, it should *not* be set here +:seti -XImplicitPrelude +-- this is default too, (ab)used in the following macro +:seti -fimplicit-import-qualified +-- for a bit neater output +:def! section \title -> let echo=System.IO.putStrLn in (echo "" GHC.Base.>> echo title GHC.Base.>> GHC.Base.return "") + +:section -- should not crash with local prelude +:load T10920.hs +:main +:show imports +:show modules + +:load +:section -- unless loaded, HomeModError is expected (on stderr) +import Prelude +:show imports + +:load +:section -- but if loaded, can be imported +:load T10920 +import Prelude +:t Prelude.storefront +:show imports +:show modules + +:load +:section -- can also be star-imported +:load T10920 +:module *Prelude +:t Prelude.backyard +:show imports +:show modules + +-- also test ghci-script similar to what stack repl generates... +-- the sequence is a tad weird, but it is what it is. +:load +:section -- double-loading is fine as well +:add Prelude ./T10920.hs +:module + Prelude +:show imports +:show modules +:main ===================================== testsuite/tests/ghci/should_run/T10920.stderr ===================================== @@ -0,0 +1,3 @@ +:1:1: error: [GHC-58427] + attempting to use module ‘main:Prelude’ (./Prelude.hs) which is not loaded + ===================================== testsuite/tests/ghci/should_run/T10920.stdout ===================================== @@ -0,0 +1,28 @@ + +-- should not crash with local prelude +it's fine: A project-local Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- unless loaded, HomeModError is expected (on stderr) + +-- but if loaded, can be imported +Prelude.storefront :: GHC.Internal.Base.String +import Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- can also be star-imported +Prelude.backyard :: GHC.Internal.Base.String +:module +*Prelude +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- double-loading is fine as well +import Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) +it's fine: A project-local Prelude ===================================== testsuite/tests/ghci/should_run/all.T ===================================== @@ -94,3 +94,5 @@ test('GhciMainIs', just_ghci, compile_and_run, ['-main-is otherMain']) test('LargeBCO', [extra_files(['LargeBCO_A.hs']), req_interp, extra_hc_opts("-O -fbyte-code-and-object-code -fprefer-byte-code")], compile_and_run, ['']) test('T24115', just_ghci + [extra_run_opts("-e ':add T24115.hs'")], ghci_script, ['T24115.script']) + +test('T10920', [only_ways(ghci_ways), extra_files(['LocalPrelude/Prelude.hs'])], ghci_script, ['T10920.script']) ===================================== testsuite/tests/interface-stability/ghc-experimental-exports.stdout ===================================== @@ -4322,6 +4322,23 @@ module GHC.Profiling.Eras where incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word setUserEra :: GHC.Types.Word -> GHC.Types.IO () +module GHC.TypeLits.Experimental where + -- Safety: Safe-Inferred + appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b) + consSSymbol :: forall (a :: GHC.Types.Char) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.ConsSymbol a b) + sCharToSNat :: forall (a :: GHC.Types.Char). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeLits.CharToNat a) + sNatToSChar :: forall (n :: GHC.Num.Natural.Natural). (n GHC.Internal.Data.Type.Ord.<= 1114111) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeLits.SChar (GHC.Internal.TypeLits.NatToChar n) + +module GHC.TypeNats.Experimental where + -- Safety: None + divSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Div n m) + log2SNat :: forall (n :: GHC.Num.Natural.Natural). (1 GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Log2 n) + minusSNat :: forall (m :: GHC.Internal.TypeNats.Nat) (n :: GHC.Internal.TypeNats.Nat). (m GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.- m) + modSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Mod n m) + plusSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.+ m) + powerSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.^ m) + timesSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.* m) + module Prelude.Experimental where -- Safety: Trustworthy type CSolo :: Constraint -> Constraint ===================================== testsuite/tests/numeric/should_run/T24245.hs ===================================== @@ -0,0 +1,83 @@ +{-# LANGUAGE DataKinds #-} +module Main where + +import GHC.TypeLits +import GHC.TypeNats.Experimental +import GHC.TypeLits.Experimental + +main :: IO () +main = do + testBinary plusSNat (SNat @2) (SNat @3) SNat + testBinary timesSNat (SNat @2) (SNat @3) SNat + testBinary powerSNat (SNat @2) (SNat @3) SNat + testBinary minusSNat (SNat @7) (SNat @3) SNat + testBinary divSNat (SNat @7) (SNat @3) SNat + testBinary modSNat (SNat @7) (SNat @3) SNat + testUnary log2SNat (SNat @7) SNat + + testBinaryS appendSSymbol (SSymbol @"foo") (SSymbol @"bar") SSymbol + testBinaryCSS consSSymbol (SChar @'x') (SSymbol @"yz") SSymbol + testUnaryCN sCharToSNat (SChar @'x') SNat + testUnaryNC sNatToSChar (SNat @62) SChar + +testBinary + :: (SNat a -> SNat b -> SNat c) + -> SNat a + -> SNat b + -> SNat c + -> IO () +testBinary f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testUnary + :: (SNat a -> SNat b) + -> SNat a + -> SNat b + -> IO () +testUnary f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +testBinaryS + :: (SSymbol a -> SSymbol b -> SSymbol c) + -> SSymbol a + -> SSymbol b + -> SSymbol c + -> IO () +testBinaryS f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testBinaryCSS + :: (SChar a -> SSymbol b -> SSymbol c) + -> SChar a + -> SSymbol b + -> SSymbol c + -> IO () +testBinaryCSS f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testUnaryCN + :: (SChar a -> SNat b) + -> SChar a + -> SNat b + -> IO () +testUnaryCN f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +testUnaryNC + :: (SNat a -> SChar b) + -> SNat a + -> SChar b + -> IO () +testUnaryNC f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +assertEqualOnShow :: Show a => a -> a -> IO () +assertEqualOnShow x y + | show x == show y = return () + | otherwise = fail "inequality" ===================================== testsuite/tests/numeric/should_run/T24245.stdout ===================================== @@ -0,0 +1,11 @@ +(SNat @5,SNat @5) +(SNat @6,SNat @6) +(SNat @8,SNat @8) +(SNat @4,SNat @4) +(SNat @2,SNat @2) +(SNat @1,SNat @1) +(SNat @2,SNat @2) +(SSymbol @"foobar",SSymbol @"foobar") +(SSymbol @"xyz",SSymbol @"xyz") +(SNat @120,SNat @120) +(SChar @'>',SChar @'>') ===================================== testsuite/tests/numeric/should_run/all.T ===================================== @@ -85,3 +85,4 @@ test('T22671', js_fragile(24259), compile_and_run, ['']) test('foundation', [when(js_arch(), run_timeout_multiplier(2)), js_fragile(24259)], compile_and_run, ['-O -package transformers']) test('T24066', normal, compile_and_run, ['']) test('div01', normal, compile_and_run, ['']) +test('T24245', normal, compile_and_run, ['']) ===================================== testsuite/tests/overloadedrecflds/should_fail/DRFPartialFields.stderr ===================================== @@ -1,3 +1,4 @@ DRFPartialFields.hs:4:17: error: [GHC-82712] [-Wpartial-fields, Werror=partial-fields] - Use of partial record field selector: ‘foo’ + Definition of partial record field: ‘foo’ + Record selection and update using this field will be partial. ===================================== testsuite/tests/typecheck/should_compile/T7169.stderr ===================================== @@ -1,2 +1,3 @@ T7169.hs:11:5: warning: [GHC-82712] [-Wpartial-fields] - Use of partial record field selector: ‘m2’ + Definition of partial record field: ‘m2’ + Record selection and update using this field will be partial. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/da2bc6be12efa219720984f65c60161aafaca94f...19b24877b0407dcb5f10ac01bd69264bd0ce867a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/da2bc6be12efa219720984f65c60161aafaca94f...19b24877b0407dcb5f10ac01bd69264bd0ce867a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 00:16:37 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 02 Jul 2024 20:16:37 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: wip Message-ID: <668498659e74b_5d7dd396aa7022221@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: dde03f52 by Fabricio de Sousa Nascimento at 2024-07-03T09:15:16+09:00 compiler: wip - - - - - 9 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - libraries/array - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014.hs - + testsuite/tests/rename/T25014/T25014.stderr - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -115,6 +116,7 @@ import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) +import qualified Distribution.Simple as ways {- ********************************************************* @@ -677,100 +679,181 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod052 for example + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> + return NameNotFound + UniqueOccurrence _ -> + -- Methods on type classes and their instances or type classes require a matching + -- parent + -- we are looking for. + noMatchingRecordFieldParentErr parent rdr_name original_gres + DisambiguatedOccurrence g -> + markUsedAndReturnFoundChild warn_if_deprec g + AmbiguousOccurrence _ -> + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + mkIncorrectParentErr parent (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +noMatchingRecordFieldParentErr :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +noMatchingRecordFieldParentErr parent rdr_name original_gres = do + traceRn "noMatchingParentErr" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> mkIncorrectParentErr parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then mkIncorrectParentErr parent (NE.fromList gss) + else mkGresNameClashErr rdr_name $ g NE.:| gss' + +-- Used in export lists to lookup the children. See +-- NOTE [ Differences in name lookup for Export List and Type Classes ] +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> + noMatchingRecordFieldParentErr parent rdr_name original_gres + UniqueOccurrence g -> + -- It seems counter intuitive that we would accept exporting an occurrence + -- that does not match the parent, but there are cases where we can export + -- a name with a different parent, for example pattern synonyms: + -- + -- module I (foo) where + -- pattern P{foo} = foo + -- + -- module M (S (foo)) where + -- import I + -- data S + markUsedAndReturnFoundChild warn_if_deprec g + DisambiguatedOccurrence g -> + markUsedAndReturnFoundChild warn_if_deprec g + AmbiguousOccurrence gres -> + mkGresNameClashErr rdr_name gres --TODO FABU it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + + +-- TODO FABU +lookup_sub_bndr_occ_on_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookup_sub_bndr_occ_on_gres parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + pick_gres :: [GlobalRdrElt] -> DisambigInfo + -- For Unqual, find all GREs that are in scope qualified or unqualified + -- For Qual, find only GREs that are in scope with that qualification + pick_gres gres + | isUnqual rdr_name + = mconcat (map right_parent gres) + | otherwise + = mconcat (map right_parent (pickGREs rdr_name gres)) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> DisambiguatedOccurrence gre + | otherwise -> NoOccurrence + NoParent -> UniqueOccurrence gre + + +-- TODO FABU explain this better +-- mkGresNameClashErr is one of the exceptions mentioned on +-- Not [ Unbound vs Ambiguous Names ]. +mkGresNameClashErr :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +mkGresNameClashErr rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +mkIncorrectParentErr :: Name -> NE.NonEmpty (GlobalRdrEltX GREInfo) -> RnM ChildLookupResult +mkIncorrectParentErr parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +markUsedAndReturnFoundChild :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +markUsedAndReturnFoundChild warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. @@ -796,7 +879,12 @@ instance Outputable DisambigInfo where instance Semi.Semigroup DisambigInfo where -- These are the key lines: we prefer disambiguated occurrences to other - -- names. + -- names. But if we have two disambiguated occurrences, this is an + -- ambiguous match (see #25014). + DisambiguatedOccurrence g <> DisambiguatedOccurrence g' + = AmbiguousOccurrence $ g NE.:| [g'] + AmbiguousOccurrence gs <> DisambiguatedOccurrence g' + = AmbiguousOccurrence (g' `NE.cons` gs) _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' @@ -835,28 +923,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit ba5e9dcf1370190239395b8361b1c92ea9fc7632 +Subproject commit 510456786715d96dfc9e9bc4cead9aace1ce2db6 ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- TODO FABU +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- TODO FABU +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014.hs ===================================== @@ -0,0 +1,4 @@ +-- TODO FABU +module T25014 (T(MkT)) where -- which MkT is exported here? + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) ===================================== testsuite/tests/rename/T25014/T25014.stderr ===================================== @@ -0,0 +1,10 @@ +T25014.hs:2:16: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1 @@ +test('T25014', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dde03f52619716f6c06387a84475350eb45202c3 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dde03f52619716f6c06387a84475350eb45202c3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 00:36:30 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 02 Jul 2024 20:36:30 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] 2 commits: compiler: fix wip Message-ID: <66849d0ed068d_5d7dd3c7d168230be@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: c7f266f5 by Fabricio de Sousa Nascimento at 2024-07-03T09:36:04+09:00 compiler: fix wip - - - - - 810170af by Fabricio de Sousa Nascimento at 2024-07-03T09:36:04+09:00 compiler: refactor wip - - - - - 8 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014.hs - + testsuite/tests/rename/T25014/T25014.stderr - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -677,100 +678,162 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod052 for example + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [Something on Type Class and Instance (better name)] +-- TODO +-- An specialization of lookupSubBndrOccOnExportList +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookup_names_on_gres parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> + noMatchingParentErr parent rdr_name original_gres + UniqueOccurrence _ -> + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + noMatchingParentErr parent rdr_name original_gres + DisambiguatedOccurrence g -> + markUsedAndReturnFoundChild warn_if_deprec g + AmbiguousOccurrence _ -> + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + mkIncorrectParentErr parent (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookup_names_on_gres parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> + noMatchingParentErr parent rdr_name original_gres + UniqueOccurrence g -> + markUsedAndReturnFoundChild warn_if_deprec g + DisambiguatedOccurrence g -> + markUsedAndReturnFoundChild warn_if_deprec g + AmbiguousOccurrence gres -> + mkGresNameClashErr rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- TODO +lookup_names_on_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookup_names_on_gres parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + pick_gres :: [GlobalRdrElt] -> DisambigInfo + -- TODO understand this better + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + pick_gres gres + | isUnqual rdr_name + = mconcat (map right_parent gres) + | otherwise + = mconcat (map right_parent (pickGREs rdr_name gres)) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> DisambiguatedOccurrence gre + | otherwise -> NoOccurrence + NoParent -> UniqueOccurrence gre + + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +noMatchingParentErr :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +noMatchingParentErr parent rdr_name original_gres = do + traceRn "noMatchingParentErr" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> mkIncorrectParentErr parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then mkIncorrectParentErr parent (NE.fromList gss) + else mkGresNameClashErr rdr_name $ g NE.:| gss' + +-- TODO explain this better +-- mkGresNameClashErr is one of the exceptions mentioned on +-- Not [ Unbound vs Ambiguous Names ]. +mkGresNameClashErr :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +mkGresNameClashErr rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +mkIncorrectParentErr :: Name -> NE.NonEmpty (GlobalRdrEltX GREInfo) -> RnM ChildLookupResult +mkIncorrectParentErr parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +markUsedAndReturnFoundChild :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +markUsedAndReturnFoundChild warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. @@ -796,7 +859,12 @@ instance Outputable DisambigInfo where instance Semi.Semigroup DisambigInfo where -- These are the key lines: we prefer disambiguated occurrences to other - -- names. + -- names. But if we have two disambiguated occurrences, this is an + -- ambiguous match (see #25014). + DisambiguatedOccurrence g <> DisambiguatedOccurrence g' + = AmbiguousOccurrence $ g NE.:| [g'] + AmbiguousOccurrence gs <> DisambiguatedOccurrence g' + = AmbiguousOccurrence (g' `NE.cons` gs) _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' @@ -835,28 +903,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014 (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) ===================================== testsuite/tests/rename/T25014/T25014.stderr ===================================== @@ -0,0 +1,10 @@ +T25014.hs:2:16: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1 @@ +test('T25014', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dde03f52619716f6c06387a84475350eb45202c3...810170af975841609c0efeb10813acfff1a3f920 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dde03f52619716f6c06387a84475350eb45202c3...810170af975841609c0efeb10813acfff1a3f920 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 08:01:54 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 03 Jul 2024 04:01:54 -0400 Subject: [Git][ghc/ghc][wip/amg/module-cycle-error] 2 commits: Use structured errors for a Backpack instantiation error Message-ID: <66850572c8e66_5d7dd765ed14584c0@gitlab.mail> sheaf pushed to branch wip/amg/module-cycle-error at Glasgow Haskell Compiler / GHC Commits: d6c5f91c by sheaf at 2024-07-03T10:01:44+02:00 Use structured errors for a Backpack instantiation error - - - - - 6b139380 by sheaf at 2024-07-03T10:01:44+02:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 8 changed files: - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Unit/Module/Location.hs - testsuite/tests/diagnostic-codes/codes.stdout Changes: ===================================== compiler/GHC/Driver/Errors/Ppr.hs ===================================== @@ -264,7 +264,10 @@ instance Diagnostic DriverMessage where ppr_ms :: ModSummary -> SDoc ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+> (parens (text (msHsFilePath ms))) - + DriverInstantiationNodeInDependencyGeneration node -> + mkSimpleDecorated $ + vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" + , nest 2 $ ppr node ] diagnosticReason = \case DriverUnknownMessage m @@ -332,6 +335,8 @@ instance Diagnostic DriverMessage where -> WarningWithFlag Opt_WarnDeprecatedFlags DriverModuleGraphCycle {} -> ErrorWithoutFlag + DriverInstantiationNodeInDependencyGeneration {} + -> ErrorWithoutFlag diagnosticHints = \case DriverUnknownMessage m @@ -401,5 +406,7 @@ instance Diagnostic DriverMessage where -> noHints DriverModuleGraphCycle {} -> noHints + DriverInstantiationNodeInDependencyGeneration {} + -> noHints diagnosticCode = constructorCode ===================================== compiler/GHC/Driver/Errors/Types.hs ===================================== @@ -385,7 +385,7 @@ data DriverMessage where DriverDeprecatedFlag :: String -> String -> DriverMessage - {- | DriverModuleGraphCycle is an error that occurs if the module graph + {-| DriverModuleGraphCycle is an error that occurs if the module graph contains cyclic imports. Test cases: @@ -397,6 +397,11 @@ data DriverMessage where -} DriverModuleGraphCycle :: [ModuleGraphNode] -> DriverMessage + {- | DriverInstantiationNodeInDependencyGeneration is an error that occurs + if the module graph used for dependency generation contains + Backpack 'InstantiationNode's. -} + DriverInstantiationNodeInDependencyGeneration :: InstantiatedUnit -> DriverMessage + deriving instance Generic DriverMessage data DriverMessageOpts = ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -1265,7 +1265,7 @@ upsweep n_jobs hsc_env hmi_cache diag_wrapper mHscMessage old_hpt build_plan = d -- of the upsweep. case cycle of Just mss -> do - cyclicModuleErr mss + throwOneError $ cyclicModuleErr mss Nothing -> do let success_flag = successIf (all isJust res) return (success_flag, completed) @@ -2386,16 +2386,15 @@ multiRootsErr summs@(summ1:_) mod = ms_mod summ1 files = map (expectJust "checkDup" . ml_hs_file . ms_location) summs -cyclicModuleErr :: [ModuleGraphNode] -> IO a +cyclicModuleErr :: [ModuleGraphNode] -> MsgEnvelope GhcMessage -- From a strongly connected component we find -- a single cycle to report cyclicModuleErr mss = assert (not (null mss)) $ case findCycle graph of Nothing -> pprPanic "Unexpected non-cycle" (ppr mss) - Just path -> throwOneError $ mkPlainErrorMsgEnvelope src_span - $ GhcDriverMessage - $ DriverModuleGraphCycle path + Just path -> mkPlainErrorMsgEnvelope src_span $ + GhcDriverMessage $ DriverModuleGraphCycle path where src_span = maybe noSrcSpan (mkFileSrcSpan . ms_location) (moduleGraphNodeModSum (head path)) where @@ -2409,13 +2408,6 @@ cyclicModuleErr mss | ms <- mss ] -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - - cleanCurrentModuleTempFilesMaybe :: MonadIO m => Logger -> TmpFs -> DynFlags -> m () cleanCurrentModuleTempFilesMaybe logger tmpfs dflags = if gopt Opt_KeepTmpFiles dflags ===================================== compiler/GHC/Driver/MakeFile.hs ===================================== @@ -19,7 +19,6 @@ import qualified GHC import GHC.Driver.Make import GHC.Driver.Monad import GHC.Driver.DynFlags -import GHC.Driver.Ppr import GHC.Utils.Misc import GHC.Driver.Env import GHC.Driver.Errors.Types @@ -213,14 +212,14 @@ processDeps :: DynFlags processDeps _ _ _ _ _ (CyclicSCC nodes) = -- There shouldn't be any cycles; report them - cyclicModuleErr nodes + throwOneError $ cyclicModuleErr nodes -processDeps dflags _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) +processDeps _ _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) = -- There shouldn't be any backpack instantiations; report them as well - throwGhcExceptionIO $ ProgramError $ - showSDoc dflags $ - vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" - , nest 2 $ ppr node ] + throwOneError $ + mkPlainErrorMsgEnvelope noSrcSpan $ + GhcDriverMessage $ DriverInstantiationNodeInDependencyGeneration node + processDeps _dflags _ _ _ _ (AcyclicSCC (LinkNode {})) = return () processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC (ModuleNode _ node)) ===================================== compiler/GHC/HsToCore.hs ===================================== @@ -64,7 +64,6 @@ import GHC.Builtin.Names import GHC.Builtin.Types.Prim import GHC.Builtin.Types -import GHC.Data.FastString import GHC.Data.Maybe ( expectJust ) import GHC.Data.OrdList import GHC.Data.SizedSeq ( sizeSS ) @@ -289,12 +288,6 @@ deSugar hsc_env ; return (msgs, Just mod_guts) }}}} -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - dsImpSpecs :: [LTcSpecPrag] -> DsM (OrdList (Id,CoreExpr), [CoreRule]) dsImpSpecs imp_specs = do { spec_prs <- mapMaybeM (dsSpec Nothing) imp_specs ===================================== compiler/GHC/Types/Error/Codes.hs ===================================== @@ -321,6 +321,7 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "DriverUnrecognisedFlag" = 93741 GhcDiagnosticCode "DriverDeprecatedFlag" = 53692 GhcDiagnosticCode "DriverModuleGraphCycle" = 92213 + GhcDiagnosticCode "DriverInstantiationNodeInDependencyGeneration" = 74284 -- Constraint solver diagnostic codes GhcDiagnosticCode "BadTelescope" = 97739 ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -18,6 +18,7 @@ module GHC.Unit.Module.Location , addBootSuffixLocn , addBootSuffixLocnOut , removeBootSuffix + , mkFileSrcSpan ) where @@ -25,7 +26,9 @@ import GHC.Prelude import GHC.Data.OsPath import GHC.Unit.Types +import GHC.Types.SrcLoc import GHC.Utils.Outputable +import GHC.Data.FastString (mkFastString) import qualified System.OsString as OsString @@ -128,6 +131,13 @@ addBootSuffixLocnOut locn , ml_hie_file_ospath = addBootSuffix (ml_hie_file_ospath locn) } +-- | Compute a 'SrcSpan' from a 'ModLocation'. +mkFileSrcSpan :: ModLocation -> SrcSpan +mkFileSrcSpan mod_loc + = case ml_hs_file mod_loc of + Just file_path -> mkGeneralSrcSpan (mkFastString file_path) + Nothing -> interactiveSrcSpan -- Presumably + -- ---------------------------------------------------------------------------- -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- ===================================== testsuite/tests/diagnostic-codes/codes.stdout ===================================== @@ -41,6 +41,7 @@ [GHC-19971] is untested (constructor = DriverBackpackModuleNotFound) [GHC-37141] is untested (constructor = DriverCannotLoadInterfaceFile) [GHC-29747] is untested (constructor = DriverMissingSafeHaskellMode) +[GHC-74284] is untested (constructor = DriverInstantiationNodeInDependencyGeneration) [GHC-06200] is untested (constructor = BlockedEquality) [GHC-81325] is untested (constructor = ExpectingMoreArguments) [GHC-78125] is untested (constructor = AmbiguityPreventsSolvingCt) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7500a74cf3dac8a0479016fc19f5d2729a5c868d...6b139380c39494c8418f4b1e88dbdc89f9bca75f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7500a74cf3dac8a0479016fc19f5d2729a5c868d...6b139380c39494c8418f4b1e88dbdc89f9bca75f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 08:30:58 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 04:30:58 -0400 Subject: [Git][ghc/ghc][wip/romes/25013] 13 commits: X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) Message-ID: <66850c42cd948_5d7dd7be0620651f0@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25013 at Glasgow Haskell Compiler / GHC Commits: eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - efb8bc99 by Rodrigo Mesquita at 2024-07-03T08:30:55+00:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 30 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - + compiler/GHC/Iface/Warnings.hs - compiler/GHC/Platform.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Settings/Builders/GenPrimopCode.hs - libraries/array - libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs - libraries/ghc-boot/ghc-boot.cabal.in - libraries/ghci/GHCi/BinaryArray.hs - libraries/os-string - testsuite/tests/regalloc/regalloc_unit_tests.hs - testsuite/tests/th/T12403.stdout - testsuite/tests/th/T12478_4.stderr - + testsuite/tests/th/T24997.hs - + testsuite/tests/th/T24997.stdout - testsuite/tests/th/all.T - utils/genapply/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/654acc7a1bbe132df2fe45f79ffa260f752aeaaf...efb8bc99d76105c6f271f60f9633ee21d18c1146 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/654acc7a1bbe132df2fe45f79ffa260f752aeaaf...efb8bc99d76105c6f271f60f9633ee21d18c1146 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 08:31:57 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 04:31:57 -0400 Subject: [Git][ghc/ghc][wip/romes/25013] ghc-boot: Relax Cabal bound Message-ID: <66850c7de1e08_5d7dd7cecf646558b@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25013 at Glasgow Haskell Compiler / GHC Commits: 4450f81d by Rodrigo Mesquita at 2024-07-03T09:31:43+01:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 1 changed file: - libraries/ghc-boot/ghc-boot.cabal.in Changes: ===================================== libraries/ghc-boot/ghc-boot.cabal.in ===================================== @@ -28,7 +28,7 @@ build-type: Custom extra-source-files: changelog.md custom-setup - setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.10, directory, filepath + setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.14, directory, filepath source-repository head type: git View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4450f81dc5a713afb01856f064b3b4feb0c372c8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4450f81dc5a713afb01856f064b3b4feb0c372c8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 09:27:13 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 05:27:13 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/strict-state-tweaks Message-ID: <66851971719ad_11373f2445f0302e1@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/strict-state-tweaks at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/strict-state-tweaks You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 09:30:10 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 03 Jul 2024 05:30:10 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66851a224659a_11373f3a6f3834789@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 30cbc047 by Zubin Duggal at 2024-07-03T05:29:47-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 0dde3902 by Oleg Grenrus at 2024-07-03T05:29:49-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - aefcc6ba by Adam Gundry at 2024-07-03T05:29:51-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 34240c4e by Max Ulidtko at 2024-07-03T05:29:53-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 692973db by Mike Pilgrem at 2024-07-03T05:29:57-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 12068a68 by Matthew Pickering at 2024-07-03T05:29:57-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - 07180937 by Andrew Lelechenko at 2024-07-03T05:29:58-04:00 base: fix more missing changelog entries - - - - - 295e8964 by Bryan Richter at 2024-07-03T05:29:58-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Finder/Types.hs - compiler/GHC/Utils/TmpFs.hs - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/ffi.rst - docs/users_guide/using-warnings.rst - ghc/GHCi/UI.hs - libraries/base/changelog.md - libraries/ghc-experimental/ghc-experimental.cabal - + libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs - + libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs - libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs - + testsuite/tests/ghci/should_run/T10920.hs - + testsuite/tests/ghci/should_run/T10920.script - + testsuite/tests/ghci/should_run/T10920.stderr - + testsuite/tests/ghci/should_run/T10920.stdout - testsuite/tests/ghci/should_run/all.T - testsuite/tests/interface-stability/ghc-experimental-exports.stdout - + testsuite/tests/numeric/should_run/T24245.hs - + testsuite/tests/numeric/should_run/T24245.stdout - testsuite/tests/numeric/should_run/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/19b24877b0407dcb5f10ac01bd69264bd0ce867a...295e8964a2554ab6ccee99b5ef278506cf875a25 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/19b24877b0407dcb5f10ac01bd69264bd0ce867a...295e8964a2554ab6ccee99b5ef278506cf875a25 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 10:15:29 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 06:15:29 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] wip Message-ID: <668524c1d7875_11373fb209bc5432a@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: cf81fcea by Fabricio de Sousa Nascimento at 2024-07-03T19:14:58+09:00 wip - - - - - 14 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -111,9 +112,8 @@ import Control.Arrow ( first ) import Control.Monad import Data.Either ( partitionEithers ) import Data.Function ( on ) -import Data.List ( find, partition, groupBy, sortBy ) +import Data.List ( find, partition, groupBy, sortBy, foldl' ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,204 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- SPOTMARK + +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + liftIO $ putStrLn "DisambigOccurence ExportList" + traceTc "DisambigOccurence ExportList" (vcat []) + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +885,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +909,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,4 @@ +T25014b.hs:2:17: error: [GHC-45510] + • Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + • In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a name for the wrong parent +module T25014b (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,4 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf81fceabd2ed0b0089d308507ce700fb4846729 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf81fceabd2ed0b0089d308507ce700fb4846729 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 10:31:31 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 06:31:31 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] wip Message-ID: <66852883c122_11373fda8310622cc@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 57683e3a by Fabricio de Sousa Nascimento at 2024-07-03T19:30:45+09:00 wip - - - - - 14 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -111,9 +112,8 @@ import Control.Arrow ( first ) import Control.Monad import Data.Either ( partitionEithers ) import Data.Function ( on ) -import Data.List ( find, partition, groupBy, sortBy ) +import Data.List ( find, partition, groupBy, sortBy) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,202 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + liftIO $ putStrLn "DisambigOccurence ExportList" + traceTc "DisambigOccurence ExportList" (vcat []) + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +883,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +907,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,4 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57683e3abc7a0262de1e6394becf0a31d0cf9edc -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57683e3abc7a0262de1e6394becf0a31d0cf9edc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 10:36:13 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 06:36:13 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Major progress in using UniqDSM in CmmToAsm and Ncg backends Message-ID: <6685299da987e_11373ff7e02c684e7@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: f8ae759b by Rodrigo Mesquita at 2024-07-03T11:34:47+01:00 Major progress in using UniqDSM in CmmToAsm and Ncg backends - - - - - 28 changed files: - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/Base.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/Driver/CodeOutput.hs - compiler/GHC/StgToCmm/ExtCode.hs - + compiler/GHC/Types/Unique/DSM.hs - compiler/GHC/Wasm/ControlFlow/FromCmm.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/BlockId.hs ===================================== @@ -16,6 +16,7 @@ import GHC.Types.Id.Info import GHC.Types.Name import GHC.Types.Unique import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Cmm.Dataflow.Label (Label, mkHooplLabel) @@ -36,8 +37,12 @@ type BlockId = Label mkBlockId :: Unique -> BlockId mkBlockId unique = mkHooplLabel $ getKey unique -newBlockId :: MonadUnique m => m BlockId -newBlockId = mkBlockId <$> getUniqueM +-- If the monad unique instance uses a deterministic unique supply, this will +-- give you a deterministic unique. Otherwise, it will not. Note that from Cmm +-- onwards (after deterministic renaming in 'codeGen'), there should only exist +-- deterministic block labels. +newBlockId :: DSM.MonadGetUnique m => m BlockId +newBlockId = mkBlockId <$> DSM.getUniqueM blockLbl :: BlockId -> CLabel blockLbl label = mkLocalBlockLabel (getUnique label) ===================================== compiler/GHC/Cmm/Reducibility.hs ===================================== @@ -47,7 +47,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Collapse import GHC.Data.Graph.Inductive.Graph import GHC.Data.Graph.Inductive.PatriciaTree -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic -- | Represents the result of a reducibility analysis. @@ -81,7 +81,7 @@ reducibility gwd = -- control-flow graph. asReducible :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) asReducible gwd = case reducibility gwd of Reducible -> return gwd Irreducible -> assertReducible <$> nodeSplit gwd @@ -97,7 +97,7 @@ assertReducible gwd = case reducibility gwd of -- irreducible. nodeSplit :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) nodeSplit gwd = graphWithDominators <$> inflate (g_entry g) <$> runNullCollapse collapsed where g = gwd_graph gwd @@ -181,7 +181,7 @@ instance PureSupernode CmmSuper where mapLabels = changeLabels instance Supernode CmmSuper NullCollapseViz where - freshen s = liftUniqSM $ relabel s + freshen s = liftUniqDSM $ relabel s -- | Return all labels defined within a supernode. @@ -212,11 +212,11 @@ changeBlockLabels f block = blockJoin entry' middle exit' -- | Within the given supernode, replace every defined label (and all -- of its uses) with a fresh label. -relabel :: CmmSuper -> UniqSM CmmSuper +relabel :: CmmSuper -> UniqDSM CmmSuper relabel node = do finite_map <- foldM addPair mapEmpty $ definedLabels node return $ changeLabels (labelChanger finite_map) node - where addPair :: LabelMap Label -> Label -> UniqSM (LabelMap Label) + where addPair :: LabelMap Label -> Label -> UniqDSM (LabelMap Label) addPair map old = do new <- newBlockId return $ mapInsert old new map labelChanger :: LabelMap Label -> (Label -> Label) ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -7,6 +7,8 @@ module GHC.Cmm.UniqueRenamer -- Careful! Not for general use! , DetUniqFM, emptyDetUFM + + , module GHC.Types.Unique.DSM ) where @@ -28,6 +30,7 @@ import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) import GHC.Types.Id import qualified GHC.Types.Unique.Supply as USM +import GHC.Types.Unique.DSM {- -------------------------------------------------------------------------------- @@ -276,93 +279,3 @@ instance (UniqRenamable a) => UniqRenamable (Maybe a) where panicMapKeysNotInjective :: a -> b -> c panicMapKeysNotInjective _ _ = error "this should be impossible because the function which maps keys should be injective" --------------------------------------------------------------------------------- --- UniqDSM (ToDo: For this to make sense in this module, rename the module to --- something like GHC.Cmm.UniqueDeterminism). Write notes.... - --- todo: Do I need to use the one-shot state monad trick? Probably yes. - --- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. - --- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic --- there, but without the unboxing it feels? Maybe not, since we carry the --- mappings too. - -newtype DUniqSupply = DUS Word64 -- supply uniques iteratively -type DUniqResult result = (# result, DUniqSupply #) - -pattern DUniqResult :: a -> b -> (# a, b #) -pattern DUniqResult x y = (# x, y #) -{-# COMPLETE DUniqResult #-} - --- | A monad which just gives the ability to obtain 'Unique's deterministically. --- There's no splitting. -newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } - deriving Functor - -instance Monad UniqDSM where - (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of - DUniqResult result us1 -> unUDSM (cont result) us1 - (>>) = (*>) - {-# INLINE (>>=) #-} - {-# INLINE (>>) #-} - -instance Applicative UniqDSM where - pure result = UDSM (DUniqResult result) - (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of - DUniqResult ff us1 -> case x us1 of - DUniqResult xx us2 -> DUniqResult (ff xx) us2 - (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of - DUniqResult _ us1 -> cont us1 - {-# INLINE pure #-} - {-# INLINE (*>) #-} - -instance MonadFix UniqDSM where - mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) - -getUniqueDSM :: UniqDSM Unique -getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) - -takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) -takeUniqueFromDSupply d = - case unUDSM getUniqueDSM d of - DUniqResult x y -> (x, y) - --- Write Note about the importance of locality in uniques that are deterministic --- --- If you use a tag which collides with other names, you'll get a uniques --- deterministically colliding with existing symbols. --- --- (e.g. easy to observe if you do this wrong) --- --- Ideally, we'd thread the same deterministic unique supply all the way --- throughout the Cmm pipeline, starting off from hte deterministic rename --- pass. -initDUniqSupply :: Char -> Word64 -> DUniqSupply -initDUniqSupply c firstUniq = - let !tag = mkTag c - in DUS (tag .|. firstUniq) - -newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply -newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c - -runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) -runUniqueDSM ds (UDSM f) = - case f ds of - DUniqResult uq us -> (uq, us) - -class Monad m => MonadGetUnique m where - getUniqueM :: m Unique - -instance MonadGetUnique UniqDSM where - getUniqueM = getUniqueDSM - -instance MonadGetUnique USM.UniqSM where - getUniqueM = USM.getUniqueM - -{- -Note [Cmm Local Deterministic Uniques] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -TODO!!!!! -TODO!!!!! --} ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -100,7 +100,7 @@ import GHC.Cmm.GenericOpt import GHC.Cmm.CLabel import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Driver.DynFlags import GHC.Driver.Ppr import GHC.Utils.Misc @@ -129,7 +129,7 @@ import System.IO import System.Directory ( getCurrentDirectory ) -------------------- -nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> UniqSupply +nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen logger ts config modLoc h us cmms @@ -203,7 +203,7 @@ nativeCodeGen' :: (OutputableP Platform statics, Outputable jumpDest, Instructio -> ModLocation -> NcgImpl statics instr jumpDest -> Handle - -> UniqSupply + -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen' logger config modLoc ncgImpl h us cmms @@ -223,9 +223,9 @@ finishNativeGen :: Instruction instr -> NCGConfig -> ModLocation -> BufHandle - -> UniqSupply + -> DUniqSupply -> NativeGenAcc statics instr - -> IO UniqSupply + -> IO DUniqSupply finishNativeGen logger config modLoc bufh us ngs = withTimingSilent logger (text "NCG") (`seq` ()) $ do -- Write debug data and finish @@ -284,19 +284,19 @@ cmmNativeGenStream :: forall statics jumpDest instr a . (OutputableP Platform st -> ModLocation -> NcgImpl statics instr jumpDest -> BufHandle - -> UniqSupply + -> DUniqSupply -> Stream.Stream IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) cmmNativeGenStream logger config modLoc ncgImpl h us cmm_stream ngs = loop us (Stream.runStream cmm_stream) ngs where ncglabel = text "NCG" - loop :: UniqSupply + loop :: DUniqSupply -> Stream.StreamS IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) loop us s ngs = case s of Stream.Done a -> @@ -345,17 +345,17 @@ cmmNativeGens :: forall statics instr jumpDest. -> NcgImpl statics instr jumpDest -> BufHandle -> LabelMap DebugBlock - -> UniqSupply + -> DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) cmmNativeGens logger config ncgImpl h dbgMap = go where - go :: UniqSupply -> [RawCmmDecl] + go :: DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) go us [] ngs !_ = return (ngs, us) @@ -424,12 +424,12 @@ cmmNativeGen :: forall statics instr jumpDest. (Instruction instr, OutputableP Platform statics, Outputable jumpDest) => Logger -> NcgImpl statics instr jumpDest - -> UniqSupply + -> DUniqSupply -> DwarfFiles -> LabelMap DebugBlock -> RawCmmDecl -- ^ the cmm to generate code for -> Int -- ^ sequence number of this top thing - -> IO ( UniqSupply + -> IO ( DUniqSupply , DwarfFiles , [NatCmmDecl statics instr] -- native code , [CLabel] -- things imported by this cmm @@ -468,7 +468,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- generate native code from cmm let ((native, lastMinuteImports, fileIds', nativeCfgWeights), usGen) = {-# SCC "genMachCode" #-} - initUs us $ genMachCode config + runUniqueDSM us $ genMachCode config (cmmTopCodeGen ncgImpl) fileIds dbgMap opt_cmm cmmCfg @@ -486,7 +486,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count else Nothing let (withLiveness, usLive) = {-# SCC "regLiveness" #-} - initUs usGen + runUniqueDSM usGen $ mapM (cmmTopLiveness livenessCfg platform) native putDumpFileMaybe logger @@ -494,8 +494,6 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count FormatCMM (vcat $ map (pprLiveCmmDecl platform) withLiveness) - -- ROMES:TODO: RENAME VIRTUAL REGISTERS DETERMINISTICALLY - -- allocate registers (alloced, usAlloc, ppr_raStatsColor, ppr_raStatsLinear, raStats, stack_updt_blks) <- if ( ncgRegsGraph config || ncgRegsIterative config ) @@ -510,7 +508,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- do the graph coloring register allocation let ((alloced, maybe_more_stack, regAllocStats), usAlloc) = {-# SCC "RegAlloc-color" #-} - initUs usLive + runUniqueDSM usLive $ Color.regAlloc config alloc_regs @@ -520,13 +518,13 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count livenessCfg let ((alloced', stack_updt_blks), usAlloc') - = initUs usAlloc $ - case maybe_more_stack of - Nothing -> return (alloced, []) - Just amount -> do - (alloced',stack_updt_blks) <- unzip <$> - (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) - return (alloced', concat stack_updt_blks ) + = runUniqueDSM usAlloc $ + case maybe_more_stack of + Nothing -> return (alloced, []) + Just amount -> do + (alloced',stack_updt_blks) <- unzip <$> + (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) + return (alloced', concat stack_updt_blks ) -- dump out what happened during register allocation @@ -571,7 +569,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count let ((alloced, regAllocStats, stack_updt_blks), usAlloc) = {-# SCC "RegAlloc-linear" #-} - initUs usLive + runUniqueDSM usLive $ liftM unzip3 $ mapM reg_alloc withLiveness @@ -643,7 +641,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- sequenced :: [NatCmmDecl statics instr] let (sequenced, us_seq) = {-# SCC "sequenceBlocks" #-} - initUs usAlloc $ mapM (BlockLayout.sequenceTop + runUniqueDSM usAlloc $ mapM (BlockLayout.sequenceTop ncgImpl optimizedCFG) shorted @@ -913,7 +911,7 @@ genMachCode -> LabelMap DebugBlock -> RawCmmDecl -> CFG - -> UniqSM + -> UniqDSM ( [NatCmmDecl statics instr] , [CLabel] , DwarfFiles @@ -921,15 +919,16 @@ genMachCode ) genMachCode config cmmTopCodeGen fileIds dbgMap cmm_top cmm_cfg - = do { initial_us <- getUniqueSupplyM - ; let initial_st = mkNatM_State initial_us 0 config - fileIds dbgMap cmm_cfg - (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) - final_delta = natm_delta final_st - final_imports = natm_imports final_st - final_cfg = natm_cfg final_st - ; if final_delta == 0 - then return (new_tops, final_imports - , natm_fileid final_st, final_cfg) - else pprPanic "genMachCode: nonzero final delta" (int final_delta) - } + = UDSM $ \initial_us -> do + { let initial_st = mkNatM_State initial_us 0 config + fileIds dbgMap cmm_cfg + (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) + final_delta = natm_delta final_st + final_imports = natm_imports final_st + final_cfg = natm_cfg final_st + ; if final_delta == 0 + then DUniqResult + (new_tops, final_imports + , natm_fileid final_st, final_cfg) (natm_us final_st) + else DUniqResult (pprPanic "genMachCode: nonzero final delta" (int final_delta)) undefined + } ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -1,4 +1,4 @@ -{-# language GADTs #-} +{-# language GADTs, LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module GHC.CmmToAsm.AArch64.CodeGen ( cmmTopCodeGen @@ -44,7 +44,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM -- The rest: import GHC.Data.OrdList @@ -1440,7 +1440,7 @@ genCondJump bid expr = do _ -> pprPanic "AArch64.genCondJump: " (text $ show expr) -- A conditional jump with at least +/-128M jump range -genCondFarJump :: MonadUnique m => Cond -> Target -> m InstrBlock +genCondFarJump :: MonadGetUnique m => Cond -> Target -> m InstrBlock genCondFarJump cond far_target = do skip_lbl_id <- newBlockId jmp_lbl_id <- newBlockId @@ -2272,7 +2272,7 @@ data BlockInRange = InRange | NotInRange Target -- See Note [AArch64 far jumps] makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches {- only used when debugging -} _platform statics basic_blocks = do -- All offsets/positions are counted in multiples of 4 bytes (the size of AArch64 instructions) -- That is an offset of 1 represents a 4-byte/one instruction offset. @@ -2293,7 +2293,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = long_bz_jump_size = 4 :: Int -- Replace out of range conditional jumps with unconditional jumps. - replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqSM (Int, [GenBasicBlock Instr]) + replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqDSM (Int, [GenBasicBlock Instr]) replace_blk !m !pos (BasicBlock lbl instrs) = do -- Account for a potential info table before the label. let !block_pos = pos + infoTblSize_maybe lbl @@ -2307,12 +2307,14 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = let final_blocks = BasicBlock lbl top : split_blocks pure (pos', final_blocks) - replace_jump :: LabelMap Int -> Int -> Instr -> UniqSM (Int, [Instr]) + replace_jump :: LabelMap Int -> Int -> Instr -> UniqDSM (Int, [Instr]) replace_jump !m !pos instr = do case instr of ANN ann instr -> do - (idx,instr':instrs') <- replace_jump m pos instr - pure (idx, ANN ann instr':instrs') + replace_jump m pos instr >>= \case + (idx,instr':instrs') -> + pure (idx, ANN ann instr':instrs') + (idx,[]) -> pprPanic "replace_jump" (text "empty return list for " <+> ppr idx) BCOND cond t -> case target_in_range m t pos of InRange -> pure (pos+long_bc_jump_size,[instr]) ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -23,7 +23,7 @@ import GHC.Cmm import GHC.Cmm.CLabel import GHC.Utils.Outputable import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic @@ -473,13 +473,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -488,8 +488,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -48,7 +48,7 @@ import Data.STRef import Control.Monad.ST.Strict import Control.Monad (foldM, unless) import GHC.Data.UnionFind -import GHC.Types.Unique.Supply (UniqSM) +import GHC.Types.Unique.DSM (UniqDSM) {- Note [CFG based code layout] @@ -793,7 +793,7 @@ sequenceTop => NcgImpl statics instr jumpDest -> Maybe CFG -- ^ CFG if we have one. -> NatCmmDecl statics instr -- ^ Function to serialize - -> UniqSM (NatCmmDecl statics instr) + -> UniqDSM (NatCmmDecl statics instr) sequenceTop _ _ top@(CmmData _ _) = pure top sequenceTop ncgImpl edgeWeights (CmmProc info lbl live (ListGraph blocks)) = do ===================================== compiler/GHC/CmmToAsm/Dwarf.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Unit.Module import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.CmmToAsm.Dwarf.Constants import GHC.CmmToAsm.Dwarf.Types @@ -31,8 +31,7 @@ import System.FilePath import qualified GHC.Cmm.Dataflow.Label as H -- | Generate DWARF/debug information -dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] - -> (doc, UniqSupply) +dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (doc, DUniqSupply) dwarfGen _ _ _ us [] = (empty, us) dwarfGen compPath config modLoc us blocks = let platform = ncgPlatform config @@ -65,7 +64,7 @@ dwarfGen compPath config modLoc us blocks = -- .debug_info section: Information records on procedures and blocks -- unique to identify start and end compilation unit .debug_inf - (unitU, us') = takeUniqFromSupply us + (unitU, us') = takeUniqueFromDSupply us infoSct = vcat [ line (dwarfInfoLabel <> colon) , dwarfInfoSection platform , compileUnitHeader platform unitU @@ -79,7 +78,7 @@ dwarfGen compPath config modLoc us blocks = line (dwarfLineLabel <> colon) -- .debug_frame section: Information about the layout of the GHC stack - (framesU, us'') = takeUniqFromSupply us' + (framesU, us'') = takeUniqueFromDSupply us' frameSct = dwarfFrameSection platform $$ line (dwarfFrameLabel <> colon) $$ pprDwarfFrame platform (debugFrame platform framesU procs) @@ -90,8 +89,8 @@ dwarfGen compPath config modLoc us blocks = aranges = dwarfARangesSection platform $$ pprDwarfARanges platform aranges' unitU in (infoSct $$ abbrevSct $$ lineSct $$ frameSct $$ aranges, us'') -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (SDoc, UniqSupply) #-} -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (HDoc, UniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (SDoc, DUniqSupply) #-} +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (HDoc, DUniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Build an address range entry for one proc. -- With split sections, each proc needs its own entry, since they may get ===================================== compiler/GHC/CmmToAsm/Monad.hs ===================================== @@ -62,7 +62,7 @@ import GHC.Cmm.Expr (LocalReg (..), isWord64) import GHC.Data.FastString ( FastString ) import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Unique ( Unique ) import GHC.Unit.Module @@ -109,11 +109,11 @@ data NcgImpl statics instr jumpDest = NcgImpl { maxSpillSlots :: Int, allocatableRegs :: [RealReg], ncgAllocMoreStack :: Int -> NatCmmDecl statics instr - -> UniqSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), + -> UniqDSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), -- ^ The list of block ids records the redirected jumps to allow us to update -- the CFG. ncgMakeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock instr] - -> UniqSM [NatBasicBlock instr], + -> UniqDSM [NatBasicBlock instr], extractUnwindPoints :: [instr] -> [UnwindPoint], -- ^ given the instruction sequence of a block, produce a list of -- the block's 'UnwindPoint's @@ -178,7 +178,7 @@ mistake would readily show up in performance tests). -} data NatM_State = NatM_State { - natm_us :: UniqSupply, + natm_us :: DUniqSupply, natm_delta :: Int, -- ^ Stack offset for unwinding information natm_imports :: [(CLabel)], natm_pic :: Maybe Reg, @@ -205,7 +205,7 @@ pattern NatM f <- NatM' (runState -> f) unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a -mkNatM_State :: UniqSupply -> Int -> NCGConfig -> +mkNatM_State :: DUniqSupply -> Int -> NCGConfig -> DwarfFiles -> LabelMap DebugBlock -> CFG -> NatM_State mkNatM_State us delta config = \dwf dbg cfg -> @@ -223,19 +223,13 @@ mkNatM_State us delta config initNat :: NatM_State -> NatM a -> (a, NatM_State) initNat = flip unNat -instance MonadUnique NatM where - getUniqueSupplyM = NatM $ \st -> - case splitUniqSupply (natm_us st) of - (us1, us2) -> (us1, st {natm_us = us2}) - +instance MonadGetUnique NatM where getUniqueM = NatM $ \st -> - case takeUniqFromSupply (natm_us st) of - (uniq, us') -> (uniq, st {natm_us = us'}) + case takeUniqueFromDSupply (natm_us st) of + (uniq, us') -> (uniq, st {natm_us = us'}) getUniqueNat :: NatM Unique -getUniqueNat = NatM $ \ st -> - case takeUniqFromSupply $ natm_us st of - (uniq, us') -> (uniq, st {natm_us = us'}) +getUniqueNat = getUniqueM getDeltaNat :: NatM Int getDeltaNat = NatM $ \ st -> (natm_delta st, st) ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -55,7 +55,7 @@ import GHC.Cmm.CLabel import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM (listToUFM, lookupUFM) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import Data.Foldable (toList) import qualified Data.List.NonEmpty as NE @@ -105,7 +105,7 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do @@ -117,7 +117,7 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do | entry `elem` infos -> infos | otherwise -> entry : infos - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -126,8 +126,6 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList @@ -698,7 +696,7 @@ makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches _platform info_env blocks | NE.last blockAddresses < nearLimit = return blocks | otherwise = return $ zipWith handleBlock blockAddressList blocks ===================================== compiler/GHC/CmmToAsm/Reg/Graph.hs ===================================== @@ -31,7 +31,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Misc (seqList) import GHC.CmmToAsm.CFG @@ -57,8 +57,8 @@ regAlloc -> Int -- ^ current number of spill slots -> [LiveCmmDecl statics instr] -- ^ code annotated with liveness information. -> Maybe CFG -- ^ CFG of basic blocks if available - -> UniqSM ( [NatCmmDecl statics instr] - , Maybe Int, [RegAllocStats statics instr] ) + -> UniqDSM ( [NatCmmDecl statics instr] + , Maybe Int, [RegAllocStats statics instr] ) -- ^ code with registers allocated, additional stacks required -- and stats for each stage of allocation @@ -107,7 +107,7 @@ regAlloc_spin -> [RegAllocStats statics instr] -- ^ Current regalloc stats to add to. -> [LiveCmmDecl statics instr] -- ^ Liveness annotated code to allocate. -> Maybe CFG - -> UniqSM ( [NatCmmDecl statics instr] + -> UniqDSM ( [NatCmmDecl statics instr] , [RegAllocStats statics instr] , Int -- Slots in use , Color.Graph VirtualReg RegClass RealReg) @@ -305,7 +305,7 @@ regAlloc_spin config spinCount triv regsFree slotsFree slotsCount debug_codeGrap buildGraph :: Instruction instr => [LiveCmmDecl statics instr] - -> UniqSM (Color.Graph VirtualReg RegClass RealReg) + -> UniqDSM (Color.Graph VirtualReg RegClass RealReg) buildGraph code = do ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -22,7 +22,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -52,7 +52,7 @@ regSpill -> UniqSet Int -- ^ available stack slots -> Int -- ^ current number of spill slots. -> UniqSet VirtualReg -- ^ the regs to spill - -> UniqSM + -> UniqDSM ([LiveCmmDecl statics instr] -- code with SPILL and RELOAD meta instructions added. , UniqSet Int -- left over slots @@ -81,17 +81,20 @@ regSpill platform code slotsFree slotCount regs -- See Note [Unique Determinism and code generation] -- Grab the unique supply from the monad. - us <- getUniqueSupplyM + UDSM $ \us -> - -- Run the spiller on all the blocks. - let (code', state') = - runState (mapM (regSpill_top platform regSlotMap) code) - (initSpillS us) + -- Run the spiller on all the blocks. + let (code', state') = + runState (mapM (regSpill_top platform regSlotMap) code) + (initSpillS us) - return ( code' + in DUniqResult + ( code' , minusUniqSet slotsFree (mkUniqSet slots) , slotCount , makeSpillStats state') + ( stateUS state' ) + -- | Spill some registers to stack slots in a top-level thing. @@ -323,21 +326,28 @@ patchReg1 old new instr -- Spiller monad -------------------------------------------------------------- -- | State monad for the spill code generator. -type SpillM a - = State SpillS a +type SpillM = State SpillS -- | Spill code generator state. data SpillS = SpillS { -- | Unique supply for generating fresh vregs. - stateUS :: UniqSupply + stateUS :: DUniqSupply -- | Spilled vreg vs the number of times it was loaded, stored. , stateSpillSL :: UniqFM Reg (Reg, Int, Int) } +instance MonadGetUnique SpillM where + getUniqueM = do + us <- gets stateUS + case takeUniqueFromDSupply us of + (uniq, us') + -> do modify $ \s -> s { stateUS = us' } + return uniq + -- | Create a new spiller state. -initSpillS :: UniqSupply -> SpillS +initSpillS :: DUniqSupply -> SpillS initSpillS uniqueSupply = SpillS { stateUS = uniqueSupply @@ -346,12 +356,7 @@ initSpillS uniqueSupply -- | Allocate a new unique in the spiller monad. newUnique :: SpillM Unique -newUnique - = do us <- gets stateUS - case takeUniqFromSupply us of - (uniq, us') - -> do modify $ \s -> s { stateUS = us' } - return uniq +newUnique = getUniqueM -- | Add a spill/reload count to a stats record for a register. ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -129,7 +129,7 @@ import GHC.Data.Graph.Directed import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -146,11 +146,11 @@ regAlloc :: Instruction instr => NCGConfig -> LiveCmmDecl statics instr - -> UniqSM ( NatCmmDecl statics instr - , Maybe Int -- number of extra stack slots required, - -- beyond maxSpillSlots - , Maybe RegAllocStats - ) + -> UniqDSM ( NatCmmDecl statics instr + , Maybe Int -- number of extra stack slots required, + -- beyond maxSpillSlots + , Maybe RegAllocStats + ) regAlloc _ (CmmData sec d) = return @@ -207,7 +207,7 @@ linearRegAlloc -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc config entry_ids block_live sccs = case platformArch platform of @@ -228,7 +228,7 @@ linearRegAlloc config entry_ids block_live sccs ArchUnknown -> panic "linearRegAlloc ArchUnknown" where go :: (FR regs, Outputable regs) - => regs -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + => regs -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) go f = linearRegAlloc' config f entry_ids block_live sccs platform = ncgPlatform config @@ -244,14 +244,14 @@ linearRegAlloc' -> [BlockId] -- ^ entry points -> BlockMap RegSet -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc' config initFreeRegs entry_ids block_live sccs - = do us <- getUniqueSupplyM - let !(_, !stack, !stats, !blocks) = - runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us - $ linearRA_SCCs entry_ids block_live [] sccs - return (blocks, stats, getStackUse stack) + = UDSM $ \us -> do + let !(_, !stack, !stats, !blocks, us') = + runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us + $ linearRA_SCCs entry_ids block_live [] sccs + in DUniqResult (blocks, stats, getStackUse stack) us' linearRA_SCCs :: OutputableRegConstraint freeRegs instr ===================================== compiler/GHC/CmmToAsm/Reg/Linear/Base.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Platform.Reg import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Label import GHC.CmmToAsm.Reg.Utils @@ -170,7 +170,7 @@ data RA_State freeRegs , ra_stack :: StackMap -- | unique supply for generating names for join point fixup blocks. - , ra_us :: UniqSupply + , ra_us :: DUniqSupply -- | Record why things were spilled, for -ddrop-asm-stats. -- Just keep a list here instead of a map of regs -> reasons. ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Cmm.BlockId import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Exts (oneShot) import Control.Monad (ap) @@ -91,9 +91,9 @@ runR :: NCGConfig -> freeRegs -> RegMap Loc -> StackMap - -> UniqSupply + -> DUniqSupply -> RegM freeRegs a - -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a) + -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a, DUniqSupply) runR config block_assig freeregs assig stack us thing = case unReg thing @@ -109,7 +109,7 @@ runR config block_assig freeregs assig stack us thing = , ra_fixups = [] }) of RA_Result state returned_thing - -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing) + -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing, ra_us state) -- | Make register allocator stats from its final state. @@ -169,7 +169,7 @@ getDeltaR = mkRegM $ \s -> RA_Result s (ra_delta s) getUniqueR :: RegM freeRegs Unique getUniqueR = mkRegM $ \s -> - case takeUniqFromSupply (ra_us s) of + case takeUniqueFromDSupply (ra_us s) of (uniq, us) -> RA_Result s{ra_us = us} uniq ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Data.Bag import GHC.Utils.Monad.State.Strict @@ -690,7 +690,7 @@ cmmTopLiveness => Maybe CFG -> Platform -> NatCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) cmmTopLiveness cfg platform cmm = regLiveness platform $ natCmmTopToLive cfg cmm @@ -784,7 +784,7 @@ regLiveness :: Instruction instr => Platform -> LiveCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) regLiveness _ (CmmData i d) = return $ CmmData i d ===================================== compiler/GHC/CmmToAsm/Wasm.hs ===================================== @@ -21,7 +21,7 @@ import GHC.Driver.DynFlags import GHC.Platform import GHC.Prelude import GHC.Settings -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Unit import GHC.Utils.Logger import GHC.Utils.Outputable (text) @@ -32,7 +32,7 @@ ncgWasm :: Logger -> Platform -> ToolSettings -> - UniqSupply -> + DUniqSupply -> ModLocation -> Handle -> Stream IO RawCmmGroup a -> @@ -58,7 +58,7 @@ ncgWasm ncg_config logger platform ts us loc h cmms = do streamCmmGroups :: NCGConfig -> Platform -> - UniqSupply -> + DUniqSupply -> Stream IO RawCmmGroup a -> IO (a, WasmCodeGenState 'I32) streamCmmGroups ncg_config platform us cmms = ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -48,7 +48,7 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable hiding ((<>)) import GHC.Utils.Panic import GHC.Wasm.ControlFlow.FromCmm @@ -1572,11 +1572,9 @@ lower_CmmGraph :: CLabel -> CmmGraph -> WasmCodeGenM w (FuncBody w) lower_CmmGraph lbl g = do ty_word <- wasmWordTypeM platform <- wasmPlatformM - us <- getUniqueSupplyM body <- structuredControl platform - us (\_ -> lower_CmmExpr_Typed lbl ty_word) (lower_CmmActions lbl) g ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -45,6 +45,7 @@ module GHC.CmmToAsm.Wasm.Types wasmStateM, wasmModifyM, wasmExecM, + wasmRunM ) where @@ -66,9 +67,10 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable hiding ((<>)) +import GHC.Data.Graph.Collapse (MonadUniqDSM(..)) import Unsafe.Coerce -- | WebAssembly type of a WebAssembly value that WebAssembly code @@ -419,10 +421,10 @@ data WasmCodeGenState w = WasmCodeGenState UniqFM LocalReg LocalInfo, localRegsCount :: Int, - wasmUniqSupply :: UniqSupply + wasmDUniqSupply :: DUniqSupply } -initialWasmCodeGenState :: Platform -> UniqSupply -> WasmCodeGenState w +initialWasmCodeGenState :: Platform -> DUniqSupply -> WasmCodeGenState w initialWasmCodeGenState platform us = WasmCodeGenState { wasmPlatform = @@ -436,12 +438,17 @@ initialWasmCodeGenState platform us = [], localRegs = emptyUFM, localRegsCount = 0, - wasmUniqSupply = us + wasmDUniqSupply = us } newtype WasmCodeGenM w a = WasmCodeGenM (State (WasmCodeGenState w) a) deriving newtype (Functor, Applicative, Monad) +instance MonadUniqDSM (WasmCodeGenM w) where + liftUniqDSM (UDSM m) = wasmStateM $ \st -> + let DUniqResult a us' = m (wasmDUniqSupply st) + in (# a, st{wasmDUniqSupply=us'} #) + wasmGetsM :: (WasmCodeGenState w -> a) -> WasmCodeGenM w a wasmGetsM = coerce . gets @@ -465,18 +472,13 @@ wasmStateM = coerce . State wasmModifyM :: (WasmCodeGenState w -> WasmCodeGenState w) -> WasmCodeGenM w () wasmModifyM = coerce . modify -wasmEvalM :: WasmCodeGenM w a -> WasmCodeGenState w -> a -wasmEvalM (WasmCodeGenM s) = evalState s - wasmExecM :: WasmCodeGenM w a -> WasmCodeGenState w -> WasmCodeGenState w wasmExecM (WasmCodeGenM s) = execState s -instance MonadUnique (WasmCodeGenM w) where - getUniqueSupplyM = wasmGetsM wasmUniqSupply +wasmRunM :: WasmCodeGenM w a -> WasmCodeGenState w -> (a, WasmCodeGenState w) +wasmRunM (WasmCodeGenM s) = runState s + +instance MonadGetUnique (WasmCodeGenM w) where getUniqueM = wasmStateM $ - \s at WasmCodeGenState {..} -> case takeUniqFromSupply wasmUniqSupply of - (u, us) -> (# u, s {wasmUniqSupply = us} #) - getUniquesM = do - u <- getUniqueM - s <- WasmCodeGenM get - pure $ u:(wasmEvalM getUniquesM s) + \s at WasmCodeGenState {..} -> case takeUniqueFromDSupply wasmDUniqSupply of + (u, us) -> (# u, s {wasmDUniqSupply = us} #) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -79,7 +79,7 @@ import GHC.Utils.Constants (debugIsOn) import GHC.Utils.Panic import GHC.Data.FastString import GHC.Utils.Misc -import GHC.Types.Unique.Supply ( getUniqueM ) +import GHC.Types.Unique.DSM ( getUniqueM ) import Control.Monad import Data.Foldable (fold) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -64,7 +64,7 @@ import GHC.Platform import GHC.Cmm.CLabel import GHC.Types.Unique.Set import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Basic (Alignment) import GHC.Cmm.DebugBlock (UnwindTable) @@ -987,13 +987,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -1002,8 +1002,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToLlvm/Base.hs ===================================== @@ -56,6 +56,7 @@ import GHC.Types.Unique import GHC.Utils.BufHandle ( BufHandle ) import GHC.Types.Unique.Set import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Utils.Logger import Data.Maybe (fromJust) @@ -300,6 +301,13 @@ instance MonadUnique LlvmM where tag <- getEnv envTag liftIO $! uniqFromTag tag +-- TODO: If you want Llvm code to be deterministic, this should use a +-- deterministic unique supply to get the Id. +instance DSM.MonadGetUnique LlvmM where + getUniqueM = do + tag <- getEnv envTag + liftIO $! uniqFromTag tag + -- | Lifting of IO actions. Not exported, as we want to encapsulate IO. liftIO :: IO a -> LlvmM a liftIO m = LlvmM $ \env -> do x <- m ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -11,7 +11,7 @@ module GHC.Data.Graph.Collapse , VizCollapseMonad(..) , NullCollapseViz(..) , runNullCollapse - , MonadUniqSM(..) + , MonadUniqDSM(..) ) where @@ -24,7 +24,7 @@ import Data.Semigroup import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Inductive.Graph -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic hiding (assert) @@ -59,23 +59,21 @@ Functional Graph Library (Hackage package `fgl`, modules -- care about visualization, you would use the `NullCollapseViz` -- monad, in which these operations are no-ops. -class (Monad m) => MonadUniqSM m where - liftUniqSM :: UniqSM a -> m a +class (Monad m) => MonadUniqDSM m where + liftUniqDSM :: UniqDSM a -> m a -class (MonadUniqSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where +class (MonadUniqDSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where consumeByInGraph :: Node -> Node -> gr s () -> m () splitGraphAt :: gr s () -> LNode s -> m () finalGraph :: gr s () -> m () - - -- | The identity monad as a `VizCollapseMonad`. Use this monad when -- you want efficiency in graph collapse. -newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqSM a } - deriving (Functor, Applicative, Monad, MonadUnique) +newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqDSM a } + deriving (Functor, Applicative, Monad, MonadGetUnique) -instance MonadUniqSM NullCollapseViz where - liftUniqSM = NullCollapseViz +instance MonadUniqDSM NullCollapseViz where + liftUniqDSM = NullCollapseViz instance (Graph gr, Supernode s NullCollapseViz) => VizCollapseMonad NullCollapseViz gr s where @@ -83,7 +81,7 @@ instance (Graph gr, Supernode s NullCollapseViz) => splitGraphAt _ _ = return () finalGraph _ = return () -runNullCollapse :: NullCollapseViz a -> UniqSM a +runNullCollapse :: NullCollapseViz a -> UniqDSM a runNullCollapse = unNCV @@ -158,7 +156,7 @@ class (Semigroup node) => PureSupernode node where superLabel :: node -> Label mapLabels :: (Label -> Label) -> (node -> node) -class (MonadUnique m, PureSupernode node) => Supernode node m where +class (MonadGetUnique m, PureSupernode node) => Supernode node m where freshen :: node -> m node -- ghost method ===================================== compiler/GHC/Driver/CodeOutput.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Unit.Finder ( mkStubPaths ) import GHC.Types.SrcLoc import GHC.Types.CostCentre import GHC.Types.ForeignStubs -import GHC.Types.Unique.Supply ( mkSplitUniqSupply ) +import GHC.Types.Unique.DSM import System.Directory import System.FilePath @@ -198,7 +198,7 @@ outputAsm :: Logger -> Stream IO RawCmmGroup a -> IO a outputAsm logger dflags this_mod location filenm cmm_stream = do - ncg_uniqs <- mkSplitUniqSupply 'n' + let ncg_uniqs = initDUniqSupply 'n' 0 {- See Note [Cmm Local Deterministic Uniques], or should we receive it as input?-} debugTraceMsg logger 4 (text "Outputing asm to" <+> text filenm) let ncg_config = initNCGConfig dflags this_mod {-# SCC "OutputAsm" #-} doOutput filenm $ ===================================== compiler/GHC/StgToCmm/ExtCode.hs ===================================== @@ -57,6 +57,7 @@ import GHC.Unit.Module import GHC.Types.Unique.FM import GHC.Types.Unique import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import Control.Monad (ap) import GHC.Utils.Outputable (SDocContext) @@ -102,6 +103,9 @@ instance MonadUnique CmmParse where u <- getUniqueM return (decls, u) +instance DSM.MonadGetUnique CmmParse where + getUniqueM = GHC.Types.Unique.Supply.getUniqueM + getProfile :: CmmParse Profile getProfile = EC (\_ _ d -> (d,) <$> F.getProfile) ===================================== compiler/GHC/Types/Unique/DSM.hs ===================================== @@ -0,0 +1,97 @@ +{-# LANGUAGE UnboxedTuples, PatternSynonyms #-} +module GHC.Types.Unique.DSM where + +import GHC.Prelude +import GHC.Word +import Control.Monad.Fix +import GHC.Types.Unique +import qualified GHC.Types.Unique.Supply as USM + +-- todo: Do I need to use the one-shot state monad trick? Probably yes. + +-- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. + +-- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic +-- there, but without the unboxing it feels? Maybe not, since we carry the +-- mappings too. + +newtype DUniqSupply = DUS Word64 -- supply uniques iteratively +type DUniqResult result = (# result, DUniqSupply #) + +pattern DUniqResult :: a -> b -> (# a, b #) +pattern DUniqResult x y = (# x, y #) +{-# COMPLETE DUniqResult #-} + +-- | A monad which just gives the ability to obtain 'Unique's deterministically. +-- There's no splitting. +newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } + deriving Functor + +instance Monad UniqDSM where + (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of + DUniqResult result us1 -> unUDSM (cont result) us1 + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} + +instance Applicative UniqDSM where + pure result = UDSM (DUniqResult result) + (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of + DUniqResult ff us1 -> case x us1 of + DUniqResult xx us2 -> DUniqResult (ff xx) us2 + (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of + DUniqResult _ us1 -> cont us1 + {-# INLINE pure #-} + {-# INLINE (*>) #-} + +instance MonadFix UniqDSM where + mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) + +getUniqueDSM :: UniqDSM Unique +getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) + +takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) +takeUniqueFromDSupply d = + case unUDSM getUniqueDSM d of + DUniqResult x y -> (x, y) + +-- Write Note about the importance of locality in uniques that are deterministic +-- +-- If you use a tag which collides with other names, you'll get a uniques +-- deterministically colliding with existing symbols. +-- +-- (e.g. easy to observe if you do this wrong) +-- +-- Ideally, we'd thread the same deterministic unique supply all the way +-- throughout the Cmm pipeline, starting off from hte deterministic rename +-- pass. +initDUniqSupply :: Char -> Word64 -> DUniqSupply +initDUniqSupply c firstUniq = + let !tag = mkTag c + in DUS (tag .|. firstUniq) + +newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply +newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c + +runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) +runUniqueDSM ds (UDSM f) = + case f ds of + DUniqResult uq us -> (uq, us) + +-- Add explanation on how this gives you a deterministic way of getting uniques +-- if the instance uses a deterministic unique supply. +class Monad m => MonadGetUnique m where + getUniqueM :: m Unique + +instance MonadGetUnique UniqDSM where + getUniqueM = getUniqueDSM + +instance MonadGetUnique USM.UniqSM where + getUniqueM = USM.getUniqueM + +{- +Note [Cmm Local Deterministic Uniques] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TODO!!!!! +TODO!!!!! +-} ===================================== compiler/GHC/Wasm/ControlFlow/FromCmm.hs ===================================== @@ -21,10 +21,11 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Reducibility import GHC.Cmm.Switch +import GHC.Data.Graph.Collapse (MonadUniqDSM (liftUniqDSM)) import GHC.CmmToAsm.Wasm.Types import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Misc import GHC.Utils.Panic import GHC.Utils.Outputable ( Outputable, text, (<+>), ppr @@ -138,22 +139,20 @@ emptyPost _ = False -- | Convert a Cmm CFG to WebAssembly's structured control flow. structuredControl :: forall expr stmt m . - Applicative m + MonadUniqDSM m => Platform -- ^ needed for offset calculation - -> UniqSupply -> (Label -> CmmExpr -> m expr) -- ^ translator for expressions -> (Label -> CmmActions -> m stmt) -- ^ translator for straight-line code -> CmmGraph -- ^ CFG to be translated -> m (WasmControl stmt expr '[] '[ 'I32]) -structuredControl platform us txExpr txBlock g' = - doTree returns dominatorTree emptyContext - where +structuredControl platform txExpr txBlock g' = do + gwd :: GraphWithDominators CmmNode <- + liftUniqDSM $ asReducible $ graphWithDominators g' + + let g :: CmmGraph g = gwd_graph gwd - gwd :: GraphWithDominators CmmNode - gwd = initUs_ us $ asReducible $ graphWithDominators g' - dominatorTree :: Tree.Tree CmmBlock-- Dominator tree in which children are sorted -- with highest reverse-postorder number first dominatorTree = fmap blockLabeled $ sortTree $ gwdDominatorTree gwd @@ -313,7 +312,7 @@ structuredControl platform us txExpr txBlock g' = dominates lbl blockname = lbl == blockname || dominatorsMember lbl (gwdDominatorsOf gwd blockname) - + doTree returns dominatorTree emptyContext nodeBody :: CmmBlock -> CmmActions nodeBody (BlockCC _first middle _last) = middle ===================================== compiler/ghc.cabal.in ===================================== @@ -894,6 +894,7 @@ Library GHC.Types.Unique GHC.Types.Unique.DFM GHC.Types.Unique.DSet + GHC.Types.Unique.DSM GHC.Types.Unique.FM GHC.Types.Unique.Map GHC.Types.Unique.MemoFun View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f8ae759bae9cb4d417ecacf590d4a721df2711d8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f8ae759bae9cb4d417ecacf590d4a721df2711d8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 10:39:34 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 06:39:34 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Major progress in using UniqDSM in CmmToAsm and Ncg backends Message-ID: <66852a6645e5f_11373f10ad1dc7106e@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 0cfb5e67 by Rodrigo Mesquita at 2024-07-03T11:39:07+01:00 Major progress in using UniqDSM in CmmToAsm and Ncg backends - - - - - 28 changed files: - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/Base.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/Driver/CodeOutput.hs - compiler/GHC/StgToCmm/ExtCode.hs - + compiler/GHC/Types/Unique/DSM.hs - compiler/GHC/Wasm/ControlFlow/FromCmm.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/BlockId.hs ===================================== @@ -15,7 +15,7 @@ import GHC.Data.FastString import GHC.Types.Id.Info import GHC.Types.Name import GHC.Types.Unique -import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Cmm.Dataflow.Label (Label, mkHooplLabel) @@ -36,8 +36,12 @@ type BlockId = Label mkBlockId :: Unique -> BlockId mkBlockId unique = mkHooplLabel $ getKey unique -newBlockId :: MonadUnique m => m BlockId -newBlockId = mkBlockId <$> getUniqueM +-- If the monad unique instance uses a deterministic unique supply, this will +-- give you a deterministic unique. Otherwise, it will not. Note that from Cmm +-- onwards (after deterministic renaming in 'codeGen'), there should only exist +-- deterministic block labels. +newBlockId :: DSM.MonadGetUnique m => m BlockId +newBlockId = mkBlockId <$> DSM.getUniqueM blockLbl :: BlockId -> CLabel blockLbl label = mkLocalBlockLabel (getUnique label) ===================================== compiler/GHC/Cmm/Reducibility.hs ===================================== @@ -47,7 +47,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Collapse import GHC.Data.Graph.Inductive.Graph import GHC.Data.Graph.Inductive.PatriciaTree -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic -- | Represents the result of a reducibility analysis. @@ -81,7 +81,7 @@ reducibility gwd = -- control-flow graph. asReducible :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) asReducible gwd = case reducibility gwd of Reducible -> return gwd Irreducible -> assertReducible <$> nodeSplit gwd @@ -97,7 +97,7 @@ assertReducible gwd = case reducibility gwd of -- irreducible. nodeSplit :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) nodeSplit gwd = graphWithDominators <$> inflate (g_entry g) <$> runNullCollapse collapsed where g = gwd_graph gwd @@ -181,7 +181,7 @@ instance PureSupernode CmmSuper where mapLabels = changeLabels instance Supernode CmmSuper NullCollapseViz where - freshen s = liftUniqSM $ relabel s + freshen s = liftUniqDSM $ relabel s -- | Return all labels defined within a supernode. @@ -212,11 +212,11 @@ changeBlockLabels f block = blockJoin entry' middle exit' -- | Within the given supernode, replace every defined label (and all -- of its uses) with a fresh label. -relabel :: CmmSuper -> UniqSM CmmSuper +relabel :: CmmSuper -> UniqDSM CmmSuper relabel node = do finite_map <- foldM addPair mapEmpty $ definedLabels node return $ changeLabels (labelChanger finite_map) node - where addPair :: LabelMap Label -> Label -> UniqSM (LabelMap Label) + where addPair :: LabelMap Label -> Label -> UniqDSM (LabelMap Label) addPair map old = do new <- newBlockId return $ mapInsert old new map labelChanger :: LabelMap Label -> (Label -> Label) ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -7,6 +7,8 @@ module GHC.Cmm.UniqueRenamer -- Careful! Not for general use! , DetUniqFM, emptyDetUFM + + , module GHC.Types.Unique.DSM ) where @@ -28,6 +30,7 @@ import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) import GHC.Types.Id import qualified GHC.Types.Unique.Supply as USM +import GHC.Types.Unique.DSM {- -------------------------------------------------------------------------------- @@ -276,93 +279,3 @@ instance (UniqRenamable a) => UniqRenamable (Maybe a) where panicMapKeysNotInjective :: a -> b -> c panicMapKeysNotInjective _ _ = error "this should be impossible because the function which maps keys should be injective" --------------------------------------------------------------------------------- --- UniqDSM (ToDo: For this to make sense in this module, rename the module to --- something like GHC.Cmm.UniqueDeterminism). Write notes.... - --- todo: Do I need to use the one-shot state monad trick? Probably yes. - --- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. - --- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic --- there, but without the unboxing it feels? Maybe not, since we carry the --- mappings too. - -newtype DUniqSupply = DUS Word64 -- supply uniques iteratively -type DUniqResult result = (# result, DUniqSupply #) - -pattern DUniqResult :: a -> b -> (# a, b #) -pattern DUniqResult x y = (# x, y #) -{-# COMPLETE DUniqResult #-} - --- | A monad which just gives the ability to obtain 'Unique's deterministically. --- There's no splitting. -newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } - deriving Functor - -instance Monad UniqDSM where - (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of - DUniqResult result us1 -> unUDSM (cont result) us1 - (>>) = (*>) - {-# INLINE (>>=) #-} - {-# INLINE (>>) #-} - -instance Applicative UniqDSM where - pure result = UDSM (DUniqResult result) - (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of - DUniqResult ff us1 -> case x us1 of - DUniqResult xx us2 -> DUniqResult (ff xx) us2 - (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of - DUniqResult _ us1 -> cont us1 - {-# INLINE pure #-} - {-# INLINE (*>) #-} - -instance MonadFix UniqDSM where - mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) - -getUniqueDSM :: UniqDSM Unique -getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) - -takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) -takeUniqueFromDSupply d = - case unUDSM getUniqueDSM d of - DUniqResult x y -> (x, y) - --- Write Note about the importance of locality in uniques that are deterministic --- --- If you use a tag which collides with other names, you'll get a uniques --- deterministically colliding with existing symbols. --- --- (e.g. easy to observe if you do this wrong) --- --- Ideally, we'd thread the same deterministic unique supply all the way --- throughout the Cmm pipeline, starting off from hte deterministic rename --- pass. -initDUniqSupply :: Char -> Word64 -> DUniqSupply -initDUniqSupply c firstUniq = - let !tag = mkTag c - in DUS (tag .|. firstUniq) - -newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply -newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c - -runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) -runUniqueDSM ds (UDSM f) = - case f ds of - DUniqResult uq us -> (uq, us) - -class Monad m => MonadGetUnique m where - getUniqueM :: m Unique - -instance MonadGetUnique UniqDSM where - getUniqueM = getUniqueDSM - -instance MonadGetUnique USM.UniqSM where - getUniqueM = USM.getUniqueM - -{- -Note [Cmm Local Deterministic Uniques] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -TODO!!!!! -TODO!!!!! --} ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -100,7 +100,7 @@ import GHC.Cmm.GenericOpt import GHC.Cmm.CLabel import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Driver.DynFlags import GHC.Driver.Ppr import GHC.Utils.Misc @@ -129,7 +129,7 @@ import System.IO import System.Directory ( getCurrentDirectory ) -------------------- -nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> UniqSupply +nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen logger ts config modLoc h us cmms @@ -203,7 +203,7 @@ nativeCodeGen' :: (OutputableP Platform statics, Outputable jumpDest, Instructio -> ModLocation -> NcgImpl statics instr jumpDest -> Handle - -> UniqSupply + -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen' logger config modLoc ncgImpl h us cmms @@ -223,9 +223,9 @@ finishNativeGen :: Instruction instr -> NCGConfig -> ModLocation -> BufHandle - -> UniqSupply + -> DUniqSupply -> NativeGenAcc statics instr - -> IO UniqSupply + -> IO DUniqSupply finishNativeGen logger config modLoc bufh us ngs = withTimingSilent logger (text "NCG") (`seq` ()) $ do -- Write debug data and finish @@ -284,19 +284,19 @@ cmmNativeGenStream :: forall statics jumpDest instr a . (OutputableP Platform st -> ModLocation -> NcgImpl statics instr jumpDest -> BufHandle - -> UniqSupply + -> DUniqSupply -> Stream.Stream IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) cmmNativeGenStream logger config modLoc ncgImpl h us cmm_stream ngs = loop us (Stream.runStream cmm_stream) ngs where ncglabel = text "NCG" - loop :: UniqSupply + loop :: DUniqSupply -> Stream.StreamS IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) loop us s ngs = case s of Stream.Done a -> @@ -345,17 +345,17 @@ cmmNativeGens :: forall statics instr jumpDest. -> NcgImpl statics instr jumpDest -> BufHandle -> LabelMap DebugBlock - -> UniqSupply + -> DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) cmmNativeGens logger config ncgImpl h dbgMap = go where - go :: UniqSupply -> [RawCmmDecl] + go :: DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) go us [] ngs !_ = return (ngs, us) @@ -424,12 +424,12 @@ cmmNativeGen :: forall statics instr jumpDest. (Instruction instr, OutputableP Platform statics, Outputable jumpDest) => Logger -> NcgImpl statics instr jumpDest - -> UniqSupply + -> DUniqSupply -> DwarfFiles -> LabelMap DebugBlock -> RawCmmDecl -- ^ the cmm to generate code for -> Int -- ^ sequence number of this top thing - -> IO ( UniqSupply + -> IO ( DUniqSupply , DwarfFiles , [NatCmmDecl statics instr] -- native code , [CLabel] -- things imported by this cmm @@ -468,7 +468,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- generate native code from cmm let ((native, lastMinuteImports, fileIds', nativeCfgWeights), usGen) = {-# SCC "genMachCode" #-} - initUs us $ genMachCode config + runUniqueDSM us $ genMachCode config (cmmTopCodeGen ncgImpl) fileIds dbgMap opt_cmm cmmCfg @@ -486,7 +486,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count else Nothing let (withLiveness, usLive) = {-# SCC "regLiveness" #-} - initUs usGen + runUniqueDSM usGen $ mapM (cmmTopLiveness livenessCfg platform) native putDumpFileMaybe logger @@ -494,8 +494,6 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count FormatCMM (vcat $ map (pprLiveCmmDecl platform) withLiveness) - -- ROMES:TODO: RENAME VIRTUAL REGISTERS DETERMINISTICALLY - -- allocate registers (alloced, usAlloc, ppr_raStatsColor, ppr_raStatsLinear, raStats, stack_updt_blks) <- if ( ncgRegsGraph config || ncgRegsIterative config ) @@ -510,7 +508,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- do the graph coloring register allocation let ((alloced, maybe_more_stack, regAllocStats), usAlloc) = {-# SCC "RegAlloc-color" #-} - initUs usLive + runUniqueDSM usLive $ Color.regAlloc config alloc_regs @@ -520,13 +518,13 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count livenessCfg let ((alloced', stack_updt_blks), usAlloc') - = initUs usAlloc $ - case maybe_more_stack of - Nothing -> return (alloced, []) - Just amount -> do - (alloced',stack_updt_blks) <- unzip <$> - (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) - return (alloced', concat stack_updt_blks ) + = runUniqueDSM usAlloc $ + case maybe_more_stack of + Nothing -> return (alloced, []) + Just amount -> do + (alloced',stack_updt_blks) <- unzip <$> + (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) + return (alloced', concat stack_updt_blks ) -- dump out what happened during register allocation @@ -571,7 +569,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count let ((alloced, regAllocStats, stack_updt_blks), usAlloc) = {-# SCC "RegAlloc-linear" #-} - initUs usLive + runUniqueDSM usLive $ liftM unzip3 $ mapM reg_alloc withLiveness @@ -643,7 +641,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- sequenced :: [NatCmmDecl statics instr] let (sequenced, us_seq) = {-# SCC "sequenceBlocks" #-} - initUs usAlloc $ mapM (BlockLayout.sequenceTop + runUniqueDSM usAlloc $ mapM (BlockLayout.sequenceTop ncgImpl optimizedCFG) shorted @@ -913,7 +911,7 @@ genMachCode -> LabelMap DebugBlock -> RawCmmDecl -> CFG - -> UniqSM + -> UniqDSM ( [NatCmmDecl statics instr] , [CLabel] , DwarfFiles @@ -921,15 +919,16 @@ genMachCode ) genMachCode config cmmTopCodeGen fileIds dbgMap cmm_top cmm_cfg - = do { initial_us <- getUniqueSupplyM - ; let initial_st = mkNatM_State initial_us 0 config - fileIds dbgMap cmm_cfg - (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) - final_delta = natm_delta final_st - final_imports = natm_imports final_st - final_cfg = natm_cfg final_st - ; if final_delta == 0 - then return (new_tops, final_imports - , natm_fileid final_st, final_cfg) - else pprPanic "genMachCode: nonzero final delta" (int final_delta) - } + = UDSM $ \initial_us -> do + { let initial_st = mkNatM_State initial_us 0 config + fileIds dbgMap cmm_cfg + (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) + final_delta = natm_delta final_st + final_imports = natm_imports final_st + final_cfg = natm_cfg final_st + ; if final_delta == 0 + then DUniqResult + (new_tops, final_imports + , natm_fileid final_st, final_cfg) (natm_us final_st) + else DUniqResult (pprPanic "genMachCode: nonzero final delta" (int final_delta)) undefined + } ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -1,4 +1,4 @@ -{-# language GADTs #-} +{-# language GADTs, LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module GHC.CmmToAsm.AArch64.CodeGen ( cmmTopCodeGen @@ -44,7 +44,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM -- The rest: import GHC.Data.OrdList @@ -1440,7 +1440,7 @@ genCondJump bid expr = do _ -> pprPanic "AArch64.genCondJump: " (text $ show expr) -- A conditional jump with at least +/-128M jump range -genCondFarJump :: MonadUnique m => Cond -> Target -> m InstrBlock +genCondFarJump :: MonadGetUnique m => Cond -> Target -> m InstrBlock genCondFarJump cond far_target = do skip_lbl_id <- newBlockId jmp_lbl_id <- newBlockId @@ -2272,7 +2272,7 @@ data BlockInRange = InRange | NotInRange Target -- See Note [AArch64 far jumps] makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches {- only used when debugging -} _platform statics basic_blocks = do -- All offsets/positions are counted in multiples of 4 bytes (the size of AArch64 instructions) -- That is an offset of 1 represents a 4-byte/one instruction offset. @@ -2293,7 +2293,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = long_bz_jump_size = 4 :: Int -- Replace out of range conditional jumps with unconditional jumps. - replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqSM (Int, [GenBasicBlock Instr]) + replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqDSM (Int, [GenBasicBlock Instr]) replace_blk !m !pos (BasicBlock lbl instrs) = do -- Account for a potential info table before the label. let !block_pos = pos + infoTblSize_maybe lbl @@ -2307,12 +2307,14 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = let final_blocks = BasicBlock lbl top : split_blocks pure (pos', final_blocks) - replace_jump :: LabelMap Int -> Int -> Instr -> UniqSM (Int, [Instr]) + replace_jump :: LabelMap Int -> Int -> Instr -> UniqDSM (Int, [Instr]) replace_jump !m !pos instr = do case instr of ANN ann instr -> do - (idx,instr':instrs') <- replace_jump m pos instr - pure (idx, ANN ann instr':instrs') + replace_jump m pos instr >>= \case + (idx,instr':instrs') -> + pure (idx, ANN ann instr':instrs') + (idx,[]) -> pprPanic "replace_jump" (text "empty return list for " <+> ppr idx) BCOND cond t -> case target_in_range m t pos of InRange -> pure (pos+long_bc_jump_size,[instr]) ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -23,7 +23,7 @@ import GHC.Cmm import GHC.Cmm.CLabel import GHC.Utils.Outputable import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic @@ -473,13 +473,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -488,8 +488,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -48,7 +48,7 @@ import Data.STRef import Control.Monad.ST.Strict import Control.Monad (foldM, unless) import GHC.Data.UnionFind -import GHC.Types.Unique.Supply (UniqSM) +import GHC.Types.Unique.DSM (UniqDSM) {- Note [CFG based code layout] @@ -793,7 +793,7 @@ sequenceTop => NcgImpl statics instr jumpDest -> Maybe CFG -- ^ CFG if we have one. -> NatCmmDecl statics instr -- ^ Function to serialize - -> UniqSM (NatCmmDecl statics instr) + -> UniqDSM (NatCmmDecl statics instr) sequenceTop _ _ top@(CmmData _ _) = pure top sequenceTop ncgImpl edgeWeights (CmmProc info lbl live (ListGraph blocks)) = do ===================================== compiler/GHC/CmmToAsm/Dwarf.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Unit.Module import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.CmmToAsm.Dwarf.Constants import GHC.CmmToAsm.Dwarf.Types @@ -31,8 +31,7 @@ import System.FilePath import qualified GHC.Cmm.Dataflow.Label as H -- | Generate DWARF/debug information -dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] - -> (doc, UniqSupply) +dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (doc, DUniqSupply) dwarfGen _ _ _ us [] = (empty, us) dwarfGen compPath config modLoc us blocks = let platform = ncgPlatform config @@ -65,7 +64,7 @@ dwarfGen compPath config modLoc us blocks = -- .debug_info section: Information records on procedures and blocks -- unique to identify start and end compilation unit .debug_inf - (unitU, us') = takeUniqFromSupply us + (unitU, us') = takeUniqueFromDSupply us infoSct = vcat [ line (dwarfInfoLabel <> colon) , dwarfInfoSection platform , compileUnitHeader platform unitU @@ -79,7 +78,7 @@ dwarfGen compPath config modLoc us blocks = line (dwarfLineLabel <> colon) -- .debug_frame section: Information about the layout of the GHC stack - (framesU, us'') = takeUniqFromSupply us' + (framesU, us'') = takeUniqueFromDSupply us' frameSct = dwarfFrameSection platform $$ line (dwarfFrameLabel <> colon) $$ pprDwarfFrame platform (debugFrame platform framesU procs) @@ -90,8 +89,8 @@ dwarfGen compPath config modLoc us blocks = aranges = dwarfARangesSection platform $$ pprDwarfARanges platform aranges' unitU in (infoSct $$ abbrevSct $$ lineSct $$ frameSct $$ aranges, us'') -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (SDoc, UniqSupply) #-} -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (HDoc, UniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (SDoc, DUniqSupply) #-} +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (HDoc, DUniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Build an address range entry for one proc. -- With split sections, each proc needs its own entry, since they may get ===================================== compiler/GHC/CmmToAsm/Monad.hs ===================================== @@ -62,7 +62,7 @@ import GHC.Cmm.Expr (LocalReg (..), isWord64) import GHC.Data.FastString ( FastString ) import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Unique ( Unique ) import GHC.Unit.Module @@ -109,11 +109,11 @@ data NcgImpl statics instr jumpDest = NcgImpl { maxSpillSlots :: Int, allocatableRegs :: [RealReg], ncgAllocMoreStack :: Int -> NatCmmDecl statics instr - -> UniqSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), + -> UniqDSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), -- ^ The list of block ids records the redirected jumps to allow us to update -- the CFG. ncgMakeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock instr] - -> UniqSM [NatBasicBlock instr], + -> UniqDSM [NatBasicBlock instr], extractUnwindPoints :: [instr] -> [UnwindPoint], -- ^ given the instruction sequence of a block, produce a list of -- the block's 'UnwindPoint's @@ -178,7 +178,7 @@ mistake would readily show up in performance tests). -} data NatM_State = NatM_State { - natm_us :: UniqSupply, + natm_us :: DUniqSupply, natm_delta :: Int, -- ^ Stack offset for unwinding information natm_imports :: [(CLabel)], natm_pic :: Maybe Reg, @@ -205,7 +205,7 @@ pattern NatM f <- NatM' (runState -> f) unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a -mkNatM_State :: UniqSupply -> Int -> NCGConfig -> +mkNatM_State :: DUniqSupply -> Int -> NCGConfig -> DwarfFiles -> LabelMap DebugBlock -> CFG -> NatM_State mkNatM_State us delta config = \dwf dbg cfg -> @@ -223,19 +223,13 @@ mkNatM_State us delta config initNat :: NatM_State -> NatM a -> (a, NatM_State) initNat = flip unNat -instance MonadUnique NatM where - getUniqueSupplyM = NatM $ \st -> - case splitUniqSupply (natm_us st) of - (us1, us2) -> (us1, st {natm_us = us2}) - +instance MonadGetUnique NatM where getUniqueM = NatM $ \st -> - case takeUniqFromSupply (natm_us st) of - (uniq, us') -> (uniq, st {natm_us = us'}) + case takeUniqueFromDSupply (natm_us st) of + (uniq, us') -> (uniq, st {natm_us = us'}) getUniqueNat :: NatM Unique -getUniqueNat = NatM $ \ st -> - case takeUniqFromSupply $ natm_us st of - (uniq, us') -> (uniq, st {natm_us = us'}) +getUniqueNat = getUniqueM getDeltaNat :: NatM Int getDeltaNat = NatM $ \ st -> (natm_delta st, st) ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -55,7 +55,7 @@ import GHC.Cmm.CLabel import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM (listToUFM, lookupUFM) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import Data.Foldable (toList) import qualified Data.List.NonEmpty as NE @@ -105,7 +105,7 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do @@ -117,7 +117,7 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do | entry `elem` infos -> infos | otherwise -> entry : infos - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -126,8 +126,6 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList @@ -698,7 +696,7 @@ makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches _platform info_env blocks | NE.last blockAddresses < nearLimit = return blocks | otherwise = return $ zipWith handleBlock blockAddressList blocks ===================================== compiler/GHC/CmmToAsm/Reg/Graph.hs ===================================== @@ -31,7 +31,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Misc (seqList) import GHC.CmmToAsm.CFG @@ -57,8 +57,8 @@ regAlloc -> Int -- ^ current number of spill slots -> [LiveCmmDecl statics instr] -- ^ code annotated with liveness information. -> Maybe CFG -- ^ CFG of basic blocks if available - -> UniqSM ( [NatCmmDecl statics instr] - , Maybe Int, [RegAllocStats statics instr] ) + -> UniqDSM ( [NatCmmDecl statics instr] + , Maybe Int, [RegAllocStats statics instr] ) -- ^ code with registers allocated, additional stacks required -- and stats for each stage of allocation @@ -107,7 +107,7 @@ regAlloc_spin -> [RegAllocStats statics instr] -- ^ Current regalloc stats to add to. -> [LiveCmmDecl statics instr] -- ^ Liveness annotated code to allocate. -> Maybe CFG - -> UniqSM ( [NatCmmDecl statics instr] + -> UniqDSM ( [NatCmmDecl statics instr] , [RegAllocStats statics instr] , Int -- Slots in use , Color.Graph VirtualReg RegClass RealReg) @@ -305,7 +305,7 @@ regAlloc_spin config spinCount triv regsFree slotsFree slotsCount debug_codeGrap buildGraph :: Instruction instr => [LiveCmmDecl statics instr] - -> UniqSM (Color.Graph VirtualReg RegClass RealReg) + -> UniqDSM (Color.Graph VirtualReg RegClass RealReg) buildGraph code = do ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -22,7 +22,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -52,7 +52,7 @@ regSpill -> UniqSet Int -- ^ available stack slots -> Int -- ^ current number of spill slots. -> UniqSet VirtualReg -- ^ the regs to spill - -> UniqSM + -> UniqDSM ([LiveCmmDecl statics instr] -- code with SPILL and RELOAD meta instructions added. , UniqSet Int -- left over slots @@ -81,17 +81,20 @@ regSpill platform code slotsFree slotCount regs -- See Note [Unique Determinism and code generation] -- Grab the unique supply from the monad. - us <- getUniqueSupplyM + UDSM $ \us -> - -- Run the spiller on all the blocks. - let (code', state') = - runState (mapM (regSpill_top platform regSlotMap) code) - (initSpillS us) + -- Run the spiller on all the blocks. + let (code', state') = + runState (mapM (regSpill_top platform regSlotMap) code) + (initSpillS us) - return ( code' + in DUniqResult + ( code' , minusUniqSet slotsFree (mkUniqSet slots) , slotCount , makeSpillStats state') + ( stateUS state' ) + -- | Spill some registers to stack slots in a top-level thing. @@ -323,21 +326,28 @@ patchReg1 old new instr -- Spiller monad -------------------------------------------------------------- -- | State monad for the spill code generator. -type SpillM a - = State SpillS a +type SpillM = State SpillS -- | Spill code generator state. data SpillS = SpillS { -- | Unique supply for generating fresh vregs. - stateUS :: UniqSupply + stateUS :: DUniqSupply -- | Spilled vreg vs the number of times it was loaded, stored. , stateSpillSL :: UniqFM Reg (Reg, Int, Int) } +instance MonadGetUnique SpillM where + getUniqueM = do + us <- gets stateUS + case takeUniqueFromDSupply us of + (uniq, us') + -> do modify $ \s -> s { stateUS = us' } + return uniq + -- | Create a new spiller state. -initSpillS :: UniqSupply -> SpillS +initSpillS :: DUniqSupply -> SpillS initSpillS uniqueSupply = SpillS { stateUS = uniqueSupply @@ -346,12 +356,7 @@ initSpillS uniqueSupply -- | Allocate a new unique in the spiller monad. newUnique :: SpillM Unique -newUnique - = do us <- gets stateUS - case takeUniqFromSupply us of - (uniq, us') - -> do modify $ \s -> s { stateUS = us' } - return uniq +newUnique = getUniqueM -- | Add a spill/reload count to a stats record for a register. ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -129,7 +129,7 @@ import GHC.Data.Graph.Directed import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -146,11 +146,11 @@ regAlloc :: Instruction instr => NCGConfig -> LiveCmmDecl statics instr - -> UniqSM ( NatCmmDecl statics instr - , Maybe Int -- number of extra stack slots required, - -- beyond maxSpillSlots - , Maybe RegAllocStats - ) + -> UniqDSM ( NatCmmDecl statics instr + , Maybe Int -- number of extra stack slots required, + -- beyond maxSpillSlots + , Maybe RegAllocStats + ) regAlloc _ (CmmData sec d) = return @@ -207,7 +207,7 @@ linearRegAlloc -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc config entry_ids block_live sccs = case platformArch platform of @@ -228,7 +228,7 @@ linearRegAlloc config entry_ids block_live sccs ArchUnknown -> panic "linearRegAlloc ArchUnknown" where go :: (FR regs, Outputable regs) - => regs -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + => regs -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) go f = linearRegAlloc' config f entry_ids block_live sccs platform = ncgPlatform config @@ -244,14 +244,14 @@ linearRegAlloc' -> [BlockId] -- ^ entry points -> BlockMap RegSet -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc' config initFreeRegs entry_ids block_live sccs - = do us <- getUniqueSupplyM - let !(_, !stack, !stats, !blocks) = - runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us - $ linearRA_SCCs entry_ids block_live [] sccs - return (blocks, stats, getStackUse stack) + = UDSM $ \us -> do + let !(_, !stack, !stats, !blocks, us') = + runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us + $ linearRA_SCCs entry_ids block_live [] sccs + in DUniqResult (blocks, stats, getStackUse stack) us' linearRA_SCCs :: OutputableRegConstraint freeRegs instr ===================================== compiler/GHC/CmmToAsm/Reg/Linear/Base.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Platform.Reg import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Label import GHC.CmmToAsm.Reg.Utils @@ -170,7 +170,7 @@ data RA_State freeRegs , ra_stack :: StackMap -- | unique supply for generating names for join point fixup blocks. - , ra_us :: UniqSupply + , ra_us :: DUniqSupply -- | Record why things were spilled, for -ddrop-asm-stats. -- Just keep a list here instead of a map of regs -> reasons. ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Cmm.BlockId import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Exts (oneShot) import Control.Monad (ap) @@ -91,9 +91,9 @@ runR :: NCGConfig -> freeRegs -> RegMap Loc -> StackMap - -> UniqSupply + -> DUniqSupply -> RegM freeRegs a - -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a) + -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a, DUniqSupply) runR config block_assig freeregs assig stack us thing = case unReg thing @@ -109,7 +109,7 @@ runR config block_assig freeregs assig stack us thing = , ra_fixups = [] }) of RA_Result state returned_thing - -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing) + -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing, ra_us state) -- | Make register allocator stats from its final state. @@ -169,7 +169,7 @@ getDeltaR = mkRegM $ \s -> RA_Result s (ra_delta s) getUniqueR :: RegM freeRegs Unique getUniqueR = mkRegM $ \s -> - case takeUniqFromSupply (ra_us s) of + case takeUniqueFromDSupply (ra_us s) of (uniq, us) -> RA_Result s{ra_us = us} uniq ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Data.Bag import GHC.Utils.Monad.State.Strict @@ -690,7 +690,7 @@ cmmTopLiveness => Maybe CFG -> Platform -> NatCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) cmmTopLiveness cfg platform cmm = regLiveness platform $ natCmmTopToLive cfg cmm @@ -784,7 +784,7 @@ regLiveness :: Instruction instr => Platform -> LiveCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) regLiveness _ (CmmData i d) = return $ CmmData i d ===================================== compiler/GHC/CmmToAsm/Wasm.hs ===================================== @@ -21,7 +21,7 @@ import GHC.Driver.DynFlags import GHC.Platform import GHC.Prelude import GHC.Settings -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Unit import GHC.Utils.Logger import GHC.Utils.Outputable (text) @@ -32,7 +32,7 @@ ncgWasm :: Logger -> Platform -> ToolSettings -> - UniqSupply -> + DUniqSupply -> ModLocation -> Handle -> Stream IO RawCmmGroup a -> @@ -58,7 +58,7 @@ ncgWasm ncg_config logger platform ts us loc h cmms = do streamCmmGroups :: NCGConfig -> Platform -> - UniqSupply -> + DUniqSupply -> Stream IO RawCmmGroup a -> IO (a, WasmCodeGenState 'I32) streamCmmGroups ncg_config platform us cmms = ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -48,7 +48,7 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable hiding ((<>)) import GHC.Utils.Panic import GHC.Wasm.ControlFlow.FromCmm @@ -1572,11 +1572,9 @@ lower_CmmGraph :: CLabel -> CmmGraph -> WasmCodeGenM w (FuncBody w) lower_CmmGraph lbl g = do ty_word <- wasmWordTypeM platform <- wasmPlatformM - us <- getUniqueSupplyM body <- structuredControl platform - us (\_ -> lower_CmmExpr_Typed lbl ty_word) (lower_CmmActions lbl) g ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -45,6 +45,7 @@ module GHC.CmmToAsm.Wasm.Types wasmStateM, wasmModifyM, wasmExecM, + wasmRunM ) where @@ -66,9 +67,10 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable hiding ((<>)) +import GHC.Data.Graph.Collapse (MonadUniqDSM(..)) import Unsafe.Coerce -- | WebAssembly type of a WebAssembly value that WebAssembly code @@ -419,10 +421,10 @@ data WasmCodeGenState w = WasmCodeGenState UniqFM LocalReg LocalInfo, localRegsCount :: Int, - wasmUniqSupply :: UniqSupply + wasmDUniqSupply :: DUniqSupply } -initialWasmCodeGenState :: Platform -> UniqSupply -> WasmCodeGenState w +initialWasmCodeGenState :: Platform -> DUniqSupply -> WasmCodeGenState w initialWasmCodeGenState platform us = WasmCodeGenState { wasmPlatform = @@ -436,12 +438,17 @@ initialWasmCodeGenState platform us = [], localRegs = emptyUFM, localRegsCount = 0, - wasmUniqSupply = us + wasmDUniqSupply = us } newtype WasmCodeGenM w a = WasmCodeGenM (State (WasmCodeGenState w) a) deriving newtype (Functor, Applicative, Monad) +instance MonadUniqDSM (WasmCodeGenM w) where + liftUniqDSM (UDSM m) = wasmStateM $ \st -> + let DUniqResult a us' = m (wasmDUniqSupply st) + in (# a, st{wasmDUniqSupply=us'} #) + wasmGetsM :: (WasmCodeGenState w -> a) -> WasmCodeGenM w a wasmGetsM = coerce . gets @@ -465,18 +472,13 @@ wasmStateM = coerce . State wasmModifyM :: (WasmCodeGenState w -> WasmCodeGenState w) -> WasmCodeGenM w () wasmModifyM = coerce . modify -wasmEvalM :: WasmCodeGenM w a -> WasmCodeGenState w -> a -wasmEvalM (WasmCodeGenM s) = evalState s - wasmExecM :: WasmCodeGenM w a -> WasmCodeGenState w -> WasmCodeGenState w wasmExecM (WasmCodeGenM s) = execState s -instance MonadUnique (WasmCodeGenM w) where - getUniqueSupplyM = wasmGetsM wasmUniqSupply +wasmRunM :: WasmCodeGenM w a -> WasmCodeGenState w -> (a, WasmCodeGenState w) +wasmRunM (WasmCodeGenM s) = runState s + +instance MonadGetUnique (WasmCodeGenM w) where getUniqueM = wasmStateM $ - \s at WasmCodeGenState {..} -> case takeUniqFromSupply wasmUniqSupply of - (u, us) -> (# u, s {wasmUniqSupply = us} #) - getUniquesM = do - u <- getUniqueM - s <- WasmCodeGenM get - pure $ u:(wasmEvalM getUniquesM s) + \s at WasmCodeGenState {..} -> case takeUniqueFromDSupply wasmDUniqSupply of + (u, us) -> (# u, s {wasmDUniqSupply = us} #) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -79,7 +79,7 @@ import GHC.Utils.Constants (debugIsOn) import GHC.Utils.Panic import GHC.Data.FastString import GHC.Utils.Misc -import GHC.Types.Unique.Supply ( getUniqueM ) +import GHC.Types.Unique.DSM ( getUniqueM ) import Control.Monad import Data.Foldable (fold) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -64,7 +64,7 @@ import GHC.Platform import GHC.Cmm.CLabel import GHC.Types.Unique.Set import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Basic (Alignment) import GHC.Cmm.DebugBlock (UnwindTable) @@ -987,13 +987,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -1002,8 +1002,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToLlvm/Base.hs ===================================== @@ -56,6 +56,7 @@ import GHC.Types.Unique import GHC.Utils.BufHandle ( BufHandle ) import GHC.Types.Unique.Set import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Utils.Logger import Data.Maybe (fromJust) @@ -300,6 +301,13 @@ instance MonadUnique LlvmM where tag <- getEnv envTag liftIO $! uniqFromTag tag +-- TODO: If you want Llvm code to be deterministic, this should use a +-- deterministic unique supply to get the Id. +instance DSM.MonadGetUnique LlvmM where + getUniqueM = do + tag <- getEnv envTag + liftIO $! uniqFromTag tag + -- | Lifting of IO actions. Not exported, as we want to encapsulate IO. liftIO :: IO a -> LlvmM a liftIO m = LlvmM $ \env -> do x <- m ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -11,7 +11,7 @@ module GHC.Data.Graph.Collapse , VizCollapseMonad(..) , NullCollapseViz(..) , runNullCollapse - , MonadUniqSM(..) + , MonadUniqDSM(..) ) where @@ -24,7 +24,7 @@ import Data.Semigroup import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Inductive.Graph -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic hiding (assert) @@ -59,23 +59,21 @@ Functional Graph Library (Hackage package `fgl`, modules -- care about visualization, you would use the `NullCollapseViz` -- monad, in which these operations are no-ops. -class (Monad m) => MonadUniqSM m where - liftUniqSM :: UniqSM a -> m a +class (Monad m) => MonadUniqDSM m where + liftUniqDSM :: UniqDSM a -> m a -class (MonadUniqSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where +class (MonadUniqDSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where consumeByInGraph :: Node -> Node -> gr s () -> m () splitGraphAt :: gr s () -> LNode s -> m () finalGraph :: gr s () -> m () - - -- | The identity monad as a `VizCollapseMonad`. Use this monad when -- you want efficiency in graph collapse. -newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqSM a } - deriving (Functor, Applicative, Monad, MonadUnique) +newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqDSM a } + deriving (Functor, Applicative, Monad, MonadGetUnique) -instance MonadUniqSM NullCollapseViz where - liftUniqSM = NullCollapseViz +instance MonadUniqDSM NullCollapseViz where + liftUniqDSM = NullCollapseViz instance (Graph gr, Supernode s NullCollapseViz) => VizCollapseMonad NullCollapseViz gr s where @@ -83,7 +81,7 @@ instance (Graph gr, Supernode s NullCollapseViz) => splitGraphAt _ _ = return () finalGraph _ = return () -runNullCollapse :: NullCollapseViz a -> UniqSM a +runNullCollapse :: NullCollapseViz a -> UniqDSM a runNullCollapse = unNCV @@ -158,7 +156,7 @@ class (Semigroup node) => PureSupernode node where superLabel :: node -> Label mapLabels :: (Label -> Label) -> (node -> node) -class (MonadUnique m, PureSupernode node) => Supernode node m where +class (MonadGetUnique m, PureSupernode node) => Supernode node m where freshen :: node -> m node -- ghost method ===================================== compiler/GHC/Driver/CodeOutput.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Unit.Finder ( mkStubPaths ) import GHC.Types.SrcLoc import GHC.Types.CostCentre import GHC.Types.ForeignStubs -import GHC.Types.Unique.Supply ( mkSplitUniqSupply ) +import GHC.Types.Unique.DSM import System.Directory import System.FilePath @@ -198,7 +198,7 @@ outputAsm :: Logger -> Stream IO RawCmmGroup a -> IO a outputAsm logger dflags this_mod location filenm cmm_stream = do - ncg_uniqs <- mkSplitUniqSupply 'n' + let ncg_uniqs = initDUniqSupply 'n' 0 {- See Note [Cmm Local Deterministic Uniques], or should we receive it as input?-} debugTraceMsg logger 4 (text "Outputing asm to" <+> text filenm) let ncg_config = initNCGConfig dflags this_mod {-# SCC "OutputAsm" #-} doOutput filenm $ ===================================== compiler/GHC/StgToCmm/ExtCode.hs ===================================== @@ -57,6 +57,7 @@ import GHC.Unit.Module import GHC.Types.Unique.FM import GHC.Types.Unique import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import Control.Monad (ap) import GHC.Utils.Outputable (SDocContext) @@ -102,6 +103,9 @@ instance MonadUnique CmmParse where u <- getUniqueM return (decls, u) +instance DSM.MonadGetUnique CmmParse where + getUniqueM = GHC.Types.Unique.Supply.getUniqueM + getProfile :: CmmParse Profile getProfile = EC (\_ _ d -> (d,) <$> F.getProfile) ===================================== compiler/GHC/Types/Unique/DSM.hs ===================================== @@ -0,0 +1,97 @@ +{-# LANGUAGE UnboxedTuples, PatternSynonyms #-} +module GHC.Types.Unique.DSM where + +import GHC.Prelude +import GHC.Word +import Control.Monad.Fix +import GHC.Types.Unique +import qualified GHC.Types.Unique.Supply as USM + +-- todo: Do I need to use the one-shot state monad trick? Probably yes. + +-- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. + +-- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic +-- there, but without the unboxing it feels? Maybe not, since we carry the +-- mappings too. + +newtype DUniqSupply = DUS Word64 -- supply uniques iteratively +type DUniqResult result = (# result, DUniqSupply #) + +pattern DUniqResult :: a -> b -> (# a, b #) +pattern DUniqResult x y = (# x, y #) +{-# COMPLETE DUniqResult #-} + +-- | A monad which just gives the ability to obtain 'Unique's deterministically. +-- There's no splitting. +newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } + deriving Functor + +instance Monad UniqDSM where + (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of + DUniqResult result us1 -> unUDSM (cont result) us1 + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} + +instance Applicative UniqDSM where + pure result = UDSM (DUniqResult result) + (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of + DUniqResult ff us1 -> case x us1 of + DUniqResult xx us2 -> DUniqResult (ff xx) us2 + (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of + DUniqResult _ us1 -> cont us1 + {-# INLINE pure #-} + {-# INLINE (*>) #-} + +instance MonadFix UniqDSM where + mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) + +getUniqueDSM :: UniqDSM Unique +getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) + +takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) +takeUniqueFromDSupply d = + case unUDSM getUniqueDSM d of + DUniqResult x y -> (x, y) + +-- Write Note about the importance of locality in uniques that are deterministic +-- +-- If you use a tag which collides with other names, you'll get a uniques +-- deterministically colliding with existing symbols. +-- +-- (e.g. easy to observe if you do this wrong) +-- +-- Ideally, we'd thread the same deterministic unique supply all the way +-- throughout the Cmm pipeline, starting off from hte deterministic rename +-- pass. +initDUniqSupply :: Char -> Word64 -> DUniqSupply +initDUniqSupply c firstUniq = + let !tag = mkTag c + in DUS (tag .|. firstUniq) + +newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply +newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c + +runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) +runUniqueDSM ds (UDSM f) = + case f ds of + DUniqResult uq us -> (uq, us) + +-- Add explanation on how this gives you a deterministic way of getting uniques +-- if the instance uses a deterministic unique supply. +class Monad m => MonadGetUnique m where + getUniqueM :: m Unique + +instance MonadGetUnique UniqDSM where + getUniqueM = getUniqueDSM + +instance MonadGetUnique USM.UniqSM where + getUniqueM = USM.getUniqueM + +{- +Note [Cmm Local Deterministic Uniques] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TODO!!!!! +TODO!!!!! +-} ===================================== compiler/GHC/Wasm/ControlFlow/FromCmm.hs ===================================== @@ -21,10 +21,11 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Reducibility import GHC.Cmm.Switch +import GHC.Data.Graph.Collapse (MonadUniqDSM (liftUniqDSM)) import GHC.CmmToAsm.Wasm.Types import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Misc import GHC.Utils.Panic import GHC.Utils.Outputable ( Outputable, text, (<+>), ppr @@ -138,22 +139,20 @@ emptyPost _ = False -- | Convert a Cmm CFG to WebAssembly's structured control flow. structuredControl :: forall expr stmt m . - Applicative m + MonadUniqDSM m => Platform -- ^ needed for offset calculation - -> UniqSupply -> (Label -> CmmExpr -> m expr) -- ^ translator for expressions -> (Label -> CmmActions -> m stmt) -- ^ translator for straight-line code -> CmmGraph -- ^ CFG to be translated -> m (WasmControl stmt expr '[] '[ 'I32]) -structuredControl platform us txExpr txBlock g' = - doTree returns dominatorTree emptyContext - where +structuredControl platform txExpr txBlock g' = do + gwd :: GraphWithDominators CmmNode <- + liftUniqDSM $ asReducible $ graphWithDominators g' + + let g :: CmmGraph g = gwd_graph gwd - gwd :: GraphWithDominators CmmNode - gwd = initUs_ us $ asReducible $ graphWithDominators g' - dominatorTree :: Tree.Tree CmmBlock-- Dominator tree in which children are sorted -- with highest reverse-postorder number first dominatorTree = fmap blockLabeled $ sortTree $ gwdDominatorTree gwd @@ -313,7 +312,7 @@ structuredControl platform us txExpr txBlock g' = dominates lbl blockname = lbl == blockname || dominatorsMember lbl (gwdDominatorsOf gwd blockname) - + doTree returns dominatorTree emptyContext nodeBody :: CmmBlock -> CmmActions nodeBody (BlockCC _first middle _last) = middle ===================================== compiler/ghc.cabal.in ===================================== @@ -894,6 +894,7 @@ Library GHC.Types.Unique GHC.Types.Unique.DFM GHC.Types.Unique.DSet + GHC.Types.Unique.DSM GHC.Types.Unique.FM GHC.Types.Unique.Map GHC.Types.Unique.MemoFun View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cfb5e673fbd25e15b5d273805df1a48af31a436 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cfb5e673fbd25e15b5d273805df1a48af31a436 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 10:41:54 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 06:41:54 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Major progress in using UniqDSM in CmmToAsm and Ncg backends Message-ID: <66852af1d459c_11373f11c878873210@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: db41639c by Rodrigo Mesquita at 2024-07-03T11:41:12+01:00 Major progress in using UniqDSM in CmmToAsm and Ncg backends - - - - - 28 changed files: - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/Base.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/Driver/CodeOutput.hs - compiler/GHC/StgToCmm/ExtCode.hs - + compiler/GHC/Types/Unique/DSM.hs - compiler/GHC/Wasm/ControlFlow/FromCmm.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/BlockId.hs ===================================== @@ -15,7 +15,7 @@ import GHC.Data.FastString import GHC.Types.Id.Info import GHC.Types.Name import GHC.Types.Unique -import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Cmm.Dataflow.Label (Label, mkHooplLabel) @@ -36,8 +36,12 @@ type BlockId = Label mkBlockId :: Unique -> BlockId mkBlockId unique = mkHooplLabel $ getKey unique -newBlockId :: MonadUnique m => m BlockId -newBlockId = mkBlockId <$> getUniqueM +-- If the monad unique instance uses a deterministic unique supply, this will +-- give you a deterministic unique. Otherwise, it will not. Note that from Cmm +-- onwards (after deterministic renaming in 'codeGen'), there should only exist +-- deterministic block labels. +newBlockId :: DSM.MonadGetUnique m => m BlockId +newBlockId = mkBlockId <$> DSM.getUniqueM blockLbl :: BlockId -> CLabel blockLbl label = mkLocalBlockLabel (getUnique label) ===================================== compiler/GHC/Cmm/Reducibility.hs ===================================== @@ -47,7 +47,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Collapse import GHC.Data.Graph.Inductive.Graph import GHC.Data.Graph.Inductive.PatriciaTree -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic -- | Represents the result of a reducibility analysis. @@ -81,7 +81,7 @@ reducibility gwd = -- control-flow graph. asReducible :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) asReducible gwd = case reducibility gwd of Reducible -> return gwd Irreducible -> assertReducible <$> nodeSplit gwd @@ -97,7 +97,7 @@ assertReducible gwd = case reducibility gwd of -- irreducible. nodeSplit :: GraphWithDominators CmmNode - -> UniqSM (GraphWithDominators CmmNode) + -> UniqDSM (GraphWithDominators CmmNode) nodeSplit gwd = graphWithDominators <$> inflate (g_entry g) <$> runNullCollapse collapsed where g = gwd_graph gwd @@ -181,7 +181,7 @@ instance PureSupernode CmmSuper where mapLabels = changeLabels instance Supernode CmmSuper NullCollapseViz where - freshen s = liftUniqSM $ relabel s + freshen s = liftUniqDSM $ relabel s -- | Return all labels defined within a supernode. @@ -212,11 +212,11 @@ changeBlockLabels f block = blockJoin entry' middle exit' -- | Within the given supernode, replace every defined label (and all -- of its uses) with a fresh label. -relabel :: CmmSuper -> UniqSM CmmSuper +relabel :: CmmSuper -> UniqDSM CmmSuper relabel node = do finite_map <- foldM addPair mapEmpty $ definedLabels node return $ changeLabels (labelChanger finite_map) node - where addPair :: LabelMap Label -> Label -> UniqSM (LabelMap Label) + where addPair :: LabelMap Label -> Label -> UniqDSM (LabelMap Label) addPair map old = do new <- newBlockId return $ mapInsert old new map labelChanger :: LabelMap Label -> (Label -> Label) ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -1,19 +1,17 @@ {-# LANGUAGE LambdaCase, RecordWildCards, MagicHash, UnboxedTuples, PatternSynonyms, ExplicitNamespaces #-} module GHC.Cmm.UniqueRenamer ( detRenameUniques - , UniqDSM, runUniqueDSM - , DUniqSupply, getUniqueDSM, takeUniqueFromDSupply, initDUniqSupply, newTagDUniqSupply , MonadGetUnique(..) -- Careful! Not for general use! , DetUniqFM, emptyDetUFM + + , module GHC.Types.Unique.DSM ) where -import Data.Bits import Prelude import Control.Monad.Trans.State -import Control.Monad.Fix import GHC.Word import GHC.Cmm import GHC.Cmm.CLabel @@ -27,7 +25,7 @@ import GHC.Types.Unique.FM import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) import GHC.Types.Id -import qualified GHC.Types.Unique.Supply as USM +import GHC.Types.Unique.DSM {- -------------------------------------------------------------------------------- @@ -276,93 +274,3 @@ instance (UniqRenamable a) => UniqRenamable (Maybe a) where panicMapKeysNotInjective :: a -> b -> c panicMapKeysNotInjective _ _ = error "this should be impossible because the function which maps keys should be injective" --------------------------------------------------------------------------------- --- UniqDSM (ToDo: For this to make sense in this module, rename the module to --- something like GHC.Cmm.UniqueDeterminism). Write notes.... - --- todo: Do I need to use the one-shot state monad trick? Probably yes. - --- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. - --- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic --- there, but without the unboxing it feels? Maybe not, since we carry the --- mappings too. - -newtype DUniqSupply = DUS Word64 -- supply uniques iteratively -type DUniqResult result = (# result, DUniqSupply #) - -pattern DUniqResult :: a -> b -> (# a, b #) -pattern DUniqResult x y = (# x, y #) -{-# COMPLETE DUniqResult #-} - --- | A monad which just gives the ability to obtain 'Unique's deterministically. --- There's no splitting. -newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } - deriving Functor - -instance Monad UniqDSM where - (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of - DUniqResult result us1 -> unUDSM (cont result) us1 - (>>) = (*>) - {-# INLINE (>>=) #-} - {-# INLINE (>>) #-} - -instance Applicative UniqDSM where - pure result = UDSM (DUniqResult result) - (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of - DUniqResult ff us1 -> case x us1 of - DUniqResult xx us2 -> DUniqResult (ff xx) us2 - (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of - DUniqResult _ us1 -> cont us1 - {-# INLINE pure #-} - {-# INLINE (*>) #-} - -instance MonadFix UniqDSM where - mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) - -getUniqueDSM :: UniqDSM Unique -getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) - -takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) -takeUniqueFromDSupply d = - case unUDSM getUniqueDSM d of - DUniqResult x y -> (x, y) - --- Write Note about the importance of locality in uniques that are deterministic --- --- If you use a tag which collides with other names, you'll get a uniques --- deterministically colliding with existing symbols. --- --- (e.g. easy to observe if you do this wrong) --- --- Ideally, we'd thread the same deterministic unique supply all the way --- throughout the Cmm pipeline, starting off from hte deterministic rename --- pass. -initDUniqSupply :: Char -> Word64 -> DUniqSupply -initDUniqSupply c firstUniq = - let !tag = mkTag c - in DUS (tag .|. firstUniq) - -newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply -newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c - -runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) -runUniqueDSM ds (UDSM f) = - case f ds of - DUniqResult uq us -> (uq, us) - -class Monad m => MonadGetUnique m where - getUniqueM :: m Unique - -instance MonadGetUnique UniqDSM where - getUniqueM = getUniqueDSM - -instance MonadGetUnique USM.UniqSM where - getUniqueM = USM.getUniqueM - -{- -Note [Cmm Local Deterministic Uniques] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -TODO!!!!! -TODO!!!!! --} ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -100,7 +100,7 @@ import GHC.Cmm.GenericOpt import GHC.Cmm.CLabel import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Driver.DynFlags import GHC.Driver.Ppr import GHC.Utils.Misc @@ -129,7 +129,7 @@ import System.IO import System.Directory ( getCurrentDirectory ) -------------------- -nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> UniqSupply +nativeCodeGen :: forall a . Logger -> ToolSettings -> NCGConfig -> ModLocation -> Handle -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen logger ts config modLoc h us cmms @@ -203,7 +203,7 @@ nativeCodeGen' :: (OutputableP Platform statics, Outputable jumpDest, Instructio -> ModLocation -> NcgImpl statics instr jumpDest -> Handle - -> UniqSupply + -> DUniqSupply -> Stream IO RawCmmGroup a -> IO a nativeCodeGen' logger config modLoc ncgImpl h us cmms @@ -223,9 +223,9 @@ finishNativeGen :: Instruction instr -> NCGConfig -> ModLocation -> BufHandle - -> UniqSupply + -> DUniqSupply -> NativeGenAcc statics instr - -> IO UniqSupply + -> IO DUniqSupply finishNativeGen logger config modLoc bufh us ngs = withTimingSilent logger (text "NCG") (`seq` ()) $ do -- Write debug data and finish @@ -284,19 +284,19 @@ cmmNativeGenStream :: forall statics jumpDest instr a . (OutputableP Platform st -> ModLocation -> NcgImpl statics instr jumpDest -> BufHandle - -> UniqSupply + -> DUniqSupply -> Stream.Stream IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) cmmNativeGenStream logger config modLoc ncgImpl h us cmm_stream ngs = loop us (Stream.runStream cmm_stream) ngs where ncglabel = text "NCG" - loop :: UniqSupply + loop :: DUniqSupply -> Stream.StreamS IO RawCmmGroup a -> NativeGenAcc statics instr - -> IO (NativeGenAcc statics instr, UniqSupply, a) + -> IO (NativeGenAcc statics instr, DUniqSupply, a) loop us s ngs = case s of Stream.Done a -> @@ -345,17 +345,17 @@ cmmNativeGens :: forall statics instr jumpDest. -> NcgImpl statics instr jumpDest -> BufHandle -> LabelMap DebugBlock - -> UniqSupply + -> DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) cmmNativeGens logger config ncgImpl h dbgMap = go where - go :: UniqSupply -> [RawCmmDecl] + go :: DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr -> Int - -> IO (NativeGenAcc statics instr, UniqSupply) + -> IO (NativeGenAcc statics instr, DUniqSupply) go us [] ngs !_ = return (ngs, us) @@ -424,12 +424,12 @@ cmmNativeGen :: forall statics instr jumpDest. (Instruction instr, OutputableP Platform statics, Outputable jumpDest) => Logger -> NcgImpl statics instr jumpDest - -> UniqSupply + -> DUniqSupply -> DwarfFiles -> LabelMap DebugBlock -> RawCmmDecl -- ^ the cmm to generate code for -> Int -- ^ sequence number of this top thing - -> IO ( UniqSupply + -> IO ( DUniqSupply , DwarfFiles , [NatCmmDecl statics instr] -- native code , [CLabel] -- things imported by this cmm @@ -468,7 +468,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- generate native code from cmm let ((native, lastMinuteImports, fileIds', nativeCfgWeights), usGen) = {-# SCC "genMachCode" #-} - initUs us $ genMachCode config + runUniqueDSM us $ genMachCode config (cmmTopCodeGen ncgImpl) fileIds dbgMap opt_cmm cmmCfg @@ -486,7 +486,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count else Nothing let (withLiveness, usLive) = {-# SCC "regLiveness" #-} - initUs usGen + runUniqueDSM usGen $ mapM (cmmTopLiveness livenessCfg platform) native putDumpFileMaybe logger @@ -494,8 +494,6 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count FormatCMM (vcat $ map (pprLiveCmmDecl platform) withLiveness) - -- ROMES:TODO: RENAME VIRTUAL REGISTERS DETERMINISTICALLY - -- allocate registers (alloced, usAlloc, ppr_raStatsColor, ppr_raStatsLinear, raStats, stack_updt_blks) <- if ( ncgRegsGraph config || ncgRegsIterative config ) @@ -510,7 +508,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- do the graph coloring register allocation let ((alloced, maybe_more_stack, regAllocStats), usAlloc) = {-# SCC "RegAlloc-color" #-} - initUs usLive + runUniqueDSM usLive $ Color.regAlloc config alloc_regs @@ -520,13 +518,13 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count livenessCfg let ((alloced', stack_updt_blks), usAlloc') - = initUs usAlloc $ - case maybe_more_stack of - Nothing -> return (alloced, []) - Just amount -> do - (alloced',stack_updt_blks) <- unzip <$> - (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) - return (alloced', concat stack_updt_blks ) + = runUniqueDSM usAlloc $ + case maybe_more_stack of + Nothing -> return (alloced, []) + Just amount -> do + (alloced',stack_updt_blks) <- unzip <$> + (mapM ((ncgAllocMoreStack ncgImpl) amount) alloced) + return (alloced', concat stack_updt_blks ) -- dump out what happened during register allocation @@ -571,7 +569,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count let ((alloced, regAllocStats, stack_updt_blks), usAlloc) = {-# SCC "RegAlloc-linear" #-} - initUs usLive + runUniqueDSM usLive $ liftM unzip3 $ mapM reg_alloc withLiveness @@ -643,7 +641,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count -- sequenced :: [NatCmmDecl statics instr] let (sequenced, us_seq) = {-# SCC "sequenceBlocks" #-} - initUs usAlloc $ mapM (BlockLayout.sequenceTop + runUniqueDSM usAlloc $ mapM (BlockLayout.sequenceTop ncgImpl optimizedCFG) shorted @@ -913,7 +911,7 @@ genMachCode -> LabelMap DebugBlock -> RawCmmDecl -> CFG - -> UniqSM + -> UniqDSM ( [NatCmmDecl statics instr] , [CLabel] , DwarfFiles @@ -921,15 +919,16 @@ genMachCode ) genMachCode config cmmTopCodeGen fileIds dbgMap cmm_top cmm_cfg - = do { initial_us <- getUniqueSupplyM - ; let initial_st = mkNatM_State initial_us 0 config - fileIds dbgMap cmm_cfg - (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) - final_delta = natm_delta final_st - final_imports = natm_imports final_st - final_cfg = natm_cfg final_st - ; if final_delta == 0 - then return (new_tops, final_imports - , natm_fileid final_st, final_cfg) - else pprPanic "genMachCode: nonzero final delta" (int final_delta) - } + = UDSM $ \initial_us -> do + { let initial_st = mkNatM_State initial_us 0 config + fileIds dbgMap cmm_cfg + (new_tops, final_st) = initNat initial_st (cmmTopCodeGen cmm_top) + final_delta = natm_delta final_st + final_imports = natm_imports final_st + final_cfg = natm_cfg final_st + ; if final_delta == 0 + then DUniqResult + (new_tops, final_imports + , natm_fileid final_st, final_cfg) (natm_us final_st) + else DUniqResult (pprPanic "genMachCode: nonzero final delta" (int final_delta)) undefined + } ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -1,4 +1,4 @@ -{-# language GADTs #-} +{-# language GADTs, LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module GHC.CmmToAsm.AArch64.CodeGen ( cmmTopCodeGen @@ -44,7 +44,7 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM -- The rest: import GHC.Data.OrdList @@ -1440,7 +1440,7 @@ genCondJump bid expr = do _ -> pprPanic "AArch64.genCondJump: " (text $ show expr) -- A conditional jump with at least +/-128M jump range -genCondFarJump :: MonadUnique m => Cond -> Target -> m InstrBlock +genCondFarJump :: MonadGetUnique m => Cond -> Target -> m InstrBlock genCondFarJump cond far_target = do skip_lbl_id <- newBlockId jmp_lbl_id <- newBlockId @@ -2272,7 +2272,7 @@ data BlockInRange = InRange | NotInRange Target -- See Note [AArch64 far jumps] makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches {- only used when debugging -} _platform statics basic_blocks = do -- All offsets/positions are counted in multiples of 4 bytes (the size of AArch64 instructions) -- That is an offset of 1 represents a 4-byte/one instruction offset. @@ -2293,7 +2293,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = long_bz_jump_size = 4 :: Int -- Replace out of range conditional jumps with unconditional jumps. - replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqSM (Int, [GenBasicBlock Instr]) + replace_blk :: LabelMap Int -> Int -> GenBasicBlock Instr -> UniqDSM (Int, [GenBasicBlock Instr]) replace_blk !m !pos (BasicBlock lbl instrs) = do -- Account for a potential info table before the label. let !block_pos = pos + infoTblSize_maybe lbl @@ -2307,12 +2307,14 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = let final_blocks = BasicBlock lbl top : split_blocks pure (pos', final_blocks) - replace_jump :: LabelMap Int -> Int -> Instr -> UniqSM (Int, [Instr]) + replace_jump :: LabelMap Int -> Int -> Instr -> UniqDSM (Int, [Instr]) replace_jump !m !pos instr = do case instr of ANN ann instr -> do - (idx,instr':instrs') <- replace_jump m pos instr - pure (idx, ANN ann instr':instrs') + replace_jump m pos instr >>= \case + (idx,instr':instrs') -> + pure (idx, ANN ann instr':instrs') + (idx,[]) -> pprPanic "replace_jump" (text "empty return list for " <+> ppr idx) BCOND cond t -> case target_in_range m t pos of InRange -> pure (pos+long_bc_jump_size,[instr]) ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -23,7 +23,7 @@ import GHC.Cmm import GHC.Cmm.CLabel import GHC.Utils.Outputable import GHC.Platform -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic @@ -473,13 +473,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.AArch64.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -488,8 +488,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -48,7 +48,7 @@ import Data.STRef import Control.Monad.ST.Strict import Control.Monad (foldM, unless) import GHC.Data.UnionFind -import GHC.Types.Unique.Supply (UniqSM) +import GHC.Types.Unique.DSM (UniqDSM) {- Note [CFG based code layout] @@ -793,7 +793,7 @@ sequenceTop => NcgImpl statics instr jumpDest -> Maybe CFG -- ^ CFG if we have one. -> NatCmmDecl statics instr -- ^ Function to serialize - -> UniqSM (NatCmmDecl statics instr) + -> UniqDSM (NatCmmDecl statics instr) sequenceTop _ _ top@(CmmData _ _) = pure top sequenceTop ncgImpl edgeWeights (CmmProc info lbl live (ListGraph blocks)) = do ===================================== compiler/GHC/CmmToAsm/Dwarf.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Unit.Module import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.CmmToAsm.Dwarf.Constants import GHC.CmmToAsm.Dwarf.Types @@ -31,8 +31,7 @@ import System.FilePath import qualified GHC.Cmm.Dataflow.Label as H -- | Generate DWARF/debug information -dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] - -> (doc, UniqSupply) +dwarfGen :: IsDoc doc => String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (doc, DUniqSupply) dwarfGen _ _ _ us [] = (empty, us) dwarfGen compPath config modLoc us blocks = let platform = ncgPlatform config @@ -65,7 +64,7 @@ dwarfGen compPath config modLoc us blocks = -- .debug_info section: Information records on procedures and blocks -- unique to identify start and end compilation unit .debug_inf - (unitU, us') = takeUniqFromSupply us + (unitU, us') = takeUniqueFromDSupply us infoSct = vcat [ line (dwarfInfoLabel <> colon) , dwarfInfoSection platform , compileUnitHeader platform unitU @@ -79,7 +78,7 @@ dwarfGen compPath config modLoc us blocks = line (dwarfLineLabel <> colon) -- .debug_frame section: Information about the layout of the GHC stack - (framesU, us'') = takeUniqFromSupply us' + (framesU, us'') = takeUniqueFromDSupply us' frameSct = dwarfFrameSection platform $$ line (dwarfFrameLabel <> colon) $$ pprDwarfFrame platform (debugFrame platform framesU procs) @@ -90,8 +89,8 @@ dwarfGen compPath config modLoc us blocks = aranges = dwarfARangesSection platform $$ pprDwarfARanges platform aranges' unitU in (infoSct $$ abbrevSct $$ lineSct $$ frameSct $$ aranges, us'') -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (SDoc, UniqSupply) #-} -{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> UniqSupply -> [DebugBlock] -> (HDoc, UniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (SDoc, DUniqSupply) #-} +{-# SPECIALIZE dwarfGen :: String -> NCGConfig -> ModLocation -> DUniqSupply -> [DebugBlock] -> (HDoc, DUniqSupply) #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Build an address range entry for one proc. -- With split sections, each proc needs its own entry, since they may get ===================================== compiler/GHC/CmmToAsm/Monad.hs ===================================== @@ -62,7 +62,7 @@ import GHC.Cmm.Expr (LocalReg (..), isWord64) import GHC.Data.FastString ( FastString ) import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Unique ( Unique ) import GHC.Unit.Module @@ -109,11 +109,11 @@ data NcgImpl statics instr jumpDest = NcgImpl { maxSpillSlots :: Int, allocatableRegs :: [RealReg], ncgAllocMoreStack :: Int -> NatCmmDecl statics instr - -> UniqSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), + -> UniqDSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), -- ^ The list of block ids records the redirected jumps to allow us to update -- the CFG. ncgMakeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock instr] - -> UniqSM [NatBasicBlock instr], + -> UniqDSM [NatBasicBlock instr], extractUnwindPoints :: [instr] -> [UnwindPoint], -- ^ given the instruction sequence of a block, produce a list of -- the block's 'UnwindPoint's @@ -178,7 +178,7 @@ mistake would readily show up in performance tests). -} data NatM_State = NatM_State { - natm_us :: UniqSupply, + natm_us :: DUniqSupply, natm_delta :: Int, -- ^ Stack offset for unwinding information natm_imports :: [(CLabel)], natm_pic :: Maybe Reg, @@ -205,7 +205,7 @@ pattern NatM f <- NatM' (runState -> f) unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a -mkNatM_State :: UniqSupply -> Int -> NCGConfig -> +mkNatM_State :: DUniqSupply -> Int -> NCGConfig -> DwarfFiles -> LabelMap DebugBlock -> CFG -> NatM_State mkNatM_State us delta config = \dwf dbg cfg -> @@ -223,19 +223,13 @@ mkNatM_State us delta config initNat :: NatM_State -> NatM a -> (a, NatM_State) initNat = flip unNat -instance MonadUnique NatM where - getUniqueSupplyM = NatM $ \st -> - case splitUniqSupply (natm_us st) of - (us1, us2) -> (us1, st {natm_us = us2}) - +instance MonadGetUnique NatM where getUniqueM = NatM $ \st -> - case takeUniqFromSupply (natm_us st) of - (uniq, us') -> (uniq, st {natm_us = us'}) + case takeUniqueFromDSupply (natm_us st) of + (uniq, us') -> (uniq, st {natm_us = us'}) getUniqueNat :: NatM Unique -getUniqueNat = NatM $ \ st -> - case takeUniqFromSupply $ natm_us st of - (uniq, us') -> (uniq, st {natm_us = us'}) +getUniqueNat = getUniqueM getDeltaNat :: NatM Int getDeltaNat = NatM $ \ st -> (natm_delta st, st) ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -55,7 +55,7 @@ import GHC.Cmm.CLabel import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM (listToUFM, lookupUFM) -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import Data.Foldable (toList) import qualified Data.List.NonEmpty as NE @@ -105,7 +105,7 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.PPC.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do @@ -117,7 +117,7 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do | entry `elem` infos -> infos | otherwise -> entry : infos - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -126,8 +126,6 @@ allocMoreStack platform slots (CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList @@ -698,7 +696,7 @@ makeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock Instr] - -> UniqSM [NatBasicBlock Instr] + -> UniqDSM [NatBasicBlock Instr] makeFarBranches _platform info_env blocks | NE.last blockAddresses < nearLimit = return blocks | otherwise = return $ zipWith handleBlock blockAddressList blocks ===================================== compiler/GHC/CmmToAsm/Reg/Graph.hs ===================================== @@ -31,7 +31,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Misc (seqList) import GHC.CmmToAsm.CFG @@ -57,8 +57,8 @@ regAlloc -> Int -- ^ current number of spill slots -> [LiveCmmDecl statics instr] -- ^ code annotated with liveness information. -> Maybe CFG -- ^ CFG of basic blocks if available - -> UniqSM ( [NatCmmDecl statics instr] - , Maybe Int, [RegAllocStats statics instr] ) + -> UniqDSM ( [NatCmmDecl statics instr] + , Maybe Int, [RegAllocStats statics instr] ) -- ^ code with registers allocated, additional stacks required -- and stats for each stage of allocation @@ -107,7 +107,7 @@ regAlloc_spin -> [RegAllocStats statics instr] -- ^ Current regalloc stats to add to. -> [LiveCmmDecl statics instr] -- ^ Liveness annotated code to allocate. -> Maybe CFG - -> UniqSM ( [NatCmmDecl statics instr] + -> UniqDSM ( [NatCmmDecl statics instr] , [RegAllocStats statics instr] , Int -- Slots in use , Color.Graph VirtualReg RegClass RealReg) @@ -305,7 +305,7 @@ regAlloc_spin config spinCount triv regsFree slotsFree slotsCount debug_codeGrap buildGraph :: Instruction instr => [LiveCmmDecl statics instr] - -> UniqSM (Color.Graph VirtualReg RegClass RealReg) + -> UniqDSM (Color.Graph VirtualReg RegClass RealReg) buildGraph code = do ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -22,7 +22,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -52,7 +52,7 @@ regSpill -> UniqSet Int -- ^ available stack slots -> Int -- ^ current number of spill slots. -> UniqSet VirtualReg -- ^ the regs to spill - -> UniqSM + -> UniqDSM ([LiveCmmDecl statics instr] -- code with SPILL and RELOAD meta instructions added. , UniqSet Int -- left over slots @@ -81,17 +81,20 @@ regSpill platform code slotsFree slotCount regs -- See Note [Unique Determinism and code generation] -- Grab the unique supply from the monad. - us <- getUniqueSupplyM + UDSM $ \us -> - -- Run the spiller on all the blocks. - let (code', state') = - runState (mapM (regSpill_top platform regSlotMap) code) - (initSpillS us) + -- Run the spiller on all the blocks. + let (code', state') = + runState (mapM (regSpill_top platform regSlotMap) code) + (initSpillS us) - return ( code' + in DUniqResult + ( code' , minusUniqSet slotsFree (mkUniqSet slots) , slotCount , makeSpillStats state') + ( stateUS state' ) + -- | Spill some registers to stack slots in a top-level thing. @@ -323,21 +326,28 @@ patchReg1 old new instr -- Spiller monad -------------------------------------------------------------- -- | State monad for the spill code generator. -type SpillM a - = State SpillS a +type SpillM = State SpillS -- | Spill code generator state. data SpillS = SpillS { -- | Unique supply for generating fresh vregs. - stateUS :: UniqSupply + stateUS :: DUniqSupply -- | Spilled vreg vs the number of times it was loaded, stored. , stateSpillSL :: UniqFM Reg (Reg, Int, Int) } +instance MonadGetUnique SpillM where + getUniqueM = do + us <- gets stateUS + case takeUniqueFromDSupply us of + (uniq, us') + -> do modify $ \s -> s { stateUS = us' } + return uniq + -- | Create a new spiller state. -initSpillS :: UniqSupply -> SpillS +initSpillS :: DUniqSupply -> SpillS initSpillS uniqueSupply = SpillS { stateUS = uniqueSupply @@ -346,12 +356,7 @@ initSpillS uniqueSupply -- | Allocate a new unique in the spiller monad. newUnique :: SpillM Unique -newUnique - = do us <- gets stateUS - case takeUniqFromSupply us of - (uniq, us') - -> do modify $ \s -> s { stateUS = us' } - return uniq +newUnique = getUniqueM -- | Add a spill/reload count to a stats record for a register. ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -129,7 +129,7 @@ import GHC.Data.Graph.Directed import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform @@ -146,11 +146,11 @@ regAlloc :: Instruction instr => NCGConfig -> LiveCmmDecl statics instr - -> UniqSM ( NatCmmDecl statics instr - , Maybe Int -- number of extra stack slots required, - -- beyond maxSpillSlots - , Maybe RegAllocStats - ) + -> UniqDSM ( NatCmmDecl statics instr + , Maybe Int -- number of extra stack slots required, + -- beyond maxSpillSlots + , Maybe RegAllocStats + ) regAlloc _ (CmmData sec d) = return @@ -207,7 +207,7 @@ linearRegAlloc -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc config entry_ids block_live sccs = case platformArch platform of @@ -228,7 +228,7 @@ linearRegAlloc config entry_ids block_live sccs ArchUnknown -> panic "linearRegAlloc ArchUnknown" where go :: (FR regs, Outputable regs) - => regs -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + => regs -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) go f = linearRegAlloc' config f entry_ids block_live sccs platform = ncgPlatform config @@ -244,14 +244,14 @@ linearRegAlloc' -> [BlockId] -- ^ entry points -> BlockMap RegSet -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" - -> UniqSM ([NatBasicBlock instr], RegAllocStats, Int) + -> UniqDSM ([NatBasicBlock instr], RegAllocStats, Int) linearRegAlloc' config initFreeRegs entry_ids block_live sccs - = do us <- getUniqueSupplyM - let !(_, !stack, !stats, !blocks) = - runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us - $ linearRA_SCCs entry_ids block_live [] sccs - return (blocks, stats, getStackUse stack) + = UDSM $ \us -> do + let !(_, !stack, !stats, !blocks, us') = + runR config emptyBlockAssignment initFreeRegs emptyRegMap emptyStackMap us + $ linearRA_SCCs entry_ids block_live [] sccs + in DUniqResult (blocks, stats, getStackUse stack) us' linearRA_SCCs :: OutputableRegConstraint freeRegs instr ===================================== compiler/GHC/CmmToAsm/Reg/Linear/Base.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Platform.Reg import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Label import GHC.CmmToAsm.Reg.Utils @@ -170,7 +170,7 @@ data RA_State freeRegs , ra_stack :: StackMap -- | unique supply for generating names for join point fixup blocks. - , ra_us :: UniqSupply + , ra_us :: DUniqSupply -- | Record why things were spilled, for -ddrop-asm-stats. -- Just keep a list here instead of a map of regs -> reasons. ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Cmm.BlockId import GHC.Platform import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Exts (oneShot) import Control.Monad (ap) @@ -91,9 +91,9 @@ runR :: NCGConfig -> freeRegs -> RegMap Loc -> StackMap - -> UniqSupply + -> DUniqSupply -> RegM freeRegs a - -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a) + -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a, DUniqSupply) runR config block_assig freeregs assig stack us thing = case unReg thing @@ -109,7 +109,7 @@ runR config block_assig freeregs assig stack us thing = , ra_fixups = [] }) of RA_Result state returned_thing - -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing) + -> (ra_blockassig state, ra_stack state, makeRAStats state, returned_thing, ra_us state) -- | Make register allocator stats from its final state. @@ -169,7 +169,7 @@ getDeltaR = mkRegM $ \s -> RA_Result s (ra_delta s) getUniqueR :: RegM freeRegs Unique getUniqueR = mkRegM $ \s -> - case takeUniqFromSupply (ra_us s) of + case takeUniqueFromDSupply (ra_us s) of (uniq, us) -> RA_Result s{ra_us = us} uniq ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Utils.Panic import GHC.Platform import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Data.Bag import GHC.Utils.Monad.State.Strict @@ -690,7 +690,7 @@ cmmTopLiveness => Maybe CFG -> Platform -> NatCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) cmmTopLiveness cfg platform cmm = regLiveness platform $ natCmmTopToLive cfg cmm @@ -784,7 +784,7 @@ regLiveness :: Instruction instr => Platform -> LiveCmmDecl statics instr - -> UniqSM (LiveCmmDecl statics instr) + -> UniqDSM (LiveCmmDecl statics instr) regLiveness _ (CmmData i d) = return $ CmmData i d ===================================== compiler/GHC/CmmToAsm/Wasm.hs ===================================== @@ -21,7 +21,7 @@ import GHC.Driver.DynFlags import GHC.Platform import GHC.Prelude import GHC.Settings -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Unit import GHC.Utils.Logger import GHC.Utils.Outputable (text) @@ -32,7 +32,7 @@ ncgWasm :: Logger -> Platform -> ToolSettings -> - UniqSupply -> + DUniqSupply -> ModLocation -> Handle -> Stream IO RawCmmGroup a -> @@ -58,7 +58,7 @@ ncgWasm ncg_config logger platform ts us loc h cmms = do streamCmmGroups :: NCGConfig -> Platform -> - UniqSupply -> + DUniqSupply -> Stream IO RawCmmGroup a -> IO (a, WasmCodeGenState 'I32) streamCmmGroups ncg_config platform us cmms = ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -48,7 +48,7 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Outputable hiding ((<>)) import GHC.Utils.Panic import GHC.Wasm.ControlFlow.FromCmm @@ -1572,11 +1572,9 @@ lower_CmmGraph :: CLabel -> CmmGraph -> WasmCodeGenM w (FuncBody w) lower_CmmGraph lbl g = do ty_word <- wasmWordTypeM platform <- wasmPlatformM - us <- getUniqueSupplyM body <- structuredControl platform - us (\_ -> lower_CmmExpr_Typed lbl ty_word) (lower_CmmActions lbl) g ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -45,6 +45,7 @@ module GHC.CmmToAsm.Wasm.Types wasmStateM, wasmModifyM, wasmExecM, + wasmRunM ) where @@ -66,9 +67,10 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Map import GHC.Types.Unique.Set -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable hiding ((<>)) +import GHC.Data.Graph.Collapse (MonadUniqDSM(..)) import Unsafe.Coerce -- | WebAssembly type of a WebAssembly value that WebAssembly code @@ -419,10 +421,10 @@ data WasmCodeGenState w = WasmCodeGenState UniqFM LocalReg LocalInfo, localRegsCount :: Int, - wasmUniqSupply :: UniqSupply + wasmDUniqSupply :: DUniqSupply } -initialWasmCodeGenState :: Platform -> UniqSupply -> WasmCodeGenState w +initialWasmCodeGenState :: Platform -> DUniqSupply -> WasmCodeGenState w initialWasmCodeGenState platform us = WasmCodeGenState { wasmPlatform = @@ -436,12 +438,17 @@ initialWasmCodeGenState platform us = [], localRegs = emptyUFM, localRegsCount = 0, - wasmUniqSupply = us + wasmDUniqSupply = us } newtype WasmCodeGenM w a = WasmCodeGenM (State (WasmCodeGenState w) a) deriving newtype (Functor, Applicative, Monad) +instance MonadUniqDSM (WasmCodeGenM w) where + liftUniqDSM (UDSM m) = wasmStateM $ \st -> + let DUniqResult a us' = m (wasmDUniqSupply st) + in (# a, st{wasmDUniqSupply=us'} #) + wasmGetsM :: (WasmCodeGenState w -> a) -> WasmCodeGenM w a wasmGetsM = coerce . gets @@ -465,18 +472,13 @@ wasmStateM = coerce . State wasmModifyM :: (WasmCodeGenState w -> WasmCodeGenState w) -> WasmCodeGenM w () wasmModifyM = coerce . modify -wasmEvalM :: WasmCodeGenM w a -> WasmCodeGenState w -> a -wasmEvalM (WasmCodeGenM s) = evalState s - wasmExecM :: WasmCodeGenM w a -> WasmCodeGenState w -> WasmCodeGenState w wasmExecM (WasmCodeGenM s) = execState s -instance MonadUnique (WasmCodeGenM w) where - getUniqueSupplyM = wasmGetsM wasmUniqSupply +wasmRunM :: WasmCodeGenM w a -> WasmCodeGenState w -> (a, WasmCodeGenState w) +wasmRunM (WasmCodeGenM s) = runState s + +instance MonadGetUnique (WasmCodeGenM w) where getUniqueM = wasmStateM $ - \s at WasmCodeGenState {..} -> case takeUniqFromSupply wasmUniqSupply of - (u, us) -> (# u, s {wasmUniqSupply = us} #) - getUniquesM = do - u <- getUniqueM - s <- WasmCodeGenM get - pure $ u:(wasmEvalM getUniquesM s) + \s at WasmCodeGenState {..} -> case takeUniqueFromDSupply wasmDUniqSupply of + (u, us) -> (# u, s {wasmDUniqSupply = us} #) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -79,7 +79,7 @@ import GHC.Utils.Constants (debugIsOn) import GHC.Utils.Panic import GHC.Data.FastString import GHC.Utils.Misc -import GHC.Types.Unique.Supply ( getUniqueM ) +import GHC.Types.Unique.DSM ( getUniqueM ) import Control.Monad import Data.Foldable (fold) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -64,7 +64,7 @@ import GHC.Platform import GHC.Cmm.CLabel import GHC.Types.Unique.Set import GHC.Types.Unique -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Types.Basic (Alignment) import GHC.Cmm.DebugBlock (UnwindTable) @@ -987,13 +987,13 @@ allocMoreStack :: Platform -> Int -> NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr - -> UniqSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) + -> UniqDSM (NatCmmDecl statics GHC.CmmToAsm.X86.Instr.Instr, [(BlockId,BlockId)]) allocMoreStack _ _ top@(CmmData _ _) = return (top,[]) allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do let entries = entryBlocks proc - uniqs <- getUniquesM + retargetList <- mapM (\e -> (e,) . mkBlockId <$> getUniqueM) entries let delta = ((x + stackAlign - 1) `quot` stackAlign) * stackAlign -- round up @@ -1002,8 +1002,6 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do alloc = mkStackAllocInstr platform delta dealloc = mkStackDeallocInstr platform delta - retargetList = (zip entries (map mkBlockId uniqs)) - new_blockmap :: LabelMap BlockId new_blockmap = mapFromList retargetList ===================================== compiler/GHC/CmmToLlvm/Base.hs ===================================== @@ -56,6 +56,7 @@ import GHC.Types.Unique import GHC.Utils.BufHandle ( BufHandle ) import GHC.Types.Unique.Set import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import GHC.Utils.Logger import Data.Maybe (fromJust) @@ -300,6 +301,13 @@ instance MonadUnique LlvmM where tag <- getEnv envTag liftIO $! uniqFromTag tag +-- TODO: If you want Llvm code to be deterministic, this should use a +-- deterministic unique supply to get the Id. +instance DSM.MonadGetUnique LlvmM where + getUniqueM = do + tag <- getEnv envTag + liftIO $! uniqFromTag tag + -- | Lifting of IO actions. Not exported, as we want to encapsulate IO. liftIO :: IO a -> LlvmM a liftIO m = LlvmM $ \env -> do x <- m ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -11,7 +11,7 @@ module GHC.Data.Graph.Collapse , VizCollapseMonad(..) , NullCollapseViz(..) , runNullCollapse - , MonadUniqSM(..) + , MonadUniqDSM(..) ) where @@ -24,7 +24,7 @@ import Data.Semigroup import GHC.Cmm.Dataflow.Label import GHC.Data.Graph.Inductive.Graph -import GHC.Types.Unique.Supply +import GHC.Types.Unique.DSM import GHC.Utils.Panic hiding (assert) @@ -59,23 +59,21 @@ Functional Graph Library (Hackage package `fgl`, modules -- care about visualization, you would use the `NullCollapseViz` -- monad, in which these operations are no-ops. -class (Monad m) => MonadUniqSM m where - liftUniqSM :: UniqSM a -> m a +class (Monad m) => MonadUniqDSM m where + liftUniqDSM :: UniqDSM a -> m a -class (MonadUniqSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where +class (MonadUniqDSM m, Graph gr, Supernode s m) => VizCollapseMonad m gr s where consumeByInGraph :: Node -> Node -> gr s () -> m () splitGraphAt :: gr s () -> LNode s -> m () finalGraph :: gr s () -> m () - - -- | The identity monad as a `VizCollapseMonad`. Use this monad when -- you want efficiency in graph collapse. -newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqSM a } - deriving (Functor, Applicative, Monad, MonadUnique) +newtype NullCollapseViz a = NullCollapseViz { unNCV :: UniqDSM a } + deriving (Functor, Applicative, Monad, MonadGetUnique) -instance MonadUniqSM NullCollapseViz where - liftUniqSM = NullCollapseViz +instance MonadUniqDSM NullCollapseViz where + liftUniqDSM = NullCollapseViz instance (Graph gr, Supernode s NullCollapseViz) => VizCollapseMonad NullCollapseViz gr s where @@ -83,7 +81,7 @@ instance (Graph gr, Supernode s NullCollapseViz) => splitGraphAt _ _ = return () finalGraph _ = return () -runNullCollapse :: NullCollapseViz a -> UniqSM a +runNullCollapse :: NullCollapseViz a -> UniqDSM a runNullCollapse = unNCV @@ -158,7 +156,7 @@ class (Semigroup node) => PureSupernode node where superLabel :: node -> Label mapLabels :: (Label -> Label) -> (node -> node) -class (MonadUnique m, PureSupernode node) => Supernode node m where +class (MonadGetUnique m, PureSupernode node) => Supernode node m where freshen :: node -> m node -- ghost method ===================================== compiler/GHC/Driver/CodeOutput.hs ===================================== @@ -56,7 +56,7 @@ import GHC.Unit.Finder ( mkStubPaths ) import GHC.Types.SrcLoc import GHC.Types.CostCentre import GHC.Types.ForeignStubs -import GHC.Types.Unique.Supply ( mkSplitUniqSupply ) +import GHC.Types.Unique.DSM import System.Directory import System.FilePath @@ -198,7 +198,7 @@ outputAsm :: Logger -> Stream IO RawCmmGroup a -> IO a outputAsm logger dflags this_mod location filenm cmm_stream = do - ncg_uniqs <- mkSplitUniqSupply 'n' + let ncg_uniqs = initDUniqSupply 'n' 0 {- See Note [Cmm Local Deterministic Uniques], or should we receive it as input?-} debugTraceMsg logger 4 (text "Outputing asm to" <+> text filenm) let ncg_config = initNCGConfig dflags this_mod {-# SCC "OutputAsm" #-} doOutput filenm $ ===================================== compiler/GHC/StgToCmm/ExtCode.hs ===================================== @@ -57,6 +57,7 @@ import GHC.Unit.Module import GHC.Types.Unique.FM import GHC.Types.Unique import GHC.Types.Unique.Supply +import qualified GHC.Types.Unique.DSM as DSM import Control.Monad (ap) import GHC.Utils.Outputable (SDocContext) @@ -102,6 +103,9 @@ instance MonadUnique CmmParse where u <- getUniqueM return (decls, u) +instance DSM.MonadGetUnique CmmParse where + getUniqueM = GHC.Types.Unique.Supply.getUniqueM + getProfile :: CmmParse Profile getProfile = EC (\_ _ d -> (d,) <$> F.getProfile) ===================================== compiler/GHC/Types/Unique/DSM.hs ===================================== @@ -0,0 +1,97 @@ +{-# LANGUAGE UnboxedTuples, PatternSynonyms #-} +module GHC.Types.Unique.DSM where + +import GHC.Prelude +import GHC.Word +import Control.Monad.Fix +import GHC.Types.Unique +import qualified GHC.Types.Unique.Supply as USM + +-- todo: Do I need to use the one-shot state monad trick? Probably yes. + +-- check: UniqSM is only used before Cmm (grep for it), afterwards only UniqDSM is used. + +-- todo: use UniqSM for UniqRenamable? We've basically re-implemented this logic +-- there, but without the unboxing it feels? Maybe not, since we carry the +-- mappings too. + +newtype DUniqSupply = DUS Word64 -- supply uniques iteratively +type DUniqResult result = (# result, DUniqSupply #) + +pattern DUniqResult :: a -> b -> (# a, b #) +pattern DUniqResult x y = (# x, y #) +{-# COMPLETE DUniqResult #-} + +-- | A monad which just gives the ability to obtain 'Unique's deterministically. +-- There's no splitting. +newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } + deriving Functor + +instance Monad UniqDSM where + (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of + DUniqResult result us1 -> unUDSM (cont result) us1 + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} + +instance Applicative UniqDSM where + pure result = UDSM (DUniqResult result) + (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of + DUniqResult ff us1 -> case x us1 of + DUniqResult xx us2 -> DUniqResult (ff xx) us2 + (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of + DUniqResult _ us1 -> cont us1 + {-# INLINE pure #-} + {-# INLINE (*>) #-} + +instance MonadFix UniqDSM where + mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) + +getUniqueDSM :: UniqDSM Unique +getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) + +takeUniqueFromDSupply :: DUniqSupply -> (Unique, DUniqSupply) +takeUniqueFromDSupply d = + case unUDSM getUniqueDSM d of + DUniqResult x y -> (x, y) + +-- Write Note about the importance of locality in uniques that are deterministic +-- +-- If you use a tag which collides with other names, you'll get a uniques +-- deterministically colliding with existing symbols. +-- +-- (e.g. easy to observe if you do this wrong) +-- +-- Ideally, we'd thread the same deterministic unique supply all the way +-- throughout the Cmm pipeline, starting off from hte deterministic rename +-- pass. +initDUniqSupply :: Char -> Word64 -> DUniqSupply +initDUniqSupply c firstUniq = + let !tag = mkTag c + in DUS (tag .|. firstUniq) + +newTagDUniqSupply :: Char -> DUniqSupply -> DUniqSupply +newTagDUniqSupply c (DUS w) = DUS $ getKey $ newTagUnique (mkUniqueGrimily w) c + +runUniqueDSM :: DUniqSupply -> UniqDSM a -> (a, DUniqSupply) +runUniqueDSM ds (UDSM f) = + case f ds of + DUniqResult uq us -> (uq, us) + +-- Add explanation on how this gives you a deterministic way of getting uniques +-- if the instance uses a deterministic unique supply. +class Monad m => MonadGetUnique m where + getUniqueM :: m Unique + +instance MonadGetUnique UniqDSM where + getUniqueM = getUniqueDSM + +instance MonadGetUnique USM.UniqSM where + getUniqueM = USM.getUniqueM + +{- +Note [Cmm Local Deterministic Uniques] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +TODO!!!!! +TODO!!!!! +-} ===================================== compiler/GHC/Wasm/ControlFlow/FromCmm.hs ===================================== @@ -21,10 +21,10 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Reducibility import GHC.Cmm.Switch +import GHC.Data.Graph.Collapse (MonadUniqDSM (liftUniqDSM)) import GHC.CmmToAsm.Wasm.Types import GHC.Platform -import GHC.Types.Unique.Supply import GHC.Utils.Misc import GHC.Utils.Panic import GHC.Utils.Outputable ( Outputable, text, (<+>), ppr @@ -138,22 +138,20 @@ emptyPost _ = False -- | Convert a Cmm CFG to WebAssembly's structured control flow. structuredControl :: forall expr stmt m . - Applicative m + MonadUniqDSM m => Platform -- ^ needed for offset calculation - -> UniqSupply -> (Label -> CmmExpr -> m expr) -- ^ translator for expressions -> (Label -> CmmActions -> m stmt) -- ^ translator for straight-line code -> CmmGraph -- ^ CFG to be translated -> m (WasmControl stmt expr '[] '[ 'I32]) -structuredControl platform us txExpr txBlock g' = - doTree returns dominatorTree emptyContext - where +structuredControl platform txExpr txBlock g' = do + gwd :: GraphWithDominators CmmNode <- + liftUniqDSM $ asReducible $ graphWithDominators g' + + let g :: CmmGraph g = gwd_graph gwd - gwd :: GraphWithDominators CmmNode - gwd = initUs_ us $ asReducible $ graphWithDominators g' - dominatorTree :: Tree.Tree CmmBlock-- Dominator tree in which children are sorted -- with highest reverse-postorder number first dominatorTree = fmap blockLabeled $ sortTree $ gwdDominatorTree gwd @@ -313,7 +311,7 @@ structuredControl platform us txExpr txBlock g' = dominates lbl blockname = lbl == blockname || dominatorsMember lbl (gwdDominatorsOf gwd blockname) - + doTree returns dominatorTree emptyContext nodeBody :: CmmBlock -> CmmActions nodeBody (BlockCC _first middle _last) = middle ===================================== compiler/ghc.cabal.in ===================================== @@ -894,6 +894,7 @@ Library GHC.Types.Unique GHC.Types.Unique.DFM GHC.Types.Unique.DSet + GHC.Types.Unique.DSM GHC.Types.Unique.FM GHC.Types.Unique.Map GHC.Types.Unique.MemoFun View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db41639cebe5a771a1e862236b063ead5870979a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db41639cebe5a771a1e862236b063ead5870979a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:12:29 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 07:12:29 -0400 Subject: [Git][ghc/ghc][wip/romes/strict-state-tweaks] Deriving-via one-shot strict state Monad instances Message-ID: <6685321d532de_11373f1686ba8741ad@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/strict-state-tweaks at Glasgow Haskell Compiler / GHC Commits: ad4e7e37 by Rodrigo Mesquita at 2024-07-03T12:09:33+01:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - 4 changed files: - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs Changes: ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad4e7e37759df6830048972abc3646b15520462c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad4e7e37759df6830048972abc3646b15520462c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:17:43 2024 From: gitlab at gitlab.haskell.org (Teo Camarasu (@teo)) Date: Wed, 03 Jul 2024 07:17:43 -0400 Subject: [Git][ghc/ghc][wip/T23397] 4553 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <668533578d311_11373f179e9f07627c@gitlab.mail> Teo Camarasu pushed to branch wip/T23397 at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension This implements Proposal 0475, introducing the `ListTuplePuns` extension which is enabled by default. Disabling this extension makes it invalid to refer to list, tuple and sum type constructors by using built-in syntax like `[Int]`, `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`. Instead, this syntax exclusively denotes data constructors for use with `DataKinds`. The conventional way of referring to these data constructors by prefixing them with a single quote (`'(Int, Int)`) is now a parser error. Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo` data constructor has been renamed to `MkSolo` (in a previous commit). Unboxed tuples and sums now have real source declarations in `GHC.Types`. Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo` and `Solo#`. Constraint tuples now have the unambiguous type constructors `CTuple<n>` as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before. A new parser construct has been added for the unboxed sum data constructor declarations. The type families `Tuple`, `Sum#` etc. that were intended to provide nicer syntax have been omitted from this change set due to inference problems, to be implemented at a later time. See the MR discussion for more info. Updates the submodule utils/haddock. Updates the cabal submodule due to new language extension. Metric Increase: haddock.base Metric Decrease: MultiLayerModulesTH_OneShot size_hello_artifact Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst Merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns This enriched the `CtOrigin` for non-linear patterns to include data of the pattern that created the constraint (which can be quite useful if it occurs nested in a pattern) as well as an explanation why the pattern is non-restricted in (at least in some cases). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * Main change: make the error message generated by mkFunTysMsg more accurate by changing "value arguments" to "visible arguments". * Refactor: define a new type synonym VisArity and use it instead of Arity in a few places. It might be the case that there other places in the compiler that should talk about visible arguments rather than value arguments, but I haven't tried to find them all, focusing only on the error message reported in the ticket. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 18c495c1 by Teo Camarasu at 2024-07-03T12:15:55+01:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 2f71e8b0 by Teo Camarasu at 2024-07-03T12:16:46+01:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 29 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/default.nix - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/README.mkd - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitlab/rel_eng/upload_ghc_libs.py - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/PrimOps.hs-boot - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Types.hs-boot - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/Uniques.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6fe14ce0ad6b4c99b73e062a082984fe83bb0d18...2f71e8b0dc346d3b74cf1ea6da8c63f9c9fe2073 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6fe14ce0ad6b4c99b73e062a082984fe83bb0d18...2f71e8b0dc346d3b74cf1ea6da8c63f9c9fe2073 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:24:02 2024 From: gitlab at gitlab.haskell.org (Teo Camarasu (@teo)) Date: Wed, 03 Jul 2024 07:24:02 -0400 Subject: [Git][ghc/ghc][wip/T24031] 4455 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <668534d211a4a_11373f1af06307877a@gitlab.mail> Teo Camarasu pushed to branch wip/T24031 at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 5a851ae8 by Teo Camarasu at 2024-07-03T12:23:19+01:00 Deprecate PrimTyConI - We produce `TyConI` for types where we used to use `PrimTyConI`. - We add a deprecation warning to `PrimTyConI` - We add a test case to ensure we can actually reify primitive types. Resolves #24031 - - - - - 30 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/PrimOps.hs-boot - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/ByteCode/Types.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/Config.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/877026819baaba0a63b8709840b151ded8f33df4...5a851ae85967bb295f0dac4a402b2be4fb6cd7fa -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/877026819baaba0a63b8709840b151ded8f33df4...5a851ae85967bb295f0dac4a402b2be4fb6cd7fa You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:24:26 2024 From: gitlab at gitlab.haskell.org (Teo Camarasu (@teo)) Date: Wed, 03 Jul 2024 07:24:26 -0400 Subject: [Git][ghc/ghc][wip/T24031] Deprecate PrimTyConI Message-ID: <668534ea92a9a_11373f1c3aaf478997@gitlab.mail> Teo Camarasu pushed to branch wip/T24031 at Glasgow Haskell Compiler / GHC Commits: cd609eee by Teo Camarasu at 2024-07-03T12:24:15+01:00 Deprecate PrimTyConI - We produce `TyConI` for types where we used to use `PrimTyConI`. - We add a deprecation warning to `PrimTyConI` - We add a test case to ensure we can actually reify primitive types. Resolves #24031 - - - - - 8 changed files: - compiler/GHC/Tc/Gen/Splice.hs - libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs - libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs - libraries/template-haskell/changelog.md - testsuite/tests/th/T16293b.hs - + testsuite/tests/th/T24031.hs - + testsuite/tests/th/T24031.stdout - testsuite/tests/th/all.T Changes: ===================================== compiler/GHC/Tc/Gen/Splice.hs ===================================== @@ -26,7 +26,7 @@ module GHC.Tc.Gen.Splice( runMetaE, runMetaP, runMetaT, runMetaD, runQuasi, tcTopSpliceExpr, lookupThName_maybe, defaultRunMeta, runMeta', runRemoteModFinalizers, - finishTH, runTopSplice + finishTH, runTopSplice, reifyName ) where import GHC.Prelude @@ -2135,15 +2135,6 @@ reifyTyCon tc | Just cls <- tyConClass_maybe tc = reifyClass cls -{- Seems to be just a short cut for the next equation -- omit - | tc `hasKey` fUNTyConKey -- I'm not quite sure what is happening here - = return (TH.PrimTyConI (reifyName tc) 2 False) --} - - | isPrimTyCon tc - = return (TH.PrimTyConI (reifyName tc) (length (tyConVisibleTyVars tc)) - (isUnliftedTypeKind (tyConResKind tc))) - | isTypeFamilyTyCon tc = do { let tvs = tyConTyVars tc res_kind = tyConResKind tc ===================================== libraries/ghc-boot-th/GHC/Internal/TH/Ppr.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE LambdaCase #-} +{-# OPTIONS_GHC -Wno-deprecations #-} -- | contains a prettyprinter for the -- Template Haskell datatypes ===================================== libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs ===================================== @@ -1554,6 +1554,7 @@ data Info Name Type -- What it is bound to deriving( Show, Eq, Ord, Data, Generic ) +{-# DEPRECATED PrimTyConI "TyConI is now produced instead." #-} -- | Obtained from 'reifyModule' in the 'Q' Monad. data ModuleInfo = ===================================== libraries/template-haskell/changelog.md ===================================== @@ -3,6 +3,7 @@ ## 2.22.1.0 * `Lift` instances were added for the `template-haskell` AST. + * `PrimTyConI` has been deprecated. `TyConI` will now be used to represent primitive types. ## 2.22.0.0 ===================================== testsuite/tests/th/T16293b.hs ===================================== @@ -7,7 +7,8 @@ import GHC.Exts import Language.Haskell.TH f :: () -f = $(do PrimTyConI _ arity _ <- reify ''Proxy# +f = $(do TyConI (DataD _ _ targs _ _ _) <- reify ''Proxy# + let arity = length targs unless (arity == 1) $ fail $ "Unexpected arity for Proxy#: " ++ show arity [| () |]) ===================================== testsuite/tests/th/T24031.hs ===================================== @@ -0,0 +1,28 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE LinearTypes #-} +-- | This test shows that we can reify a bunch of primitive types. +-- Additionally it acts as a golden test to ensure that we don't +-- accidentally change our output for these types. + +import Control.Monad +import Data.Char +import GHC.Exts +import Language.Haskell.TH +import Language.Haskell.TH.Syntax +import GHC.Builtin.Types.Prim (primTyCons) +import GHC.Tc.Gen.Splice (reifyName) + +main :: IO () +main = $(do let types = map reifyName primTyCons + reified <- mapM reify types + let stripInt [] = [] + stripInt (x:xs) + | isDigit x = stripInt xs + | otherwise = x:xs + -- remove _[0-9]* sequences + let stripUniques ('_':xs) = stripUniques $ stripInt xs + stripUniques (x:xs)= x:stripUniques xs + stripUniques [] = [] + let output = lift $ map (stripUniques . show) reified + [| mapM_ putStrLn $output |]) ===================================== testsuite/tests/th/T24031.stdout ===================================== @@ -0,0 +1,74 @@ +TyConI (DataD [] GHC.Prim.~# [KindedTV a BndrReq (VarT k0),KindedTV b BndrReq (VarT k1)] Nothing [] []) +TyConI (DataD [] GHC.Prim.~R# [KindedTV a BndrReq (VarT k0),KindedTV b BndrReq (VarT k1)] Nothing [] []) +TyConI (DataD [] GHC.Prim.~P# [KindedTV a BndrReq (VarT k0),KindedTV b BndrReq (VarT k1)] Nothing [] []) +TyConI (DataD [] GHC.Prim.=> [KindedTV a BndrReq (AppT (ConT GHC.Prim.CONSTRAINT) (VarT q)),KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (VarT r))] Nothing [] []) +TyConI (DataD [] GHC.Prim.==> [KindedTV a BndrReq (AppT (ConT GHC.Prim.CONSTRAINT) (VarT q)),KindedTV b BndrReq (AppT (ConT GHC.Prim.CONSTRAINT) (VarT r))] Nothing [] []) +TyConI (DataD [] GHC.Prim.-=> [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (VarT q)),KindedTV b BndrReq (AppT (ConT GHC.Prim.CONSTRAINT) (VarT r))] Nothing [] []) +TyConI (DataD [] GHC.Prim.Addr# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Array# [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.ByteArray# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.SmallArray# [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.Char# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Double# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Float# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int64# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.BCO [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Weak# [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.MutableArray# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.MutableByteArray# [KindedTV a BndrReq StarT] Nothing [] []) +TyConI (DataD [] GHC.Prim.SmallMutableArray# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.MVar# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.IOPort# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.TVar# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.MutVar# [KindedTV a BndrReq StarT,KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.RealWorld [] Nothing [] []) +TyConI (DataD [] GHC.Prim.StablePtr# [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.StableName# [KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (AppT (PromotedT GHC.Types.BoxedRep) (VarT l)))] Nothing [] []) +TyConI (DataD [] GHC.Prim.Compact# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.State# [KindedTV a BndrReq StarT] Nothing [] []) +TyConI (DataD [] GHC.Prim.Proxy# [KindedTV a BndrReq (VarT k)] Nothing [] []) +TyConI (DataD [] GHC.Prim.ThreadId# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word64# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.StackSnapshot# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.PromptTag# [KindedTV a BndrReq StarT] Nothing [] []) +TyConI (DataD [] GHC.Prim.FUN [KindedTV n BndrReq (ConT GHC.Types.Multiplicity),KindedTV a BndrReq (AppT (ConT GHC.Prim.TYPE) (VarT q)),KindedTV b BndrReq (AppT (ConT GHC.Prim.TYPE) (VarT r))] Nothing [] []) +TyConI (DataD [] GHC.Prim.TYPE [KindedTV a BndrReq (ConT GHC.Types.RuntimeRep)] Nothing [] []) +TyConI (DataD [] GHC.Prim.CONSTRAINT [KindedTV a BndrReq (ConT GHC.Types.RuntimeRep)] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int8X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int16X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int32X4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int64X2# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int8X32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int16X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int32X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int64X4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int8X64# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int16X32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int32X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Int64X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word8X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word16X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word32X4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word64X2# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word8X32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word16X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word32X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word64X4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word8X64# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word16X32# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word32X16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.Word64X8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.FloatX4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.DoubleX2# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.FloatX8# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.DoubleX4# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.FloatX16# [] Nothing [] []) +TyConI (DataD [] GHC.Prim.DoubleX8# [] Nothing [] []) ===================================== testsuite/tests/th/all.T ===================================== @@ -617,3 +617,4 @@ test('T24702b', normal, compile, ['']) test('T24837', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T24911', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T24997', normal, compile_and_run, ['']) +test('T24031', normal, compile_and_run, ['-package ghc']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd609eeece220e69bb211b470b71f720aa0e35ed -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd609eeece220e69bb211b470b71f720aa0e35ed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:30:57 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Wed, 03 Jul 2024 07:30:57 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haddock-iface-fixes Message-ID: <6685367193ba3_11373f1dedcfc815b0@gitlab.mail> Zubin pushed new branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haddock-iface-fixes You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:53:13 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 03 Jul 2024 07:53:13 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: Testsuite: use py-cpuinfo to compute CPU features Message-ID: <66853ba9119a1_11373f215b70484051@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: ed5cdb8e by sheaf at 2024-07-03T13:37:25+02:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 27d72632 by sheaf at 2024-07-03T13:39:59+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 5455c4cb by sheaf at 2024-07-03T13:47:24+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - a3e1c38f by sheaf at 2024-07-03T13:47:24+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - d7103896 by sheaf at 2024-07-03T13:52:14+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 31b1cc97 by sheaf at 2024-07-03T13:52:14+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8edac7a83baf3bbdf2df1f1d4a2ef1e31e6d8aaa...31b1cc978c37551faf1810d2daf5dc87f8a3641d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8edac7a83baf3bbdf2df1f1d4a2ef1e31e6d8aaa...31b1cc978c37551faf1810d2daf5dc87f8a3641d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:57:13 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 03 Jul 2024 07:57:13 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 22 commits: Expand LLVM version matching regex for compability with bsd systems Message-ID: <66853c99bb140_11373f22f15c8846a1@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 54084843 by sheaf at 2024-07-03T13:55:01+02:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 87974f83 by sheaf at 2024-07-03T13:55:42+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - fefd5622 by sheaf at 2024-07-03T13:56:56+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 28d0c8fd by sheaf at 2024-07-03T13:56:58+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - f493411d by sheaf at 2024-07-03T13:56:58+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e2b57729 by sheaf at 2024-07-03T13:56:59+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31b1cc978c37551faf1810d2daf5dc87f8a3641d...e2b57729572cd502b27b91635e0f37376306d583 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31b1cc978c37551faf1810d2daf5dc87f8a3641d...e2b57729572cd502b27b91635e0f37376306d583 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 11:59:49 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 03 Jul 2024 07:59:49 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 4 commits: Add vector fused multiply-add operations Message-ID: <66853d35d3e92_11373f2484a5c852f1@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: ffc1e910 by sheaf at 2024-07-03T13:59:20+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 60d3c203 by sheaf at 2024-07-03T13:59:20+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 751c6143 by sheaf at 2024-07-03T13:59:21+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - f47ef2d5 by sheaf at 2024-07-03T13:59:21+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 27 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd011.stdout - utils/genprimopcode/Lexer.x - utils/genprimopcode/Main.hs - utils/genprimopcode/Parser.y - utils/genprimopcode/ParserM.hs - utils/genprimopcode/Syntax.hs Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -4175,6 +4175,33 @@ primop VecWriteScalarOffAddrOp "writeOffAddrAs#" GenPrimOp can_fail_warning = YesWarnCanFail vector = ALL_VECTOR_TYPES +primop VecFMAdd "fmadd#" GenPrimOp + VECTOR -> VECTOR -> VECTOR -> VECTOR + {Fused multiply-add operation @x*y+z at . See "GHC.Prim#fma".} + with + vector = FLOAT_VECTOR_TYPES +primop VecFMSub "fmsub#" GenPrimOp + VECTOR -> VECTOR -> VECTOR -> VECTOR + {Fused multiply-subtract operation @x*y-z at . See "GHC.Prim#fma".} + with + vector = FLOAT_VECTOR_TYPES +primop VecFNMAdd "fnmadd#" GenPrimOp + VECTOR -> VECTOR -> VECTOR -> VECTOR + {Fused negate-multiply-add operation @-x*y+z at . See "GHC.Prim#fma".} + with + vector = FLOAT_VECTOR_TYPES +primop VecFNMSub "fnmsub#" GenPrimOp + VECTOR -> VECTOR -> VECTOR -> VECTOR + {Fused negate-multiply-subtract operation @-x*y-z at . See "GHC.Prim#fma".} + with + vector = FLOAT_VECTOR_TYPES + +primop VecShuffleOp "shuffle#" GenPrimOp + VECTOR -> VECTOR -> INTVECTUPLE -> VECTOR + {Shuffle elements of the concatenation of the input two vectors + into the result vector.} + with vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -116,7 +116,7 @@ data MachOp -- Floating-point fused multiply-add operations -- | Fused multiply-add, see 'FMASign'. - | MO_FMA FMASign Width + | MO_FMA FMASign Length Width -- Floating point comparison | MO_F_Eq Width @@ -158,6 +158,7 @@ data MachOp | MO_FW_Bitcast Width -- Float/Double -> Word32/Word64 -- Vector element insertion and extraction operations + | MO_V_Broadcast Length Width -- Broadcast a scalar into a vector | MO_V_Insert Length Width -- Insert scalar into vector | MO_V_Extract Length Width -- Extract scalar from vector @@ -175,7 +176,12 @@ data MachOp | MO_VU_Quot Length Width | MO_VU_Rem Length Width + -- Vector shuffles + | MO_V_Shuffle Length Width [Int] + | MO_VF_Shuffle Length Width [Int] + -- Floating point vector element insertion and extraction operations + | MO_VF_Broadcast Length Width -- Broadcast a scalar into a vector | MO_VF_Insert Length Width -- Insert scalar into vector | MO_VF_Extract Length Width -- Extract scalar from vector @@ -459,7 +465,7 @@ machOpResultType platform mop tys = MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r - MO_FMA _ r -> cmmFloat r + MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) MO_F_Eq {} -> comparisonResultRep platform MO_F_Ne {} -> comparisonResultRep platform @@ -485,6 +491,7 @@ machOpResultType platform mop tys = MO_WF_Bitcast w -> cmmFloat w MO_FW_Bitcast w -> cmmBits w + MO_V_Broadcast l w -> cmmVec l (cmmBits w) MO_V_Insert l w -> cmmVec l (cmmBits w) MO_V_Extract _ w -> cmmBits w @@ -499,6 +506,10 @@ machOpResultType platform mop tys = MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) + MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) + + MO_VF_Broadcast l w -> cmmVec l (cmmFloat w) MO_VF_Insert l w -> cmmVec l (cmmFloat w) MO_VF_Extract _ w -> cmmFloat w @@ -556,7 +567,7 @@ machOpArgReps platform op = MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] - MO_FMA _ r -> [r,r,r] + MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] MO_F_Eq r -> [r,r] MO_F_Ne r -> [r,r] @@ -582,8 +593,13 @@ machOpArgReps platform op = MO_WF_Bitcast w -> [w] MO_FW_Bitcast w -> [w] + MO_V_Shuffle l r _ -> [vecwidth l r, vecwidth l r] + MO_VF_Shuffle l r _ -> [vecwidth l r, vecwidth l r] + + MO_V_Broadcast _ r -> [r] MO_V_Insert l r -> [vecwidth l r, r, W32] MO_V_Extract l r -> [vecwidth l r, W32] + MO_VF_Broadcast _ r -> [r] MO_VF_Insert l r -> [vecwidth l r, r, W32] MO_VF_Extract l r -> [vecwidth l r, W32] -- SIMD vector indices are always 32 bit ===================================== compiler/GHC/Cmm/Opt.hs ===================================== @@ -79,6 +79,11 @@ cmmMachOpFoldM -> MachOp -> [CmmExpr] -> Maybe CmmExpr +cmmMachOpFoldM _ (MO_V_Broadcast {}) _ = Nothing +cmmMachOpFoldM _ (MO_VF_Broadcast {}) _ = Nothing + -- SIMD NCG TODO: supporting constant folding for vector operations + -- would require augmenting getRegister' to handle them. + -- See the code for "getRegister' platform _ (CmmLit lit)". cmmMachOpFoldM _ op [CmmLit (CmmInt x rep)] = Just $! case op of MO_S_Neg _ -> CmmLit (CmmInt (-x) rep) ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1053,10 +1053,10 @@ machOps = listToUFM $ ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), - ( "fmadd" , MO_FMA FMAdd ), - ( "fmsub" , MO_FMA FMSub ), - ( "fnmadd", MO_FMA FNMAdd ), - ( "fnmsub", MO_FMA FNMSub ), + ( "fmadd" , MO_FMA FMAdd 1 ), + ( "fmsub" , MO_FMA FMSub 1 ), + ( "fnmadd", MO_FMA FNMAdd 1 ), + ( "fnmsub", MO_FMA FNMSub 1 ), ( "feq", MO_F_Eq ), ( "fne", MO_F_Ne ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -813,6 +813,8 @@ getRegister' config plat expr MO_VS_Neg {} -> notUnary MO_VU_Quot {} -> notUnary MO_VU_Rem {} -> notUnary + MO_V_Shuffle {} -> notUnary + MO_VF_Shuffle {} -> notUnary MO_VF_Insert {} -> notUnary MO_VF_Extract {} -> notUnary MO_VF_Add {} -> notUnary @@ -825,6 +827,8 @@ getRegister' config plat expr MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) + MO_V_Broadcast {} -> vectorsNeedLlvm + MO_VF_Broadcast {} -> vectorsNeedLlvm MO_VF_Neg {} -> vectorsNeedLlvm where notUnary = pprPanic "getRegister' (non-unary CmmMachOp with 1 argument):" (pdoc plat expr) @@ -1170,6 +1174,8 @@ getRegister' config plat expr MO_FF_Conv {} -> notDyadic MO_WF_Bitcast {} -> notDyadic MO_FW_Bitcast {} -> notDyadic + MO_V_Broadcast {} -> notDyadic + MO_VF_Broadcast {} -> notDyadic MO_V_Insert {} -> notDyadic MO_VF_Insert {} -> notDyadic MO_AlignmentCheck {} -> notDyadic @@ -1191,6 +1197,8 @@ getRegister' config plat expr MO_VF_Neg {} -> vectorsNeedLlvm MO_VF_Mul {} -> vectorsNeedLlvm MO_VF_Quot {} -> vectorsNeedLlvm + MO_V_Shuffle {} -> vectorsNeedLlvm + MO_VF_Shuffle {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ @@ -1210,11 +1218,15 @@ getRegister' config plat expr -- x86 fnmadd - x * y + z <=> AArch64 fmsub : d = - r1 * r2 + r3 -- x86 fnmsub - x * y - z <=> AArch64 fnmadd: d = - r1 * r2 - r3 - MO_FMA var w -> case var of - FMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMAdd d n m a) - FMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMSub d n m a) - FNMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMSub d n m a) - FNMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMAdd d n m a) + MO_FMA var l w + | l == 1 + -> case var of + FMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMAdd d n m a) + FMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMSub d n m a) + FNMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMSub d n m a) + FNMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMAdd d n m a) + | otherwise + -> vectorsNeedLlvm MO_V_Insert {} -> vectorsNeedLlvm MO_VF_Insert {} -> vectorsNeedLlvm ===================================== compiler/GHC/CmmToAsm/Format.hs ===================================== @@ -24,6 +24,7 @@ module GHC.CmmToAsm.Format ( isVecFormat, cmmTypeFormat, formatToWidth, + scalarWidth, formatInBytes, isFloatScalarFormat, scalarFormatFormat, ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -538,6 +538,8 @@ getRegister' config platform (CmmMachOp mop [x]) -- unary MachOps MO_XX_Conv _ to -> conversionNop (intFormat to) x + MO_V_Broadcast {} -> vectorsNeedLlvm + MO_VF_Broadcast {} -> vectorsNeedLlvm MO_VF_Neg {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" @@ -667,6 +669,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Neg {} -> vectorsNeedLlvm MO_VF_Mul {} -> vectorsNeedLlvm MO_VF_Quot {} -> vectorsNeedLlvm + MO_V_Shuffle {} -> vectorsNeedLlvm + MO_VF_Shuffle {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" @@ -692,12 +696,14 @@ getRegister' _ _ (CmmMachOp mop [x, y, z]) -- ternary PrimOps -- x86 fnmadd - x * y + z ~~ PPC fnmsub rt = -(ra * rc - rb) -- x86 fnmsub - x * y - z ~~ PPC fnmadd rt = -(ra * rc + rb) - MO_FMA variant w -> + MO_FMA variant l w | l == 1 -> case variant of FMAdd -> fma_code w (FMADD FMAdd) x y z FMSub -> fma_code w (FMADD FMSub) x y z FNMAdd -> fma_code w (FMADD FNMAdd) x y z FNMSub -> fma_code w (FMADD FNMSub) x y z + | otherwise + -> vectorsNeedLlvm MO_V_Insert {} -> vectorsNeedLlvm MO_VF_Insert {} -> vectorsNeedLlvm ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -944,6 +944,7 @@ getRegister' _ _ (CmmLit lit@(CmmFloat f w)) = float_const_sse2 where float_const_sse2 | f == 0.0 = do + -- TODO: this mishandles negative zero floating point literals. let format = floatFormat w code dst = unitOL (XOR format (OpReg dst) (OpReg dst)) @@ -951,9 +952,7 @@ getRegister' _ _ (CmmLit lit@(CmmFloat f w)) = -- They all appear to do the same thing --SDM return (Any format code) - | otherwise = do - Amode addr code <- memConstant (mkAlignment $ widthInBytes w) lit - loadFloatAmode w addr code + | otherwise = getFloatLitRegister lit -- catch simple cases of zero- or sign-extended load getRegister' _ _ (CmmMachOp (MO_UU_Conv W8 W32) [CmmLoad addr _ _]) = do @@ -1010,9 +1009,10 @@ getRegister' _ is32Bit (CmmMachOp (MO_Add W64) [CmmReg (CmmGlobal (GlobalRegUse LEA II64 (OpAddr (ripRel (litToImm displacement))) (OpReg dst)) getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps - sse2 <- sse2Enabled - sse <- sseEnabled - avx <- avxEnabled + sse4_1 <- sse4_1Enabled + sse2 <- sse2Enabled + sse <- sseEnabled + avx <- avxEnabled case mop of MO_F_Neg w -> sse2NegCode w x @@ -1099,13 +1099,27 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_FS_Truncate from to -> coerceFP2Int from to x MO_SF_Round from to -> coerceInt2FP from to x - MO_VF_Neg l w | avx -> vector_float_negate_avx l w x - | sse && sse2 -> vector_float_negate_sse l w x + MO_VF_Neg l w | avx -> vector_float_negate_avx l w x + | sse && w == W32 -> vector_float_negate_sse l w x + | sse2 && w == W64 -> vector_float_negate_sse l w x | otherwise - -> sorry "Please enable the -mavx or -msse, -msse2 flag" + -> sorry "Please enable the -mavx or -msse, -msse2 flag" -- SIMD NCG TODO: add integer negation MO_VS_Neg {} -> needLlvm mop + MO_VF_Broadcast l W32 | avx -> vector_float_broadcast_avx l W32 x + | sse4_1 -> vector_float_broadcast_sse l W32 x + | otherwise + -> sorry "Please enable the -mavx or -msse4 flag" + MO_VF_Broadcast l W64 | sse2 -> vector_float_broadcast_sse l W64 x + | otherwise -> sorry "Please enable the -msse2 flag" + MO_VF_Broadcast {} -> incorrectOperands + + MO_V_Broadcast l W64 | sse2 -> vector_int_broadcast l W64 x + | otherwise -> sorry "Please enable the -msse2 flag" + -- SIMD NCG TODO: W32, W16, W8 + MO_V_Broadcast {} -> needLlvm mop + -- Binary MachOps MO_Add {} -> incorrectOperands MO_Sub {} -> incorrectOperands @@ -1150,6 +1164,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VS_Rem {} -> incorrectOperands MO_VU_Quot {} -> incorrectOperands MO_VU_Rem {} -> incorrectOperands + MO_V_Shuffle {} -> incorrectOperands + MO_VF_Shuffle {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1206,37 +1222,117 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps vector_float_negate_avx :: Length -> Width -> CmmExpr -> NatM Register vector_float_negate_avx l w expr = do - tmp <- getNewRegNat (VecFormat l FmtFloat) - (reg, exp) <- getSomeReg expr - Amode addr addr_code <- memConstant (mkAlignment $ widthInBytes W32) (CmmFloat 0.0 W32) - let format = case w of - W32 -> VecFormat l FmtFloat - W64 -> VecFormat l FmtDouble - _ -> pprPanic "Cannot negate vector of width" (ppr w) - code dst = case w of - W32 -> exp `appOL` addr_code `snocOL` - (VBROADCAST format addr tmp) `snocOL` - (VSUB format (OpReg reg) tmp dst) - W64 -> exp `appOL` addr_code `snocOL` - (MOVL format (OpAddr addr) (OpReg tmp)) `snocOL` - (MOVH format (OpAddr addr) (OpReg tmp)) `snocOL` - (VSUB format (OpReg reg) tmp dst) - _ -> pprPanic "Cannot negate vector of width" (ppr w) - return (Any format code) + let fmt :: Format + mask :: CmmLit + (fmt, mask) = case w of + W32 -> (VecFormat l FmtFloat , CmmInt (bit 31) w) -- TODO: these should be negative 0 floating point literals, + W64 -> (VecFormat l FmtDouble, CmmInt (bit 63) w) -- but we don't currently have those in Cmm. + _ -> panic "AVX floating-point negation: elements must be FF32 or FF64" + (maskReg, maskCode) <- getSomeReg (CmmMachOp (MO_VF_Broadcast l w) [CmmLit mask]) + (reg, exp) <- getSomeReg expr + let code dst = maskCode `appOL` + exp `snocOL` + (VMOVU fmt (OpReg reg) (OpReg dst)) `snocOL` + (VXOR fmt (OpReg maskReg) dst dst) + return (Any fmt code) vector_float_negate_sse :: Length -> Width -> CmmExpr -> NatM Register vector_float_negate_sse l w expr = do - tmp <- getNewRegNat (VecFormat l FmtFloat) - (reg, exp) <- getSomeReg expr - let format = case w of - W32 -> VecFormat l FmtFloat - W64 -> VecFormat l FmtDouble - _ -> pprPanic "Cannot negate vector of width" (ppr w) + let fmt :: Format + mask :: CmmLit + (fmt, mask) = case w of + W32 -> (VecFormat l FmtFloat , CmmInt (bit 31) w) -- Same comment as for vector_float_negate_avx, + W64 -> (VecFormat l FmtDouble, CmmInt (bit 63) w) -- these should be -0.0 CmmFloat values. + _ -> panic "SSE floating-point negation: elements must be FF32 or FF64" + (maskReg, maskCode) <- getSomeReg (CmmMachOp (MO_VF_Broadcast l w) [CmmLit mask]) + (reg, exp) <- getSomeReg expr + let code dst = maskCode `appOL` + exp `snocOL` + (MOVU fmt (OpReg reg) (OpReg dst)) `snocOL` + (XOR fmt (OpReg maskReg) (OpReg dst)) + return (Any fmt code) + + ----------------------- + + -- Like 'getSomeReg', but with special handling for int literals + -- used as floating point values, to work around the fact that we don't + -- have negative zero floating point literals in Cmm yet. + -- + -- This should get removed once we have negative zero in CmmFloat. + get_float_broadcast_value_reg expr = case expr of + CmmLit lit -> do + r <- getFloatLitRegister lit + case r of + Any rep code -> do + tmp <- getNewRegNat rep + return (tmp, code tmp) + Fixed _ reg code -> + return (reg, code) + _ -> getSomeReg expr + + vector_float_broadcast_avx :: Length + -> Width + -> CmmExpr + -> NatM Register + vector_float_broadcast_avx len W32 expr + = do + (reg, exp) <- get_float_broadcast_value_reg expr + let f = VecFormat len FmtFloat + addr = spRel platform 0 + in return $ Any f (\dst -> exp `snocOL` + (VMOVU f (OpReg reg) (OpAddr addr)) `snocOL` + (VBROADCAST f addr dst)) + vector_float_broadcast_avx l w _ + -- NB: for some reason, VBROADCASTSD does not support xmm, only ymm. + = pprPanic "vector_float_broadcast_avx" (text "l" <+> ppr l $$ text "w" <+> ppr w) + + vector_float_broadcast_sse :: Length + -> Width + -> CmmExpr + -> NatM Register + vector_float_broadcast_sse len W32 expr + = do + (reg, exp) <- get_float_broadcast_value_reg expr + let f = VecFormat len FmtFloat + addr = spRel platform 0 code dst = exp `snocOL` - (XOR format (OpReg tmp) (OpReg tmp)) `snocOL` - (MOVU format (OpReg tmp) (OpReg dst)) `snocOL` - (SUB format (OpReg reg) (OpReg dst)) - return (Any format code) + (MOVU f (OpReg reg) (OpAddr addr)) `snocOL` + (insertps $ 0b1110) `snocOL` + (insertps $ 16) `snocOL` + (insertps $ 32) `snocOL` + (insertps $ 48) + where + insertps imm = + INSERTPS f (ImmInt imm) (OpAddr addr) dst + + in return $ Any f code + vector_float_broadcast_sse len W64 expr + = do + (reg, exp) <- get_float_broadcast_value_reg expr + let f = VecFormat len FmtDouble + addr = spRel platform 0 + in return $ Any f (\dst -> exp `snocOL` + (MOVU f (OpReg reg) (OpAddr addr)) `snocOL` + (MOVL f (OpAddr addr) (OpReg dst)) `snocOL` + (MOVH f (OpAddr addr) (OpReg dst))) + vector_float_broadcast_sse _ _ c + = pprPanic "Broadcast not supported for : " (pdoc platform c) + + vector_int_broadcast :: Length + -> Width + -> CmmExpr + -> NatM Register + vector_int_broadcast len W64 expr + = do + (reg, exp) <- getSomeReg expr + let fmt = VecFormat len FmtInt64 + return $ Any fmt (\dst -> exp `snocOL` + (MOVD II64 (OpReg reg) (OpReg dst)) `snocOL` + (PUNPCKLQDQ fmt (OpReg dst) dst) + ) + vector_int_broadcast _ _ c + = pprPanic "Broadcast not supported for : " (pdoc platform c) + getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps sse2 <- sse2Enabled @@ -1294,6 +1390,16 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_U_Shr rep -> shift_code rep SHR x y {-False-} MO_S_Shr rep -> shift_code rep SAR x y {-False-} + MO_VF_Shuffle l w is + | l * widthInBits w == 128 + -> if + | avx + -> vector_shuffle_float l w x y is + | otherwise + -> sorry "Please enable the -mavx flag" + | otherwise + -> sorry "Please use -fllvm for wide shuffle instructions" + MO_VF_Extract l W32 | avx -> vector_float_extract l W32 x y | sse -> vector_float_extract_sse l W32 x y | otherwise @@ -1332,6 +1438,7 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps -> sorry "Please enable the -mavx or -msse flag" -- SIMD NCG TODO: integer vector operations + MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop MO_V_Sub {} -> needLlvm mop MO_V_Mul {} -> needLlvm mop @@ -1356,6 +1463,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_AlignmentCheck {} -> incorrectOperands MO_VS_Neg {} -> incorrectOperands MO_VF_Neg {} -> incorrectOperands + MO_V_Broadcast {} -> incorrectOperands + MO_VF_Broadcast {} -> incorrectOperands -- Ternary MachOps MO_FMA {} -> incorrectOperands @@ -1674,13 +1783,95 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps vector_int_extract_sse _ w c e = pprPanic "Unsupported SSE floating-point vector extract" (pdoc platform c $$ pdoc platform e $$ ppr w) + vector_shuffle_float :: Length -> Width -> CmmExpr -> CmmExpr -> [Int] -> NatM Register + vector_shuffle_float l w v1 v2 is = do + (r1, exp1) <- getSomeReg v1 + (r2, exp2) <- getSomeReg v2 + let fmt = VecFormat l (if w == W32 then FmtFloat else FmtDouble) + code dst + = exp1 `appOL` (exp2 `appOL` shuffleInstructions fmt r1 r2 is dst) + return (Any fmt code) + + shuffleInstructions :: Format -> Reg -> Reg -> [Int] -> Reg -> OrdList Instr + shuffleInstructions fmt v1 v2 is dst = + case fmt of + VecFormat 2 FmtDouble -> + case is of + [i1, i2] -> case (i1, i2) of + (0,0) -> unitOL (VSHUFPD fmt (ImmInt 0b00) (OpReg v1) v1 dst) + (1,1) -> unitOL (VSHUFPD fmt (ImmInt 0b11) (OpReg v1) v1 dst) + (2,2) -> unitOL (VSHUFPD fmt (ImmInt 0b00) (OpReg v2) v2 dst) + (3,3) -> unitOL (VSHUFPD fmt (ImmInt 0b11) (OpReg v2) v2 dst) + (0,1) -> unitOL (VMOVU fmt (OpReg v1) (OpReg dst)) + (2,3) -> unitOL (VMOVU fmt (OpReg v2) (OpReg dst)) + (1,0) -> unitOL (VSHUFPD fmt (ImmInt 0b01) (OpReg v1) v1 dst) + (3,2) -> unitOL (VSHUFPD fmt (ImmInt 0b01) (OpReg v2) v2 dst) + (0,2) -> unitOL (VSHUFPD fmt (ImmInt 0b00) (OpReg v2) v1 dst) + (2,0) -> unitOL (VSHUFPD fmt (ImmInt 0b00) (OpReg v1) v2 dst) + (0,3) -> unitOL (VSHUFPD fmt (ImmInt 0b10) (OpReg v2) v1 dst) + (3,0) -> unitOL (VSHUFPD fmt (ImmInt 0b01) (OpReg v1) v2 dst) + (1,2) -> unitOL (VSHUFPD fmt (ImmInt 0b01) (OpReg v2) v1 dst) + (2,1) -> unitOL (VSHUFPD fmt (ImmInt 0b10) (OpReg v1) v2 dst) + (1,3) -> unitOL (VSHUFPD fmt (ImmInt 0b11) (OpReg v2) v1 dst) + (3,1) -> unitOL (VSHUFPD fmt (ImmInt 0b11) (OpReg v1) v2 dst) + _ -> pprPanic "vector shuffle: indices out of bounds 0 <= i <= 3" (ppr is) + _ -> pprPanic "vector shuffle: wrong number of indices (expected 2)" (ppr is) + VecFormat 4 FmtFloat + -- indices 0 <= i <= 7 + | all ( (>= 0) <&&> (<= 7) ) is -> + case is of + [i1, i2, i3, i4] + | all ( <= 3 ) is + , let imm = i1 + i2 `shiftL` 2 + i3 `shiftL` 4 + i4 `shiftL` 6 + -> unitOL (VSHUFPS fmt (ImmInt imm) (OpReg v1) v1 dst) + | all ( >= 4 ) is + , let [j1, j2, j3, j4] = map ( subtract 4 ) is + imm = j1 + j2 `shiftL` 2 + j3 `shiftL` 4 + j4 `shiftL` 6 + -> unitOL (VSHUFPS fmt (ImmInt imm) (OpReg v2) v2 dst) + | i1 <= 3, i2 <= 3 + , i3 >= 4, i4 >= 4 + , let imm = i1 + i2 `shiftL` 2 + (i3 - 4) `shiftL` 4 + (i4 - 4) `shiftL` 6 + -> unitOL (VSHUFPS fmt (ImmInt imm) (OpReg v2) v1 dst) + | i1 >= 4, i2 >= 4 + , i3 <= 3, i4 <= 3 + , let imm = (i1 - 4) + (i2 - 4) `shiftL` 2 + i3 `shiftL` 4 + i4 `shiftL` 6 + -> unitOL (VSHUFPS fmt (ImmInt imm) (OpReg v1) v2 dst) + | otherwise + -> + -- Fall-back code with 4 INSERTPS operations. + -- SIMD NCG TODO: handle more cases with better lowering. + let -- bits: ss_dd_zzzz + -- ss: pick source location + -- dd: pick destination location + -- zzzz: pick locations to be zeroed + insertImm src dst = shiftL ( src `mod` 4 ) 6 + .|. shiftL dst 4 + vec src = if src >= 4 then v2 else v1 + in unitOL + (INSERTPS fmt (ImmInt $ insertImm i1 0 .|. 0b1110) (OpReg $ vec i1) dst) + `snocOL` + (INSERTPS fmt (ImmInt $ insertImm i2 1) (OpReg $ vec i2) dst) + `snocOL` + (INSERTPS fmt (ImmInt $ insertImm i3 2) (OpReg $ vec i3) dst) + `snocOL` + (INSERTPS fmt (ImmInt $ insertImm i4 3) (OpReg $ vec i4) dst) + _ -> pprPanic "vector shuffle: wrong number of indices (expected 4)" (ppr is) + | otherwise + -> pprPanic "vector shuffle: indices out of bounds 0 <= i <= 7" (ppr is) + _ -> + pprPanic "vector shuffle: unsupported format" (ppr fmt) + getRegister' platform _is32Bit (CmmMachOp mop [x, y, z]) = do -- ternary MachOps sse4_1 <- sse4_1Enabled sse2 <- sse2Enabled sse <- sseEnabled case mop of -- Floating point fused multiply-add operations @ ± x*y ± z@ - MO_FMA var w -> genFMA3Code w var x y z + MO_FMA var l w + | l * widthInBits w > 256 + -> sorry "Please use -fllvm for wide vector FMA support" + | otherwise + -> genFMA3Code l w var x y z -- Ternary vector operations MO_VF_Insert l W32 | sse4_1 && sse -> vector_float_insert_sse l W32 x y z @@ -1875,33 +2066,48 @@ getRegister' platform is32Bit (CmmLit lit) -- note2: all labels are small, because we're assuming the -- small memory model. See Note [%rip-relative addressing on x86-64]. -getRegister' platform _ (CmmLit lit) - | isVecType cmmtype = vectorRegister cmmtype - | otherwise = standardRegister cmmtype - where - cmmtype = cmmLitType platform lit - vectorRegister ctype - | case lit of { CmmVec fs -> all (\case { CmmInt i _ -> i == 0; CmmFloat f _ -> f == 0; _ -> False }) fs; _ -> False } - = -- NOTE: - -- This operation is only used to zero a register. For loading a - -- vector literal there are pack and broadcast operations - let format = cmmTypeFormat ctype - code dst = unitOL (XOR format (OpReg dst) (OpReg dst)) - in return (Any format code) +getRegister' platform _ (CmmLit lit) = + case fmt of + VecFormat l sFmt + | case lit of { CmmVec fs -> all is_zero fs; _ -> False } + -> let code dst = unitOL (XOR fmt (OpReg dst) (OpReg dst)) + in return (Any fmt code) + | Just f <- case lit of { CmmVec (f:fs) | all (== f) fs -> Just f; _ -> Nothing } + -> do config <- getConfig + let w = scalarWidth sFmt + broadcast = if isFloatScalarFormat sFmt + then MO_VF_Broadcast l w + else MO_V_Broadcast l w + (valReg, valCode) <- getSomeReg (CmmMachOp broadcast [CmmLit f]) + let code dst = + valCode `snocOL` + (mkRegRegMoveInstr config fmt valReg dst) + return $ Any fmt code | otherwise - = pprPanic "getRegister': no support for (nonzero) vector literals" $ - vcat [ text "lit:" <+> ppr lit ] - -- SIMD NCG TODO: can we do better here? - standardRegister ctype - = do - let format = cmmTypeFormat ctype - imm = litToImm lit - code dst = unitOL (MOV format (OpImm imm) (OpReg dst)) - return (Any format code) + -- SIMD NCG TODO: handle this case as well. + -> pprPanic "getRegister': non-constant vector literals not supported" + (ppr lit) + where + is_zero (CmmInt i _) = i == 0 + is_zero (CmmFloat f _) = f == 0 -- TODO: mishandles negative zero + is_zero _ = False + + _ -> let imm = litToImm lit + code dst = unitOL (MOV fmt (OpImm imm) (OpReg dst)) + in return (Any fmt code) + where + cmmTy = cmmLitType platform lit + fmt = cmmTypeFormat cmmTy getRegister' platform _ other = pprPanic "getRegister(x86)" (pdoc platform other) +getFloatLitRegister :: CmmLit -> NatM Register +getFloatLitRegister lit = do + let w :: Width + w = case lit of { CmmInt _ w -> w; CmmFloat _ w -> w; _ -> panic "getFloatLitRegister" (ppr lit) } + Amode addr code <- memConstant (mkAlignment $ widthInBytes w) lit + loadFloatAmode w addr code intLoadCode :: (Operand -> Operand -> Instr) -> CmmExpr -> NatM (Reg -> InstrBlock) @@ -3852,10 +4058,11 @@ _ `regClashesWithOp` _ = False -- | Generate code for a fused multiply-add operation, of the form @± x * y ± z@, -- with 3 operands (FMA3 instruction set). -genFMA3Code :: Width +genFMA3Code :: Length + -> Width -> FMASign -> CmmExpr -> CmmExpr -> CmmExpr -> NatM Register -genFMA3Code w signs x y z = do +genFMA3Code l w signs x y z = do config <- getConfig -- For the FMA instruction, we want to compute x * y + z -- @@ -3883,7 +4090,11 @@ genFMA3Code w signs x y z = do -- only possible if the other arguments don't use the destination register. -- We check for this and if there is a conflict we move the result only after -- the computation. See #24496 how this went wrong in the past. - let rep = floatFormat w + let rep + | l == 1 + = floatFormat w + | otherwise + = vecFormat (cmmVec l $ cmmFloat w) (y_reg, y_code) <- getNonClobberedReg y (z_op, z_code) <- getNonClobberedOperand z x_code <- getAnyReg x ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -259,6 +259,8 @@ data Instr | AND Format Operand Operand | OR Format Operand Operand | XOR Format Operand Operand + -- | AVX bitwise logical XOR operation + | VXOR Format Operand Reg Reg | NOT Format Operand | NEGI Format Operand -- NEG instruction (name clash with Cond) | BSWAP Format Reg @@ -295,8 +297,9 @@ data Instr -- | FMA3 fused multiply-add operations. | FMA3 Format FMASign FMAPermutation Operand Reg Reg - -- src3 (r/m), src2 (r), dst/src1 (r) - -- This is exactly reversed from how intel lists the arguments. + -- For the FMA213 permutation (the only one we use currently), + -- this is: src3 (r/m), src2 (r), dst/src1 (r) + -- (NB: this isexactly reversed from how Intel lists the arguments.) -- use ADD, SUB, and SQRT for arithmetic. In both cases, operands -- are Operand Reg. @@ -476,9 +479,16 @@ regUsageOfInstr platform instr OR fmt src dst -> usageRM fmt src dst XOR fmt (OpReg src) (OpReg dst) - | src == dst -> mkRU [] [mk fmt dst] + | src == dst + -> mkRU [] [mk fmt dst] + XOR fmt src dst + -> usageRM fmt src dst + VXOR fmt (OpReg src1) src2 dst + | src1 == src2, src1 == dst + -> mkRU [] [mk fmt dst] + VXOR fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] - XOR fmt src dst -> usageRM fmt src dst NOT fmt op -> usageM fmt op BSWAP fmt reg -> mkRU [mk fmt reg] [mk fmt reg] NEGI fmt op -> usageM fmt op @@ -721,6 +731,7 @@ patchRegsOfInstr platform instr env AND fmt src dst -> patch2 (AND fmt) src dst OR fmt src dst -> patch2 (OR fmt) src dst XOR fmt src dst -> patch2 (XOR fmt) src dst + VXOR fmt src1 src2 dst -> VXOR fmt (patchOp src1) (env src2) (env dst) NOT fmt op -> patch1 (NOT fmt) op BSWAP fmt reg -> BSWAP fmt (env reg) NEGI fmt op -> patch1 (NEGI fmt) op @@ -763,6 +774,8 @@ patchRegsOfInstr platform instr env LOCATION {} -> instr UNWIND {} -> instr DELTA _ -> instr + LDATA {} -> instr + NEWBLOCK {} -> instr JXX _ _ -> instr JXX_GBL _ _ -> instr @@ -829,8 +842,6 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) - _other -> panic "patchRegs: unrecognised instr" - where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -752,11 +752,14 @@ pprInstr platform i = case i of XOR format src dst -> pprFormatOpOp (text "xor") format src dst + VXOR fmt src1 src2 dst + -> pprVxor fmt src1 src2 dst + POPCNT format src dst -> pprOpOp (text "popcnt") format src (OpReg dst) LZCNT format src dst - -> pprOpOp (text "lzcnt") format src (OpReg dst) + -> pprOpOp (text "lzcnt") format src (OpReg dst) TZCNT format src dst -> pprOpOp (text "tzcnt") format src (OpReg dst) @@ -1304,6 +1307,23 @@ pprInstr platform i = case i of pprReg platform format reg3 ] + pprVxor :: Format -> Operand -> Reg -> Reg -> doc + pprVxor fmt src1 src2 dst + = line $ hcat [ + pprGenMnemonic mem fmt, + pprOperand platform fmt src1, + comma, + pprReg platform fmt src2, + comma, + pprReg platform fmt dst + ] + where + mem = case fmt of + VecFormat _ FmtFloat -> text "vxorps" + VecFormat _ FmtDouble -> text "vxorpd" + _ -> pprPanic "GHC.CmmToAsm.X86.Ppr.pprVxor: elementy type must be Float or Double" + (ppr fmt) + pprInsert :: Line doc -> Format -> Imm -> Operand -> Reg -> doc pprInsert name format off src dst = line $ hcat [ ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -727,7 +727,7 @@ pprMachOp_for_C platform mop = case mop of MO_F_Quot _ -> char '/' -- Floating-point fused multiply-add operations - MO_FMA FMAdd w -> + MO_FMA FMAdd 1 w -> case w of W32 -> text "fmaf" W64 -> text "fma" @@ -736,10 +736,15 @@ pprMachOp_for_C platform mop = case mop of (text "FMAdd") (panic $ "PprC.pprMachOp_for_C: FMAdd unsupported" ++ "at width " ++ show w) - MO_FMA var _ -> - pprTrace "offending mop:" + MO_FMA var l width + | l == 1 + -> pprTrace "offending mop:" (text $ "FMA " ++ show var) (panic $ "PprC.pprMachOp_for_C: should have been handled earlier!") + | otherwise + -> pprTrace "offending mop:" + (text $ "FMA " ++ show var ++ " " ++ show l ++ " " ++ show width) + (panic $ "PprC.pprMachOp_for_C: unsupported vector operation") -- Signed comparisons MO_S_Ge _ -> text ">=" @@ -828,6 +833,14 @@ pprMachOp_for_C platform mop = case mop of MO_AlignmentCheck {} -> panic "-falignment-sanitisation not supported by unregisterised backend" -- SIMD vector instructions: currently unsupported + MO_V_Shuffle {} -> pprTrace "offending mop:" + (text "MO_V_Shuffle") + (panic $ "PprC.pprMachOp_for_C: MO_V_Shuffle" + ++ "unsupported by the unregisterised backend") + MO_VF_Shuffle {} -> pprTrace "offending mop:" + (text "MO_VF_Shuffle") + (panic $ "PprC.pprMachOp_for_C: MO_VF_Shuffle" + ++ "unsupported by the unregisterised backend") MO_V_Insert {} -> pprTrace "offending mop:" (text "MO_V_Insert") (panic $ "PprC.pprMachOp_for_C: MO_V_Insert" @@ -868,6 +881,14 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VU_Rem") (panic $ "PprC.pprMachOp_for_C: MO_VU_Rem" ++ "unsupported by the unregisterised backend") + MO_V_Broadcast {} -> pprTrace "offending mop:" + (text "MO_V_Broadcast") + (panic $ "PprC.pprMachOp_for_C: MO_V_Broadcast" + ++ "unsupported by the unregisterised backend") + MO_VF_Broadcast {} -> pprTrace "offending mop:" + (text "MO_VF_Broadcast") + (panic $ "PprC.pprMachOp_for_C: MO_VF_Broadcast" + ++ "unsupported by the unregisterised backend") MO_VF_Insert {} -> pprTrace "offending mop:" (text "MO_VF_Insert") (panic $ "PprC.pprMachOp_for_C: MO_VF_Insert" ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1460,6 +1460,9 @@ genMachOp _ op [x] = case op of all0s = LMLitVar $ LMVectorLit (replicate len all0) in negateVec vecty all0s LM_MO_FSub + MO_V_Broadcast l w -> genBroadcastOp l w x + MO_VF_Broadcast l w -> genBroadcastOp l w x + MO_RelaxedRead w -> exprToVar (CmmLoad x (cmmBits w) NaturallyAligned) MO_AlignmentCheck _ _ -> panic "-falignment-sanitisation is not supported by -fllvm" @@ -1491,7 +1494,7 @@ genMachOp _ op [x] = case op of MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp - MO_FMA _ _ -> panicOp + MO_FMA _ _ _ -> panicOp MO_F_Eq _ -> panicOp MO_F_Ne _ -> panicOp @@ -1523,6 +1526,9 @@ genMachOp _ op [x] = case op of MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp + MO_V_Shuffle {} -> panicOp + MO_VF_Shuffle {} -> panicOp + MO_VF_Add _ _ -> panicOp MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp @@ -1676,7 +1682,7 @@ genMachOp_slow opt op [x, y] = case op of MO_F_Mul _ -> genBinMach LM_MO_FMul MO_F_Quot _ -> genBinMach LM_MO_FDiv - MO_FMA _ _ -> panicOp + MO_FMA _ _ _ -> panicOp MO_And _ -> genBinMach LM_MO_And MO_Or _ -> genBinMach LM_MO_Or @@ -1716,9 +1722,14 @@ genMachOp_slow opt op [x, y] = case op of MO_VS_Neg {} -> panicOp + MO_VF_Broadcast {} -> panicOp + MO_V_Broadcast {} -> panicOp MO_V_Insert {} -> panicOp MO_VF_Insert {} -> panicOp + MO_V_Shuffle _ _ is -> genShuffleOp is x y + MO_VF_Shuffle _ _ is -> genShuffleOp is x y + MO_VF_Neg {} -> panicOp MO_RelaxedRead {} -> panicOp @@ -1815,7 +1826,7 @@ genMachOp_slow _opt op [x, y, z] = do panicOp = panic $ "LLVM.CodeGen.genMachOp_slow: non-ternary op encountered " ++ "with three arguments! (" ++ show op ++ ")" case op of - MO_FMA var width -> + MO_FMA var lg width -> case var of -- LLVM only has the fmadd variant. FMAdd -> genFmaOp x y z @@ -1825,12 +1836,43 @@ genMachOp_slow _opt op [x, y, z] = do FNMAdd -> genFmaOp (neg x) y z FNMSub -> genFmaOp (neg x) y (neg z) where - neg x = CmmMachOp (MO_F_Neg width) [x] + neg x + | lg == 1 + = CmmMachOp (MO_F_Neg width) [x] + | otherwise + = CmmMachOp (MO_VF_Neg lg width) [x] _ -> panicOp -- More than three expressions, invalid! genMachOp_slow _ _ _ = panic "genMachOp_slow: More than 3 expressions in MachOp!" +genBroadcastOp :: Int -> Width -> CmmExpr -> LlvmM ExprData +genBroadcastOp lg _width x = runExprData $ do + -- To broadcast a scalar x as a vector v: + -- 1. insert x at the 0 position of the zero vector + -- 2. shuffle x into all positions + var_x <- exprToVarW x + let tx = getVarType var_x + tv = LMVector lg tx + z = if isFloat tx + then LMFloatLit 0 tx + else LMIntLit 0 tx + zs = LMLitVar $ LMVectorLit $ replicate lg z + w <- doExprW tv $ Insert zs var_x (LMLitVar $ LMIntLit 0 (LMInt 32)) + doExprW tv $ Shuffle w w (replicate lg 0) + +genShuffleOp :: [Int] -> CmmExpr -> CmmExpr -> LlvmM ExprData +genShuffleOp is x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + Panic.massertPpr + (tx == ty) + (vcat [ text "shuffle: mismatched arg types" + , ppLlvmType tx, ppLlvmType ty ]) + doExprW tx $ Shuffle vx vy is + -- | Generate code for a fused multiply-add operation. genFmaOp :: CmmExpr -> CmmExpr -> CmmExpr -> LlvmM ExprData genFmaOp x y z = runExprData $ do @@ -1847,6 +1889,12 @@ genFmaOp x y z = runExprData $ do let fname = case tx of LMFloat -> fsLit "llvm.fma.f32" LMDouble -> fsLit "llvm.fma.f64" + LMVector 4 LMFloat -> fsLit "llvm.fma.v4f32" + LMVector 8 LMFloat -> fsLit "llvm.fma.v8f32" + LMVector 16 LMFloat -> fsLit "llvm.fma.v16f32" + LMVector 2 LMDouble -> fsLit "llvm.fma.v2f64" + LMVector 4 LMDouble -> fsLit "llvm.fma.v4f64" + LMVector 8 LMDouble -> fsLit "llvm.fma.v8f64" _ -> pprPanic "CmmToLlvm.genFmaOp: unsupported type" (ppLlvmType tx) fptr <- liftExprData $ getInstrinct fname ty [tx, ty, tz] doExprW tx $ Call StdCall fptr [vx, vy, vz] [ReadNone, NoUnwind] ===================================== compiler/GHC/Llvm/Ppr.hs ===================================== @@ -281,6 +281,7 @@ ppLlvmExpression opts expr Extract vec idx -> ppExtract opts vec idx ExtractV struct idx -> ppExtractV opts struct idx Insert vec elt idx -> ppInsert opts vec elt idx + Shuffle v1 v2 idxs -> ppShuffle opts v1 v2 idxs GetElemPtr inb ptr indexes -> ppGetElementPtr opts inb ptr indexes Load ptr align -> ppLoad opts ptr align ALoad ord st ptr -> ppALoad opts ord st ptr @@ -577,6 +578,15 @@ ppInsert opts vec elt idx = {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +ppShuffle :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> [Int] -> doc +ppShuffle opts v1 v2 idxs = + text "shufflevector" + <+> ppLlvmType (getVarType v1) <+> ppName opts v1 <> comma + <+> ppLlvmType (getVarType v2) <+> ppName opts v2 <> comma + <+> ppLlvmType (LMVector (length idxs) (LMInt 32)) <+> ppLit opts (LMVectorLit $ map ((`LMIntLit` (LMInt 32)) . fromIntegral) idxs) +{-# SPECIALIZE ppShuffle :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [Int] -> SDoc #-} +{-# SPECIALIZE ppShuffle :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [Int] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable + ppMetaAnnotExpr :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> doc ppMetaAnnotExpr opts meta expr = ppLlvmExpression opts expr <> ppMetaAnnots opts meta ===================================== compiler/GHC/Llvm/Syntax.hs ===================================== @@ -237,6 +237,10 @@ data LlvmExpression -} | Insert LlvmVar LlvmVar LlvmVar + {- | Shuffle two vectors into a destination vector using given indices + -} + | Shuffle LlvmVar LlvmVar [Int] + {- | Allocate amount * sizeof(tp) bytes on the heap * tp: LlvmType to reserve room for ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -949,16 +949,8 @@ emitPrimOp cfg primop = -- SIMD primops (VecBroadcastOp vcat n w) -> \[e] -> opIntoRegs $ \[res] -> do checkVecCompatibility cfg vcat n w - doVecPackOp ty zeros (replicate n e) res + doVecBroadcastOp ty e res where - zeros :: CmmExpr - zeros = CmmLit $ CmmVec (replicate n zero) - - zero :: CmmLit - zero = case vcat of - IntVec -> CmmInt 0 w - WordVec -> CmmInt 0 w - FloatVec -> CmmFloat 0 w ty :: CmmType ty = vecVmmType vcat n w @@ -1085,6 +1077,10 @@ emitPrimOp cfg primop = ty :: CmmType ty = vecCmmCat vcat w + VecShuffleOp vcat n w -> \ args -> opIntoRegs $ \ [res] -> do + checkVecCompatibility cfg vcat n w + doShuffleOp (vecVmmType vcat n w) args res + -- Prefetch PrefetchByteArrayOp3 -> \args -> opIntoRegs $ \[] -> doPrefetchByteArrayOp 3 args @@ -1491,10 +1487,10 @@ emitPrimOp cfg primop = DoubleDivOp -> opTranslate (MO_F_Quot W64) DoubleNegOp -> opTranslate (MO_F_Neg W64) - DoubleFMAdd -> fmaOp FMAdd W64 - DoubleFMSub -> fmaOp FMSub W64 - DoubleFNMAdd -> fmaOp FNMAdd W64 - DoubleFNMSub -> fmaOp FNMSub W64 + DoubleFMAdd -> fmaOp FMAdd 1 W64 + DoubleFMSub -> fmaOp FMSub 1 W64 + DoubleFNMAdd -> fmaOp FNMAdd 1 W64 + DoubleFNMSub -> fmaOp FNMSub 1 W64 -- Float ops @@ -1511,10 +1507,10 @@ emitPrimOp cfg primop = FloatDivOp -> opTranslate (MO_F_Quot W32) FloatNegOp -> opTranslate (MO_F_Neg W32) - FloatFMAdd -> fmaOp FMAdd W32 - FloatFMSub -> fmaOp FMSub W32 - FloatFNMAdd -> fmaOp FNMAdd W32 - FloatFNMSub -> fmaOp FNMSub W32 + FloatFMAdd -> fmaOp FMAdd 1 W32 + FloatFMSub -> fmaOp FMSub 1 W32 + FloatFNMAdd -> fmaOp FNMAdd 1 W32 + FloatFNMSub -> fmaOp FNMSub 1 W32 -- Vector ops @@ -1542,6 +1538,12 @@ emitPrimOp cfg primop = (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + -- Vector FMA instructions + VecFMAdd _ n w -> fmaOp FMAdd n w + VecFMSub _ n w -> fmaOp FMSub n w + VecFNMAdd _ n w -> fmaOp FNMAdd n w + VecFNMSub _ n w -> fmaOp FNMSub n w + -- Conversions IntToDoubleOp -> opTranslate (MO_SF_Round (wordWidth platform) W64) @@ -1839,10 +1841,11 @@ emitPrimOp cfg primop = allowFMA = stgToCmmAllowFMAInstr cfg - fmaOp :: FMASign -> Width -> [CmmActual] -> PrimopCmmEmit - fmaOp signs w args@[arg_x, arg_y, arg_z] - | allowFMA signs - = opTranslate (MO_FMA signs w) args + fmaOp :: FMASign -> Length -> Width -> [CmmActual] -> PrimopCmmEmit + fmaOp signs l w args@[arg_x, arg_y, arg_z] + | allowFMA signs + || l > 1 -- (always use the MachOp for vector FMA) + = opTranslate (MO_FMA signs l w) args | otherwise = case signs of @@ -1851,12 +1854,16 @@ emitPrimOp cfg primop = -- Other fused multiply-add operations are implemented in terms of fmadd -- This is sound: it does not lose any precision. - FMSub -> fmaOp FMAdd w [arg_x, arg_y, neg arg_z] - FNMAdd -> fmaOp FMAdd w [neg arg_x, arg_y, arg_z] - FNMSub -> fmaOp FMAdd w [neg arg_x, arg_y, neg arg_z] + FMSub -> fmaOp FMAdd l w [arg_x, arg_y, neg arg_z] + FNMAdd -> fmaOp FMAdd l w [neg arg_x, arg_y, arg_z] + FNMSub -> fmaOp FMAdd l w [neg arg_x, arg_y, neg arg_z] where - neg x = CmmMachOp (MO_F_Neg w) [x] - fmaOp _ _ _ = panic "fmaOp: wrong number of arguments (expected 3)" + neg x + | l == 1 + = CmmMachOp (MO_F_Neg w) [x] + | otherwise + = CmmMachOp (MO_VF_Neg l w) [x] + fmaOp _ _ _ _ = panic "fmaOp: wrong number of arguments (expected 3)" data PrimopCmmEmit -- | Out of line fake primop that's actually just a foreign call to other @@ -2588,6 +2595,21 @@ checkVecCompatibility cfg vcat l w = ------------------------------------------------------------------------------ -- Helpers for translating vector packing and unpacking. +doVecBroadcastOp :: CmmType -- Type of vector + -> CmmExpr -- Element + -> CmmFormal -- Destination for result + -> FCode () +doVecBroadcastOp ty e dst + | isFloatType (vecElemType ty) + = emitAssign (CmmLocal dst) (CmmMachOp (MO_VF_Broadcast len wid) [e]) + | otherwise + = emitAssign (CmmLocal dst) (CmmMachOp (MO_V_Broadcast len wid) [e]) + where + len :: Length + len = vecLength ty + wid :: Width + wid = typeWidth (vecElemType ty) + doVecPackOp :: CmmType -- Type of vector -> [CmmExpr] -- Elements -> CmmFormal -- Destination for result @@ -2666,6 +2688,36 @@ doVecInsertOp ty src e idx res = do wid :: Width wid = typeWidth (vecElemType ty) +------------------------------------------------------------------------------ +-- Shuffles + +doShuffleOp :: CmmType -> [CmmExpr] -> LocalReg -> FCode () +doShuffleOp ty (v1:v2:idxs) res + | isVecType ty + = case mapMaybe idx_maybe idxs of + is + | length is == len + -> emitAssign (CmmLocal res) (CmmMachOp (mo is) [v1,v2]) + | otherwise + -> pprPanic "doShuffleOp" $ + vcat [ text "shuffle indices must be literals, 0 <= i <" <+> ppr len ] + | otherwise + = pprPanic "doShuffleOp" $ + vcat [ text "non-vector argument type:" <+> ppr ty ] + where + len = vecLength ty + wid = typeWidth $ vecElemType ty + mo = if isFloatType (vecElemType ty) + then MO_VF_Shuffle len wid + else MO_V_Shuffle len wid + idx_maybe (CmmLit (CmmInt i _)) + | let j :: Int; j = fromInteger i + , j >= 0, j < 2 * len + = Just j + idx_maybe _ = Nothing +doShuffleOp _ _ _ = + panic "doShuffleOp: wrong number of arguments" + ------------------------------------------------------------------------------ -- Helpers for translating prefetching. ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -1192,12 +1192,18 @@ genPrim prof bound ty op = case op of VecReadOffAddrOp _ _ _ -> unhandledPrimop op VecWriteOffAddrOp _ _ _ -> unhandledPrimop op + VecFMAdd {} -> unhandledPrimop op + VecFMSub {} -> unhandledPrimop op + VecFNMAdd {} -> unhandledPrimop op + VecFNMSub {} -> unhandledPrimop op + VecIndexScalarByteArrayOp _ _ _ -> unhandledPrimop op VecReadScalarByteArrayOp _ _ _ -> unhandledPrimop op VecWriteScalarByteArrayOp _ _ _ -> unhandledPrimop op VecIndexScalarOffAddrOp _ _ _ -> unhandledPrimop op VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op + VecShuffleOp _ _ _ -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -111,6 +111,19 @@ Runtime system - Usage of deprecated primops is now correctly reported (#19629). +- New fused multiply-add instructions for vectors of floating-point values, + such as ``fmaddFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# -> FloatX4#`` and + ``fnmsubDoubleX2# :: DoubleX2# -> DoubleX2# -> DoubleX2# -> DoubleX2#``. + These follow the same semantics as ``fmadd``/``fmsub``/``fnmadd``/``fnmsub``, + operating in parallel on vectors of floating-point values. + +- New vector shuffle instructions, such as ``shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4#``. + These instructions take two input vectors and a collection of indices (which must + be compile-time literal integers), and constructs a result vector by extracting + out the values at those indices. For instance, ``shuffleFloatX4#`` on input vectors with + components ``(# 0.1#, 11.1#, 22.1#, 33.1# #)`` and ``(# 44.1#, 55.1#, 66.1#, 77.1# #)``, + and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components + ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -147,6 +147,62 @@ import GHC.Prim hiding dataToTagSmall#, dataToTagLarge# -- whereFrom# is similarly internal. , whereFrom# + -- Don't re-export vector FMA instructions + , fmaddFloatX4# + , fmsubFloatX4# + , fnmaddFloatX4# + , fnmsubFloatX4# + , fmaddFloatX8# + , fmsubFloatX8# + , fnmaddFloatX8# + , fnmsubFloatX8# + , fmaddFloatX16# + , fmsubFloatX16# + , fnmaddFloatX16# + , fnmsubFloatX16# + , fmaddDoubleX2# + , fmsubDoubleX2# + , fnmaddDoubleX2# + , fnmsubDoubleX2# + , fmaddDoubleX4# + , fmsubDoubleX4# + , fnmaddDoubleX4# + , fnmsubDoubleX4# + , fmaddDoubleX8# + , fmsubDoubleX8# + , fnmaddDoubleX8# + , fnmsubDoubleX8# + -- Don't re-export SIMD shuffle primops + , shuffleDoubleX2# + , shuffleDoubleX4# + , shuffleDoubleX8# + , shuffleFloatX16# + , shuffleFloatX4# + , shuffleFloatX8# + , shuffleInt16X16# + , shuffleInt16X32# + , shuffleInt16X8# + , shuffleInt32X16# + , shuffleInt32X4# + , shuffleInt32X8# + , shuffleInt64X2# + , shuffleInt64X4# + , shuffleInt64X8# + , shuffleInt8X16# + , shuffleInt8X32# + , shuffleInt8X64# + , shuffleWord16X16# + , shuffleWord16X32# + , shuffleWord16X8# + , shuffleWord32X16# + , shuffleWord32X4# + , shuffleWord32X8# + , shuffleWord64X2# + , shuffleWord64X4# + , shuffleWord64X8# + , shuffleWord8X16# + , shuffleWord8X32# + , shuffleWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -120,6 +120,62 @@ import GHC.Prim hiding , dataToTagSmall#, dataToTagLarge# -- whereFrom# is similarly internal. , whereFrom# + -- Don't re-export vector FMA instructions + , fmaddFloatX4# + , fmsubFloatX4# + , fnmaddFloatX4# + , fnmsubFloatX4# + , fmaddFloatX8# + , fmsubFloatX8# + , fnmaddFloatX8# + , fnmsubFloatX8# + , fmaddFloatX16# + , fmsubFloatX16# + , fnmaddFloatX16# + , fnmsubFloatX16# + , fmaddDoubleX2# + , fmsubDoubleX2# + , fnmaddDoubleX2# + , fnmsubDoubleX2# + , fmaddDoubleX4# + , fmsubDoubleX4# + , fnmaddDoubleX4# + , fnmsubDoubleX4# + , fmaddDoubleX8# + , fmsubDoubleX8# + , fnmaddDoubleX8# + , fnmsubDoubleX8# + -- Don't re-export SIMD shuffle primops + , shuffleDoubleX2# + , shuffleDoubleX4# + , shuffleDoubleX8# + , shuffleFloatX16# + , shuffleFloatX4# + , shuffleFloatX8# + , shuffleInt16X16# + , shuffleInt16X32# + , shuffleInt16X8# + , shuffleInt32X16# + , shuffleInt32X4# + , shuffleInt32X8# + , shuffleInt64X2# + , shuffleInt64X4# + , shuffleInt64X8# + , shuffleInt8X16# + , shuffleInt8X32# + , shuffleInt8X64# + , shuffleWord16X16# + , shuffleWord16X32# + , shuffleWord16X8# + , shuffleWord32X16# + , shuffleWord32X4# + , shuffleWord32X8# + , shuffleWord64X2# + , shuffleWord64X4# + , shuffleWord64X8# + , shuffleWord8X16# + , shuffleWord8X32# + , shuffleWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -22,4 +22,5 @@ test('simd009', [ req_th ] , multimod_compile_and_run, ['simd009', '']) test('simd010', [], compile_and_run, ['']) +test('simd011', [when(have_cpu_feature('fma'), extra_hc_opts('-mfma'))], compile_and_run, ['']) test('simd012', [], compile_and_run, ['']) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -123,17 +123,15 @@ instance Arbitrary Word32 where newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where - FloatNT f1 == FloatNT f2 = f1 == f2 - -- TODO: tests fail with this equality due to signed zeros - -- castFloatToWord32 f1 == castFloatToWord32 f2 + FloatNT f1 == FloatNT f2 = + castFloatToWord32 f1 == castFloatToWord32 f2 instance Arbitrary FloatNT where arbitrary = FloatNT . castWord32ToFloat <$> arbitrary newtype DoubleNT = DoubleNT Double deriving newtype (Show, Num) instance Eq DoubleNT where - DoubleNT d1 == DoubleNT d2 = d1 == d2 - -- TODO: tests fail with this equality due to signed zeros - -- castDoubleToWord64 d1 == castDoubleToWord64 d2 + DoubleNT d1 == DoubleNT d2 = + castDoubleToWord64 d1 == castDoubleToWord64 d2 instance Arbitrary DoubleNT where arbitrary = DoubleNT . castWord64ToDouble <$> arbitrary ===================================== testsuite/tests/simd/should_run/simd011.stdout ===================================== @@ -0,0 +1,8 @@ +(1011.11,2044.4401,3099.99,4177.7603) +(-988.89,-1955.5599,-2900.01,-3822.24) +(988.89,1955.5599,2900.01,3822.24) +(-1011.11,-2044.4401,-3099.99,-4177.7603) +(1011.11,2044.44) +(-988.89,-1955.56) +(988.89,1955.56) +(-1011.11,-2044.44) ===================================== utils/genprimopcode/Lexer.x ===================================== @@ -67,6 +67,7 @@ words :- <0> "SCALAR" { mkT TSCALAR } <0> "VECTOR" { mkT TVECTOR } <0> "VECTUPLE" { mkT TVECTUPLE } + <0> "INTVECTUPLE" { mkT TINTVECTUPLE } <0> [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } <0> [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } <0> \-? [0-9][0-9]* { mkTv (TInteger . read) } ===================================== utils/genprimopcode/Main.hs ===================================== @@ -79,6 +79,8 @@ desugarVectorSpec i = case vecOptions i of desugarTy (TyApp SCALAR []) = TyApp (TyCon repCon) [] desugarTy (TyApp VECTOR []) = TyApp (VecTyCon vecCons vecTyName) [] desugarTy (TyApp VECTUPLE []) = TyUTup (replicate n (TyApp (TyCon repCon) [])) + desugarTy (TyApp INTVECTUPLE []) + = TyUTup (replicate n (TyApp (TyCon "Int#") []) ) desugarTy (TyApp tycon ts) = TyApp tycon (map desugarTy ts) desugarTy t@(TyVar {}) = t desugarTy (TyUTup ts) = TyUTup (map desugarTy ts) ===================================== utils/genprimopcode/Parser.y ===================================== @@ -58,6 +58,7 @@ import AccessOps SCALAR { TSCALAR } VECTOR { TVECTOR } VECTUPLE { TVECTUPLE } + INTVECTUPLE { TINTVECTUPLE } bytearray_access_ops { TByteArrayAccessOps } addr_access_ops { TAddrAccessOps } thats_all_folks { TThatsAllFolks } @@ -215,6 +216,7 @@ pTycon : upperName { TyCon $1 } | SCALAR { SCALAR } | VECTOR { VECTOR } | VECTUPLE { VECTUPLE } + | INTVECTUPLE { INTVECTUPLE } { parse :: String -> Either String Info ===================================== utils/genprimopcode/ParserM.hs ===================================== @@ -124,6 +124,7 @@ data Token = TEOF | TSCALAR | TVECTOR | TVECTUPLE + | TINTVECTUPLE deriving Show -- Actions ===================================== utils/genprimopcode/Syntax.hs ===================================== @@ -87,6 +87,7 @@ data TyCon = TyCon String | SCALAR | VECTOR | VECTUPLE + | INTVECTUPLE | VecTyCon String String deriving (Eq, Ord) @@ -95,6 +96,7 @@ instance Show TyCon where show SCALAR = "SCALAR" show VECTOR = "VECTOR" show VECTUPLE = "VECTUPLE" + show INTVECTUPLE = "INTVECTUPLE" show (VecTyCon tc _) = tc -- Follow definitions of Fixity and FixityDirection in GHC View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2b57729572cd502b27b91635e0f37376306d583...f47ef2d5f999e43af1dcc333142368d91ee5d3af -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2b57729572cd502b27b91635e0f37376306d583...f47ef2d5f999e43af1dcc333142368d91ee5d3af You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:27:08 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 08:27:08 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] wip Message-ID: <6685439c895ad_11373f298b654859dc@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: b6426f66 by Fabricio de Sousa Nascimento at 2024-07-03T21:26:15+09:00 wip - - - - - 17 changed files: - + .hlint.yaml - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - libraries/array - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== .hlint.yaml ===================================== @@ -0,0 +1,69 @@ +# HLint configuration file +# https://github.com/ndmitchell/hlint +########################## + +# This file contains a template configuration file, which is typically +# placed as .hlint.yaml in the root of your project + + +# Specify additional command line arguments +# +# - arguments: [--color, --cpp-simple, -XQuasiQuotes] + + +# Control which extensions/flags/modules/functions can be used +# +# - extensions: +# - default: false # all extension are banned by default +# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used +# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module +# +# - flags: +# - {name: -w, within: []} # -w is allowed nowhere +# +# - modules: +# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set' +# - {name: Control.Arrow, within: []} # Certain modules are banned entirely +# +# - functions: +# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules + + +# Add custom hints for this project +# +# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar" +# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x} + +# The hints are named by the string they display in warning messages. +# For example, if you see a warning starting like +# +# Main.hs:116:51: Warning: Redundant == +# +# You can refer to that hint with `{name: Redundant ==}` (see below). + +# Turn on hints that are off by default +# +# Ban "module X(module X) where", to require a real export list +# - warn: {name: Use explicit module export list} +# +# Replace a $ b $ c with a . b $ c +# - group: {name: dollar, enabled: true} +# +# Generalise map to fmap, ++ to <> +# - group: {name: generalise, enabled: true} +# +# Warn on use of partial functions +# - group: {name: partial, enabled: true} + + +# Ignore some builtin hints +- ignore: {name: Use camelCase} +# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules + + +# Define some custom infix operators +# - fixity: infixr 3 ~^#^~ + + +# To generate a suitable file for HLint do: +# $ hlint --default > .hlint.yaml ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -111,9 +112,8 @@ import Control.Arrow ( first ) import Control.Monad import Data.Either ( partitionEithers ) import Data.Function ( on ) -import Data.List ( find, partition, groupBy, sortBy ) +import Data.List ( find, partition, groupBy, sortBy) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit ba5e9dcf1370190239395b8361b1c92ea9fc7632 +Subproject commit 510456786715d96dfc9e9bc4cead9aace1ce2db6 ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6426f661fa1b3dcc46600035c470e6e15ee132a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6426f661fa1b3dcc46600035c470e6e15ee132a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:28:00 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 08:28:00 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] wip Message-ID: <668543d0d74dd_11373f2a5f2b08696a@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 017bc112 by Fabricio de Sousa Nascimento at 2024-07-03T21:27:42+09:00 wip - - - - - 16 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - libraries/array - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -111,9 +112,8 @@ import Control.Arrow ( first ) import Control.Monad import Data.Either ( partitionEithers ) import Data.Function ( on ) -import Data.List ( find, partition, groupBy, sortBy ) +import Data.List ( find, partition, groupBy, sortBy) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== libraries/array ===================================== @@ -1 +1 @@ -Subproject commit ba5e9dcf1370190239395b8361b1c92ea9fc7632 +Subproject commit 510456786715d96dfc9e9bc4cead9aace1ce2db6 ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/017bc1127fc7a167d6c43bdd09f80ab71a495bfb -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/017bc1127fc7a167d6c43bdd09f80ab71a495bfb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:30:48 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 08:30:48 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 2 commits: Use inherited tag rather than 'Q' Message-ID: <66854478b6cf9_11373f2ba74c4895fc@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 1acd4b62 by Rodrigo Mesquita at 2024-07-03T13:29:01+01:00 Use inherited tag rather than 'Q' - - - - - f0a4b1b5 by Rodrigo Mesquita at 2024-07-03T13:30:42+01:00 Disable renaming to check performance - - - - - 2 changed files: - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/StgToCmm.hs Changes: ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -72,7 +72,7 @@ renameDetUniq uq = do Nothing -> do new_w <- gets supply -- New deterministic unique in this `DetRnM` let (tag, _) = unpkUnique uq - det_uniq = mkUnique 'Q' new_w + det_uniq = mkUnique tag new_w modify' (\DetUniqFM{mapping, supply} -> -- Update supply and mapping DetUniqFM ===================================== compiler/GHC/StgToCmm.hs ===================================== @@ -103,7 +103,8 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons let ((a, cmm), st') = runC cfg fstate st (getCmm fcode) - (rnm1, cmm_renamed) = detRenameUniques rnm0 cmm -- The yielded cmm will already be renamed. + (rnm1, cmm_renamed) = (rnm0, cmm) -- TODO: + {- ENABLE IF OPT-DETERMINISTIC FLAG: -} -- detRenameUniques rnm0 cmm -- The yielded cmm will already be renamed. -- NB. stub-out cgs_tops and cgs_stmts. This fixes -- a big space leak. DO NOT REMOVE! View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/db41639cebe5a771a1e862236b063ead5870979a...f0a4b1b54cd8bf6f28422eafe4e84c7a978b9251 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/db41639cebe5a771a1e862236b063ead5870979a...f0a4b1b54cd8bf6f28422eafe4e84c7a978b9251 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:38:21 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 08:38:21 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <6685463d7f65e_11373f2d28b4090297@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 9f244423 by Fabricio de Sousa Nascimento at 2024-07-03T21:36:42+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 15 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres -- it seems odd this is used here too +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9f244423a30a07ec7c45527691e7deaaf6747cac -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9f244423a30a07ec7c45527691e7deaaf6747cac You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:40:40 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 08:40:40 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <668546c89fa7c_11373f2e2bb289107d@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: e922de00 by Fabricio de Sousa Nascimento at 2024-07-03T21:40:14+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 15 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, for example T24452c + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrEltX info) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (mkUnboundGRERdr rdr_name) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,4 @@ +T25014c.hs:2:17: [GHC-45510] + Term variable ‘foo’ cannot be used here + (term variables cannot be promoted) + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e922de00ae8790c0347d670150244815b80c9154 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e922de00ae8790c0347d670150244815b80c9154 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 12:54:26 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 08:54:26 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/uniqdsm-cmm-onwards Message-ID: <66854a0250bf1_11373f30d8d3096236@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/uniqdsm-cmm-onwards at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/uniqdsm-cmm-onwards You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:13:11 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:13:11 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/deterministic-label-map Message-ID: <66854e67eac02_11373f34f71c810128a@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/deterministic-label-map You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:13:40 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:13:40 -0400 Subject: [Git][ghc/ghc][wip/romes/uniqdsm-cmm-onwards] UniqDSM det uniques + use in Cmm.Info Message-ID: <66854e849c473_11373f353ac341014fb@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/uniqdsm-cmm-onwards at Glasgow Haskell Compiler / GHC Commits: d625501a by Rodrigo Mesquita at 2024-07-03T14:13:26+01:00 UniqDSM det uniques + use in Cmm.Info Now for SRTs SRT generation using deterministic uniq supply Back LabelMap with deterministic UDFM TSAN uniq rename hard Revert "TSAN uniq rename hard" This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda. improvements to uniqdsm UniqDSM ProcPoint CmmLayoutStack UniqDet 90% of cpsTop UniqDSM Major progress in using UniqDSM in CmmToAsm and Ncg backends Fix imports Un-back label map with udfm Revert "Un-back label map with udfm" This reverts commit f5d2e4257214a3f7b7d845651e6662c5babfd6a3. - - - - - 30 changed files: - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Switch/Implement.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d625501aa9f66034adc652ca9ec9ff0e07d81dc8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d625501aa9f66034adc652ca9ec9ff0e07d81dc8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:22:34 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:22:34 -0400 Subject: [Git][ghc/ghc][wip/romes/deterministic-label-map] cmm: Back LabelMap with UDFM Message-ID: <6685509ad04ca_11373f37386e41017d9@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC Commits: 1f94ce0e by Rodrigo Mesquita at 2024-07-03T14:22:21+01:00 cmm: Back LabelMap with UDFM Use a deterministic unique map to back the implementation of `LabelMap`. This is necessary towards the goal of object code determinism in #12935. Our intended solution requires renaming uniques in a deterministic order (which will be the order in which they were created), but storing them label map makes us lose this order. Backing it with a UDFM fixes this issue. - - - - - 2 changed files: - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Types/Unique/DFM.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -45,17 +45,15 @@ module GHC.Cmm.Dataflow.Label , mapAlter , mapAdjust , mapUnion - , mapUnions , mapUnionWithKey + , mapUnions , mapDifference , mapIntersection - , mapIsSubmapOf , mapMap , mapMapWithKey , mapFoldl , mapFoldr , mapFoldlWithKey - , mapFoldMapWithKey , mapFilter , mapFilterWithKey , mapElems @@ -69,7 +67,7 @@ import GHC.Prelude import GHC.Utils.Outputable -import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) +import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily, getKey) -- The code generator will eventually be using all the labels stored in a -- LabelSet and LabelMap. For these reasons we use the strict variants of these @@ -77,12 +75,12 @@ import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) -- to fire. import GHC.Data.Word64Set (Word64Set) import qualified GHC.Data.Word64Set as S -import GHC.Data.Word64Map.Strict (Word64Map) -import qualified GHC.Data.Word64Map.Strict as M import GHC.Data.TrieMap +import GHC.Types.Unique.DFM import Data.Word (Word64) import Data.List (foldl1') +import GHC.Data.Maybe (fromMaybe) ----------------------------------------------------------------------------- @@ -173,114 +171,109 @@ setFromList ks = LS (S.fromList (map lblToUnique ks)) ----------------------------------------------------------------------------- -- LabelMap -newtype LabelMap v = LM (Word64Map v) - deriving newtype (Eq, Ord, Show, Functor, Foldable) +newtype LabelMap v = LM (UniqDFM Word64 v) + deriving newtype (Functor, Foldable) deriving stock Traversable mapNull :: LabelMap a -> Bool -mapNull (LM m) = M.null m +mapNull (LM m) = isNullUDFM m {-# INLINE mapSize #-} mapSize :: LabelMap a -> Int -mapSize (LM m) = M.size m +mapSize (LM m) = sizeUDFM m mapMember :: Label -> LabelMap a -> Bool -mapMember (Label k) (LM m) = M.member k m +mapMember (Label k) (LM m) = elemUDFM k m mapLookup :: Label -> LabelMap a -> Maybe a -mapLookup (Label k) (LM m) = M.lookup k m +mapLookup (Label k) (LM m) = lookupUDFM m k mapFindWithDefault :: a -> Label -> LabelMap a -> a -mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m +mapFindWithDefault def (Label k) (LM m) = fromMaybe def $ lookupUDFM m k mapEmpty :: LabelMap v -mapEmpty = LM M.empty +mapEmpty = LM emptyUDFM mapSingleton :: Label -> v -> LabelMap v -mapSingleton (Label k) v = LM (M.singleton k v) +mapSingleton (Label k) v = LM (unitUDFM k v) mapInsert :: Label -> v -> LabelMap v -> LabelMap v -mapInsert (Label k) v (LM m) = LM (M.insert k v m) +mapInsert (Label k) v (LM m) = LM (addToUDFM m k v) mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v -mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) +mapInsertWith f (Label k) v (LM m) = LM (addToUDFM_C f m k v) mapDelete :: Label -> LabelMap v -> LabelMap v -mapDelete (Label k) (LM m) = LM (M.delete k m) +mapDelete (Label k) (LM m) = LM (delFromUDFM m k) mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v -mapAlter f (Label k) (LM m) = LM (M.alter f k m) +mapAlter f (Label k) (LM m) = LM (alterUDFM f m k) mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v -mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) +mapAdjust f (Label k) (LM m) = LM (adjustUDFM f m k) mapUnion :: LabelMap v -> LabelMap v -> LabelMap v -mapUnion (LM x) (LM y) = LM (M.union x y) +mapUnion (LM x) (LM y) = LM (plusUDFM x y) + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (plusUDFM_CK (f . mkHooplLabel . getKey) x y) {-# INLINE mapUnions #-} mapUnions :: [LabelMap a] -> LabelMap a mapUnions [] = mapEmpty mapUnions maps = foldl1' mapUnion maps -mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v -mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) - mapDifference :: LabelMap v -> LabelMap b -> LabelMap v -mapDifference (LM x) (LM y) = LM (M.difference x y) +mapDifference (LM x) (LM y) = LM (minusUDFM x y) -mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v -mapIntersection (LM x) (LM y) = LM (M.intersection x y) - -mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool -mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y +mapIntersection :: LabelMap v -> LabelMap v -> LabelMap v +mapIntersection (LM x) (LM y) = LM (intersectUDFM x y) mapMap :: (a -> v) -> LabelMap a -> LabelMap v -mapMap f (LM m) = LM (M.map f m) +mapMap f (LM m) = LM (mapUDFM f m) mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v -mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) +mapMapWithKey f (LM m) = LM (mapWithInternalKeyUDFM (f . mkHooplLabel) m) {-# INLINE mapFoldl #-} mapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a -mapFoldl k z (LM m) = M.foldl k z m +mapFoldl k z lm = mapFoldr (\b g x -> g (k x b)) id lm z -- foldl as foldr + -- REVIEW: Is this implementation bad for performance? {-# INLINE mapFoldr #-} mapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b -mapFoldr k z (LM m) = M.foldr k z m +mapFoldr k z (LM m) = foldUDFM k z m {-# INLINE mapFoldlWithKey #-} mapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t -mapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m - -mapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m -mapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m +mapFoldlWithKey k z (LM m) = foldWithKeyUDFM (\t v acc -> k acc (mkHooplLabel $ getKey t) v) z m {-# INLINEABLE mapFilter #-} mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v -mapFilter f (LM m) = LM (M.filter f m) +mapFilter f (LM m) = LM (filterUDFM f m) {-# INLINEABLE mapFilterWithKey #-} mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v -mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) +mapFilterWithKey f (LM m) = LM (filterUDFM_Directly (f . mkHooplLabel . getKey) m) {-# INLINE mapElems #-} mapElems :: LabelMap a -> [a] -mapElems (LM m) = M.elems m +mapElems (LM m) = eltsUDFM m {-# INLINE mapKeys #-} mapKeys :: LabelMap a -> [Label] -mapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) +mapKeys (LM m) = map (mkHooplLabel . getKey . fst) (udfmToList m) {-# INLINE mapToList #-} mapToList :: LabelMap b -> [(Label, b)] -mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] +mapToList (LM m) = [(mkHooplLabel $ getKey k, v) | (k, v) <- udfmToList m] {-# INLINE mapFromList #-} mapFromList :: [(Label, v)] -> LabelMap v -mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromList assocs = LM (listToUDFM_Directly [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v -mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromListWith f assocs = LM (listToUDFM_C_Directly f [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -40,12 +40,13 @@ module GHC.Types.Unique.DFM ( adjustUDFM_Directly, alterUDFM, mapUDFM, + mapWithInternalKeyUDFM, mapMaybeUDFM, plusUDFM, - plusUDFM_C, + plusUDFM_C, plusUDFM_CK, lookupUDFM, lookupUDFM_Directly, elemUDFM, - foldUDFM, + foldUDFM, foldWithKeyUDFM, eltsUDFM, filterUDFM, filterUDFM_Directly, isNullUDFM, @@ -55,6 +56,7 @@ module GHC.Types.Unique.DFM ( equalKeysUDFM, minusUDFM, listToUDFM, listToUDFM_Directly, + listToUDFM_C_Directly, udfmMinusUFM, ufmMinusUDFM, partitionUDFM, udfmRestrictKeys, @@ -83,6 +85,7 @@ import Data.Function (on) import GHC.Types.Unique.FM (UniqFM, nonDetUFMToList, ufmToIntMap, unsafeIntMapToUFM) import Unsafe.Coerce import qualified GHC.Data.Word64Set as W +import GHC.Word -- Note [Deterministic UniqFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -223,6 +226,12 @@ addListToUDFM_Directly_C addListToUDFM_Directly_C f = foldl' (\m (k, v) -> addToUDFM_C_Directly f m k v) {-# INLINEABLE addListToUDFM_Directly_C #-} +-- | Like 'addListToUDFM_Directly_C' but also passes the unique key to the combine function +addListToUDFM_Directly_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> [(Unique,elt)] -> UniqDFM key elt +addListToUDFM_Directly_CK f = foldl' (\m (k, v) -> addToUDFM_C_Directly (f k) m k v) +{-# INLINEABLE addListToUDFM_Directly_CK #-} + delFromUDFM :: Uniquable key => UniqDFM key elt -> key -> UniqDFM key elt delFromUDFM (UDFM m i) k = UDFM (M.delete (getKey $ getUnique k) m) i @@ -233,6 +242,15 @@ plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) | i > j = insertUDFMIntoLeft_C f udfml udfmr | otherwise = insertUDFMIntoLeft_C f udfmr udfml +-- | Like 'plusUDFM_C' but the combine function also receives the unique key +plusUDFM_CK :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +plusUDFM_CK f udfml@(UDFM _ i) udfmr@(UDFM _ j) + -- we will use the upper bound on the tag as a proxy for the set size, + -- to insert the smaller one into the bigger one + | i > j = insertUDFMIntoLeft_CK f udfml udfmr + | otherwise = insertUDFMIntoLeft_CK f udfmr udfml + + -- Note [Overflow on plusUDFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- There are multiple ways of implementing plusUDFM. @@ -281,6 +299,12 @@ insertUDFMIntoLeft_C insertUDFMIntoLeft_C f udfml udfmr = addListToUDFM_Directly_C f udfml $ udfmToList udfmr +-- | Like 'insertUDFMIntoLeft_C', but the merge function also receives the unique key +insertUDFMIntoLeft_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +insertUDFMIntoLeft_CK f udfml udfmr = + addListToUDFM_Directly_CK f udfml $ udfmToList udfmr + lookupUDFM :: Uniquable key => UniqDFM key elt -> key -> Maybe elt lookupUDFM (UDFM m _i) k = taggedFst `fmap` M.lookup (getKey $ getUnique k) m @@ -297,6 +321,12 @@ foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a -- This INLINE prevents a regression in !10568 foldUDFM k z m = foldr k z (eltsUDFM m) +-- | Like 'foldUDFM' but the function also receives a key +foldWithKeyUDFM :: (Unique -> elt -> a -> a) -> a -> UniqDFM key elt -> a +{-# INLINE foldWithKeyUDFM #-} +-- This INLINE was copied from foldUDFM +foldWithKeyUDFM k z m = foldr (uncurry k) z (udfmToList m) + -- | Performs a nondeterministic strict fold over the UniqDFM. -- It's O(n), same as the corresponding function on `UniqFM`. -- If you use this please provide a justification why it doesn't introduce @@ -396,6 +426,9 @@ listToUDFM = foldl' (\m (k, v) -> addToUDFM m k v) emptyUDFM listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt listToUDFM_Directly = foldl' (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM +listToUDFM_C_Directly :: (elt -> elt -> elt) -> [(Unique, elt)] -> UniqDFM key elt +listToUDFM_C_Directly f = foldl' (\m (u, v) -> addToUDFM_C_Directly f m u v) emptyUDFM + -- | Apply a function to a particular element adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt adjustUDFM f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey $ getUnique k) m) i @@ -429,6 +462,10 @@ mapUDFM f (UDFM m i) = UDFM (MS.map (fmap f) m) i -- in GHCi because all old ModDetails are retained (see pruneHomePackageTable). -- Modify with care. +-- | Map a function over every value in a UniqDFM +mapWithInternalKeyUDFM :: (Word64 -> elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 +mapWithInternalKeyUDFM f (UDFM m i) = UDFM (MS.mapWithKey (fmap . f) m) i + mapMaybeUDFM :: forall elt1 elt2 key. (elt1 -> Maybe elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 mapMaybeUDFM f (UDFM m i) = UDFM (M.mapMaybe (traverse f) m) i View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f94ce0e5e66df3443668c02230a452c1d374a72 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f94ce0e5e66df3443668c02230a452c1d374a72 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:27:16 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:27:16 -0400 Subject: [Git][ghc/ghc][wip/romes/deterministic-label-map] cmm: Back LabelMap with UDFM Message-ID: <668551b488f5f_11373f3804d20103910@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC Commits: 448e10da by Rodrigo Mesquita at 2024-07-03T14:27:00+01:00 cmm: Back LabelMap with UDFM Use a deterministic unique map to back the implementation of `LabelMap`. This is necessary towards the goal of object code determinism in #12935. Our intended solution requires renaming uniques in a deterministic order (which will be the order in which they were created), but storing them label map makes us lose this order. Backing it with a UDFM fixes this issue. - - - - - 3 changed files: - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Types/Unique/DFM.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -45,17 +45,15 @@ module GHC.Cmm.Dataflow.Label , mapAlter , mapAdjust , mapUnion - , mapUnions , mapUnionWithKey + , mapUnions , mapDifference , mapIntersection - , mapIsSubmapOf , mapMap , mapMapWithKey , mapFoldl , mapFoldr , mapFoldlWithKey - , mapFoldMapWithKey , mapFilter , mapFilterWithKey , mapElems @@ -69,7 +67,7 @@ import GHC.Prelude import GHC.Utils.Outputable -import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) +import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily, getKey) -- The code generator will eventually be using all the labels stored in a -- LabelSet and LabelMap. For these reasons we use the strict variants of these @@ -77,12 +75,12 @@ import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) -- to fire. import GHC.Data.Word64Set (Word64Set) import qualified GHC.Data.Word64Set as S -import GHC.Data.Word64Map.Strict (Word64Map) -import qualified GHC.Data.Word64Map.Strict as M import GHC.Data.TrieMap +import GHC.Types.Unique.DFM import Data.Word (Word64) import Data.List (foldl1') +import GHC.Data.Maybe (fromMaybe) ----------------------------------------------------------------------------- @@ -173,114 +171,109 @@ setFromList ks = LS (S.fromList (map lblToUnique ks)) ----------------------------------------------------------------------------- -- LabelMap -newtype LabelMap v = LM (Word64Map v) - deriving newtype (Eq, Ord, Show, Functor, Foldable) +newtype LabelMap v = LM (UniqDFM Word64 v) + deriving newtype (Functor, Foldable) deriving stock Traversable mapNull :: LabelMap a -> Bool -mapNull (LM m) = M.null m +mapNull (LM m) = isNullUDFM m {-# INLINE mapSize #-} mapSize :: LabelMap a -> Int -mapSize (LM m) = M.size m +mapSize (LM m) = sizeUDFM m mapMember :: Label -> LabelMap a -> Bool -mapMember (Label k) (LM m) = M.member k m +mapMember (Label k) (LM m) = elemUDFM k m mapLookup :: Label -> LabelMap a -> Maybe a -mapLookup (Label k) (LM m) = M.lookup k m +mapLookup (Label k) (LM m) = lookupUDFM m k mapFindWithDefault :: a -> Label -> LabelMap a -> a -mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m +mapFindWithDefault def (Label k) (LM m) = fromMaybe def $ lookupUDFM m k mapEmpty :: LabelMap v -mapEmpty = LM M.empty +mapEmpty = LM emptyUDFM mapSingleton :: Label -> v -> LabelMap v -mapSingleton (Label k) v = LM (M.singleton k v) +mapSingleton (Label k) v = LM (unitUDFM k v) mapInsert :: Label -> v -> LabelMap v -> LabelMap v -mapInsert (Label k) v (LM m) = LM (M.insert k v m) +mapInsert (Label k) v (LM m) = LM (addToUDFM m k v) mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v -mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) +mapInsertWith f (Label k) v (LM m) = LM (addToUDFM_C f m k v) mapDelete :: Label -> LabelMap v -> LabelMap v -mapDelete (Label k) (LM m) = LM (M.delete k m) +mapDelete (Label k) (LM m) = LM (delFromUDFM m k) mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v -mapAlter f (Label k) (LM m) = LM (M.alter f k m) +mapAlter f (Label k) (LM m) = LM (alterUDFM f m k) mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v -mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) +mapAdjust f (Label k) (LM m) = LM (adjustUDFM f m k) mapUnion :: LabelMap v -> LabelMap v -> LabelMap v -mapUnion (LM x) (LM y) = LM (M.union x y) +mapUnion (LM x) (LM y) = LM (plusUDFM x y) + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (plusUDFM_CK (f . mkHooplLabel . getKey) x y) {-# INLINE mapUnions #-} mapUnions :: [LabelMap a] -> LabelMap a mapUnions [] = mapEmpty mapUnions maps = foldl1' mapUnion maps -mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v -mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) - mapDifference :: LabelMap v -> LabelMap b -> LabelMap v -mapDifference (LM x) (LM y) = LM (M.difference x y) +mapDifference (LM x) (LM y) = LM (minusUDFM x y) -mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v -mapIntersection (LM x) (LM y) = LM (M.intersection x y) - -mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool -mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y +mapIntersection :: LabelMap v -> LabelMap v -> LabelMap v +mapIntersection (LM x) (LM y) = LM (intersectUDFM x y) mapMap :: (a -> v) -> LabelMap a -> LabelMap v -mapMap f (LM m) = LM (M.map f m) +mapMap f (LM m) = LM (mapUDFM f m) mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v -mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) +mapMapWithKey f (LM m) = LM (mapWithInternalKeyUDFM (f . mkHooplLabel) m) {-# INLINE mapFoldl #-} mapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a -mapFoldl k z (LM m) = M.foldl k z m +mapFoldl k z lm = mapFoldr (\b g x -> g (k x b)) id lm z -- foldl as foldr + -- REVIEW: Is this implementation bad for performance? {-# INLINE mapFoldr #-} mapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b -mapFoldr k z (LM m) = M.foldr k z m +mapFoldr k z (LM m) = foldUDFM k z m {-# INLINE mapFoldlWithKey #-} mapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t -mapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m - -mapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m -mapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m +mapFoldlWithKey k z (LM m) = foldWithKeyUDFM (\t v acc -> k acc (mkHooplLabel $ getKey t) v) z m {-# INLINEABLE mapFilter #-} mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v -mapFilter f (LM m) = LM (M.filter f m) +mapFilter f (LM m) = LM (filterUDFM f m) {-# INLINEABLE mapFilterWithKey #-} mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v -mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) +mapFilterWithKey f (LM m) = LM (filterUDFM_Directly (f . mkHooplLabel . getKey) m) {-# INLINE mapElems #-} mapElems :: LabelMap a -> [a] -mapElems (LM m) = M.elems m +mapElems (LM m) = eltsUDFM m {-# INLINE mapKeys #-} mapKeys :: LabelMap a -> [Label] -mapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) +mapKeys (LM m) = map (mkHooplLabel . getKey . fst) (udfmToList m) {-# INLINE mapToList #-} mapToList :: LabelMap b -> [(Label, b)] -mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] +mapToList (LM m) = [(mkHooplLabel $ getKey k, v) | (k, v) <- udfmToList m] {-# INLINE mapFromList #-} mapFromList :: [(Label, v)] -> LabelMap v -mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromList assocs = LM (listToUDFM_Directly [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v -mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromListWith f assocs = LM (listToUDFM_C_Directly f [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -205,6 +205,9 @@ instance Uniquable FastString where instance Uniquable Int where getUnique i = mkUniqueIntGrimily i +instance Uniquable Word64 where + getUnique i = mkUniqueGrimily i + instance Uniquable ModuleName where getUnique (ModuleName nm) = getUnique nm ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -40,12 +40,13 @@ module GHC.Types.Unique.DFM ( adjustUDFM_Directly, alterUDFM, mapUDFM, + mapWithInternalKeyUDFM, mapMaybeUDFM, plusUDFM, - plusUDFM_C, + plusUDFM_C, plusUDFM_CK, lookupUDFM, lookupUDFM_Directly, elemUDFM, - foldUDFM, + foldUDFM, foldWithKeyUDFM, eltsUDFM, filterUDFM, filterUDFM_Directly, isNullUDFM, @@ -55,6 +56,7 @@ module GHC.Types.Unique.DFM ( equalKeysUDFM, minusUDFM, listToUDFM, listToUDFM_Directly, + listToUDFM_C_Directly, udfmMinusUFM, ufmMinusUDFM, partitionUDFM, udfmRestrictKeys, @@ -83,6 +85,7 @@ import Data.Function (on) import GHC.Types.Unique.FM (UniqFM, nonDetUFMToList, ufmToIntMap, unsafeIntMapToUFM) import Unsafe.Coerce import qualified GHC.Data.Word64Set as W +import GHC.Word -- Note [Deterministic UniqFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -223,6 +226,12 @@ addListToUDFM_Directly_C addListToUDFM_Directly_C f = foldl' (\m (k, v) -> addToUDFM_C_Directly f m k v) {-# INLINEABLE addListToUDFM_Directly_C #-} +-- | Like 'addListToUDFM_Directly_C' but also passes the unique key to the combine function +addListToUDFM_Directly_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> [(Unique,elt)] -> UniqDFM key elt +addListToUDFM_Directly_CK f = foldl' (\m (k, v) -> addToUDFM_C_Directly (f k) m k v) +{-# INLINEABLE addListToUDFM_Directly_CK #-} + delFromUDFM :: Uniquable key => UniqDFM key elt -> key -> UniqDFM key elt delFromUDFM (UDFM m i) k = UDFM (M.delete (getKey $ getUnique k) m) i @@ -233,6 +242,15 @@ plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) | i > j = insertUDFMIntoLeft_C f udfml udfmr | otherwise = insertUDFMIntoLeft_C f udfmr udfml +-- | Like 'plusUDFM_C' but the combine function also receives the unique key +plusUDFM_CK :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +plusUDFM_CK f udfml@(UDFM _ i) udfmr@(UDFM _ j) + -- we will use the upper bound on the tag as a proxy for the set size, + -- to insert the smaller one into the bigger one + | i > j = insertUDFMIntoLeft_CK f udfml udfmr + | otherwise = insertUDFMIntoLeft_CK f udfmr udfml + + -- Note [Overflow on plusUDFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- There are multiple ways of implementing plusUDFM. @@ -281,6 +299,12 @@ insertUDFMIntoLeft_C insertUDFMIntoLeft_C f udfml udfmr = addListToUDFM_Directly_C f udfml $ udfmToList udfmr +-- | Like 'insertUDFMIntoLeft_C', but the merge function also receives the unique key +insertUDFMIntoLeft_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +insertUDFMIntoLeft_CK f udfml udfmr = + addListToUDFM_Directly_CK f udfml $ udfmToList udfmr + lookupUDFM :: Uniquable key => UniqDFM key elt -> key -> Maybe elt lookupUDFM (UDFM m _i) k = taggedFst `fmap` M.lookup (getKey $ getUnique k) m @@ -297,6 +321,12 @@ foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a -- This INLINE prevents a regression in !10568 foldUDFM k z m = foldr k z (eltsUDFM m) +-- | Like 'foldUDFM' but the function also receives a key +foldWithKeyUDFM :: (Unique -> elt -> a -> a) -> a -> UniqDFM key elt -> a +{-# INLINE foldWithKeyUDFM #-} +-- This INLINE was copied from foldUDFM +foldWithKeyUDFM k z m = foldr (uncurry k) z (udfmToList m) + -- | Performs a nondeterministic strict fold over the UniqDFM. -- It's O(n), same as the corresponding function on `UniqFM`. -- If you use this please provide a justification why it doesn't introduce @@ -396,6 +426,9 @@ listToUDFM = foldl' (\m (k, v) -> addToUDFM m k v) emptyUDFM listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt listToUDFM_Directly = foldl' (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM +listToUDFM_C_Directly :: (elt -> elt -> elt) -> [(Unique, elt)] -> UniqDFM key elt +listToUDFM_C_Directly f = foldl' (\m (u, v) -> addToUDFM_C_Directly f m u v) emptyUDFM + -- | Apply a function to a particular element adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt adjustUDFM f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey $ getUnique k) m) i @@ -429,6 +462,10 @@ mapUDFM f (UDFM m i) = UDFM (MS.map (fmap f) m) i -- in GHCi because all old ModDetails are retained (see pruneHomePackageTable). -- Modify with care. +-- | Map a function over every value in a UniqDFM +mapWithInternalKeyUDFM :: (Word64 -> elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 +mapWithInternalKeyUDFM f (UDFM m i) = UDFM (MS.mapWithKey (fmap . f) m) i + mapMaybeUDFM :: forall elt1 elt2 key. (elt1 -> Maybe elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 mapMaybeUDFM f (UDFM m i) = UDFM (M.mapMaybe (traverse f) m) i View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/448e10dabbed631b36414334e2f0d07a7a1a5455 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/448e10dabbed631b36414334e2f0d07a7a1a5455 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:30:27 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:30:27 -0400 Subject: [Git][ghc/ghc][wip/romes/deterministic-label-map] cmm: Back LabelMap with UDFM Message-ID: <6685527355137_11373f389cecc1041ae@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC Commits: a7e58e41 by Rodrigo Mesquita at 2024-07-03T14:30:00+01:00 cmm: Back LabelMap with UDFM Use a deterministic unique map to back the implementation of `LabelMap`. This is necessary towards the goal of object code determinism in #12935. Our intended solution requires renaming uniques in a deterministic order (which will be the order in which they were created), but storing them label map makes us lose this order. Backing it with a UDFM fixes this issue. - - - - - 5 changed files: - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Types/Unique/DFM.hs - compiler/GHC/Utils/Outputable.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -45,17 +45,15 @@ module GHC.Cmm.Dataflow.Label , mapAlter , mapAdjust , mapUnion - , mapUnions , mapUnionWithKey + , mapUnions , mapDifference , mapIntersection - , mapIsSubmapOf , mapMap , mapMapWithKey , mapFoldl , mapFoldr , mapFoldlWithKey - , mapFoldMapWithKey , mapFilter , mapFilterWithKey , mapElems @@ -69,7 +67,7 @@ import GHC.Prelude import GHC.Utils.Outputable -import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) +import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily, getKey) -- The code generator will eventually be using all the labels stored in a -- LabelSet and LabelMap. For these reasons we use the strict variants of these @@ -77,12 +75,12 @@ import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) -- to fire. import GHC.Data.Word64Set (Word64Set) import qualified GHC.Data.Word64Set as S -import GHC.Data.Word64Map.Strict (Word64Map) -import qualified GHC.Data.Word64Map.Strict as M import GHC.Data.TrieMap +import GHC.Types.Unique.DFM import Data.Word (Word64) import Data.List (foldl1') +import GHC.Data.Maybe (fromMaybe) ----------------------------------------------------------------------------- @@ -173,114 +171,109 @@ setFromList ks = LS (S.fromList (map lblToUnique ks)) ----------------------------------------------------------------------------- -- LabelMap -newtype LabelMap v = LM (Word64Map v) - deriving newtype (Eq, Ord, Show, Functor, Foldable) +newtype LabelMap v = LM (UniqDFM Word64 v) + deriving newtype (Functor, Foldable) deriving stock Traversable mapNull :: LabelMap a -> Bool -mapNull (LM m) = M.null m +mapNull (LM m) = isNullUDFM m {-# INLINE mapSize #-} mapSize :: LabelMap a -> Int -mapSize (LM m) = M.size m +mapSize (LM m) = sizeUDFM m mapMember :: Label -> LabelMap a -> Bool -mapMember (Label k) (LM m) = M.member k m +mapMember (Label k) (LM m) = elemUDFM k m mapLookup :: Label -> LabelMap a -> Maybe a -mapLookup (Label k) (LM m) = M.lookup k m +mapLookup (Label k) (LM m) = lookupUDFM m k mapFindWithDefault :: a -> Label -> LabelMap a -> a -mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m +mapFindWithDefault def (Label k) (LM m) = fromMaybe def $ lookupUDFM m k mapEmpty :: LabelMap v -mapEmpty = LM M.empty +mapEmpty = LM emptyUDFM mapSingleton :: Label -> v -> LabelMap v -mapSingleton (Label k) v = LM (M.singleton k v) +mapSingleton (Label k) v = LM (unitUDFM k v) mapInsert :: Label -> v -> LabelMap v -> LabelMap v -mapInsert (Label k) v (LM m) = LM (M.insert k v m) +mapInsert (Label k) v (LM m) = LM (addToUDFM m k v) mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v -mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) +mapInsertWith f (Label k) v (LM m) = LM (addToUDFM_C f m k v) mapDelete :: Label -> LabelMap v -> LabelMap v -mapDelete (Label k) (LM m) = LM (M.delete k m) +mapDelete (Label k) (LM m) = LM (delFromUDFM m k) mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v -mapAlter f (Label k) (LM m) = LM (M.alter f k m) +mapAlter f (Label k) (LM m) = LM (alterUDFM f m k) mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v -mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) +mapAdjust f (Label k) (LM m) = LM (adjustUDFM f m k) mapUnion :: LabelMap v -> LabelMap v -> LabelMap v -mapUnion (LM x) (LM y) = LM (M.union x y) +mapUnion (LM x) (LM y) = LM (plusUDFM x y) + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (plusUDFM_CK (f . mkHooplLabel . getKey) x y) {-# INLINE mapUnions #-} mapUnions :: [LabelMap a] -> LabelMap a mapUnions [] = mapEmpty mapUnions maps = foldl1' mapUnion maps -mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v -mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) - mapDifference :: LabelMap v -> LabelMap b -> LabelMap v -mapDifference (LM x) (LM y) = LM (M.difference x y) +mapDifference (LM x) (LM y) = LM (minusUDFM x y) -mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v -mapIntersection (LM x) (LM y) = LM (M.intersection x y) - -mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool -mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y +mapIntersection :: LabelMap v -> LabelMap v -> LabelMap v +mapIntersection (LM x) (LM y) = LM (intersectUDFM x y) mapMap :: (a -> v) -> LabelMap a -> LabelMap v -mapMap f (LM m) = LM (M.map f m) +mapMap f (LM m) = LM (mapUDFM f m) mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v -mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) +mapMapWithKey f (LM m) = LM (mapWithInternalKeyUDFM (f . mkHooplLabel) m) {-# INLINE mapFoldl #-} mapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a -mapFoldl k z (LM m) = M.foldl k z m +mapFoldl k z lm = mapFoldr (\b g x -> g (k x b)) id lm z -- foldl as foldr + -- REVIEW: Is this implementation bad for performance? {-# INLINE mapFoldr #-} mapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b -mapFoldr k z (LM m) = M.foldr k z m +mapFoldr k z (LM m) = foldUDFM k z m {-# INLINE mapFoldlWithKey #-} mapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t -mapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m - -mapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m -mapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m +mapFoldlWithKey k z (LM m) = foldWithKeyUDFM (\t v acc -> k acc (mkHooplLabel $ getKey t) v) z m {-# INLINEABLE mapFilter #-} mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v -mapFilter f (LM m) = LM (M.filter f m) +mapFilter f (LM m) = LM (filterUDFM f m) {-# INLINEABLE mapFilterWithKey #-} mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v -mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) +mapFilterWithKey f (LM m) = LM (filterUDFM_Directly (f . mkHooplLabel . getKey) m) {-# INLINE mapElems #-} mapElems :: LabelMap a -> [a] -mapElems (LM m) = M.elems m +mapElems (LM m) = eltsUDFM m {-# INLINE mapKeys #-} mapKeys :: LabelMap a -> [Label] -mapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) +mapKeys (LM m) = map (mkHooplLabel . getKey . fst) (udfmToList m) {-# INLINE mapToList #-} mapToList :: LabelMap b -> [(Label, b)] -mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] +mapToList (LM m) = [(mkHooplLabel $ getKey k, v) | (k, v) <- udfmToList m] {-# INLINE mapFromList #-} mapFromList :: [(Label, v)] -> LabelMap v -mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromList assocs = LM (listToUDFM_Directly [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v -mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) +mapFromListWith f assocs = LM (listToUDFM_C_Directly f [(mkUniqueGrimily $ lblToUnique k, v) | (k, v) <- assocs]) ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -260,7 +260,7 @@ instance OutputableP Platform LiveInfo where = (pdoc env mb_static) $$ text "# entryIds = " <> ppr entryIds $$ text "# liveVRegsOnEntry = " <> ppr liveVRegsOnEntry - $$ text "# liveSlotsOnEntry = " <> text (show liveSlotsOnEntry) + $$ text "# liveSlotsOnEntry = " <> ppr liveSlotsOnEntry ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -205,6 +205,9 @@ instance Uniquable FastString where instance Uniquable Int where getUnique i = mkUniqueIntGrimily i +instance Uniquable Word64 where + getUnique i = mkUniqueGrimily i + instance Uniquable ModuleName where getUnique (ModuleName nm) = getUnique nm ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -40,12 +40,13 @@ module GHC.Types.Unique.DFM ( adjustUDFM_Directly, alterUDFM, mapUDFM, + mapWithInternalKeyUDFM, mapMaybeUDFM, plusUDFM, - plusUDFM_C, + plusUDFM_C, plusUDFM_CK, lookupUDFM, lookupUDFM_Directly, elemUDFM, - foldUDFM, + foldUDFM, foldWithKeyUDFM, eltsUDFM, filterUDFM, filterUDFM_Directly, isNullUDFM, @@ -55,6 +56,7 @@ module GHC.Types.Unique.DFM ( equalKeysUDFM, minusUDFM, listToUDFM, listToUDFM_Directly, + listToUDFM_C_Directly, udfmMinusUFM, ufmMinusUDFM, partitionUDFM, udfmRestrictKeys, @@ -83,6 +85,7 @@ import Data.Function (on) import GHC.Types.Unique.FM (UniqFM, nonDetUFMToList, ufmToIntMap, unsafeIntMapToUFM) import Unsafe.Coerce import qualified GHC.Data.Word64Set as W +import GHC.Word -- Note [Deterministic UniqFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -223,6 +226,12 @@ addListToUDFM_Directly_C addListToUDFM_Directly_C f = foldl' (\m (k, v) -> addToUDFM_C_Directly f m k v) {-# INLINEABLE addListToUDFM_Directly_C #-} +-- | Like 'addListToUDFM_Directly_C' but also passes the unique key to the combine function +addListToUDFM_Directly_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> [(Unique,elt)] -> UniqDFM key elt +addListToUDFM_Directly_CK f = foldl' (\m (k, v) -> addToUDFM_C_Directly (f k) m k v) +{-# INLINEABLE addListToUDFM_Directly_CK #-} + delFromUDFM :: Uniquable key => UniqDFM key elt -> key -> UniqDFM key elt delFromUDFM (UDFM m i) k = UDFM (M.delete (getKey $ getUnique k) m) i @@ -233,6 +242,15 @@ plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) | i > j = insertUDFMIntoLeft_C f udfml udfmr | otherwise = insertUDFMIntoLeft_C f udfmr udfml +-- | Like 'plusUDFM_C' but the combine function also receives the unique key +plusUDFM_CK :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +plusUDFM_CK f udfml@(UDFM _ i) udfmr@(UDFM _ j) + -- we will use the upper bound on the tag as a proxy for the set size, + -- to insert the smaller one into the bigger one + | i > j = insertUDFMIntoLeft_CK f udfml udfmr + | otherwise = insertUDFMIntoLeft_CK f udfmr udfml + + -- Note [Overflow on plusUDFM] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- There are multiple ways of implementing plusUDFM. @@ -281,6 +299,12 @@ insertUDFMIntoLeft_C insertUDFMIntoLeft_C f udfml udfmr = addListToUDFM_Directly_C f udfml $ udfmToList udfmr +-- | Like 'insertUDFMIntoLeft_C', but the merge function also receives the unique key +insertUDFMIntoLeft_CK + :: (Unique -> elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt +insertUDFMIntoLeft_CK f udfml udfmr = + addListToUDFM_Directly_CK f udfml $ udfmToList udfmr + lookupUDFM :: Uniquable key => UniqDFM key elt -> key -> Maybe elt lookupUDFM (UDFM m _i) k = taggedFst `fmap` M.lookup (getKey $ getUnique k) m @@ -297,6 +321,12 @@ foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a -- This INLINE prevents a regression in !10568 foldUDFM k z m = foldr k z (eltsUDFM m) +-- | Like 'foldUDFM' but the function also receives a key +foldWithKeyUDFM :: (Unique -> elt -> a -> a) -> a -> UniqDFM key elt -> a +{-# INLINE foldWithKeyUDFM #-} +-- This INLINE was copied from foldUDFM +foldWithKeyUDFM k z m = foldr (uncurry k) z (udfmToList m) + -- | Performs a nondeterministic strict fold over the UniqDFM. -- It's O(n), same as the corresponding function on `UniqFM`. -- If you use this please provide a justification why it doesn't introduce @@ -396,6 +426,9 @@ listToUDFM = foldl' (\m (k, v) -> addToUDFM m k v) emptyUDFM listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt listToUDFM_Directly = foldl' (\m (u, v) -> addToUDFM_Directly m u v) emptyUDFM +listToUDFM_C_Directly :: (elt -> elt -> elt) -> [(Unique, elt)] -> UniqDFM key elt +listToUDFM_C_Directly f = foldl' (\m (u, v) -> addToUDFM_C_Directly f m u v) emptyUDFM + -- | Apply a function to a particular element adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt adjustUDFM f (UDFM m i) k = UDFM (M.adjust (fmap f) (getKey $ getUnique k) m) i @@ -429,6 +462,10 @@ mapUDFM f (UDFM m i) = UDFM (MS.map (fmap f) m) i -- in GHCi because all old ModDetails are retained (see pruneHomePackageTable). -- Modify with care. +-- | Map a function over every value in a UniqDFM +mapWithInternalKeyUDFM :: (Word64 -> elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 +mapWithInternalKeyUDFM f (UDFM m i) = UDFM (MS.mapWithKey (fmap . f) m) i + mapMaybeUDFM :: forall elt1 elt2 key. (elt1 -> Maybe elt2) -> UniqDFM key elt1 -> UniqDFM key elt2 mapMaybeUDFM f (UDFM m i) = UDFM (M.mapMaybe (traverse f) m) i ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -142,6 +142,7 @@ import Data.Int import qualified Data.IntMap as IM import Data.Set (Set) import qualified Data.Set as Set +import qualified Data.IntSet as IntSet import qualified GHC.Data.Word64Set as Word64Set import Data.String import Data.Word @@ -991,6 +992,9 @@ instance (Outputable a) => Outputable (Set a) where instance Outputable Word64Set.Word64Set where ppr s = braces (pprWithCommas ppr (Word64Set.toList s)) +instance Outputable IntSet.IntSet where + ppr s = braces (pprWithCommas ppr (IntSet.toList s)) + instance (Outputable a, Outputable b) => Outputable (a, b) where ppr (x,y) = parens (sep [ppr x <> comma, ppr y]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a7e58e4100d9e33f22a478447a05efd359bf3a2c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a7e58e4100d9e33f22a478447a05efd359bf3a2c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:32:04 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 03 Jul 2024 09:32:04 -0400 Subject: [Git][ghc/ghc][wip/romes/uniqdsm-cmm-onwards] UniqDSM det uniques + use in Cmm.Info Message-ID: <668552d46d054_11373f3956160107384@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/uniqdsm-cmm-onwards at Glasgow Haskell Compiler / GHC Commits: 3feb117a by Rodrigo Mesquita at 2024-07-03T14:31:55+01:00 UniqDSM det uniques + use in Cmm.Info Now for SRTs SRT generation using deterministic uniq supply Back LabelMap with deterministic UDFM TSAN uniq rename hard Revert "TSAN uniq rename hard" This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda. improvements to uniqdsm UniqDSM ProcPoint CmmLayoutStack UniqDet 90% of cpsTop UniqDSM Major progress in using UniqDSM in CmmToAsm and Ncg backends Fix imports Un-back label map with udfm Revert "Un-back label map with udfm" This reverts commit f5d2e4257214a3f7b7d845651e6662c5babfd6a3. - - - - - 30 changed files: - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Switch/Implement.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3feb117a7eaee190942eac27d1d8de97a3d8df8d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3feb117a7eaee190942eac27d1d8de97a3d8df8d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 13:43:18 2024 From: gitlab at gitlab.haskell.org (josephf (@josephf)) Date: Wed, 03 Jul 2024 09:43:18 -0400 Subject: [Git][ghc/ghc][wip/type-sharing] 3 commits: simple-opt: don't inline type-lets Message-ID: <668555761e6cb_11373f3b8a10c110028@gitlab.mail> josephf pushed to branch wip/type-sharing at Glasgow Haskell Compiler / GHC Commits: 5bf70596 by Joseph Fourment at 2024-07-03T15:42:57+02:00 simple-opt: don't inline type-lets - - - - - 27947cb0 by Joseph Fourment at 2024-07-03T15:42:57+02:00 specialise: fix type-lets in DFun unfoldings During specialisation, a dictionary being specialised gets a new unfolding by turning `DFun \ bndrs -> MkD @<T1> ... @<Tm> <op1> ... <opn>` into `DFun \ spec_bndrs -> MkD @((\ bndrs -> TYPE: <T1>) spec_args) ... ((\ bndrs -> <opn>) spec_args)` which in turns gets beta-reduced into `DFun \ spec_bndrs -> MkD (let { bndrs = spec_args } in TYPE: <T1>) ... (let { bndrs = spec_args } in <opn>)`. Previously, such let binders would immediately be substituted into the type so it didn't cause any issue, but now we want to avoid inlining. Arguments of the form `let { bndrs = spec_args } in TYPE: <T1>` are not considered as type arguments since they're not of the canonical form `TYPE: something`. This commit restores the previous behavior of substituting the specialised type arguments. Alternatively, we could attach some floated type bindings to `DFun`s. - - - - - 9c622629 by Joseph Fourment at 2024-07-03T15:42:57+02:00 occur-anal: implement occurence analysis for type variables In order to find out let-bound type variables that are used only once, in the hope of inlining them, we need to track type variables as well in the occurrence analiser. Just like Id's, we attach an `OccInfo` to each (immutable) type variable, and we walk into types and coercions to accurately gather occurrences. - - - - - 4 changed files: - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/Unfold/Make.hs - compiler/GHC/Types/Var.hs Changes: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -39,6 +39,7 @@ import GHC.Core.Opt.Arity ( joinRhsArity, isOneShotBndr ) import GHC.Core.Coercion import GHC.Core.Predicate ( isDictId ) import GHC.Core.Type +import GHC.Core.TyCo.Rep import GHC.Core.TyCo.FVs ( tyCoVarsOfMCo ) import GHC.Data.Maybe( orElse ) @@ -665,7 +666,7 @@ through A, so it should have ManyOcc. Bear this case in mind! See addJoinPoint. * At an occurrence of a join point, we do everything as normal, but add in the - UsageDetails from the occ_join_points. See mkOneOcc. + UsageDetails from the occ_join_points. See mkOneIdOcc. * Crucially, at the NonRec binding of the join point, in `occAnalBind`, we use `orUDs`, not `andUDs` to combine the usage from the RHS with the usage from @@ -721,7 +722,7 @@ There are a couple of tricky wrinkles in f (case x of { K j -> ...; ... }) We can zap the entire occ_join_points when looking at the argument, because `j` can't posibly occur -- it's a join point! And the smaller - occ_join_points is, the better. Smaller to look up in mkOneOcc, and + occ_join_points is, the better. Smaller to look up in mkOneIdOcc, and more important, less looking-up when checking (W2). This is done in setNonTailCtxt. It's important /not/ to do this for @@ -1142,6 +1143,13 @@ occAnalRec !_ lvl (WUD body_uds binds) | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds + + | isTyVar bndr + = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds + !bndr' = tagged_bndr + in WUD (body_uds `andUDs` rhs_uds') + (NonRec bndr' rhs' : binds) | otherwise = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds @@ -1700,6 +1708,30 @@ rank (r, _, _) = r makeNode :: OccEnv -> ImpRuleEdges -> VarSet -> (Var, CoreExpr) -> LetrecNode -- See Note [Recursive bindings: the grand plan] +makeNode !env _imp_rule_edges bndr_set (bndr, Type rhs) + = assert (isTyVar bndr) $ + DigraphNode { node_payload = details + , node_key = varUnique bndr + , node_dependencies = nonDetKeysUniqSet inl_fvs } + where + details = ND { nd_bndr = bndr' + , nd_rhs = WTUD (TUD 0 inl_uds) (Type rhs') + , nd_inl = inl_fvs + , nd_simple = True + , nd_weak_fvs = emptyVarSet + , nd_active_rule_fvs = emptyVarSet } + + bndr' = bndr `setTyVarUnfolding` rhs' + + rhs_env = setNonTailCtxt OccRhs env + -- WUD unf_uds mb_unf' + -- | Just unf <- tyVarUnfolding bndr = Just <$> occAnalTy rhs_env unf + -- | otherwise = WUD emptyUDs Nothing + WUD rhs_uds rhs' = occAnalTy rhs_env rhs + + inl_uds = rhs_uds -- `andUDs` unf_uds + inl_fvs = udFreeVars bndr_set inl_uds + makeNode !env imp_rule_edges bndr_set (bndr, rhs) = -- pprTrace "makeNode" (ppr bndr <+> ppr (sizeVarSet bndr_set)) $ DigraphNode { node_payload = details @@ -2198,29 +2230,24 @@ occ_anal_lam_tail env expr@(Lam {}) = addInScope env rev_bndrs $ \env -> let !(WUD usage body') = occ_anal_lam_tail env body wrap_lam body bndr = Lam (tagLamBinder usage bndr) body - in WUD (usage `addLamCoVarOccs` rev_bndrs) + in WUD (usage `addLamTyCoVarOccs` rev_bndrs) (foldl' wrap_lam body' rev_bndrs) -- For casts, keep going in the same lambda-group -- See Note [Occurrence analysis for lambda binders] occ_anal_lam_tail env (Cast expr co) - = let WUD usage expr' = occ_anal_lam_tail env expr + = let WUD expr_uds expr' = occ_anal_lam_tail env expr -- usage1: see Note [Gather occurrences of coercion variables] - usage1 = addManyOccs usage (coVarsOfCo co) + WUD co_uds co' = occAnalCo env co -- usage2: see Note [Occ-anal and cast worker/wrapper] - usage2 = case expr of - Var {} | isRhsEnv env -> markAllMany usage1 - _ -> usage1 + co_uds' = case expr of + Var {} | isRhsEnv env -> markAllMany co_uds + _ -> co_uds - -- usage3: you might think this was not necessary, because of - -- the markAllNonTail in adjustTailUsage; but not so! For a - -- join point, adjustTailUsage doesn't do this; yet if there is - -- a cast, we must! Also: why markAllNonTail? See - -- GHC.Core.Lint: Note Note [Join points and casts] - usage3 = markAllNonTail usage2 + uds = markAllNonTail (expr_uds `andUDs` co_uds') - in WUD usage3 (Cast expr' co) + in WUD uds (Cast expr' co') occ_anal_lam_tail env expr -- Not Lam, not Cast = occAnal env expr @@ -2427,6 +2454,140 @@ occAnalList env (e:es) = let (WUD uds1 e') = occAnal env e (WUD uds2 es') = occAnalList env es in WUD (uds1 `andUDs` uds2) (e' : es') +occAnalTys :: OccEnv -> [Type] -> WithUsageDetails [Type] +occAnalTys !_ [] = WUD emptyDetails [] +occAnalTys env (t:ts) = let + (WUD uds1 t') = occAnalTy env t + (WUD uds2 ts') = occAnalTys env ts + in WUD (uds1 `andUDs` uds2) (t' : ts') + +occAnalTy :: OccEnv + -> Type + -> WithUsageDetails Type +occAnalTy env (TyVarTy tv) + = let tv_usage = mkOneTyVarOcc env tv + -- WUD ki_usage tv_ki' = occAnalTy env () + in WUD tv_usage (TyVarTy tv) +occAnalTy env (AppTy t1 t2) + = let WUD t1_usage t1' = occAnalTy env t1 + WUD t2_usage t2' = occAnalTy env t2 + in WUD (t1_usage `andUDs` t2_usage) (mkAppTy t1' t2') +occAnalTy _ ty@(LitTy {}) = WUD emptyDetails ty +occAnalTy env (CastTy ty co) + = let WUD ty_usage ty' = occAnalTy env ty + WUD co_usage co' = occAnalCo env co + in WUD (ty_usage `andUDs` co_usage) (mkCastTy ty' co') +occAnalTy env (CoercionTy co) + = let WUD co_usage co' = occAnalCo env co + in WUD co_usage (CoercionTy co') +occAnalTy env fun@(FunTy _ w arg res) + = let WUD w_usage w' = occAnalTy env w + WUD arg_usage arg' = occAnalTy env arg + WUD res_usage res' = occAnalTy env res + all_usage = w_usage `andUDs` arg_usage `andUDs` res_usage + in WUD all_usage (fun { ft_mult = w', ft_arg = arg', ft_res = res' }) +occAnalTy env ty@(TyConApp tc tys) + | null tys + = WUD emptyDetails ty + + | let WUD tys_usage tys' = occAnalTys env tys + = WUD tys_usage (mkTyConApp tc tys') +occAnalTy env (ForAllTy (Bndr tv vis) inner) + = let WUD usage inner' = occAnalTy env inner + in WUD usage (ForAllTy (Bndr tv vis) inner') + +occAnalCos :: OccEnv -> [Coercion] -> WithUsageDetails [Coercion] +occAnalCos _ [] = WUD emptyDetails [] +occAnalCos env (co:cos) + = let WUD uds1 co' = occAnalCo env co + WUD uds2 cos' = occAnalCos env cos + in WUD (uds1 `andUDs` uds2) (co' : cos') + +occAnalMCo :: OccEnv -> MCoercion -> WithUsageDetails MCoercion +occAnalMCo _ MRefl = WUD emptyDetails MRefl +occAnalMCo env (MCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (MCo co') + +occAnalCo :: OccEnv -> Coercion -> WithUsageDetails Coercion +occAnalCo !env (Refl ty) + = let WUD usage ty' = occAnalTy env ty + in WUD usage (Refl ty') +occAnalCo !env (GRefl r ty mco) + = let WUD usage1 ty' = occAnalTy env ty + WUD usage2 mco' = occAnalMCo env mco + in WUD (usage1 `andUDs` usage2) (mkGReflCo r ty' mco') +occAnalCo !env (AppCo co1 co2) + = let WUD usage1 co1' = occAnalCo env co1 + WUD usage2 co2' = occAnalCo env co2 + in WUD (usage1 `andUDs` usage2) (mkAppCo co1' co2') +occAnalCo !env (FunCo r afl afr cw c1 c2) + = let WUD cw_usage cw' = occAnalCo env cw + WUD c1_usage c1' = occAnalCo env c1 + WUD c2_usage c2' = occAnalCo env c2 + total_usage = cw_usage `andUDs` c1_usage `andUDs` c2_usage + in WUD total_usage (mkFunCo2 r afl afr cw' c1' c2') +occAnalCo env (CoVarCo cv) + = let occ = mkOneIdOcc env cv NotInteresting 0 + in WUD occ (mkCoVarCo cv) +occAnalCo _ (HoleCo hole) + = pprPanic "occAnalCo:HoleCo" (ppr hole) +occAnalCo env (UnivCo p r t1 t2) + = let WUD p_usage p' = occAnalProv env p + WUD t1_usage t1' = occAnalTy env t1 + WUD t2_usage t2' = occAnalTy env t2 + total_usage = p_usage `andUDs` t1_usage `andUDs` t2_usage + in WUD total_usage (mkUnivCo p' r t1' t2') +occAnalCo env (SymCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSymCo co') +occAnalCo env (TransCo co1 co2) + = let WUD usage1 co1' = occAnalCo env co1 + WUD usage2 co2' = occAnalCo env co2 + in WUD (usage1 `andUDs` usage2) (mkTransCo co1' co2') +occAnalCo env (AxiomRuleCo r cos) + = let WUD usage cos' = occAnalCos env cos + in WUD usage (AxiomRuleCo r cos') +occAnalCo env (SelCo i co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSelCo i co') +occAnalCo env (LRCo lr co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkLRCo lr co') +occAnalCo env (InstCo co arg) + = let WUD usage1 co' = occAnalCo env co + WUD usage2 arg' = occAnalCo env arg + in WUD (usage1 `andUDs` usage2) (mkInstCo co' arg') +occAnalCo env (KindCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkKindCo co') +occAnalCo env (SubCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSubCo co') +occAnalCo env (AxiomInstCo ax i cos) + = let WUD usage cos' = occAnalCos env cos + in WUD usage (mkAxiomInstCo ax i cos') +occAnalCo env co@(TyConAppCo r tc cos) + | null cos + = WUD emptyDetails co + + | otherwise + = let WUD usage cos' = occAnalCos env cos + in WUD usage (mkTyConAppCo r tc cos') +occAnalCo env (ForAllCo { fco_tcv = tv, fco_visL = visL, fco_visR = visR + , fco_kind = kind_co, fco_body = co }) + = let WUD usage1 kind_co' = occAnalCo env kind_co + WUD usage2 co' = occAnalCo env co + in WUD (usage1 `andUDs` usage2) (mkForAllCo tv visL visR kind_co' co') + +occAnalProv :: OccEnv -> UnivCoProvenance -> WithUsageDetails UnivCoProvenance +occAnalProv env (PhantomProv co) + = let WUD usage co' = occAnalCo env co + in WUD usage (PhantomProv co') +occAnalProv env (ProofIrrelProv co) + = let WUD usage co' = occAnalCo env co + in WUD usage (ProofIrrelProv co') +occAnalProv _ p@(PluginProv _) = WUD emptyDetails p occAnal :: OccEnv -> CoreExpr @@ -2442,11 +2603,12 @@ occAnal env expr@(Var _) = occAnalApp env (expr, [], []) -- rules in them, so the *specialised* versions looked as if they -- weren't used at all. -occAnal _ expr@(Type ty) - = WUD (addManyOccs emptyDetails (coVarsOfType ty)) expr -occAnal _ expr@(Coercion co) - = WUD (addManyOccs emptyDetails (coVarsOfCo co)) expr - -- See Note [Gather occurrences of coercion variables] +occAnal env (Type ty) + = let WUD usage ty' = occAnalTy env ty + in WUD usage (Type ty') +occAnal env (Coercion co) + = let WUD usage co' = occAnalCo env co + in WUD usage (Coercion co') {- Note [Gather occurrences of coercion variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2523,12 +2685,12 @@ occAnal env (Tick tickish body) -- See #14242. occAnal env (Cast expr co) - = let (WUD usage expr') = occAnal env expr - usage1 = addManyOccs usage (coVarsOfCo co) - -- usage2: see Note [Gather occurrences of coercion variables] - usage2 = markAllNonTail usage1 - -- usage3: calls inside expr aren't tail calls any more - in WUD usage2 (Cast expr' co) + = let (WUD expr_uds expr') = occAnal env expr + WUD co_uds co' = occAnalCo env co + -- co_uds: see Note [Gather occurrences of coercion variables] + uds = markAllNonTail (expr_uds `andUDs` co_uds) + -- co_uds': calls inside expr aren't tail calls any more + in WUD uds (Cast expr' co') occAnal env app@(App _ _) = occAnalApp env (collectArgsTicks tickishFloatable app) @@ -2660,7 +2822,7 @@ occAnalApp env (Var fun_id, args, ticks) !(fun', fun_id') = lookupBndrSwap env fun_id !(WUD args_uds app') = occAnalArgs env fun' args one_shots - fun_uds = mkOneOcc env fun_id' int_cxt n_args + fun_uds = mkOneIdOcc env fun_id' int_cxt n_args -- NB: fun_uds is computed for fun_id', not fun_id -- See (BS1) in Note [The binder-swap substitution] @@ -2923,7 +3085,7 @@ setNonTailCtxt ctxt !env -- that might mean we don't record all occurrencs, and that means we -- duplicate a redex.... a very nasty bug (which I encountered!). Hence -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch + -- emptyDetails, which in turn causes a panic in mkOneIdOcc. That will catch -- this bug before it does any damage. #ifdef DEBUG zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) @@ -3497,8 +3659,8 @@ For example, in (case x of A -> y; B -> y; C -> True), -} -type OccInfoEnv = IdEnv LocalOcc -- A finite map from an expression's - -- free variables to their usage +type OccInfoEnv = VarEnv LocalOcc -- A finite map from an expression's + -- free variables to their usage data LocalOcc -- See Note [LocalOcc] = OneOccL { lo_n_br :: {-# UNPACK #-} !BranchCount -- Number of syntactic occurrences @@ -3562,9 +3724,17 @@ andUDs, orUDs andUDs = combineUsageDetailsWith andLocalOcc orUDs = combineUsageDetailsWith orLocalOcc -mkOneOcc :: OccEnv -> Id -> InterestingCxt -> JoinArity -> UsageDetails -mkOneOcc !env id int_cxt arity - | not (isLocalId id) +mkOneTyVarOcc :: OccEnv -> TyVar -> UsageDetails +mkOneTyVarOcc !_env tv + = mkSimpleDetails (unitVarEnv tv occ) + where + occ = OneOccL { lo_n_br = 1, lo_int_cxt = NotInteresting + , lo_tail = NoTailCallInfo } + +mkOneIdOcc :: OccEnv -> Var -> InterestingCxt -> JoinArity -> UsageDetails +mkOneIdOcc !env id int_cxt arity + | assert (not (isTyVar id)) $ + not (isLocalId id) = emptyDetails | Just join_uds <- lookupVarEnv (occ_join_points env) id @@ -3582,8 +3752,7 @@ mkOneOcc !env id int_cxt arity -- Add several occurrences, assumed not to be tail calls add_many_occ :: Var -> OccInfoEnv -> OccInfoEnv -add_many_occ v env | isId v = extendVarEnv env v (ManyOccL NoTailCallInfo) - | otherwise = env +add_many_occ v env = extendVarEnv env v (ManyOccL NoTailCallInfo) -- Give a non-committal binder info (i.e noOccInfo) because -- a) Many copies of the specialised thing can appear -- b) We don't want to substitute a BIG expression inside a RULE @@ -3598,13 +3767,14 @@ addManyOccs uds var_set add_to env = nonDetStrictFoldUniqSet add_many_occ env var_set -- It's OK to use nonDetStrictFoldUniqSet here because add_many_occ commutes -addLamCoVarOccs :: UsageDetails -> [Var] -> UsageDetails --- Add any CoVars free in the type of a lambda-binder +addLamTyCoVarOccs :: UsageDetails -> [Var] -> UsageDetails +-- occAnalLamBndrs :: OccEnv -> UsageDetails -> [Var] -> WithUsageDetails [Var] +-- Add any TyCoVars free in the type of a lambda-binder -- See Note [Gather occurrences of coercion variables] -addLamCoVarOccs uds bndrs +addLamTyCoVarOccs uds bndrs = foldr add uds bndrs where - add bndr uds = uds `addManyOccs` coVarsOfType (varType bndr) + add bndr uds = uds `addManyOccs` tyCoVarsOfType (varType bndr) emptyDetails :: UsageDetails emptyDetails = mkSimpleDetails emptyVarEnv @@ -3806,7 +3976,6 @@ tagNonRecBinder :: TopLevelFlag -- At top level? -> OccInfo -- Of scope -> CoreBndr -- Binder -> (IdWithOccInfo, JoinPointHood) -- Tagged binder --- No-op on TyVars -- Precondition: OccInfo is not IAmDead tagNonRecBinder lvl occ bndr | okForJoinPoint lvl bndr tail_call_info @@ -3871,9 +4040,11 @@ tagRecBinders lvl body_uds details_s setBinderOcc :: OccInfo -> CoreBndr -> CoreBndr setBinderOcc occ_info bndr - | isTyVar bndr = bndr - | occ_info == idOccInfo bndr = bndr - | otherwise = setIdOccInfo bndr occ_info + | isTyVar bndr + , occ_info == tyVarOccInfo bndr = bndr + | isTyVar bndr = setTyVarOccInfo bndr occ_info + | occ_info == idOccInfo bndr = bndr + | otherwise = setIdOccInfo bndr occ_info -- | Decide whether some bindings should be made into join points or not, based -- on its occurrences. This is ===================================== compiler/GHC/Core/SimpleOpt.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Core.Opt.OccurAnal( occurAnalyseExpr, occurAnalysePgm, zapLambdaBndrs import GHC.Types.Literal import GHC.Types.Id import GHC.Types.Id.Info ( realUnfoldingInfo, setUnfoldingInfo, setRuleInfo, IdInfo (..) ) -import GHC.Types.Var ( isNonCoVarId ) +import GHC.Types.Var ( isNonCoVarId, tyVarUnfolding, setTyVarUnfolding ) import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Core.DataCon @@ -437,6 +437,29 @@ simple_opt_bind env (Rec prs) top_level where (env', mb_pr) = simple_bind_pair env b (Just b') (env,r) top_level +---------------------- +simple_bind_type :: SimpleOptEnv + -> InTyVar -> Maybe OutTyVar + -> (SimpleOptEnv, InType) + -> (SimpleOptEnv, Maybe (OutTyVar, OutType)) +simple_bind_type env@(SOE { soe_subst = subst }) + in_bndr mb_out_bndr (rhs_env, in_rhs) + | Just in_tyvar <- getTyVar_maybe in_rhs + , Just unf <- tyVarUnfolding in_tyvar + , let out_unf = substTyUnchecked (soe_subst rhs_env) unf + , isAtomicTy out_unf + = {- pprTrace "simple_bind_type" (ppr in_tyvar) $ -} + (env { soe_subst = extendTvSubst subst in_bndr out_unf }, Nothing) + + | otherwise + = let + out_ty = substTyUnchecked (soe_subst rhs_env) in_rhs + (env', bndr1) = case mb_out_bndr of + Just out_bndr -> (env, out_bndr) + Nothing -> subst_opt_bndr env in_bndr + out_bndr = setTyVarUnfolding bndr1 out_ty + in (env', Just (out_bndr, out_ty)) + ---------------------- simple_bind_pair :: SimpleOptEnv -> InVar -> Maybe OutVar @@ -449,10 +472,15 @@ simple_bind_pair :: SimpleOptEnv simple_bind_pair env@(SOE { soe_inl = inl_env, soe_subst = subst }) in_bndr mb_out_bndr clo@(rhs_env, in_rhs) top_level - | Type ty <- in_rhs -- let a::* = TYPE ty in - , let out_ty = substTyUnchecked (soe_subst rhs_env) ty - = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr in_rhs) $ - (env { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + | Type in_ty <- in_rhs -- let a::* = TYPE ty in + = let + (env', mb_out_bind_type) = simple_bind_type env in_bndr mb_out_bndr (rhs_env, in_ty) + in + case mb_out_bind_type of + Just (out_bndr, out_ty) + | isAtomicTy out_ty -> (env' { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + | otherwise -> (env', Just (out_bndr, Type out_ty)) + Nothing -> (env', Nothing) | Coercion co <- in_rhs , let out_co = optCoercion (so_co_opts (soe_opts env)) (soe_subst rhs_env) co @@ -523,8 +551,8 @@ simple_out_bind :: TopLevelFlag -> (SimpleOptEnv, Maybe (OutVar, OutExpr)) simple_out_bind top_level env@(SOE { soe_subst = subst }) (in_bndr, out_rhs) | Type out_ty <- out_rhs - = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr out_ty $$ ppr out_rhs) - (env { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr out_ty $$ ppr out_rhs) $ + (env, Just (in_bndr `setTyVarUnfolding` out_ty, out_rhs)) | Coercion out_co <- out_rhs = assert (isCoVar in_bndr) ===================================== compiler/GHC/Core/Unfold/Make.hs ===================================== @@ -40,6 +40,9 @@ import Data.Maybe ( fromMaybe ) -- the very simple optimiser is used to optimise unfoldings import {-# SOURCE #-} GHC.Core.SimpleOpt +import GHC.Core.Subst (mkOpenSubst) +import GHC.Core.Type (substTy) +import GHC.Types.Var.Env (mkInScopeSetList) @@ -180,10 +183,12 @@ specUnfolding opts spec_bndrs spec_app rule_lhs_args -- to -- \sbs. MkD ((\obs. ) spec_args) ... ditto where - spec_arg arg = simpleOptExpr opts $ - spec_app (mkLams old_bndrs arg) - -- The beta-redexes created by spec_app will be - -- simplified away by simplOptExpr + spec_arg (Type t) = let subst = mkOpenSubst (mkInScopeSetList old_bndrs) (zip old_bndrs rule_lhs_args) + in Type (substTy subst t) + spec_arg arg = simpleOptExpr opts $ + spec_app (mkLams old_bndrs arg) + -- The beta-redexes created by spec_app will be + -- simplified away by simplOptExpr specUnfolding opts spec_bndrs spec_app rule_lhs_args (CoreUnfolding { uf_src = src, uf_tmpl = tmpl ===================================== compiler/GHC/Types/Var.hs ===================================== @@ -103,10 +103,10 @@ module GHC.Types.Var ( mkTyVar, mkTyVarWithUnfolding, mkTcTyVar, -- ** Taking 'TyVar's apart - tyVarName, tyVarKind, tyVarUnfolding, tcTyVarDetails, setTcTyVarDetails, + tyVarName, tyVarKind, tyVarUnfolding, tyVarOccInfo, tcTyVarDetails, setTcTyVarDetails, -- ** Modifying 'TyVar's - setTyVarName, setTyVarUnique, setTyVarKind, setTyVarUnfolding, + setTyVarName, setTyVarUnique, setTyVarKind, setTyVarUnfolding, setTyVarOccInfo, updateTyVarKind, updateTyVarKindM, updateTyVarUnfolding, updateTyVarUnfoldingM, updateTyVarKindAndUnfoldingM, @@ -124,7 +124,7 @@ import {-# SOURCE #-} GHC.Builtin.Types ( manyDataConTy ) import GHC.Types.Name hiding (varName) import GHC.Types.Unique ( Uniquable, Unique, getKey, getUnique , nonDetCmpUnique ) -import GHC.Types.Basic( TypeOrConstraint(..) ) +import GHC.Types.Basic( TypeOrConstraint(..), OccInfo, noOccInfo ) import GHC.Utils.Misc import GHC.Utils.Binary import GHC.Utils.Outputable @@ -258,8 +258,9 @@ data Var -- Identical to the Unique in the name, -- cached here for speed varType :: Kind, -- ^ The type or kind of the 'Var' in question - tv_unfolding :: Maybe Type -- ^ The type to which the variable is bound to, + tv_unfolding :: Maybe Type, -- ^ The type to which the variable is bound to, -- if any. + tv_occ_info :: OccInfo } | TcTyVar { -- Used only during type inference @@ -1096,6 +1097,11 @@ tyVarUnfolding :: TyVar -> Maybe Type tyVarUnfolding (TyVar { tv_unfolding = unf }) = unf tyVarUnfolding _ = Nothing +tyVarOccInfo :: TyVar -> OccInfo +tyVarOccInfo (TcTyVar {}) = noOccInfo +tyVarOccInfo tv = assertPpr (isTyVar tv) (ppr tv) $ tv_occ_info tv +{-# NOINLINE tyVarOccInfo #-} + setTyVarUnique :: TyVar -> Unique -> TyVar setTyVarUnique = setVarUnique @@ -1108,6 +1114,14 @@ setTyVarKind tv k = tv {varType = k} setTyVarUnfolding :: TyVar -> Type -> TyVar setTyVarUnfolding tv unf = tv {tv_unfolding = Just unf} +setTyVarOccInfo :: TyVar -> OccInfo -> TyVar +-- TODO: Surprisingly, TcTyVar's can occur after zonking, why? +-- It could be caused by other parts of my changes though, but I wasn't able to find out where. +-- For now, we just ignore them. +-- setTyVarOccInfo tv@(TcTyVar {}) occ_info = pprPanic "setTyVarOccInfo" (ppr tv $$ ppr occ_info) +setTyVarOccInfo tv@(TcTyVar {}) _occ_info = tv +setTyVarOccInfo tv occ_info = assertPpr (isTyVar tv) (ppr tv) $ tv {tv_occ_info = occ_info} + updateTyVarKind :: (Kind -> Kind) -> TyVar -> TyVar updateTyVarKind update tv = tv {varType = update (tyVarKind tv)} @@ -1143,6 +1157,7 @@ mkTyVar name kind = TyVar { varName = name , realUnique = nameUnique name , varType = kind , tv_unfolding = Nothing + , tv_occ_info = noOccInfo } mkTyVarWithUnfolding :: Name -> Kind -> Type -> TyVar @@ -1150,6 +1165,7 @@ mkTyVarWithUnfolding name kind unf = TyVar { varName = name , realUnique = nameUnique name , varType = kind , tv_unfolding = Just unf + , tv_occ_info = noOccInfo } mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> TyVar View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2c991bbca82f15683247be09bb50e99b0bb30fb9...9c622629f53a23fc56814ce98fceb7b9d6d103e8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2c991bbca82f15683247be09bb50e99b0bb30fb9...9c622629f53a23fc56814ce98fceb7b9d6d103e8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 16:09:55 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 03 Jul 2024 12:09:55 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] Add support for building profiled dynamic way Message-ID: <668577d3dc771_398c9741e664514cd@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: 01fd5ec8 by Matthew Pickering at 2024-07-03T17:08:49+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json - hadrian/bootstrap/src/Main.hs - hadrian/build-cabal - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/src/Context.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/01fd5ec84fc704ce01d36805be9f463c98d46c1d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/01fd5ec84fc704ce01d36805be9f463c98d46c1d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 16:46:24 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Wed, 03 Jul 2024 12:46:24 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25033 Message-ID: <6685806084651_398c97947ba458337@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25033 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25033 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 3 20:20:57 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Wed, 03 Jul 2024 16:20:57 -0400 Subject: [Git][ghc/ghc][wip/T25033] Wibble unused veriable Message-ID: <6685b2a9edb91_398c9721e89c47493a@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25033 at Glasgow Haskell Compiler / GHC Commits: 92fa7807 by Simon Peyton Jones at 2024-07-03T21:20:35+01:00 Wibble unused veriable - - - - - 1 changed file: - compiler/GHC/CoreToStg/Prep.hs Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -1624,7 +1624,7 @@ eta_would_wreck_join :: CoreExpr -> Bool -- ^ Identify the cases where we'd generate invalid `CpeApp`s as described in -- Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] eta_would_wreck_join (Let bs e) = isJoinBind bs || eta_would_wreck_join e -eta_would_wreck_join (Lam b e) = eta_would_wreck_join e +eta_would_wreck_join (Lam _ e) = eta_would_wreck_join e eta_would_wreck_join (Cast e _) = eta_would_wreck_join e eta_would_wreck_join (Tick _ e) = eta_would_wreck_join e eta_would_wreck_join (Case _ _ _ alts) = any eta_would_wreck_join (rhssOfAlts alts) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/92fa7807a84349a458360dc71d8f9efa16222a93 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/92fa7807a84349a458360dc71d8f9efa16222a93 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 01:51:37 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 03 Jul 2024 21:51:37 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 24 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66860029721d4_31e0fd1396d0819263@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 8fb629b9 by Zubin Duggal at 2024-07-03T21:51:09-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 7539d874 by Oleg Grenrus at 2024-07-03T21:51:11-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - ca2881a4 by Teo Camarasu at 2024-07-03T21:51:11-04:00 Deprecate PrimTyConI - We produce `TyConI` for types where we used to use `PrimTyConI`. - We add a deprecation warning to `PrimTyConI` - We add a test case to ensure we can actually reify primitive types. Resolves #24031 - - - - - 49be7fb6 by Adam Gundry at 2024-07-03T21:51:13-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 3df08208 by Max Ulidtko at 2024-07-03T21:51:15-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 8b0dd1e6 by Ryan Scott at 2024-07-03T21:51:15-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - 1141c3a1 by Adam Gundry at 2024-07-03T21:51:15-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 714586ab by Adam Gundry at 2024-07-03T21:51:15-04:00 Use structured error representation when reloading a nonexistent module - - - - - 720fa1a3 by sheaf at 2024-07-03T21:51:15-04:00 Use structured errors for a Backpack instantiation error - - - - - c82f336a by sheaf at 2024-07-03T21:51:15-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 689313dc by Adriaan Leijnse at 2024-07-03T21:51:16-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - a0b0ef66 by Alexander Foremny at 2024-07-03T21:51:16-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - 03f0543f by Alexander Foremny at 2024-07-03T21:51:16-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - cc0eaddc by Fabian Kirchner at 2024-07-03T21:51:16-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - bb3dae58 by Fabian Kirchner at 2024-07-03T21:51:16-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 619d983b by Fabian Kirchner at 2024-07-03T21:51:16-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 67a82e31 by Mauricio at 2024-07-03T21:51:16-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 31e44262 by Fabian Kirchner at 2024-07-03T21:51:16-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - e520dbb5 by Adowrath at 2024-07-03T21:51:16-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - cfbbc858 by Mauricio at 2024-07-03T21:51:16-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - ef2a2d40 by Mike Pilgrem at 2024-07-03T21:51:21-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 875aa5ef by Matthew Pickering at 2024-07-03T21:51:22-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - 7579de42 by Andrew Lelechenko at 2024-07-03T21:51:22-04:00 base: fix more missing changelog entries - - - - - 1024576a by Bryan Richter at 2024-07-03T21:51:23-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/295e8964a2554ab6ccee99b5ef278506cf875a25...1024576a4c7107d9e8ede89f5849bb85c30025af -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/295e8964a2554ab6ccee99b5ef278506cf875a25...1024576a4c7107d9e8ede89f5849bb85c30025af You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 02:20:40 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Wed, 03 Jul 2024 22:20:40 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <668606f84b714_31e0fd19510e0454d6@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 1cd08756 by Fabricio de Sousa Nascimento at 2024-07-04T11:20:12+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 15 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent rdr_name (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent rdr_name (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent rdr_name (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> RdrName -> NE.NonEmpty (GlobalRdrElt) -> RnM ChildLookupResult +make_incorrect_parent_error parent rdr_name gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1cd08756e656cc11512200b6f4ec1a355fa70d91 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1cd08756e656cc11512200b6f4ec1a355fa70d91 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 04:08:23 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Thu, 04 Jul 2024 00:08:23 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <668620374a79a_31e0fd261482c52486@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 2eedafca by Fabricio de Sousa Nascimento at 2024-07-04T13:08:04+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 15 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupSubBndrOccOnTypeClass, + lookupSubBndrOccOnExportList, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -677,109 +677,200 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up +-- Find all the things the 'RdrName' maps to, +-- and pick the one with the right 'Parent' 'Name'. +lookupSubBndrOcc :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do { child <- lookupSubBndrOccOnTypeClass warn_if_deprec the_parent rdr_name what_lkup + ; return $ case child of + FoundChild g -> Right (greName g) + NameNotFound -> Left (UnknownSubordinate doc) + IncorrectParent {} -> Left (UnknownSubordinate doc) } + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + where + what_lkup = LookupChild { wantedParent = the_parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + +{- NOTE [ Differences in name lookup for Export List and Type Classes ] + +Even though the logic to lookup in the export list and instance methods +for type classes share some common behavior (see Note [childGREPriority]) +they differ on how they report errors. Unifying those in a single method +caused some subtle issue (see #24452, #25014). + +For example on exports lists, you could export a name for a different parent +in the case of (pattern synonyms) while for type classes the parent must match +so names with different parents should be report as an error. +-} +lookupSubBndrOccOnTypeClass :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up -> LookupChild -- ^ how to look it up (e.g. which -- 'NameSpace's to look in) -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) +lookupSubBndrOccOnTypeClass warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnTypeClass" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence _ -> do + -- This unique occurrence will have no parent, and thus can't match the parent + -- we are looking for. + no_matching_parent_error parent rdr_name original_gres + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence _ -> do + -- It is more helpful to tell the user that the ambiguous matches + -- are for a wrong parent, then that there is a name clash, + -- see (#24452). Also since `gres` is NonEmpty and is a sub-list + -- of `original_gres` we are sure the original list is NonEmpty. + make_incorrect_parent_error parent (NE.fromList original_gres) +{-# INLINEABLE lookupSubBndrOccOnTypeClass #-} - | otherwise = do +-- | Used in export lists to lookup the children. +lookupSubBndrOccOnExportList :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupSubBndrOccOnExportList warn_if_deprec parent rdr_name how_lkup = + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (FoundChild (mkUnboundGRERdr rdr_name)) + else do + traceTc "lookupSubBndrOccOnExportList" (vcat []) + (picked_gres, original_gres) <- lookupSubBndrOcc_helper parent rdr_name how_lkup + case picked_gres of + NoOccurrence -> do + no_matching_parent_error parent rdr_name original_gres + NoParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + MatchingParentOccurrence g -> do + mark_used_found_child warn_if_deprec g + AmbiguousOccurrence gres -> do + gres_name_clash_error rdr_name gres +{-# INLINEABLE lookupSubBndrOccOnExportList #-} + +-- Used to lookup names on GRE for export lists and type classes +lookupSubBndrOcc_helper :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +lookupSubBndrOcc_helper parent rdr_name how_lkup = do gre_env <- getGlobalRdrEnv let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) picked_gres = pick_gres original_gres -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. traceTc "lookupExportChild original_gres:" (ppr original_gres) traceTc "lookupExportChild picked_gres:" (ppr picked_gres) - case picked_gres of - NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g - AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + return (picked_gres, original_gres) + where + -- We are looking for a single matching parent occurrences, and multiple of those + -- occurrences should be presented as an ambiguous error. After that, we are satisfied + -- with a single NoParentOccurrence. If there are no occurences whatsoever we will report + -- NoOccurence. + -- + -- To report the most precise error, we either report matching parent conflicts or no parent conflicts + -- but never both together. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = MatchingParentOccurrence $ head matching_parent_gres + | length no_parent_gres == 1 = NoParentOccurrence $ head no_parent_gres + | null no_parent_gres && null matching_parent_gres = NoOccurrence + | not $ null matching_parent_gres = AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = AmbiguousOccurrence (NE.fromList no_parent_gres) -- which cannot be empty due to the above 2 conditions + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr (flip separate_gres) ([], []) + + -- We prefer disambiguated then unique occurrences, so we separate then so we can decide based on those + -- occurrences separately. + separate_gres :: ([GlobalRdrElt], [GlobalRdrElt]) -> DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres (matching_parent_gres, no_parent_gres) (MatchingParentOccurrence g) = (g:matching_parent_gres, no_parent_gres) + separate_gres (matching_parent_gres, no_parent_gres) (NoParentOccurrence g) = (matching_parent_gres, g:no_parent_gres) + separate_gres acc _ = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map right_parent gres + | otherwise = map right_parent (pickGREs rdr_name gres) + + right_parent :: GlobalRdrElt -> DisambigInfo + right_parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre + +-- Called when we find no matching GREs after disambiguation but +-- there are three situations where this happens. +-- 1. There were none to begin with. +-- 2. None of the matching ones were the parent but +-- a. They were from an overloaded record field so we can report +-- a better error. +-- b. The original lookup was actually ambiguous. +-- For example, the case where overloading is off and two +-- record fields are in scope from different record +-- constructors, neither of which is the parent. +no_matching_parent_error :: Name -> RdrName -> [GlobalRdrEltX GREInfo] -> RnM ChildLookupResult +no_matching_parent_error parent rdr_name original_gres = do + traceRn "no_matching_parent_error" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> make_incorrect_parent_error parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then make_incorrect_parent_error parent (NE.fromList gss) + else gres_name_clash_error rdr_name $ g NE.:| gss' + +gres_name_clash_error :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +gres_name_clash_error rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) + +make_incorrect_parent_error :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +make_incorrect_parent_error parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + +mark_used_found_child :: DeprecationWarnings -> GlobalRdrElt -> RnM ChildLookupResult +mark_used_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt + | MatchingParentOccurrence GlobalRdrElt -- ^ The parent of the GRE is the correct parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. @@ -790,31 +881,10 @@ data DisambigInfo instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurence:" <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -835,28 +905,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -698,8 +698,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupSubBndrOccOnExportList ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1265,13 +1265,15 @@ greIsRelevant which_gres ns gre {- Note [childGREPriority] ~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupSubBndrOccOnExportList looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + B. lookupSubBndrOccOnTypeClass looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: class C a where { type (+++) :: a -> a ->; infixl 6 +++ } ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,5 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2eedafca26daff472cd8b25ef743c598c88f5de7 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2eedafca26daff472cd8b25ef743c598c88f5de7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 05:43:12 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 01:43:12 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 26 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668636704744a_31e0fd331b68878244@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 8c5ff69d by Zubin Duggal at 2024-07-04T01:42:26-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 11797a4c by Teo Camarasu at 2024-07-04T01:42:27-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - a3db151b by Teo Camarasu at 2024-07-04T01:42:27-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - ae6bd177 by Oleg Grenrus at 2024-07-04T01:42:29-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 62b4db4d by Teo Camarasu at 2024-07-04T01:42:30-04:00 Deprecate PrimTyConI - We produce `TyConI` for types where we used to use `PrimTyConI`. - We add a deprecation warning to `PrimTyConI` - We add a test case to ensure we can actually reify primitive types. Resolves #24031 - - - - - 42ebebae by Adam Gundry at 2024-07-04T01:42:32-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - c67bcdeb by Max Ulidtko at 2024-07-04T01:42:34-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - cfa2fe6c by Ryan Scott at 2024-07-04T01:42:34-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - c3e3f3e3 by Adam Gundry at 2024-07-04T01:42:35-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 9c8eee76 by Adam Gundry at 2024-07-04T01:42:35-04:00 Use structured error representation when reloading a nonexistent module - - - - - 13babc80 by sheaf at 2024-07-04T01:42:35-04:00 Use structured errors for a Backpack instantiation error - - - - - 55a994e9 by sheaf at 2024-07-04T01:42:35-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 34fb0770 by Adriaan Leijnse at 2024-07-04T01:42:35-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 6760cc17 by Alexander Foremny at 2024-07-04T01:42:35-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - 0d5055d1 by Alexander Foremny at 2024-07-04T01:42:35-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 2ee431c9 by Fabian Kirchner at 2024-07-04T01:42:35-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 60566ac9 by Fabian Kirchner at 2024-07-04T01:42:36-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - c798fd05 by Fabian Kirchner at 2024-07-04T01:42:36-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 3ee03a0b by Mauricio at 2024-07-04T01:42:36-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 895d4920 by Fabian Kirchner at 2024-07-04T01:42:36-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - c364eff3 by Adowrath at 2024-07-04T01:42:36-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 1ee677bf by Mauricio at 2024-07-04T01:42:36-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - d9366dc7 by Mike Pilgrem at 2024-07-04T01:42:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 6028cf2e by Matthew Pickering at 2024-07-04T01:42:41-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - a80296a4 by Andrew Lelechenko at 2024-07-04T01:42:42-04:00 base: fix more missing changelog entries - - - - - 2659e326 by Bryan Richter at 2024-07-04T01:42:42-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1024576a4c7107d9e8ede89f5849bb85c30025af...2659e32622ec132739606c1f37d3fd897260a09a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1024576a4c7107d9e8ede89f5849bb85c30025af...2659e32622ec132739606c1f37d3fd897260a09a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 08:12:41 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 04 Jul 2024 04:12:41 -0400 Subject: [Git][ghc/ghc][wip/T25033] Fix eta-expansion in Prep Message-ID: <6686597992c5e_1c2f9cde1cb4583f9@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25033 at Glasgow Haskell Compiler / GHC Commits: 010445e1 by Simon Peyton Jones at 2024-07-04T09:10:28+01:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 3 changed files: - compiler/GHC/CoreToStg/Prep.hs - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -1611,7 +1611,7 @@ cpeArgArity env float_decision floats1 arg -- See wrinkle (EA2) in Note [Eta expansion of arguments in CorePrep] | Just ao <- cp_arityOpts (cpe_config env) -- Just <=> -O1 or -O2 - , not (has_join_in_tail_context arg) + , not (eta_would_wreck_join arg) -- See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] = case exprEtaExpandArity ao arg of Nothing -> 0 @@ -1620,15 +1620,15 @@ cpeArgArity env float_decision floats1 arg | otherwise = exprArity arg -- this is cheap enough for -O0 -has_join_in_tail_context :: CoreExpr -> Bool +eta_would_wreck_join :: CoreExpr -> Bool -- ^ Identify the cases where we'd generate invalid `CpeApp`s as described in -- Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] -has_join_in_tail_context (Let bs e) = isJoinBind bs || has_join_in_tail_context e -has_join_in_tail_context (Lam b e) | isTyVar b = has_join_in_tail_context e -has_join_in_tail_context (Cast e _) = has_join_in_tail_context e -has_join_in_tail_context (Tick _ e) = has_join_in_tail_context e -has_join_in_tail_context (Case _ _ _ alts) = any has_join_in_tail_context (rhssOfAlts alts) -has_join_in_tail_context _ = False +eta_would_wreck_join (Let bs e) = isJoinBind bs || eta_would_wreck_join e +eta_would_wreck_join (Lam _ e) = eta_would_wreck_join e +eta_would_wreck_join (Cast e _) = eta_would_wreck_join e +eta_would_wreck_join (Tick _ e) = eta_would_wreck_join e +eta_would_wreck_join (Case _ _ _ alts) = any eta_would_wreck_join (rhssOfAlts alts) +eta_would_wreck_join _ = False maybeSaturate :: Id -> CpeApp -> Int -> [CoreTickish] -> UniqSM CpeRhs maybeSaturate fn expr n_args unsat_ticks @@ -1761,7 +1761,8 @@ There is a nasty Wrinkle: (EA1) When eta expanding an argument headed by a join point, we might get "crap", as Note [Eta expansion for join points] in GHC.Core.Opt.Arity puts - it. + it. This crap means the output does not conform to the syntax in + Note [CorePrep invariants], which then makes later passes crash (#25033). Consider f (join j x = rhs in ...(j 1)...(j 2)...) @@ -1776,15 +1777,22 @@ There is a nasty Wrinkle: In our case, (join j x = rhs in ...(j 1)...(j 2)...) is not a valid `CpeApp` (see Note [CorePrep invariants]) and we'd get a crash in the App case of `coreToStgExpr`. - Hence we simply check for the cases where an intervening join point - binding in the tail context of the argument would lead to the introduction - of such crap via `has_join_in_tail_context`, in which case we abstain from - eta expansion. + + Hence, in `eta_would_wreck_join`, we check for the cases where an + intervening join point binding in the tail context of the argument would + make eta-expansion break Note [CorePrep invariants], in which + case we abstain from eta expansion. This scenario occurs rarely; hence it's OK to generate sub-optimal code. The alternative would be to fix Note [Eta expansion for join points], but that's quite challenging due to unfoldings of (recursive) join points. + `eta_would_wreck_join` sees if there are any join points, like `j` above + that would be messed up. It must look inside lambdas (#25033); consider + f (\x. join j y = ... in ...(j 1)...(j 3)...) + We can't eta expand that `\x` any more than we could if the join was at + the top. (And when there's a lambda, we don't have a thunk anyway.) + (EA2) In cpeArgArity, if float_decision=FloatNone the `arg` will look like let in rhs where is non-empty and can't be floated out of a lazy context (see ===================================== testsuite/tests/simplCore/should_compile/T25033.hs ===================================== @@ -0,0 +1,18 @@ +{-# OPTIONS_GHC -fno-do-lambda-eta-expansion #-} +-- It's hard to trigger #25033, because the Simplier eta-expands +-- lambdas. So I switched off that Simplifier ability, and thereby +-- triggered the bug on this nice small example. + +module T25033 where + +{-# NOINLINE woo #-} +woo x = x + +foo v = woo (\xs -> let + j ys = \ws -> xs ++ (reverse . reverse . reverse . reverse . + reverse . reverse . reverse . reverse) ws + in + case v of + "a" -> j "wim" + _ -> j "wam" + ) ===================================== testsuite/tests/simplCore/should_compile/all.T ===================================== @@ -527,3 +527,4 @@ test('T24808', [ grep_errmsg(r'myFunction') ], compile, ['-O -ddump-simpl']) test('T24944', [extra_files(['T24944a.hs'])], multimod_compile, ['T24944', '-v0 -O2']) test('T24725a', [ grep_errmsg(r'testedRule')], compile, ['-O -ddump-rule-firings']) +test('T25033', normal, compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/010445e101bd5d62e3568b15d8c4a0b9fb8b68fb -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/010445e101bd5d62e3568b15d8c4a0b9fb8b68fb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 08:33:51 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 04:33:51 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 26 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66865e6fb44b4_1c2f9c1256ab06808a@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 572b31fa by Zubin Duggal at 2024-07-04T04:33:13-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 25794ef7 by Teo Camarasu at 2024-07-04T04:33:14-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - a15d3b68 by Teo Camarasu at 2024-07-04T04:33:14-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 20429755 by Oleg Grenrus at 2024-07-04T04:33:16-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - b2c98190 by Teo Camarasu at 2024-07-04T04:33:16-04:00 Deprecate PrimTyConI - We produce `TyConI` for types where we used to use `PrimTyConI`. - We add a deprecation warning to `PrimTyConI` - We add a test case to ensure we can actually reify primitive types. Resolves #24031 - - - - - 3922b214 by Adam Gundry at 2024-07-04T04:33:18-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 08cb75c4 by Max Ulidtko at 2024-07-04T04:33:20-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 349308fe by Ryan Scott at 2024-07-04T04:33:20-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - d89c7f2b by Adam Gundry at 2024-07-04T04:33:20-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - cc8cd471 by Adam Gundry at 2024-07-04T04:33:21-04:00 Use structured error representation when reloading a nonexistent module - - - - - 20f4d2d0 by sheaf at 2024-07-04T04:33:21-04:00 Use structured errors for a Backpack instantiation error - - - - - f00a54f9 by sheaf at 2024-07-04T04:33:21-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 753ec9c9 by Adriaan Leijnse at 2024-07-04T04:33:21-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 975350bb by Alexander Foremny at 2024-07-04T04:33:21-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - 2e12396a by Alexander Foremny at 2024-07-04T04:33:21-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 828cd38a by Fabian Kirchner at 2024-07-04T04:33:21-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 3928a11a by Fabian Kirchner at 2024-07-04T04:33:21-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 8329e884 by Fabian Kirchner at 2024-07-04T04:33:21-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 8783b690 by Mauricio at 2024-07-04T04:33:21-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 7e563b03 by Fabian Kirchner at 2024-07-04T04:33:21-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 9ab22d80 by Adowrath at 2024-07-04T04:33:21-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 80fadfda by Mauricio at 2024-07-04T04:33:22-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - ec1eb88a by Mike Pilgrem at 2024-07-04T04:33:26-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 5cedace2 by Matthew Pickering at 2024-07-04T04:33:27-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - dcc6bbb3 by Andrew Lelechenko at 2024-07-04T04:33:27-04:00 base: fix more missing changelog entries - - - - - d325d7f0 by Bryan Richter at 2024-07-04T04:33:28-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2659e32622ec132739606c1f37d3fd897260a09a...d325d7f03bd1352894f33955589199c1f2df5aef -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2659e32622ec132739606c1f37d3fd897260a09a...d325d7f03bd1352894f33955589199c1f2df5aef You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 08:46:38 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 04 Jul 2024 04:46:38 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] Add support for building profiled dynamic way Message-ID: <6686616e9df1a_23b87516961c5582@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: 01521dea by Matthew Pickering at 2024-07-04T09:46:23+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json - hadrian/bootstrap/src/Main.hs - hadrian/build-cabal - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/src/Context.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/01521dea493bef3789a1a1f2f6a0d50de1345b74 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/01521dea493bef3789a1a1f2f6a0d50de1345b74 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 09:01:23 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Thu, 04 Jul 2024 05:01:23 -0400 Subject: [Git][ghc/ghc][wip/haddock-iface-fixes] 2 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <668664e31ed7a_23b87542bddc61475@gitlab.mail> Zubin pushed to branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC Commits: c03db15b by Zubin Duggal at 2024-07-04T14:31:04+05:30 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - c49a84ba by Zubin Duggal at 2024-07-04T14:31:04+05:30 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 9 changed files: - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs - utils/haddock/haddock-api/src/Haddock/Types.hs - utils/haddock/html-test/ref/Bug1004.html - utils/haddock/html-test/ref/Bug548.html Changes: ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -430,16 +430,17 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap + pkgSrcLMap = Map.map (hypSrcModuleUrlToLineFormat . hypSrcPkgUrlToModuleFormat) + $ Map.mapKeys moduleUnit extSrcMap -- These urls have a template for the module %M and the line %L - -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey - = Map.singleton k hypSrcModuleLineUrlFormat + = Map.insert k hypSrcModuleLineUrlFormat pkgSrcLMap | Just path <- srcLEntity , Just k <- pkgKey - = Map.singleton k path - | otherwise = Map.empty + = Map.insert k path pkgSrcLMap + | otherwise = pkgSrcLMap sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs ===================================== @@ -14,6 +14,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleNameUrlFormat , hypSrcModuleLineUrlFormat , hypSrcModuleUrlToNameFormat + , hypSrcModuleUrlToLineFormat , hypSrcPkgUrlToModuleFormat , spliceURL , spliceURL' @@ -86,6 +87,9 @@ hypSrcModuleLineUrlFormat = hypSrcModuleUrlFormat ++ "#" ++ lineFormat hypSrcModuleUrlToNameFormat :: String -> String hypSrcModuleUrlToNameFormat url = url ++ "#" ++ nameFormat +hypSrcModuleUrlToLineFormat :: String -> String +hypSrcModuleUrlToLineFormat url = url ++ "#" ++ lineFormat + hypSrcPkgUrlToModuleFormat :: String -> String hypSrcPkgUrlToModuleFormat url = url moduleFormat ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -217,25 +217,28 @@ createIfaces verbosity modules flags instIfaceMap = do -- Visit modules in that order sortedMods = concatMap go $ topSortModuleGraph False modGraph Nothing out verbosity normal "Haddock coverage:" - (ifaces, _) <- foldM f ([], Map.empty) sortedMods + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) + (ifaces, _, _) <- foldM f ([], Map.empty, inst_warning_map) sortedMods return (reverse ifaces) where - f (ifaces, ifaceMap) modSummary = do + f (ifaces, ifaceMap, warningMap) modSummary = do x <- {-# SCC processModule #-} withTimingM "processModule" (const ()) $ do - processModule verbosity modSummary flags ifaceMap instIfaceMap + processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap return $ case x of Just iface -> ( iface:ifaces - , Map.insert (ifaceMod iface) iface ifaceMap ) + , Map.insert (ifaceMod iface) iface ifaceMap + , Map.union (ifaceWarningMap iface) warningMap) Nothing -> ( ifaces - , ifaceMap ) -- Boot modules don't generate ifaces. + , ifaceMap + , warningMap ) -- Boot modules don't generate ifaces. dropErr :: MaybeErr e a -> Maybe a dropErr (Succeeded a) = Just a dropErr (Failed _) = Nothing -processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface) -processModule verbosity modSummary flags ifaceMap instIfaceMap = do +processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> WarningMap -> Ghc (Maybe Interface) +processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modSummary) ++ "..." hsc_env <- getSession @@ -258,7 +261,7 @@ processModule verbosity modSummary flags ifaceMap instIfaceMap = do {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts + createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts warningMap let (haddockable, haddocked) = ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -140,10 +140,11 @@ attachInstances expInfo ifaces instIfaceMap = do attach (cls_insts, fam_insts, inst_map) iface = do let getInstDoc = findInstDoc iface ifaceMap instIfaceMap getFixity = findFixity iface ifaceMap instIfaceMap + getInstLocIface name = Map.lookup name . instInstanceLocMap =<< Map.lookup (nameModule name) instIfaceMap newItems <- mapM - (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity) + (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity getInstLocIface) (ifaceExportItems iface) let orphanInstances = attachOrphanInstances expInfo getInstDoc (ifaceInstances iface) fam_insts return $ @@ -181,9 +182,11 @@ attachToExportItem -- ^ how to lookup the doc of an instance -> (Name -> Maybe Fixity) -- ^ how to lookup a fixity + -> (Name -> Maybe RealSrcSpan) + -- ^ how to lookup definition spans for instances -> ExportItem GhcRn -> Ghc (ExportItem GhcRn) -attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export = +attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity getInstLocIface export = case attachFixities export of ExportDecl e@(ExportD{expDDecl = L eSpan (TyClD _ d)}) -> do insts <- @@ -264,12 +267,17 @@ attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export -- spanName: attach the location to the name that is the same file as the instance location spanName s (InstHead{ihdClsName = clsn}) (L instL instn) = - let s1 = getSrcSpan s + let s1 = let orig_span = getSrcSpan s + in if isGoodSrcSpan orig_span + then orig_span + else case getInstLocIface s of + Nothing -> orig_span + Just rs -> RealSrcSpan rs mempty sn = if srcSpanFileName_maybe s1 == srcSpanFileName_maybe instL then instn else clsn - in L (getSrcSpan s) sn + in L s1 sn -- spanName on Either spanNameE s (Left e) _ = L (getSrcSpan s) (Left e) spanNameE s (Right ok) linst = ===================================== utils/haddock/haddock-api/src/Haddock/Interface/Create.hs ===================================== @@ -83,8 +83,9 @@ createInterface1 -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = do +createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = do let ModSummary { -- Cached flags from OPTIONS, INCLUDE and LANGUAGE @@ -191,7 +192,7 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance let -- Warnings in this module and transitive warnings from dependent modules transitiveWarnings :: Map Name (Doc Name) - transitiveWarnings = Map.unions (warningMap : map ifaceWarningMap (Map.elems ifaces)) + transitiveWarnings = Map.union warningMap depWarnings export_items <- mkExportItems ===================================== utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs ===================================== @@ -49,6 +49,7 @@ import GHC.Iface.Binary (getWithUserData, putSymbolTable) import GHC.Iface.Type (IfaceType, putIfaceType) import GHC.Types.Name.Cache import GHC.Types.Unique +import GHC.Types.SrcLoc import GHC.Types.Unique.FM import GHC.Unit.State import GHC.Utils.Binary @@ -366,6 +367,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) = do put_ bh modu put_ bh is_sig @@ -376,6 +379,8 @@ instance Binary InstalledInterface where put_ bh visExps put_ bh opts put_ bh fixMap + put_ bh warnMap + put_ bh locMap get bh = do modu <- get bh @@ -387,6 +392,8 @@ instance Binary InstalledInterface where visExps <- get bh opts <- get bh fixMap <- get bh + warnMap <- get bh + locMap <- get bh return ( InstalledInterface modu @@ -399,6 +406,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) instance Binary DocOption where @@ -758,3 +767,19 @@ instance Binary n => Binary (Wrap n) where name <- get bh return (Backticked name) _ -> error "get Wrap: Bad h" + +instance Binary RealSrcSpan where + put_ bh sp = do + put_ bh (srcSpanFile sp) + put_ bh (srcSpanStartLine sp) + put_ bh (srcSpanStartCol sp) + put_ bh (srcSpanEndLine sp) + put_ bh (srcSpanEndCol sp) + + get bh = do + fs <- get bh + sl <- get bh + sc <- get bh + el <- get bh + ec <- get bh + pure $ mkRealSrcSpan (mkRealSrcLoc fs sl sc) (mkRealSrcLoc fs el ec) ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -48,16 +48,18 @@ import Control.Monad.Catch import Control.Monad.State.Strict import Data.Data (Data) import Data.Map (Map) +import qualified Data.Map as Map import qualified Data.Set as Set import GHC import qualified GHC.Data.Strict as Strict import GHC.Driver.Session (Language) import qualified GHC.LanguageExtensions as LangExt +import GHC.Core.InstEnv (is_dfun_name) import GHC.Types.Fixity (Fixity (..)) import GHC.Types.Name (stableNameCmp) import GHC.Types.Name.Occurrence import GHC.Types.Name.Reader (RdrName (..)) -import GHC.Types.SrcLoc (BufPos (..), BufSpan (..)) +import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan) import GHC.Types.Var (Specificity) import GHC.Utils.Outputable @@ -166,6 +168,8 @@ data InstalledInterface = InstalledInterface , instOptions :: [DocOption] -- ^ Haddock options for this module (prune, ignore-exports, etc). , instFixMap :: Map Name Fixity + , instWarningMap :: WarningMap + , instInstanceLocMap :: Map Name RealSrcSpan } -- | Convert an 'Interface' to an 'InstalledInterface' @@ -182,6 +186,8 @@ toInstalledIface interface = , instOptions = interface.ifaceOptions , instFixMap = interface.ifaceFixMap , instDefMeths = interface.ifaceDefMeths + , instWarningMap = interface.ifaceWarningMap + , instInstanceLocMap = Map.fromList [(inst_name, loc) | i <- interface.ifaceInstances, let inst_name = is_dfun_name i, Just loc <- [srcSpanToRealSrcSpan (nameSrcSpan inst_name)]] } -- | A monad in which we create Haddock interfaces. Not to be confused with ===================================== utils/haddock/html-test/ref/Bug1004.html ===================================== @@ -147,6 +147,8 @@ > f g :: k -> Type) #  (Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #  (Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g a) #

(Product f g a) #

(Product f g a) #

(Product f g a) #  (Product f g a) #

(Product f g a) #

(Product f g a) #

(Product f g a) #

-> Type) #  (WrappedArrow a b) #

(WrappedArrow a b) #

(WrappedArrow a b) #

(WrappedArrow a b c) #

(WrappedArrow a b c) #  From gitlab at gitlab.haskell.org Thu Jul 4 09:13:13 2024 From: gitlab at gitlab.haskell.org (josephf (@josephf)) Date: Thu, 04 Jul 2024 05:13:13 -0400 Subject: [Git][ghc/ghc][wip/type-sharing] 5 commits: compiler: introduce type variable unfoldings Message-ID: <668667a9527c5_1ad1518577c9519c@gitlab.mail> josephf pushed to branch wip/type-sharing at Glasgow Haskell Compiler / GHC Commits: 4e5d33c7 by Joseph Fourment at 2024-07-04T11:09:39+02:00 compiler: introduce type variable unfoldings The plan for #20264 is to introduce let-bound types to have observable sharing in types. To avoid the need to carry an environment when dealing with occurrences of these type variables, we embed the types they're bound to (if any) in a `tv_unfolding :: Maybe Type` attribute. This way, one can look through let-bound type variables using `coreView` and friends. In particular, definitional equality looks through unfoldings. - - - - - 34dc7705 by Joseph Fourment at 2024-07-04T11:09:39+02:00 simple-opt: don't inline type-lets - - - - - e7cf9d01 by Joseph Fourment at 2024-07-04T11:09:39+02:00 specialise: fix type-lets in DFun unfoldings During specialisation, a dictionary being specialised gets a new unfolding by turning `DFun \ bndrs -> MkD @<T1> ... @<Tm> <op1> ... <opn>` into `DFun \ spec_bndrs -> MkD @((\ bndrs -> TYPE: <T1>) spec_args) ... ((\ bndrs -> <opn>) spec_args)` which in turns gets beta-reduced into `DFun \ spec_bndrs -> MkD (let { bndrs = spec_args } in TYPE: <T1>) ... (let { bndrs = spec_args } in <opn>)`. Previously, such let binders would immediately be substituted into the type so it didn't cause any issue, but now we want to avoid inlining. Arguments of the form `let { bndrs = spec_args } in TYPE: <T1>` are not considered as type arguments since they're not of the canonical form `TYPE: something`. This commit restores the previous behavior of substituting the specialised type arguments. Alternatively, we could attach some floated type bindings to `DFun`s. - - - - - d8174aa1 by Joseph Fourment at 2024-07-04T11:09:40+02:00 occur-anal: implement occurence analysis for type variables In order to find out let-bound type variables that are used only once, in the hope of inlining them, we need to track type variables as well in the occurrence analiser. Just like Id's, we attach an `OccInfo` to each (immutable) type variable, and we walk into types and coercions to accurately gather occurrences. - - - - - 80ffac20 by Joseph Fourment at 2024-07-04T11:12:07+02:00 simplifier: don't inline type-lets Keep propagating type-lets further down the pipeline, in the simplifier. We also update CallArity, CprAnal, DmdAnal, WorkWrap, and Specialise to ignore type-lets. - - - - - 17 changed files: - compiler/GHC/Core/Opt/CallArity.hs - compiler/GHC/Core/Opt/CprAnal.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Subst.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unfold/Make.hs - compiler/GHC/Tc/Zonk/TcType.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Var.hs Changes: ===================================== compiler/GHC/Core/Opt/CallArity.hs ===================================== @@ -23,6 +23,7 @@ import GHC.Types.Demand import GHC.Utils.Misc import Control.Arrow ( first, second ) +import GHC.Types.Var (isTyVar) {- @@ -559,7 +560,9 @@ addInterestingBinds int bind -- Second argument is the demand from the body callArityBind :: VarSet -> CallArityRes -> VarSet -> CoreBind -> (CallArityRes, CoreBind) -- Non-recursive let -callArityBind boring_vars ae_body int (NonRec v rhs) +callArityBind boring_vars ae_body int bind@(NonRec v rhs) + | isTyVar v + = (ae_body, bind) | otherwise = -- pprTrace "callArityBind:NonRec" -- (vcat [ppr v, ppr ae_body, ppr int, ppr ae_rhs, ppr safe_arity]) ===================================== compiler/GHC/Core/Opt/CprAnal.hs ===================================== @@ -499,6 +499,8 @@ cprAnalBind -> CoreExpr -> (Id, CoreExpr, AnalEnv) cprAnalBind env id rhs + | isTyVar id + = (id, rhs, extendSigEnv env id topCprSig) | isDFunId id -- Never give DFuns the CPR property; we'll never save allocs. = (id, rhs, extendSigEnv env id topCprSig) -- See Note [CPR for data structures] ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -297,6 +297,9 @@ dmdAnalBind -- where the binding is in scope -> WithDmdType (DmdResult CoreBind a) dmdAnalBind top_lvl env dmd bind anal_body = case bind of + NonRec var rhs + | isTyVar var + -> dmdAnalBindLetDown top_lvl env dmd bind anal_body NonRec id rhs | useLetUp top_lvl id -> dmdAnalBindLetUp top_lvl env_rhs id rhs anal_body @@ -369,6 +372,9 @@ dmdAnalBindLetUp top_lvl env id rhs anal_body = WithDmdType final_ty (R (NonRec -- This is the LetDown rule in the paper “Higher-Order Cardinality Analysis”. dmdAnalBindLetDown :: TopLevelFlag -> AnalEnv -> SubDemand -> CoreBind -> (AnalEnv -> WithDmdType a) -> WithDmdType (DmdResult CoreBind a) dmdAnalBindLetDown top_lvl env dmd bind anal_body = case bind of + NonRec tv rhs + | isTyVar tv + -> do_rest env emptyVarEnv [(tv, rhs)] (uncurry NonRec . only) NonRec id rhs | (env', weak_fv, id1, rhs1) <- dmdAnalRhsSig top_lvl NonRecursive env dmd id rhs @@ -379,13 +385,16 @@ dmdAnalBindLetDown top_lvl env dmd bind anal_body = case bind of where do_rest env' weak_fv pairs1 build_bind = WithDmdType final_ty (R (build_bind pairs2) body') where - WithDmdType body_ty body' = anal_body env' + WithDmdType body_ty body' = anal_body env' -- see Note [Lazy and unleashable free variables] dmd_ty = addWeakFVs body_ty weak_fv - WithDmdType final_ty id_dmds = findBndrsDmds env' dmd_ty (strictMap fst pairs1) + WithDmdType final_ty maybe_dmds = findBndrsDmds_maybe env' dmd_ty (strictMap fst pairs1) -- Important to force this as build_bind might not force it. - !pairs2 = strictZipWith do_one pairs1 id_dmds - do_one (id', rhs') dmd = ((,) $! setBindIdDemandInfo top_lvl id' dmd) $! rhs' + !pairs2 = strictZipWith do_one pairs1 maybe_dmds + do_one (bndr', rhs') maybe_dmd + | isTyVar bndr' = (bndr', rhs') + | Just dmd <- maybe_dmd = ((,) $! setBindIdDemandInfo top_lvl bndr' dmd) $! rhs' + | otherwise = pprPanic "dmdAnalBindLetDown:do_one" (ppr bndr' $$ ppr rhs' $$ ppr maybe_dmd) -- If the actual demand is better than the vanilla call -- demand, you might think that we might do better to re-analyse -- the RHS with the stronger demand. @@ -2540,6 +2549,18 @@ findBndrsDmds env dmd_ty bndrs in WithDmdType dmd_ty2 (dmd : dmds) | otherwise = go dmd_ty bs +findBndrsDmds_maybe :: AnalEnv -> DmdType -> [Var] -> WithDmdType [Maybe Demand] +findBndrsDmds_maybe env dmd_ty bndrs + = go dmd_ty bndrs + where + go dmd_ty [] = WithDmdType dmd_ty [] + go dmd_ty (b:bs) + | isId b = let WithDmdType dmd_ty1 dmds = go dmd_ty bs + WithDmdType dmd_ty2 dmd = findBndrDmd env dmd_ty1 b + in WithDmdType dmd_ty2 (Just dmd : dmds) + | otherwise = let WithDmdType dmd_ty1 dmds = go dmd_ty bs + in WithDmdType dmd_ty1 (Nothing : dmds) + findBndrDmd :: AnalEnv -> DmdType -> Id -> WithDmdType Demand -- See Note [Trimming a demand to a type] findBndrDmd env dmd_ty id ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -39,6 +39,7 @@ import GHC.Core.Opt.Arity ( joinRhsArity, isOneShotBndr ) import GHC.Core.Coercion import GHC.Core.Predicate ( isDictId ) import GHC.Core.Type +import GHC.Core.TyCo.Rep import GHC.Core.TyCo.FVs ( tyCoVarsOfMCo ) import GHC.Data.Maybe( orElse ) @@ -665,7 +666,7 @@ through A, so it should have ManyOcc. Bear this case in mind! See addJoinPoint. * At an occurrence of a join point, we do everything as normal, but add in the - UsageDetails from the occ_join_points. See mkOneOcc. + UsageDetails from the occ_join_points. See mkOneIdOcc. * Crucially, at the NonRec binding of the join point, in `occAnalBind`, we use `orUDs`, not `andUDs` to combine the usage from the RHS with the usage from @@ -721,7 +722,7 @@ There are a couple of tricky wrinkles in f (case x of { K j -> ...; ... }) We can zap the entire occ_join_points when looking at the argument, because `j` can't posibly occur -- it's a join point! And the smaller - occ_join_points is, the better. Smaller to look up in mkOneOcc, and + occ_join_points is, the better. Smaller to look up in mkOneIdOcc, and more important, less looking-up when checking (W2). This is done in setNonTailCtxt. It's important /not/ to do this for @@ -1142,6 +1143,13 @@ occAnalRec !_ lvl (WUD body_uds binds) | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds + + | isTyVar bndr + = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds + !bndr' = tagged_bndr + in WUD (body_uds `andUDs` rhs_uds') + (NonRec bndr' rhs' : binds) | otherwise = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds @@ -1700,6 +1708,30 @@ rank (r, _, _) = r makeNode :: OccEnv -> ImpRuleEdges -> VarSet -> (Var, CoreExpr) -> LetrecNode -- See Note [Recursive bindings: the grand plan] +makeNode !env _imp_rule_edges bndr_set (bndr, Type rhs) + = assert (isTyVar bndr) $ + DigraphNode { node_payload = details + , node_key = varUnique bndr + , node_dependencies = nonDetKeysUniqSet inl_fvs } + where + details = ND { nd_bndr = bndr' + , nd_rhs = WTUD (TUD 0 inl_uds) (Type rhs') + , nd_inl = inl_fvs + , nd_simple = True + , nd_weak_fvs = emptyVarSet + , nd_active_rule_fvs = emptyVarSet } + + bndr' = bndr `setTyVarUnfolding` rhs' + + rhs_env = setNonTailCtxt OccRhs env + -- WUD unf_uds mb_unf' + -- | Just unf <- tyVarUnfolding bndr = Just <$> occAnalTy rhs_env unf + -- | otherwise = WUD emptyUDs Nothing + WUD rhs_uds rhs' = occAnalTy rhs_env rhs + + inl_uds = rhs_uds -- `andUDs` unf_uds + inl_fvs = udFreeVars bndr_set inl_uds + makeNode !env imp_rule_edges bndr_set (bndr, rhs) = -- pprTrace "makeNode" (ppr bndr <+> ppr (sizeVarSet bndr_set)) $ DigraphNode { node_payload = details @@ -2198,29 +2230,24 @@ occ_anal_lam_tail env expr@(Lam {}) = addInScope env rev_bndrs $ \env -> let !(WUD usage body') = occ_anal_lam_tail env body wrap_lam body bndr = Lam (tagLamBinder usage bndr) body - in WUD (usage `addLamCoVarOccs` rev_bndrs) + in WUD (usage `addLamTyCoVarOccs` rev_bndrs) (foldl' wrap_lam body' rev_bndrs) -- For casts, keep going in the same lambda-group -- See Note [Occurrence analysis for lambda binders] occ_anal_lam_tail env (Cast expr co) - = let WUD usage expr' = occ_anal_lam_tail env expr + = let WUD expr_uds expr' = occ_anal_lam_tail env expr -- usage1: see Note [Gather occurrences of coercion variables] - usage1 = addManyOccs usage (coVarsOfCo co) + WUD co_uds co' = occAnalCo env co -- usage2: see Note [Occ-anal and cast worker/wrapper] - usage2 = case expr of - Var {} | isRhsEnv env -> markAllMany usage1 - _ -> usage1 + co_uds' = case expr of + Var {} | isRhsEnv env -> markAllMany co_uds + _ -> co_uds - -- usage3: you might think this was not necessary, because of - -- the markAllNonTail in adjustTailUsage; but not so! For a - -- join point, adjustTailUsage doesn't do this; yet if there is - -- a cast, we must! Also: why markAllNonTail? See - -- GHC.Core.Lint: Note Note [Join points and casts] - usage3 = markAllNonTail usage2 + uds = markAllNonTail (expr_uds `andUDs` co_uds') - in WUD usage3 (Cast expr' co) + in WUD uds (Cast expr' co') occ_anal_lam_tail env expr -- Not Lam, not Cast = occAnal env expr @@ -2427,6 +2454,140 @@ occAnalList env (e:es) = let (WUD uds1 e') = occAnal env e (WUD uds2 es') = occAnalList env es in WUD (uds1 `andUDs` uds2) (e' : es') +occAnalTys :: OccEnv -> [Type] -> WithUsageDetails [Type] +occAnalTys !_ [] = WUD emptyDetails [] +occAnalTys env (t:ts) = let + (WUD uds1 t') = occAnalTy env t + (WUD uds2 ts') = occAnalTys env ts + in WUD (uds1 `andUDs` uds2) (t' : ts') + +occAnalTy :: OccEnv + -> Type + -> WithUsageDetails Type +occAnalTy env (TyVarTy tv) + = let tv_usage = mkOneTyVarOcc env tv + -- WUD ki_usage tv_ki' = occAnalTy env () + in WUD tv_usage (TyVarTy tv) +occAnalTy env (AppTy t1 t2) + = let WUD t1_usage t1' = occAnalTy env t1 + WUD t2_usage t2' = occAnalTy env t2 + in WUD (t1_usage `andUDs` t2_usage) (mkAppTy t1' t2') +occAnalTy _ ty@(LitTy {}) = WUD emptyDetails ty +occAnalTy env (CastTy ty co) + = let WUD ty_usage ty' = occAnalTy env ty + WUD co_usage co' = occAnalCo env co + in WUD (ty_usage `andUDs` co_usage) (mkCastTy ty' co') +occAnalTy env (CoercionTy co) + = let WUD co_usage co' = occAnalCo env co + in WUD co_usage (CoercionTy co') +occAnalTy env fun@(FunTy _ w arg res) + = let WUD w_usage w' = occAnalTy env w + WUD arg_usage arg' = occAnalTy env arg + WUD res_usage res' = occAnalTy env res + all_usage = w_usage `andUDs` arg_usage `andUDs` res_usage + in WUD all_usage (fun { ft_mult = w', ft_arg = arg', ft_res = res' }) +occAnalTy env ty@(TyConApp tc tys) + | null tys + = WUD emptyDetails ty + + | let WUD tys_usage tys' = occAnalTys env tys + = WUD tys_usage (mkTyConApp tc tys') +occAnalTy env (ForAllTy (Bndr tv vis) inner) + = let WUD usage inner' = occAnalTy env inner + in WUD usage (ForAllTy (Bndr tv vis) inner') + +occAnalCos :: OccEnv -> [Coercion] -> WithUsageDetails [Coercion] +occAnalCos _ [] = WUD emptyDetails [] +occAnalCos env (co:cos) + = let WUD uds1 co' = occAnalCo env co + WUD uds2 cos' = occAnalCos env cos + in WUD (uds1 `andUDs` uds2) (co' : cos') + +occAnalMCo :: OccEnv -> MCoercion -> WithUsageDetails MCoercion +occAnalMCo _ MRefl = WUD emptyDetails MRefl +occAnalMCo env (MCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (MCo co') + +occAnalCo :: OccEnv -> Coercion -> WithUsageDetails Coercion +occAnalCo !env (Refl ty) + = let WUD usage ty' = occAnalTy env ty + in WUD usage (Refl ty') +occAnalCo !env (GRefl r ty mco) + = let WUD usage1 ty' = occAnalTy env ty + WUD usage2 mco' = occAnalMCo env mco + in WUD (usage1 `andUDs` usage2) (mkGReflCo r ty' mco') +occAnalCo !env (AppCo co1 co2) + = let WUD usage1 co1' = occAnalCo env co1 + WUD usage2 co2' = occAnalCo env co2 + in WUD (usage1 `andUDs` usage2) (mkAppCo co1' co2') +occAnalCo !env (FunCo r afl afr cw c1 c2) + = let WUD cw_usage cw' = occAnalCo env cw + WUD c1_usage c1' = occAnalCo env c1 + WUD c2_usage c2' = occAnalCo env c2 + total_usage = cw_usage `andUDs` c1_usage `andUDs` c2_usage + in WUD total_usage (mkFunCo2 r afl afr cw' c1' c2') +occAnalCo env (CoVarCo cv) + = let occ = mkOneIdOcc env cv NotInteresting 0 + in WUD occ (mkCoVarCo cv) +occAnalCo _ (HoleCo hole) + = pprPanic "occAnalCo:HoleCo" (ppr hole) +occAnalCo env (UnivCo p r t1 t2) + = let WUD p_usage p' = occAnalProv env p + WUD t1_usage t1' = occAnalTy env t1 + WUD t2_usage t2' = occAnalTy env t2 + total_usage = p_usage `andUDs` t1_usage `andUDs` t2_usage + in WUD total_usage (mkUnivCo p' r t1' t2') +occAnalCo env (SymCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSymCo co') +occAnalCo env (TransCo co1 co2) + = let WUD usage1 co1' = occAnalCo env co1 + WUD usage2 co2' = occAnalCo env co2 + in WUD (usage1 `andUDs` usage2) (mkTransCo co1' co2') +occAnalCo env (AxiomRuleCo r cos) + = let WUD usage cos' = occAnalCos env cos + in WUD usage (AxiomRuleCo r cos') +occAnalCo env (SelCo i co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSelCo i co') +occAnalCo env (LRCo lr co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkLRCo lr co') +occAnalCo env (InstCo co arg) + = let WUD usage1 co' = occAnalCo env co + WUD usage2 arg' = occAnalCo env arg + in WUD (usage1 `andUDs` usage2) (mkInstCo co' arg') +occAnalCo env (KindCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkKindCo co') +occAnalCo env (SubCo co) + = let WUD usage co' = occAnalCo env co + in WUD usage (mkSubCo co') +occAnalCo env (AxiomInstCo ax i cos) + = let WUD usage cos' = occAnalCos env cos + in WUD usage (mkAxiomInstCo ax i cos') +occAnalCo env co@(TyConAppCo r tc cos) + | null cos + = WUD emptyDetails co + + | otherwise + = let WUD usage cos' = occAnalCos env cos + in WUD usage (mkTyConAppCo r tc cos') +occAnalCo env (ForAllCo { fco_tcv = tv, fco_visL = visL, fco_visR = visR + , fco_kind = kind_co, fco_body = co }) + = let WUD usage1 kind_co' = occAnalCo env kind_co + WUD usage2 co' = occAnalCo env co + in WUD (usage1 `andUDs` usage2) (mkForAllCo tv visL visR kind_co' co') + +occAnalProv :: OccEnv -> UnivCoProvenance -> WithUsageDetails UnivCoProvenance +occAnalProv env (PhantomProv co) + = let WUD usage co' = occAnalCo env co + in WUD usage (PhantomProv co') +occAnalProv env (ProofIrrelProv co) + = let WUD usage co' = occAnalCo env co + in WUD usage (ProofIrrelProv co') +occAnalProv _ p@(PluginProv _) = WUD emptyDetails p occAnal :: OccEnv -> CoreExpr @@ -2442,11 +2603,12 @@ occAnal env expr@(Var _) = occAnalApp env (expr, [], []) -- rules in them, so the *specialised* versions looked as if they -- weren't used at all. -occAnal _ expr@(Type ty) - = WUD (addManyOccs emptyDetails (coVarsOfType ty)) expr -occAnal _ expr@(Coercion co) - = WUD (addManyOccs emptyDetails (coVarsOfCo co)) expr - -- See Note [Gather occurrences of coercion variables] +occAnal env (Type ty) + = let WUD usage ty' = occAnalTy env ty + in WUD usage (Type ty') +occAnal env (Coercion co) + = let WUD usage co' = occAnalCo env co + in WUD usage (Coercion co') {- Note [Gather occurrences of coercion variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2523,12 +2685,12 @@ occAnal env (Tick tickish body) -- See #14242. occAnal env (Cast expr co) - = let (WUD usage expr') = occAnal env expr - usage1 = addManyOccs usage (coVarsOfCo co) - -- usage2: see Note [Gather occurrences of coercion variables] - usage2 = markAllNonTail usage1 - -- usage3: calls inside expr aren't tail calls any more - in WUD usage2 (Cast expr' co) + = let (WUD expr_uds expr') = occAnal env expr + WUD co_uds co' = occAnalCo env co + -- co_uds: see Note [Gather occurrences of coercion variables] + uds = markAllNonTail (expr_uds `andUDs` co_uds) + -- co_uds': calls inside expr aren't tail calls any more + in WUD uds (Cast expr' co') occAnal env app@(App _ _) = occAnalApp env (collectArgsTicks tickishFloatable app) @@ -2660,7 +2822,7 @@ occAnalApp env (Var fun_id, args, ticks) !(fun', fun_id') = lookupBndrSwap env fun_id !(WUD args_uds app') = occAnalArgs env fun' args one_shots - fun_uds = mkOneOcc env fun_id' int_cxt n_args + fun_uds = mkOneIdOcc env fun_id' int_cxt n_args -- NB: fun_uds is computed for fun_id', not fun_id -- See (BS1) in Note [The binder-swap substitution] @@ -2923,7 +3085,7 @@ setNonTailCtxt ctxt !env -- that might mean we don't record all occurrencs, and that means we -- duplicate a redex.... a very nasty bug (which I encountered!). Hence -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch + -- emptyDetails, which in turn causes a panic in mkOneIdOcc. That will catch -- this bug before it does any damage. #ifdef DEBUG zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) @@ -3497,8 +3659,8 @@ For example, in (case x of A -> y; B -> y; C -> True), -} -type OccInfoEnv = IdEnv LocalOcc -- A finite map from an expression's - -- free variables to their usage +type OccInfoEnv = VarEnv LocalOcc -- A finite map from an expression's + -- free variables to their usage data LocalOcc -- See Note [LocalOcc] = OneOccL { lo_n_br :: {-# UNPACK #-} !BranchCount -- Number of syntactic occurrences @@ -3562,9 +3724,17 @@ andUDs, orUDs andUDs = combineUsageDetailsWith andLocalOcc orUDs = combineUsageDetailsWith orLocalOcc -mkOneOcc :: OccEnv -> Id -> InterestingCxt -> JoinArity -> UsageDetails -mkOneOcc !env id int_cxt arity - | not (isLocalId id) +mkOneTyVarOcc :: OccEnv -> TyVar -> UsageDetails +mkOneTyVarOcc !_env tv + = mkSimpleDetails (unitVarEnv tv occ) + where + occ = OneOccL { lo_n_br = 1, lo_int_cxt = NotInteresting + , lo_tail = NoTailCallInfo } + +mkOneIdOcc :: OccEnv -> Var -> InterestingCxt -> JoinArity -> UsageDetails +mkOneIdOcc !env id int_cxt arity + | assert (not (isTyVar id)) $ + not (isLocalId id) = emptyDetails | Just join_uds <- lookupVarEnv (occ_join_points env) id @@ -3582,8 +3752,7 @@ mkOneOcc !env id int_cxt arity -- Add several occurrences, assumed not to be tail calls add_many_occ :: Var -> OccInfoEnv -> OccInfoEnv -add_many_occ v env | isId v = extendVarEnv env v (ManyOccL NoTailCallInfo) - | otherwise = env +add_many_occ v env = extendVarEnv env v (ManyOccL NoTailCallInfo) -- Give a non-committal binder info (i.e noOccInfo) because -- a) Many copies of the specialised thing can appear -- b) We don't want to substitute a BIG expression inside a RULE @@ -3598,13 +3767,14 @@ addManyOccs uds var_set add_to env = nonDetStrictFoldUniqSet add_many_occ env var_set -- It's OK to use nonDetStrictFoldUniqSet here because add_many_occ commutes -addLamCoVarOccs :: UsageDetails -> [Var] -> UsageDetails --- Add any CoVars free in the type of a lambda-binder +addLamTyCoVarOccs :: UsageDetails -> [Var] -> UsageDetails +-- occAnalLamBndrs :: OccEnv -> UsageDetails -> [Var] -> WithUsageDetails [Var] +-- Add any TyCoVars free in the type of a lambda-binder -- See Note [Gather occurrences of coercion variables] -addLamCoVarOccs uds bndrs +addLamTyCoVarOccs uds bndrs = foldr add uds bndrs where - add bndr uds = uds `addManyOccs` coVarsOfType (varType bndr) + add bndr uds = uds `addManyOccs` tyCoVarsOfType (varType bndr) emptyDetails :: UsageDetails emptyDetails = mkSimpleDetails emptyVarEnv @@ -3806,7 +3976,6 @@ tagNonRecBinder :: TopLevelFlag -- At top level? -> OccInfo -- Of scope -> CoreBndr -- Binder -> (IdWithOccInfo, JoinPointHood) -- Tagged binder --- No-op on TyVars -- Precondition: OccInfo is not IAmDead tagNonRecBinder lvl occ bndr | okForJoinPoint lvl bndr tail_call_info @@ -3871,9 +4040,11 @@ tagRecBinders lvl body_uds details_s setBinderOcc :: OccInfo -> CoreBndr -> CoreBndr setBinderOcc occ_info bndr - | isTyVar bndr = bndr - | occ_info == idOccInfo bndr = bndr - | otherwise = setIdOccInfo bndr occ_info + | isTyVar bndr + , occ_info == tyVarOccInfo bndr = bndr + | isTyVar bndr = setTyVarOccInfo bndr occ_info + | occ_info == idOccInfo bndr = bndr + | otherwise = setIdOccInfo bndr occ_info -- | Decide whether some bindings should be made into join points or not, based -- on its occurrences. This is ===================================== compiler/GHC/Core/Opt/Simplify/Env.hs ===================================== @@ -21,15 +21,15 @@ module GHC.Core.Opt.Simplify.Env ( extendTvSubst, extendCvSubst, zapSubstEnv, setSubstEnv, bumpCaseDepth, getInScope, setInScopeFromE, setInScopeFromF, - setInScopeSet, modifyInScope, addNewInScopeIds, + setInScopeSet, modifyInScope, addNewInScopeBndrs, getSimplRules, enterRecGroupRHSs, reSimplifying, -- * Substitution results SimplSR(..), mkContEx, substId, lookupRecBndr, - -- * Simplifying 'Id' binders - simplNonRecBndr, simplNonRecJoinBndr, simplRecBndrs, simplRecJoinBndrs, + -- * Simplifying binders + simplTopBndrs, simplNonRecBndr, simplNonRecJoinBndr, simplRecBndrs, simplRecJoinBndrs, simplBinder, simplBinders, substTy, substTyVar, getSubst, substCo, substCoVar, @@ -588,20 +588,39 @@ setInScopeFromE rhs_env here_env = rhs_env { seInScope = seInScope here_env } setInScopeFromF :: SimplEnv -> SimplFloats -> SimplEnv setInScopeFromF env floats = env { seInScope = sfInScope floats } -addNewInScopeIds :: SimplEnv -> [CoreBndr] -> SimplEnv - -- The new Ids are guaranteed to be freshly allocated -addNewInScopeIds env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) vs --- See Note [Bangs in the Simplifier] - = let !in_scope1 = in_scope `extendInScopeSetList` vs - !id_subst1 = id_subst `delVarEnvList` vs - in - env { seInScope = in_scope1, - seIdSubst = id_subst1 } - -- Why delete? Consider - -- let x = a*b in (x, \x -> x+3) - -- We add [x |-> a*b] to the substitution, but we must - -- _delete_ it from the substitution when going inside - -- the (\x -> ...)! +addNewInScopeBndrs :: SimplEnv -> [CoreBndr] -> SimplEnv + -- The new binders are guaranteed to be freshly allocated +addNewInScopeBndrs env bndrs + = go env bndrs + where + go env [] = env + go env@(SimplEnv { seInScope = in_scope, seTvSubst = tv_subst }) (tv:bndrs) + | isTyVar tv + = let !in_scope1 = in_scope `extendInScopeSet` tv + !tv_subst1 = tv_subst `delVarEnv` tv + env1 = env { seInScope = in_scope1, + seTvSubst = tv_subst1 } + in go env1 bndrs + go env@(SimplEnv { seInScope = in_scope, seCvSubst = cv_subst }) (cv:bndrs) + | isCoVar cv + = let !in_scope1 = in_scope `extendInScopeSet` cv + !cv_subst1 = cv_subst `delVarEnv` cv + env1 = env { seInScope = in_scope1, + seCvSubst = cv_subst1 } + in go env1 bndrs + go env@(SimplEnv { seInScope = in_scope, seIdSubst = id_subst }) (v:bndrs) + = -- See Note [Bangs in the Simplifier] + let !in_scope1 = in_scope `extendInScopeSet` v + !id_subst1 = id_subst `delVarEnv` v + -- Why delete? Consider + -- let x = a*b in (x, \x -> x+3) + -- We add [x |-> a*b] to the substitution, but we must + -- _delete_ it from the substitution when going inside + -- the (\x -> ...)! + env1 = env { seInScope = in_scope1, + seIdSubst = id_subst1 } + in go env1 bndrs + modifyInScope :: SimplEnv -> CoreBndr -> SimplEnv -- The variable should already be in scope, but @@ -776,6 +795,7 @@ unitLetFloat bind = assert (all (not . isJoinId) (bindersOf bind)) $ where flag (Rec {}) = FltLifted flag (NonRec bndr rhs) + | isTyVar bndr = FltLifted | not (isStrictId bndr) = FltLifted | exprIsTickedString rhs = FltLifted -- String literals can be floated freely. @@ -964,6 +984,12 @@ refineFromInScope in_scope v lookupRecBndr :: SimplEnv -> InId -> OutId -- Look up an Id which has been put into the envt by simplRecBndrs, -- but where we have not yet done its RHS +-- lookupRecBndr (SimplEnv { seInScope = in_scope, seTvSubst = tvs }) v +-- | isTyVar v +-- = case lookupVarEnv tvs v of +-- Just (DoneId v) -> v +-- Just _ -> pprPanic "lookupRecBndr" (ppr v) +-- Nothing -> refineFromInScope in_scope v lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v = case lookupVarEnv ids v of Just (DoneId v) -> v @@ -1030,30 +1056,63 @@ simplBinder !env bndr --------------- simplNonRecBndr :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) -- A non-recursive let binder -simplNonRecBndr !env id +simplNonRecBndr !env bndr -- See Note [Bangs in the Simplifier] - = do { let (!env1, id1) = substIdBndr env id - ; seqId id1 `seq` return (env1, id1) } + = do { let (!env1, bndr1) = substBndr env bndr + ; seqVar bndr1 `seq` return (env1, bndr1) } --------------- simplRecBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv -- Recursive let binders -simplRecBndrs env@(SimplEnv {}) ids +simplRecBndrs env@(SimplEnv {}) bndrs -- See Note [Bangs in the Simplifier] - = assert (all (not . isJoinId) ids) $ - do { let (!env1, ids1) = mapAccumL substIdBndr env ids - ; seqIds ids1 `seq` return env1 } + = assert (all (not . isJoinId) bndrs) $ + do { let (!env1, bndrs1) = mapAccumL substIdBndr env bndrs + ; seqVars bndrs1 `seq` return env1 } --------------- -substIdBndr :: SimplEnv -> InBndr -> (SimplEnv, OutBndr) +simplTopBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv +simplTopBndrs env@(SimplEnv {}) bndrs + -- See Note [Bangs in the Simplifier] + = assert (all (not . isJoinId) bndrs) $ + do { let (!env1, bndrs1) = mapAccumL substBndr env bndrs + ; seqVars bndrs1 `seq` return env1 } + +--------------- +substBndr :: HasDebugCallStack => SimplEnv -> InBndr -> (SimplEnv, OutBndr) +substBndr env bndr + | isTyVar bndr = substTyVarBndr env bndr + | otherwise = substIdBndr env bndr + +--------------- +substIdBndr :: HasDebugCallStack => SimplEnv -> InBndr -> (SimplEnv, OutBndr) -- Might be a coercion variable substIdBndr env bndr | isCoVar bndr = substCoVarBndr env bndr | otherwise = substNonCoVarIdBndr env bndr +--------------- +-- substTyVarBndr :: SimplEnv +-- -> InBndr +-- -> (SimplEnv, OutBndr) +-- substTyVarBndr env@(SimplEnv { seInScope = in_scope, seTvSubst = tv_subst }) old_tv +-- = assertPpr (isTyVar old_tv) (ppr old_tv) +-- (env { seInScope = new_in_scope, +-- seTvSubst = new_subst }, new_tv) +-- where +-- !tv1 = uniqAway in_scope old_tv +-- !tv2 = substTyVarKind env tv1 +-- !new_tv = zapFragileTyVarInfo tv2 -- Zaps unfolding and fragile OccInfo +-- !new_subst | new_tv /= old_tv +-- = extendVarEnv tv_subst old_tv (DoneId new_tv) +-- | otherwise +-- = delVarEnv tv_subst old_tv +-- +-- !new_in_scope = in_scope `extendInScopeSet` new_tv + --------------- substNonCoVarIdBndr - :: SimplEnv + :: HasDebugCallStack => SimplEnv -> InBndr -- Env and binder to transform -> (SimplEnv, OutBndr) -- Clone Id if necessary, substitute its type @@ -1079,7 +1138,7 @@ substNonCoVarIdBndr env id = subst_id_bndr env id (\x -> x) -- This is especially important for `substNonCoVarIdBndr` which -- passes an identity lambda. {-# INLINE subst_id_bndr #-} -subst_id_bndr :: SimplEnv +subst_id_bndr :: HasDebugCallStack => SimplEnv -> InBndr -- Env and binder to transform -> (OutId -> OutId) -- Adjust the type -> (SimplEnv, OutBndr) @@ -1124,6 +1183,15 @@ seqIds :: [Id] -> () seqIds [] = () seqIds (id:ids) = seqId id `seq` seqIds ids +seqVar :: Var -> () +seqVar var + | isTyVar var = seqTyVar var + | otherwise = seqId var + +seqVars :: [Var] -> () +seqVars [] = () +seqVars (var:vars) = seqVar var `seq` seqVars vars + {- Note [Arity robustness] ~~~~~~~~~~~~~~~~~~~~~~~ @@ -1308,3 +1376,4 @@ substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env, seCvSubst = cv subst = Subst in_scope emptyIdSubstEnv tv_env cv_env old_ty = idType id old_w = varMult id + ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -57,7 +57,7 @@ import GHC.Types.Demand import GHC.Types.Unique ( hasKey ) import GHC.Types.Basic import GHC.Types.Tickish -import GHC.Types.Var ( isTyCoVar ) +import GHC.Types.Var ( isTyCoVar, setTyVarUnfolding ) import GHC.Builtin.PrimOps ( PrimOp (SeqOp) ) import GHC.Builtin.Types.Prim( realWorldStatePrimTy ) import GHC.Builtin.Names( runRWKey ) @@ -209,7 +209,7 @@ simplTopBinds env0 binds0 -- It's rather as if the top-level binders were imported. -- See Note [Glomming] in "GHC.Core.Opt.OccurAnal". -- See Note [Bangs in the Simplifier] - ; !env1 <- {-#SCC "simplTopBinds-simplRecBndrs" #-} simplRecBndrs env0 (bindersOfBinds binds0) + ; !env1 <- {-#SCC "simplTopBinds-simplRecBndrs" #-} simplTopBndrs env0 (bindersOfBinds binds0) ; (floats, env2) <- {-#SCC "simplTopBinds-simpl_binds" #-} simpl_binds env1 binds0 ; freeTick SimplifierDone ; return (floats, env2) } @@ -229,6 +229,11 @@ simplTopBinds env0 binds0 simpl_bind env (Rec pairs) = simplRecBind env (BC_Let TopLevel Recursive) pairs simpl_bind env (NonRec b r) + | isTyVar b + = do { let bind_cxt = BC_Type TopLevel + ; (env', b') <- return (env, b) -- addBndrRules env b (lookupRecBndr env b) bind_cxt + ; simplRecOrTopPair env' bind_cxt b b' r } + | otherwise = do { let bind_cxt = BC_Let TopLevel NonRecursive ; (env', b') <- addBndrRules env b (lookupRecBndr env b) bind_cxt ; simplRecOrTopPair env' bind_cxt b b' r } @@ -295,6 +300,12 @@ simplRecOrTopPair env bind_cxt old_bndr new_bndr rhs simplJoinBind is_rec cont (old_bndr,env) (new_bndr,env) (rhs,env) + BC_Type top_lvl + | Type rhs_ty <- rhs -> simplTrace "SimplBind:type" (ppr old_bndr) $ + simplTypeBind top_lvl + (old_bndr,env) (new_bndr,env) (rhs_ty,env) + | otherwise -> pprPanic "simplRecOrTopPair:Type" (ppr rhs) + BC_Let top_lvl is_rec -> simplTrace "SimplBind:normal" (ppr old_bndr) $ simplLazyBind top_lvl is_rec (old_bndr,env) (new_bndr,env) (rhs,env) @@ -372,6 +383,27 @@ simplLazyBind top_lvl is_rec (bndr,unf_se) (bndr1,env) (rhs,rhs_se) ; (bind_float, env2) <- completeBind (BC_Let top_lvl is_rec) (bndr,unf_se) (bndr1,rhs',env1) ; return (rhs_floats `addFloats` bind_float, env2) } +-------------------------- +simplTypeBind :: TopLevelFlag + -> (InTyVar, SimplEnv) + -> (OutTyVar, SimplEnv) + -> (InType, SimplEnv) + -> SimplM (SimplFloats, SimplEnv) +simplTypeBind top_lvl (bndr,unf_se) (bndr1,env) (rhs,rhs_se) + = assert (isTyVar bndr) $ + pprTrace "simplTypeBind" (ppr bndr $$ ppr bndr1) $ + do { let !rhs_env = rhs_se `setInScopeFromE` env + ; (rhs_env1, tvs') <- {-#SCC "simplBinders" #-} simplBinders rhs_env [] + -- See Note [Floating and type abstraction] in GHC.Core.Opt.Simplify.Utils + ; body <- simplType rhs_env rhs + ; (rhs_floats, expr_rhs') <- {-#SCC "prepareBinding" #-} + prepareBinding env top_lvl NonRecursive + False + bndr1 (emptyFloats rhs_env1) (Type body) + ; let env1 = env `setInScopeFromF` rhs_floats + ; (bind_float, env2) <- completeBind (BC_Type top_lvl) (bndr,unf_se) (bndr1,expr_rhs',env1) + ; return (rhs_floats `addFloats` bind_float, env2) } + -------------------------- simplJoinBind :: RecFlag -> SimplCont @@ -920,6 +952,10 @@ completeBind :: BindContext -- Binder /can/ be a JoinId -- Precondition: rhs obeys the let-can-float invariant completeBind bind_cxt (old_bndr, unf_se) (new_bndr, new_rhs, env) + | Type new_ty <- new_rhs + = assert (isTyVar old_bndr) $ + return (mkFloatBind env (NonRec (new_bndr `setTyVarUnfolding` new_ty) new_rhs)) + | isCoVar old_bndr = case new_rhs of Coercion co -> return (emptyFloats env, extendCvSubst env old_bndr co) @@ -1247,11 +1283,20 @@ simplExprF1 env (Let (Rec pairs) body) cont = {-#SCC "simplRecE" #-} simplRecE env pairs body cont simplExprF1 env (Let (NonRec bndr rhs) body) cont - | Type ty <- rhs -- First deal with type lets (let a = Type ty in e) - = {-#SCC "simplExprF1-NonRecLet-Type" #-} - assert (isTyVar bndr) $ - do { ty' <- simplType env ty - ; simplExprF (extendTvSubst env bndr ty') body cont } + -- | Type ty <- rhs -- First deal with type lets (let a = Type ty in e) + -- = {-#SCC "simplExprF1-NonRecLet-Type" #-} + -- assert (isTyVar bndr) $ + -- do { (env1, bndr1) <- simplNonRecBndr env bndr + -- ; (floats1, env2) <- simplTypeBind NotTopLevel (bndr,env) (bndr1,env1) (ty,env1) + -- ; (floats2, expr') <- simplNonRecBody env2 FromLet body cont + -- ; return (floats1 `addFloats` floats2, expr') } + -- | Coercion _co <- rhs + -- = {-#SCC "simplExprF1-NonRecLet-Coercion" #-} + -- assert (isCoVar bndr) $ + -- do { (env1, bndr1) <- simplNonRecBndr env bndr + -- ; (floats1, env2) <- simplLazyBind NotTopLevel NonRecursive (bndr,env) (bndr1,env1) (rhs,env1) + -- ; (floats2, expr') <- simplNonRecBody env2 FromLet body cont + -- ; return (floats1 `addFloats` floats2, expr') } | Just env' <- preInlineUnconditionally env NotTopLevel bndr rhs env -- Because of the let-can-float invariant, it's ok to @@ -1271,6 +1316,7 @@ simplExprF1 env (Let (NonRec bndr rhs) body) cont = {-#SCC "simplNonRecE" #-} simplNonRecE env FromLet bndr (rhs, env) body cont + {- Note [Avoiding space leaks in OutType] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since the simplifier is run for multiple iterations, we need to ensure @@ -1900,6 +1946,14 @@ simplNonRecE :: HasDebugCallStack -- Otherwise it may or may not satisfy it. simplNonRecE env from_what bndr (rhs, rhs_se) body cont + | Type ty <- rhs + = assert (isTyVar bndr) $ + do { (env1, bndr1) <- simplNonRecBndr env bndr + ; ty' <- simplType env ty + ; let (floats1, env2) = mkFloatBind env1 (NonRec (bndr1 `setTyVarUnfolding` ty') (Type ty')) + ; (floats2, expr') <- simplNonRecBody env2 from_what body cont + ; return (floats1 `addFloats` floats2, expr') } + | assert (isId bndr && not (isJoinId bndr) ) $ is_strict_bind = -- Evaluate RHS strictly @@ -2360,7 +2414,7 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) -- See Note [No eta-expansion in runRW#] _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty - env' = arg_env `addNewInScopeIds` [s'] + env' = arg_env `addNewInScopeBndrs` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' , sc_env = env', sc_cont = cont , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } @@ -3826,7 +3880,7 @@ mkDupableContWithDmds env _ do { let rhs_ty = contResultType cont (m,arg_ty,_) = splitFunTy fun_ty ; arg_bndr <- newId (fsLit "arg") m arg_ty - ; let env' = env `addNewInScopeIds` [arg_bndr] + ; let env' = env `addNewInScopeBndrs` [arg_bndr] ; (floats, join_rhs) <- rebuildCall env' (addValArgTo fun (Var arg_bndr) fun_ty) cont ; mkDupableStrictBind env' arg_bndr (wrapFloats floats join_rhs) rhs_ty } where ===================================== compiler/GHC/Core/Opt/Simplify/Utils.hs ===================================== @@ -86,6 +86,7 @@ import Control.Monad ( when ) import Data.List ( sortBy ) import GHC.Types.Name.Env import Data.Graph +import GHC.Types.Var (tyVarOccInfo) {- ********************************************************************* * * @@ -98,20 +99,26 @@ data BindContext = BC_Let -- A regular let-binding TopLevelFlag RecFlag + | BC_Type + TopLevelFlag + | BC_Join -- A join point with continuation k RecFlag -- See Note [Rules and unfolding for join points] SimplCont -- in GHC.Core.Opt.Simplify bindContextLevel :: BindContext -> TopLevelFlag bindContextLevel (BC_Let top_lvl _) = top_lvl +bindContextLevel (BC_Type top_lvl) = top_lvl bindContextLevel (BC_Join {}) = NotTopLevel bindContextRec :: BindContext -> RecFlag bindContextRec (BC_Let _ rec_flag) = rec_flag +bindContextRec (BC_Type _) = NonRecursive bindContextRec (BC_Join rec_flag _) = rec_flag isJoinBC :: BindContext -> Bool isJoinBC (BC_Let {}) = False +isJoinBC (BC_Type {}) = False isJoinBC (BC_Join {}) = True @@ -1041,7 +1048,7 @@ interestingArg env e = go env 0 e ValueArg -> ValueArg _ -> NonTrivArg where - env' = env `addNewInScopeIds` bindersOf b + env' = env `addNewInScopeBndrs` bindersOf b go_var n v | isConLikeId v = ValueArg -- Experimenting with 'conlike' rather that @@ -1462,6 +1469,7 @@ preInlineUnconditionally -- for unlifted, side-effect-ful bindings preInlineUnconditionally env top_lvl bndr rhs rhs_env | not pre_inline_unconditionally = Nothing + | isTyVar bndr = Nothing | not active = Nothing | isTopLevel top_lvl && isDeadEndId bndr = Nothing -- Note [Top-level bottoming Ids] | isCoVar bndr = Nothing -- Note [Do not inline CoVars unconditionally] @@ -1597,6 +1605,7 @@ postInlineUnconditionally -- Reason: we don't want to inline single uses, or discard dead bindings, -- for unlifted, side-effect-ful bindings postInlineUnconditionally env bind_cxt old_bndr bndr rhs + | BC_Type {} <- bind_cxt = False | not active = False | isWeakLoopBreaker occ_info = False -- If it's a loop-breaker of any kind, don't inline -- because it might be referred to "earlier" @@ -2220,16 +2229,19 @@ abstractFloats uf_opts top_lvl main_tvs floats body -- See wrinkle (AB5) in Note [Which type variables to abstract over] -- for why we need to re-do dependency analysis - to_sccs :: OutBind -> [SCC (Id, CoreExpr, VarSet)] - to_sccs (NonRec id e) = [AcyclicSCC (id, e, emptyVarSet)] -- emptyVarSet: abstract doesn't need it + to_sccs :: OutBind -> [SCC (Var, CoreExpr, VarSet)] + to_sccs (NonRec v e) = [AcyclicSCC (v, e, emptyVarSet)] -- emptyVarSet: abstract doesn't need it to_sccs (Rec prs) = sccs where - (ids,rhss) = unzip prs - sccs = depAnal (\(id,_rhs,_fvs) -> [getName id]) - (\(_id,_rhs,fvs) -> nonDetStrictFoldVarSet ((:) . getName) [] fvs) -- Wrinkle (AB3) - (zip3 ids rhss (map exprFreeVars rhss)) + (vars,rhss) = unzip prs + sccs = depAnal (\(v,_rhs,_fvs) -> [getName v]) + (\(_v,_rhs,fvs) -> nonDetStrictFoldVarSet ((:) . getName) [] fvs) -- Wrinkle (AB3) + (zip3 vars rhss (map exprFreeVars rhss)) abstract :: GHC.Core.Subst.Subst -> SCC (Id, CoreExpr, VarSet) -> SimplM (GHC.Core.Subst.Subst, OutBind) + abstract subst (AcyclicSCC (tv, rhs, _empty_var_set)) + | isTyVar tv + = return (subst, NonRec tv rhs) abstract subst (AcyclicSCC (id, rhs, _empty_var_set)) = do { (poly_id1, poly_app) <- mk_poly1 tvs_here id ; let (poly_id2, poly_rhs) = mk_poly2 poly_id1 tvs_here rhs' ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1469,9 +1469,15 @@ specBind :: TopLevelFlag -> SpecM ( [OutBind] -- New bindings , body -- Body , UsageDetails) -- And info to pass upstream - -- Returned UsageDetails: -- No calls for binders of this bind + +specBind _top_lvl env bind@(NonRec _ (Type {})) do_body + -- Can't check that the binder is a type variable, otherwise the the variable is forced and + -- will trigger an infinite loop. Instead, we match on the structure of the RHS. + = do { (body, body_uds) <- do_body env + ; return ([bind], body, body_uds) } + specBind top_lvl env (NonRec fn rhs) do_body = do { (rhs', rhs_uds) <- specExpr env rhs ===================================== compiler/GHC/Core/Opt/WorkWrap.hs ===================================== @@ -88,12 +88,16 @@ wwBind :: WwOpts -- the caller will convert to Expr/Binding, -- as appropriate. -wwBind ww_opts (NonRec binder rhs) = do - new_rhs <- wwExpr ww_opts rhs - new_pairs <- tryWW ww_opts NonRecursive binder new_rhs - return [NonRec b e | (b,e) <- new_pairs] - -- Generated bindings must be non-recursive - -- because the original binding was. +wwBind ww_opts (NonRec binder rhs) + | isTyVar binder + = return [NonRec binder rhs] + + | otherwise + = do { new_rhs <- wwExpr ww_opts rhs + ; new_pairs <- tryWW ww_opts NonRecursive binder new_rhs + ; return [NonRec b e | (b,e) <- new_pairs] } + -- Generated bindings must be non-recursive + -- because the original binding was. wwBind ww_opts (Rec pairs) = return . Rec <$> concatMapM do_one pairs ===================================== compiler/GHC/Core/SimpleOpt.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Core.Opt.OccurAnal( occurAnalyseExpr, occurAnalysePgm, zapLambdaBndrs import GHC.Types.Literal import GHC.Types.Id import GHC.Types.Id.Info ( realUnfoldingInfo, setUnfoldingInfo, setRuleInfo, IdInfo (..) ) -import GHC.Types.Var ( isNonCoVarId ) +import GHC.Types.Var ( isNonCoVarId, tyVarUnfolding, setTyVarUnfolding ) import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Core.DataCon @@ -437,6 +437,29 @@ simple_opt_bind env (Rec prs) top_level where (env', mb_pr) = simple_bind_pair env b (Just b') (env,r) top_level +---------------------- +simple_bind_type :: SimpleOptEnv + -> InTyVar -> Maybe OutTyVar + -> (SimpleOptEnv, InType) + -> (SimpleOptEnv, Maybe (OutTyVar, OutType)) +simple_bind_type env@(SOE { soe_subst = subst }) + in_bndr mb_out_bndr (rhs_env, in_rhs) + | Just in_tyvar <- getTyVar_maybe in_rhs + , Just unf <- tyVarUnfolding in_tyvar + , let out_unf = substTyUnchecked (soe_subst rhs_env) unf + , isAtomicTy out_unf + = {- pprTrace "simple_bind_type" (ppr in_tyvar) $ -} + (env { soe_subst = extendTvSubst subst in_bndr out_unf }, Nothing) + + | otherwise + = let + out_ty = substTyUnchecked (soe_subst rhs_env) in_rhs + (env', bndr1) = case mb_out_bndr of + Just out_bndr -> (env, out_bndr) + Nothing -> subst_opt_bndr env in_bndr + out_bndr = setTyVarUnfolding bndr1 out_ty + in (env', Just (out_bndr, out_ty)) + ---------------------- simple_bind_pair :: SimpleOptEnv -> InVar -> Maybe OutVar @@ -449,10 +472,15 @@ simple_bind_pair :: SimpleOptEnv simple_bind_pair env@(SOE { soe_inl = inl_env, soe_subst = subst }) in_bndr mb_out_bndr clo@(rhs_env, in_rhs) top_level - | Type ty <- in_rhs -- let a::* = TYPE ty in - , let out_ty = substTyUnchecked (soe_subst rhs_env) ty - = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr in_rhs) $ - (env { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + | Type in_ty <- in_rhs -- let a::* = TYPE ty in + = let + (env', mb_out_bind_type) = simple_bind_type env in_bndr mb_out_bndr (rhs_env, in_ty) + in + case mb_out_bind_type of + Just (out_bndr, out_ty) + | isAtomicTy out_ty -> (env' { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + | otherwise -> (env', Just (out_bndr, Type out_ty)) + Nothing -> (env', Nothing) | Coercion co <- in_rhs , let out_co = optCoercion (so_co_opts (soe_opts env)) (soe_subst rhs_env) co @@ -523,8 +551,8 @@ simple_out_bind :: TopLevelFlag -> (SimpleOptEnv, Maybe (OutVar, OutExpr)) simple_out_bind top_level env@(SOE { soe_subst = subst }) (in_bndr, out_rhs) | Type out_ty <- out_rhs - = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr out_ty $$ ppr out_rhs) - (env { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) + = assertPpr (isTyVar in_bndr) (ppr in_bndr $$ ppr out_ty $$ ppr out_rhs) $ + (env, Just (in_bndr `setTyVarUnfolding` out_ty, out_rhs)) | Coercion out_co <- out_rhs = assert (isCoVar in_bndr) ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -23,7 +23,7 @@ module GHC.Core.TyCo.Compare ( import GHC.Prelude -import GHC.Core.Type( typeKind, coreView, tcSplitAppTyNoView_maybe, splitAppTyNoView_maybe +import GHC.Core.Type( typeKind, unfoldView, coreView, tcSplitAppTyNoView_maybe, splitAppTyNoView_maybe , isLevityTy, isRuntimeRepTy, isMultiplicityTy ) import GHC.Core.TyCo.Rep @@ -227,12 +227,17 @@ tc_eq_type keep_syns orig_ty1 orig_ty2 where orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] + view + | keep_syns = unfoldView + | otherwise = coreView + go :: RnEnv2 -> Type -> Type -> Bool -- See Note [Comparing nullary type synonyms] go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + go _ (TyVarTy tv1) (TyVarTy tv2) | tv1 == tv2 = True - go env t1 t2 | not keep_syns, Just t1' <- coreView t1 = go env t1' t2 - go env t1 t2 | not keep_syns, Just t2' <- coreView t2 = go env t1 t2' + go env t1 t2 | Just t1' <- view t1 = go env t1' t2 + go env t1 t2 | Just t2' <- view t2 = go env t1 t2' go env (TyVarTy tv1) (TyVarTy tv2) = rnOccL env tv1 == rnOccR env tv2 go _ (LitTy lit1) (LitTy lit2) = lit1 == lit2 @@ -606,6 +611,9 @@ nonDetCmpTypeX env orig_t1 orig_t2 = go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = TEQ + go _ (TyVarTy tv1) (TyVarTy tv2) + | tv1 == tv2 + = TEQ go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCo/Subst.hs ===================================== @@ -1106,12 +1106,21 @@ cloneTyVarBndr subst@(Subst in_scope id_env tv_env cv_env) tv uniq , tv') where old_ki = tyVarKind tv + old_unf = tyVarUnfolding tv no_kind_change = noFreeVarsOfType old_ki -- verify that kind is closed + no_unf_change = maybe True noFreeVarsOfType old_unf -- verify that kind is closed tv1 | no_kind_change = tv | otherwise = setTyVarKind tv (substTy subst old_ki) - tv' = setVarUnique tv1 uniq + tv2 | Just unf <- tyVarUnfolding tv1 + , not no_unf_change + = tv2 `setTyVarUnfolding` substTy subst unf + + | otherwise + = tv1 + + tv' = setVarUnique tv2 uniq cloneTyVarBndrs :: Subst -> [TyVar] -> UniqSupply -> (Subst, [TyVar]) cloneTyVarBndrs subst [] _usupply = (subst, []) ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -186,7 +186,7 @@ module GHC.Core.Type ( seqType, seqTypes, -- * Other views onto Types - coreView, coreFullView, rewriterView, + coreView, coreFullView, rewriterView, unfoldView, tyConsOfType, @@ -361,6 +361,11 @@ import GHC.Data.Maybe ( orElse, isJust, firstJust ) ************************************************************************ -} +unfoldView :: Type -> Maybe Type +{-# INLINE unfoldView #-} +unfoldView (TyVarTy tv) = tyVarUnfolding tv +unfoldView _ = Nothing + rewriterView :: Type -> Maybe Type -- Unwrap a type synonym only when either: -- The type synonym is forgetful, or @@ -371,6 +376,7 @@ rewriterView (TyConApp tc tys) | isTypeSynonymTyCon tc , isForgetfulSynTyCon tc || not (isFamFreeTyCon tc) = expandSynTyConApp_maybe tc tys +rewriterView (TyVarTy tv) = tyVarUnfolding tv rewriterView _other = Nothing @@ -384,6 +390,7 @@ coreView :: Type -> Maybe Type -- By being non-recursive and inlined, this case analysis gets efficiently -- joined onto the case analysis that the caller is already doing coreView (TyConApp tc tys) = expandSynTyConApp_maybe tc tys +coreView (TyVarTy tv) = tyVarUnfolding tv coreView _ = Nothing -- See Note [Inlining coreView]. {-# INLINE coreView #-} @@ -395,6 +402,8 @@ coreFullView, core_full_view :: Type -> Type -- See Note [Inlining coreView]. coreFullView ty@(TyConApp tc _) | isTypeSynonymTyCon tc = core_full_view ty +coreFullView (TyVarTy tv) + | Just ty <- tyVarUnfolding tv = core_full_view ty coreFullView ty = ty {-# INLINE coreFullView #-} @@ -2709,6 +2718,9 @@ sORTKind_maybe :: Kind -> Maybe (TypeOrConstraint, Type) -- -- This is a "hot" function. Do not call splitTyConApp_maybe here, -- to avoid the faff with FunTy +sORTKind_maybe ty + | Just ty <- unfoldView ty + = sORTKind_maybe ty sORTKind_maybe (TyConApp tc tys) -- First, short-cuts for Type and Constraint that do no allocation | tc_uniq == liftedTypeKindTyConKey = assert( null tys ) $ Just (TypeLike, liftedRepTy) @@ -2849,7 +2861,9 @@ isFixedRuntimeRepKind k isConcreteType :: Type -> Bool isConcreteType = go where - go (TyVarTy tv) = isConcreteTyVar tv + go (TyVarTy tv) + | Just ty <- tyVarUnfolding tv = go ty + | otherwise = isConcreteTyVar tv go (AppTy ty1 ty2) = go ty1 && go ty2 go (TyConApp tc tys) = go_tc tc tys go ForAllTy{} = False ===================================== compiler/GHC/Core/Unfold/Make.hs ===================================== @@ -40,6 +40,9 @@ import Data.Maybe ( fromMaybe ) -- the very simple optimiser is used to optimise unfoldings import {-# SOURCE #-} GHC.Core.SimpleOpt +import GHC.Core.Subst (mkOpenSubst) +import GHC.Core.Type (substTy) +import GHC.Types.Var.Env (mkInScopeSetList) @@ -180,10 +183,12 @@ specUnfolding opts spec_bndrs spec_app rule_lhs_args -- to -- \sbs. MkD ((\obs. ) spec_args) ... ditto where - spec_arg arg = simpleOptExpr opts $ - spec_app (mkLams old_bndrs arg) - -- The beta-redexes created by spec_app will be - -- simplified away by simplOptExpr + spec_arg (Type t) = let subst = mkOpenSubst (mkInScopeSetList old_bndrs) (zip old_bndrs rule_lhs_args) + in Type (substTy subst t) + spec_arg arg = simpleOptExpr opts $ + spec_app (mkLams old_bndrs arg) + -- The beta-redexes created by spec_app will be + -- simplified away by simplOptExpr specUnfolding opts spec_bndrs spec_app rule_lhs_args (CoreUnfolding { uf_src = src, uf_tmpl = tmpl ===================================== compiler/GHC/Tc/Zonk/TcType.hs ===================================== @@ -243,22 +243,22 @@ zonkTcTyVar :: TcTyVar -> ZonkM TcType zonkTcTyVar tv | isTcTyVar tv = case tcTyVarDetails tv of - SkolemTv {} -> zonk_kind_and_return - RuntimeUnk {} -> zonk_kind_and_return + SkolemTv {} -> zonk_and_return + RuntimeUnk {} -> zonk_and_return MetaTv { mtv_ref = ref } -> do { cts <- readTcRef ref ; case cts of - Flexi -> zonk_kind_and_return + Flexi -> zonk_and_return Indirect ty -> do { zty <- zonkTcType ty - ; writeTcRef ref (Indirect zty) -- See Note [Sharing in zonking] + ; writeTcRef ref (Indirect zty) ; return zty } } | otherwise -- coercion variable - = zonk_kind_and_return + = zonk_and_return where - zonk_kind_and_return = do { z_tv <- zonkTyCoVarKind tv - ; return (mkTyVarTy z_tv) } + zonk_and_return = do { z_tv <- updateTyVarKindAndUnfoldingM zonkTcType tv + ; return (mkTyVarTy z_tv) } -- Variant that assumes that any result of zonking is still a TyVar. -- Should be used only on skolems and TyVarTvs ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -387,7 +387,7 @@ zonkTyVarOcc tv -- This can happen for RuntimeUnk variables (which -- should stay as RuntimeUnk), but I think it should -- not happen for SkolemTv. - mkTyVarTy <$> updateTyVarKindM zonkTcTypeToTypeX tv + mkTyVarTy <$> updateTyVarKindAndUnfoldingM zonkTcTypeToTypeX tv Just tv' -> return (mkTyVarTy tv') ===================================== compiler/GHC/Types/Var.hs ===================================== @@ -100,14 +100,15 @@ module GHC.Types.Var ( ExportFlag(..), -- ** Constructing TyVar's - mkTyVar, mkTcTyVar, + mkTyVar, mkTyVarWithUnfolding, mkTcTyVar, -- ** Taking 'TyVar's apart - tyVarName, tyVarKind, tcTyVarDetails, setTcTyVarDetails, + tyVarName, tyVarKind, tyVarUnfolding, tyVarOccInfo, tcTyVarDetails, setTcTyVarDetails, -- ** Modifying 'TyVar's - setTyVarName, setTyVarUnique, setTyVarKind, updateTyVarKind, - updateTyVarKindM, + setTyVarName, setTyVarUnique, setTyVarKind, setTyVarUnfolding, setTyVarOccInfo, + updateTyVarKind, updateTyVarKindM, updateTyVarUnfolding, updateTyVarUnfoldingM, + updateTyVarKindAndUnfoldingM, nonDetCmpVar ) where @@ -123,7 +124,7 @@ import {-# SOURCE #-} GHC.Builtin.Types ( manyDataConTy ) import GHC.Types.Name hiding (varName) import GHC.Types.Unique ( Uniquable, Unique, getKey, getUnique , nonDetCmpUnique ) -import GHC.Types.Basic( TypeOrConstraint(..) ) +import GHC.Types.Basic( TypeOrConstraint(..), OccInfo, noOccInfo ) import GHC.Utils.Misc import GHC.Utils.Binary import GHC.Utils.Outputable @@ -251,12 +252,15 @@ in its @VarDetails at . data Var = TyVar { -- Type and kind variables -- see Note [Kind and type variables] - varName :: !Name, - realUnique :: {-# UNPACK #-} !Unique, - -- ^ Key for fast comparison - -- Identical to the Unique in the name, - -- cached here for speed - varType :: Kind -- ^ The type or kind of the 'Var' in question + varName :: !Name, + realUnique :: {-# UNPACK #-} !Unique, + -- ^ Key for fast comparison + -- Identical to the Unique in the name, + -- cached here for speed + varType :: Kind, -- ^ The type or kind of the 'Var' in question + tv_unfolding :: Maybe Type, -- ^ The type to which the variable is bound to, + -- if any. + tv_occ_info :: OccInfo } | TcTyVar { -- Used only during type inference @@ -346,6 +350,10 @@ instance Outputable Var where getPprStyle $ \sty -> let ppr_var = case var of + (TyVar { tv_unfolding = Just ty }) + | debug + -> brackets (text "unf =" <+> ppr ty) + (TyVar {}) | debug -> brackets (text "tv") @@ -1085,6 +1093,15 @@ tyVarName = varName tyVarKind :: TyVar -> Kind tyVarKind = varType +tyVarUnfolding :: TyVar -> Maybe Type +tyVarUnfolding (TyVar { tv_unfolding = unf }) = unf +tyVarUnfolding _ = Nothing + +tyVarOccInfo :: TyVar -> OccInfo +tyVarOccInfo (TcTyVar {}) = noOccInfo +tyVarOccInfo tv = assertPpr (isTyVar tv) (ppr tv) $ tv_occ_info tv +{-# NOINLINE tyVarOccInfo #-} + setTyVarUnique :: TyVar -> Unique -> TyVar setTyVarUnique = setVarUnique @@ -1094,6 +1111,17 @@ setTyVarName = setVarName setTyVarKind :: TyVar -> Kind -> TyVar setTyVarKind tv k = tv {varType = k} +setTyVarUnfolding :: TyVar -> Type -> TyVar +setTyVarUnfolding tv unf = tv {tv_unfolding = Just unf} + +setTyVarOccInfo :: TyVar -> OccInfo -> TyVar +-- TODO: Surprisingly, TcTyVar's can occur after zonking, why? +-- It could be caused by other parts of my changes though, but I wasn't able to find out where. +-- For now, we just ignore them. +-- setTyVarOccInfo tv@(TcTyVar {}) occ_info = pprPanic "setTyVarOccInfo" (ppr tv $$ ppr occ_info) +setTyVarOccInfo tv@(TcTyVar {}) _occ_info = tv +setTyVarOccInfo tv occ_info = assertPpr (isTyVar tv) (ppr tv) $ tv {tv_occ_info = occ_info} + updateTyVarKind :: (Kind -> Kind) -> TyVar -> TyVar updateTyVarKind update tv = tv {varType = update (tyVarKind tv)} @@ -1102,12 +1130,44 @@ updateTyVarKindM update tv = do { k' <- update (tyVarKind tv) ; return $ tv {varType = k'} } +updateTyVarUnfolding :: (Type -> Type) -> TyVar -> TyVar +updateTyVarUnfolding update tv + | Just unf <- tyVarUnfolding tv + = tv {tv_unfolding = Just (update unf)} + + | otherwise + = tv + +updateTyVarUnfoldingM :: (Monad m) => (Type -> m Type) -> TyVar -> m TyVar +updateTyVarUnfoldingM update tv + | Just unf <- tyVarUnfolding tv + = do { unf' <- update unf + ; return $ tv {tv_unfolding = Just unf'} } + + | otherwise + = return tv + +updateTyVarKindAndUnfoldingM :: (Monad m) => (Type -> m Type) -> TyVar -> m TyVar +updateTyVarKindAndUnfoldingM update tv + = do { tv' <- updateTyVarKindM update tv + ; updateTyVarUnfoldingM update tv' } + mkTyVar :: Name -> Kind -> TyVar -mkTyVar name kind = TyVar { varName = name - , realUnique = nameUnique name - , varType = kind +mkTyVar name kind = TyVar { varName = name + , realUnique = nameUnique name + , varType = kind + , tv_unfolding = Nothing + , tv_occ_info = noOccInfo } +mkTyVarWithUnfolding :: Name -> Kind -> Type -> TyVar +mkTyVarWithUnfolding name kind unf = TyVar { varName = name + , realUnique = nameUnique name + , varType = kind + , tv_unfolding = Just unf + , tv_occ_info = noOccInfo + } + mkTcTyVar :: Name -> Kind -> TcTyVarDetails -> TyVar mkTcTyVar name kind details = -- NB: 'kind' may be a coercion kind; cf, 'GHC.Tc.Utils.TcMType.newMetaCoVar' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c622629f53a23fc56814ce98fceb7b9d6d103e8...80ffac20b1ca82855908d73d69717901a02d034e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9c622629f53a23fc56814ce98fceb7b9d6d103e8...80ffac20b1ca82855908d73d69717901a02d034e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 09:40:50 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 04 Jul 2024 05:40:50 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] Add support for building profiled dynamic way Message-ID: <66866e22b0737_1ad155593581104f1@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: f417afa1 by Matthew Pickering at 2024-07-04T10:40:43+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json - hadrian/bootstrap/src/Main.hs - hadrian/build-cabal - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/src/Context.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f417afa17427b092755f08b9081fa378fd92a2f4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f417afa17427b092755f08b9081fa378fd92a2f4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 11:04:42 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 07:04:42 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 26 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668681caba16e_2032d567f64c47953@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: ba9744b4 by Zubin Duggal at 2024-07-04T07:04:02-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - f4ab2ce8 by Teo Camarasu at 2024-07-04T07:04:02-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 114d843c by Teo Camarasu at 2024-07-04T07:04:02-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 88067ee5 by Oleg Grenrus at 2024-07-04T07:04:04-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 1d9cfbc0 by Adam Gundry at 2024-07-04T07:04:06-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 7fd65bf2 by Max Ulidtko at 2024-07-04T07:04:08-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 6e5e63b3 by Ryan Scott at 2024-07-04T07:04:08-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - cce0149b by Adam Gundry at 2024-07-04T07:04:08-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 0fd38fa1 by Adam Gundry at 2024-07-04T07:04:08-04:00 Use structured error representation when reloading a nonexistent module - - - - - 28f5d59d by sheaf at 2024-07-04T07:04:08-04:00 Use structured errors for a Backpack instantiation error - - - - - 14f0368a by sheaf at 2024-07-04T07:04:09-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f68fce4d by Adriaan Leijnse at 2024-07-04T07:04:09-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - c3d66f5b by Alexander Foremny at 2024-07-04T07:04:09-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - 34c34f84 by Alexander Foremny at 2024-07-04T07:04:09-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - ef1ad839 by Fabian Kirchner at 2024-07-04T07:04:09-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 5e28bd71 by Fabian Kirchner at 2024-07-04T07:04:09-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - d3d5c9ea by Fabian Kirchner at 2024-07-04T07:04:09-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - cb6a79d1 by Mauricio at 2024-07-04T07:04:09-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 61dfb5f7 by Fabian Kirchner at 2024-07-04T07:04:09-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 2500d829 by Adowrath at 2024-07-04T07:04:09-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 8f32abe6 by Mauricio at 2024-07-04T07:04:09-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 5bcd2050 by Mike Pilgrem at 2024-07-04T07:04:14-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 61d0c93d by Matthew Pickering at 2024-07-04T07:04:15-04:00 ci: Use nixpkgs-20.04-darwin channel for darwin toolchain We are currently seeing a couple of errors on darwin machines after I bumped the toolchain commit. ``` last 10 log lines: > from .extern.jaraco.text import yield_lines > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module> > from setuptools.extern.jaraco.context import ExceptionTrap > File "/private/tmp/nix-build-python3.11-setuptools-69.5.1.drv-0/source/setuptools/_vendor/jaraco/context.py", line 11, in <module> > import urllib.request > File "/nix/store/z3ccgikilqsd1kzjf1sr03wbnjyga4hh-python3-minimal-3.11.9/lib/python3.11/urllib/request.py", line 2656, in <module> > from _scproxy import _get_proxy_settings, _get_proxies > ModuleNotFoundError: No module named '_scproxy' > > ERROR Backend 'setuptools.build_meta' is not available. ``` In theory this channel should be tested so it should work? - - - - - fde15d15 by Andrew Lelechenko at 2024-07-04T07:04:15-04:00 base: fix more missing changelog entries - - - - - dd6e395a by Peter Trommler at 2024-07-04T07:04:16-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - 2b602fa1 by Bryan Richter at 2024-07-04T07:04:16-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d325d7f03bd1352894f33955589199c1f2df5aef...2b602fa1fed5a9eefdc398eebd697c1897b48fb9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d325d7f03bd1352894f33955589199c1f2df5aef...2b602fa1fed5a9eefdc398eebd697c1897b48fb9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 11:24:21 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 04 Jul 2024 07:24:21 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/torsten.schmits/oneshot-bytecode-pkgdeps Message-ID: <66868665bf473_44a94114dc48581e@gitlab.mail> Torsten Schmits pushed new branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/torsten.schmits/oneshot-bytecode-pkgdeps You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 12:28:44 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 08:28:44 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 25 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <6686957ca93e0_44a949cd61410205@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: dbe6662b by Zubin Duggal at 2024-07-04T08:28:16-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 54a713fc by Teo Camarasu at 2024-07-04T08:28:17-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - c647b173 by Teo Camarasu at 2024-07-04T08:28:17-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 2c6a8749 by Oleg Grenrus at 2024-07-04T08:28:19-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 80ef0a6c by Adam Gundry at 2024-07-04T08:28:21-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 30e66aa9 by Max Ulidtko at 2024-07-04T08:28:22-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - cb3a0cc2 by Ryan Scott at 2024-07-04T08:28:22-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - 82711cbe by Adam Gundry at 2024-07-04T08:28:22-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - b1a4d26e by Adam Gundry at 2024-07-04T08:28:22-04:00 Use structured error representation when reloading a nonexistent module - - - - - 941b5daf by sheaf at 2024-07-04T08:28:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 9b42f725 by sheaf at 2024-07-04T08:28:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 07a501db by Adriaan Leijnse at 2024-07-04T08:28:23-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - a7b14b3a by Alexander Foremny at 2024-07-04T08:28:23-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - e4f0c33f by Alexander Foremny at 2024-07-04T08:28:23-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 6a70d5bc by Fabian Kirchner at 2024-07-04T08:28:23-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 5e02a96a by Fabian Kirchner at 2024-07-04T08:28:23-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 51a15aa0 by Fabian Kirchner at 2024-07-04T08:28:23-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 7f5b8c08 by Mauricio at 2024-07-04T08:28:23-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 4bc6872f by Fabian Kirchner at 2024-07-04T08:28:23-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - f1566fae by Adowrath at 2024-07-04T08:28:23-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - a21e5ed9 by Mauricio at 2024-07-04T08:28:23-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 84ba6518 by Mike Pilgrem at 2024-07-04T08:28:31-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 7c367cd4 by Andrew Lelechenko at 2024-07-04T08:28:31-04:00 base: fix more missing changelog entries - - - - - cefd9fc0 by Peter Trommler at 2024-07-04T08:28:32-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - 993195c8 by Bryan Richter at 2024-07-04T08:28:32-04:00 Add .gitlab/README.md with creds instructions - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b602fa1fed5a9eefdc398eebd697c1897b48fb9...993195c836fdb59d8e62a767354850fef130abc6 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2b602fa1fed5a9eefdc398eebd697c1897b48fb9...993195c836fdb59d8e62a767354850fef130abc6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 13:00:48 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 04 Jul 2024 09:00:48 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/andreask/aarch64_reg_graph Message-ID: <66869d00e0d23_dd27f152ac08243d@gitlab.mail> Andreas Klebinger pushed new branch wip/andreask/aarch64_reg_graph at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/andreask/aarch64_reg_graph You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:02:41 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 04 Jul 2024 10:02:41 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] PoC for package dep hydration Message-ID: <6686ab81ef7b9_dd27f88322c9612@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: d1f5e96f by Torsten Schmits at 2024-07-04T16:02:29+02:00 PoC for package dep hydration - - - - - 12 changed files: - compiler/GHC/Linker/Deps.hs - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -58,8 +58,6 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock -import GHC.Driver.Flags -import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -211,16 +209,22 @@ get_link_deps opts pls maybe_normal_osuf span mods = do -> UniqDSet Module -- accum. module dependencies -> UniqDSet UnitId -- accum. package dependencies -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs - = return (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod:mods) acc_mods acc_pkgs - = do - mb_iface <- ldLoadIface opts msg mod - iface <- case mb_iface of - Failed err -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> return iface - + follow_deps [] acc_mods acc_pkgs = + pure (uniqDSetToList acc_mods, acc_pkgs) + follow_deps (mod : mods) acc_mods acc_pkgs = do + ldLoadIface opts msg mod >>= \case + Failed err + | ldUseByteCode opts + -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs (moduleUnitId mod)) + | otherwise + -> throwProgramError opts $ + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + Succeeded iface -> follow_deps_iface iface mod mods acc_mods acc_pkgs + where + msg = text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + follow_deps_iface iface mod mods acc_mods acc_pkgs = do when (mi_boot iface == IsBoot) $ link_boot_mod_error mod let @@ -228,28 +232,43 @@ get_link_deps opts pls maybe_normal_osuf span mods = do deps = mi_deps iface pkg_deps = dep_direct_pkgs deps - (boot_deps, mod_deps) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ + (boot_deps_home, mod_deps_home) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ \case - (_, GWIB m IsBoot) -> Left m - (_, GWIB m NotBoot) -> Right m + (_, GWIB m IsBoot) -> Left (mkModule pkg m) + (_, GWIB m NotBoot) -> Right (mkModule pkg m) - mod_deps' = case ue_homeUnit unit_env of - Nothing -> [] - Just home_unit -> filter (not . (`elementOfUniqDSet` acc_mods)) (map (mkHomeModule home_unit) $ (boot_deps ++ mod_deps)) - acc_mods' = case ue_homeUnit unit_env of - Nothing -> acc_mods - Just home_unit -> addListToUniqDSet acc_mods (mod : map (mkHomeModule home_unit) mod_deps) - acc_pkgs' = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) + has_core_bindings = isJust (mi_extra_decls iface) - case ue_homeUnit unit_env of - Just home_unit | isHomeUnit home_unit pkg -> follow_deps (mod_deps' ++ mods) - acc_mods' acc_pkgs' - _ -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" + acc_pkgs' + | ldUseByteCode opts + = if has_core_bindings + then acc_pkgs + else addOneToUniqDSet acc_pkgs (moduleUnitId mod) + | otherwise + = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) + mod_deps_pkg + | ldUseByteCode opts + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] + | otherwise + = [] + mod_deps' = filterOut (`elementOfUniqDSet` acc_mods) (boot_deps_home ++ mod_deps_home ++ mod_deps_pkg) + + acc_mods' + | ldUseByteCode opts + = addOneToUniqDSet acc_mods mod + | otherwise + = addListToUniqDSet acc_mods (mod : mod_deps') + + case ue_homeUnit unit_env of + _ | ldUseByteCode opts && has_core_bindings -> + follow_deps (mod_deps' ++ mods) acc_mods' acc_pkgs' + Just home_unit | isHomeUnit home_unit pkg -> + follow_deps (mod_deps' ++ mods) acc_mods' acc_pkgs' + _ -> + follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) + where link_boot_mod_error :: Module -> IO a link_boot_mod_error mod = throwProgramError opts $ @@ -287,29 +306,28 @@ get_link_deps opts pls maybe_normal_osuf span mods = do mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) case mb_stuff of Found loc mod -> found loc mod - _ -> no_obj (moduleName mod) + _ | ldUseByteCode opts -> hydrate (no_obj mod) mod + | otherwise -> no_obj (moduleName mod) where found loc mod - | prefer_bytecode = do - Succeeded iface <- ldLoadIface opts (text "makima") mod - case mi_extra_decls iface of - Just extra_decls -> do - details <- initModDetails hsc_env iface - t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] - _ -> fallback_no_bytecode loc mod + | ldUseByteCode opts = hydrate (fallback_no_bytecode loc mod) mod | otherwise = fallback_no_bytecode loc mod + hydrate alt mod = do + Succeeded iface <- ldLoadIface opts (text "makima") mod + case mi_extra_decls iface of + Just extra_decls -> do + details <- initModDetails hsc_env iface + t <- getCurrentTime + initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> alt + fallback_no_bytecode loc mod = do mb_lnk <- findObjectLinkableMaybe mod loc case mb_lnk of Nothing -> no_obj mod Just lnk -> adjust_linkable lnk - prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags - - dflags = hsc_dflags hsc_env - hsc_env = ldHscEnv opts adjust_linkable lnk ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -0,0 +1,11 @@ +{-# language TemplateHaskell #-} + +module Main where + +import CrossLocal (splc) + +a :: Int +a = $(splc) + +main :: IO () +main = putStrLn (show a) ===================================== testsuite/tests/th/cross-package/CrossDep.hs ===================================== @@ -0,0 +1,15 @@ +module CrossDep where + +data A = A Int + +used :: Int +used = 9681 + +dep :: A +dep = A used + +unused1 :: A +unused1 = A 1 + +unused2 :: A +unused2 = unused1 ===================================== testsuite/tests/th/cross-package/CrossDepApi.hs ===================================== @@ -0,0 +1,7 @@ +module CrossDepApi (A (A), dep) where + +import CrossDep (A (A)) +import qualified CrossDep + +dep :: A +dep = CrossDep.dep ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -0,0 +1,14 @@ +{-# language PackageImports #-} + +module CrossLocal where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +-- just to be sure that the file isn't accidentally picked up locally +import "dep" CrossDepApi (dep, A (A)) +import CrossNum (num) + +splc :: ExpQ +splc = lift @_ @Int (num + d) + where + A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs ===================================== @@ -0,0 +1,4 @@ +module CrossNum where + +num :: Int +num = 48332 ===================================== testsuite/tests/th/cross-package/CrossPackage.stdout ===================================== @@ -0,0 +1 @@ +58013 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -0,0 +1,20 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +ARGS := $(TEST_HC_OPTS) -package-db db -fprefer-byte-code -fbyte-code-and-object-code -package dep -v0 + +.PHONY: CrossPackageArchive +CrossPackageArchive: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageEmptyArchive +CrossPackageEmptyArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 2 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageNoArchive +CrossPackageNoArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 + ./run.bash "$(TEST_HC)" "$(ARGS)" ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -0,0 +1,23 @@ +def cross_test(suf): + name = f'CrossPackage{suf}' + test( + name, + [ + extra_files([ + 'Cross.hs', + 'CrossLocal.hs', + 'CrossDep.hs', + 'CrossDepApi.hs', + 'CrossNum.hs', + 'dep.conf', + 'prep.bash', + 'run.bash', + ]), + ], + makefile_test, + [name], + ) + +cross_test('Archive') +cross_test('EmptyArchive') +cross_test('NoArchive') ===================================== testsuite/tests/th/cross-package/dep.conf ===================================== @@ -0,0 +1,8 @@ +name: dep +version: 1.0 +id: dep-1.0 +key: dep-1.0 +exposed: True +exposed-modules: CrossDepApi +import-dirs: ${pkgroot}/dep +library-dirs: ${pkgroot}/dep ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" +ghc_pkg_cmd="$3" +archive="$4" + +base="$PWD" +lib="$base/dep" +# TODO see if this can just be stored in pwd. $lib as well +db="$base/db" +conf="${lib}/dep.conf" + +ghc_pkg() +{ + eval "${ghc_pkg_cmd at Q} --no-user-package-db --package-db=${db at Q} $@" +} + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +mkdir -p "$lib" "$db" +mv CrossDep.hs CrossDepApi.hs "$lib/" +cp dep.conf "$lib/" + +ghc_pkg recache + +ghc "-package-db ${db at Q} -hidir ${lib at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${lib at Q}/CrossDep.hs ${lib at Q}/CrossDepApi.hs" + +if [[ "$archive" == 1 ]] +then + $AR cqs "${lib}/libHSdep-1.0.a" "${lib}/CrossDep.o" "${lib}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf" +elif [[ "$archive" == 2 ]] +then + $AR cqs "${lib}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf" +fi + +ghc_pkg -v0 register "${conf at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +ghc -c CrossNum.hs CrossLocal.hs +ghc -c Cross.hs +ghc Cross.o -o Cross +./Cross View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d1f5e96fc6de619f7842786fcab63314fe79d0e2 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d1f5e96fc6de619f7842786fcab63314fe79d0e2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:15:53 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 04 Jul 2024 10:15:53 -0400 Subject: [Git][ghc/ghc][wip/ticky-dump-remove] hadrian: Add dump_stg flavour transformer Message-ID: <6686ae99e9913_dd27fa0bf681010e6@gitlab.mail> Matthew Pickering pushed to branch wip/ticky-dump-remove at Glasgow Haskell Compiler / GHC Commits: 6e601e15 by Matthew Pickering at 2024-07-04T15:15:41+01:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - 2 changed files: - hadrian/doc/flavours.md - hadrian/src/Flavour.hs Changes: ===================================== hadrian/doc/flavours.md ===================================== @@ -320,6 +320,10 @@ The supported transformers are listed below: late_ccs Enable -fprof-late in profiled libraries. + + dump_stg + Dump STG of all modules compiled by a stage1 compiler to a file + ### Static ===================================== hadrian/src/Flavour.hs ===================================== @@ -68,6 +68,7 @@ flavourTransformers = M.fromList , "hi_core" =: enableHiCore , "late_ccs" =: enableLateCCS , "boot_nonmoving_gc" =: enableBootNonmovingGc + , "dump_stg" =: enableDumpStg ] where (=:) = (,) @@ -178,6 +179,11 @@ tickyArgs = mconcat , arg "-ticky-dyn-thunk" ] +enableDumpStg :: Flavour -> Flavour +enableDumpStg = + addArgs $ stage1 ? + builder (Ghc CompileHs) ? mconcat [ arg "-ddump-to-file", arg "-ddump-stg-final" ] + -- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler. enableLinting :: Flavour -> Flavour enableLinting = View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6e601e15e5b97ee10808b0441f6b65f018988052 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6e601e15e5b97ee10808b0441f6b65f018988052 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:19:34 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 04 Jul 2024 10:19:34 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/remove-cc-var Message-ID: <6686af76e230e_dd27fb65f801080ad@gitlab.mail> Matthew Pickering pushed new branch wip/remove-cc-var at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/remove-cc-var You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:20:37 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 04 Jul 2024 10:20:37 -0400 Subject: [Git][ghc/ghc][wip/T24978] Another big increment Message-ID: <6686afb5a0f9e_dd27fc241b01099fc@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: d109ecb0 by Simon Peyton Jones at 2024-07-04T15:18:18+01:00 Another big increment * Combine sfInteractTop, sfInteractInert * Kill off tryFamFamInjectivity (now happens in improveWantedTopFunEqs) - - - - - 3 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Tc/Solver/Equality.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -142,23 +142,21 @@ tryInteractTopFam :: BuiltInSynFamily -> TyCon -> [Type] -> Type -> [(CoAxiomRule, TypeEqn)] tryInteractTopFam fam fam_tc tys r = [(BuiltInFamInteract ax_rule, eqn) - | ax_rule <- sfInteractTop fam + | ax_rule <- sfInteract fam , Just eqn <- [bifint_proves ax_rule [eqn]] ] where eqn :: TypeEqn eqn = Pair (mkTyConApp fam_tc tys) r tryInteractInertFam :: BuiltInSynFamily -> TyCon - -> [Type] -> Type -- F tys1 ~ ty1 - -> [Type] -> Type -- F tys2 ~ ty2 + -> [Type] -> [Type] -- F tys1 ~ F tys2 -> [(CoAxiomRule, TypeEqn)] -tryInteractInertFam builtin_fam fam_tc tys1 ty1 tys2 ty2 +tryInteractInertFam builtin_fam fam_tc tys1 tys2 = [(BuiltInFamInteract ax_rule, eqn) - | ax_rule <- sfInteractInert builtin_fam - , Just eqn <- [bifint_proves ax_rule [eqn1,eqn2]] ] + | ax_rule <- sfInteract builtin_fam + , Just eqn <- [bifint_proves ax_rule [eqn]] ] where - eqn1 = Pair (mkTyConApp fam_tc tys1) ty1 - eqn2 = Pair (mkTyConApp fam_tc tys2) ty2 + eqn = Pair (mkTyConApp fam_tc tys1) (mkTyConApp fam_tc tys2) tryMatchFam :: BuiltInSynFamily -> [Type] -> Maybe (CoAxiomRule, [Type], Type) @@ -274,41 +272,58 @@ mkTopBinFamDeduction str fam_tc f ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) ; f a b rhs } } -mkInteractUnaryFamDeduction :: String -> TyCon - -> (Type -> Type -> -- F x1 ~ r1 - Type -> Type -> -- F x2 ~ r2 - Maybe TypeEqn) - -> BuiltInFamInteract -mkInteractUnaryFamDeduction str fam_tc f - = BIF_Interact - { bifint_name = fsLit str - , bifint_arg_roles = [Nominal, Nominal] - , bifint_res_role = Nominal - , bifint_proves = \cs -> do { [Pair lhs1 rhs1, Pair lhs2 rhs2] <- return cs - ; (tc1, [x1]) <- splitTyConApp_maybe lhs1 - ; (tc2, [x2]) <- splitTyConApp_maybe lhs2 - ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) - ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) - ; f x1 rhs1 x2 rhs2 } } - -mkInteractBinFamDeduction :: String -> TyCon - -> (Type -> Type -> Type -> -- F x1 y1 ~ r1 - Type -> Type -> Type -> -- F x2 y2 ~ r2 - Maybe TypeEqn) - -> BuiltInFamInteract -mkInteractBinFamDeduction str fam_tc f - = BIF_Interact - { bifint_name = fsLit str - , bifint_arg_roles = [Nominal, Nominal] - , bifint_res_role = Nominal - , bifint_proves = \cs -> do { [Pair lhs1 rhs1, Pair lhs2 rhs2] <- return cs --- ; same rhs1 rhs2 - ; (tc1, [x1,y1]) <- splitTyConApp_maybe lhs1 - ; (tc2, [x2,y2]) <- splitTyConApp_maybe lhs2 - ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) - ; massertPpr (tc2 == fam_tc) (ppr tc2 $$ ppr fam_tc) --- ; f x1 y1 x2 y2 } } - ; f x1 y1 rhs1 x2 y2 rhs2 } } +mkUnaryBIF :: String -> TyCon -> BuiltInFamInteract +mkUnaryBIF str fam_tc + = BIF_Interact { bifint_name = fsLit str + , bifint_arg_roles = [Nominal] + , bifint_res_role = Nominal + , bifint_proves = proves } + where + proves cs + | [Pair lhs rhs] <- cs -- Expect one coercion argument + = do { (tc2, [x2]) <- splitTyConApp_maybe rhs + ; guard (tc2 == fam_tc) + ; (tc1, [x1]) <- splitTyConApp_maybe lhs + ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) + ; return (Pair x1 x2) } + | otherwise + = Nothing + +mkBinBIF :: String -> TyCon + -> WhichArg -> WhichArg + -> (Type -> Bool) -- The guard on the equal args, if any + -> BuiltInFamInteract +mkBinBIF str fam_tc eq1 eq2 check_me + = BIF_Interact { bifint_name = fsLit str + , bifint_arg_roles = [Nominal] + , bifint_res_role = Nominal + , bifint_proves = proves } + where + proves cs + | [Pair lhs rhs] <- cs -- Expect one coercion argument + = do { (tc2, [x2,y2]) <- splitTyConApp_maybe rhs + ; guard (tc2 == fam_tc) + ; (tc1, [x1,y1]) <- splitTyConApp_maybe lhs + ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) + ; case (eq1, eq2) of + (ArgX,ArgX) -> do_it x1 x2 y1 y2 + (ArgX,ArgY) -> do_it x1 y2 x2 y1 + (ArgY,ArgX) -> do_it y1 x2 y2 x1 + (ArgY,ArgY) -> do_it y1 y2 x1 x2 } + | otherwise + = Nothing + + do_it a1 a2 b1 b2 = do { same a1 a2; guard (check_me a1); return (Pair b1 b2) } + +noGuard :: Type -> Bool +noGuard _ = True + +numGuard :: (Integer -> Bool) -> Type -> Bool +numGuard pred ty = case isNumLitTy ty of + Just n -> pred n + Nothing -> False + +data WhichArg = ArgX | ArgY ------------------------------------------------------------------------------- @@ -341,8 +356,7 @@ typeNatTyCons = tyConAxiomRules :: TyCon -> [CoAxiomRule] tyConAxiomRules tc | Just ops <- isBuiltInSynFamTyCon_maybe tc - = map BuiltInFamInteract (sfInteractTop ops) - ++ map BuiltInFamInteract (sfInteractInert ops) + = map BuiltInFamInteract (sfInteract ops) ++ map BuiltInFamRewrite (sfMatchFam ops) | otherwise = [] @@ -361,9 +375,8 @@ typeNatCoAxiomRules = listToUFM $ map (\x -> (coaxrName x, x)) $ typeNatAddTyCon :: TyCon typeNatAddTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = axAddMatches - , sfInteractTop = axAddTops - , sfInteractInert = axAddInteracts + { sfMatchFam = axAddMatches + , sfInteract = axAddInteracts } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "+") @@ -382,39 +395,31 @@ axAddMatches where tc = typeNatAddTyCon -axAddTops :: [BuiltInFamInteract] -axAddTops +axAddInteracts :: [BuiltInFamInteract] +axAddInteracts = [ -- (s + t ~ 0) => (s ~ 0) - mkTopBinFamDeduction "AddT-0L" typeNatAddTyCon $ \ a _b r -> + mkTopBinFamDeduction "AddT-0L" tc $ \ a _b r -> do { _ <- known r (== 0); return (Pair a (num 0)) } , -- (s + t ~ 0) => (t ~ 0) - mkTopBinFamDeduction "AddT-0R" typeNatAddTyCon $ \ _a b r -> + mkTopBinFamDeduction "AddT-0R" tc $ \ _a b r -> do { _ <- known r (== 0); return (Pair b (num 0)) } , -- (5 + t ~ 8) => (t ~ 3) - mkTopBinFamDeduction "AddT-KKL" typeNatAddTyCon $ \ a b r -> + mkTopBinFamDeduction "AddT-KKL" tc $ \ a b r -> do { na <- isNumLitTy a; nr <- known r (>= na); return (Pair b (num (nr-na))) } , -- (s + 5 ~ 8) => (s ~ 3) - mkTopBinFamDeduction "AddT-KKR" typeNatAddTyCon $ \ a b r -> - do { nb <- isNumLitTy b; nr <- known r (>= nb); return (Pair a (num (nr-nb))) } ] + mkTopBinFamDeduction "AddT-KKR" tc $ \ a b r -> + do { nb <- isNumLitTy b; nr <- known r (>= nb); return (Pair a (num (nr-nb))) } -axAddInteracts :: [BuiltInFamInteract] -axAddInteracts - = map mk_ax $ - [ ("AddI-xr", \ x1 y1 z1 x2 y2 z2 -> injCheck x1 x2 z1 z2 y1 y2) - -- (x1+y1~z1, x2+y2~z2) {x1=x2,z1=z2}=> (y1 ~ y2) - , ("AddI-xr2", \ x1 y1 z1 x2 y2 z2 -> injCheck x2 y1 z1 z2 x1 y2) - -- (x1+y1~z1, x2+y2~z2) {x2=y1,z1=z2}=> (x1 ~ y2) - , ("AddI-yr", \ x1 y1 z1 x2 y2 z2 -> injCheck y1 y2 z1 z2 x1 x2) - -- (x1+y1~z1, x2+y2~z2) {y1=y2,z1=z2}=> (x1 ~ x2) - , ("AddI-yr2", \ x1 y1 z1 x2 y2 z2 -> injCheck x1 y2 z1 z2 y1 x2) - -- (x1+y1~z1, x2+y2~z2) {x1=y2,z1=z2}=> (y1 ~ x2) + , mkBinBIF "AddI-xx" tc ArgX ArgX noGuard -- x1+y1~x2+y2 {x1=x2}=> (y1 ~ y2) + , mkBinBIF "AddI-xy" tc ArgX ArgY noGuard -- x1+y1~x2+y2 {x1=y2}=> (x2 ~ y1) + , mkBinBIF "AddI-yx" tc ArgY ArgX noGuard -- x1+y1~x2+y2 {y1=x2}=> (x1 ~ y2) + , mkBinBIF "AddI-yy" tc ArgY ArgY noGuard -- x1+y1~x2+y2 {y1=y2}=> (x1 ~ x2) ] where - mk_ax (str, fun) = mkInteractBinFamDeduction str typeNatAddTyCon fun - + tc = typeNatAddTyCon ------------------------------------------------------------------------------- -- Subtraction (-) @@ -423,9 +428,8 @@ axAddInteracts typeNatSubTyCon :: TyCon typeNatSubTyCon = mkTypeNatFunTyCon2 name BuiltInSynFamily - { sfMatchFam = axSubMatches - , sfInteractTop = axSubTops - , sfInteractInert = axSubInteracts + { sfMatchFam = axSubMatches + , sfInteract = axSubInteracts } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "-") @@ -439,20 +443,17 @@ axSubMatches where tc = typeNatSubTyCon -axSubTops :: [BuiltInFamInteract] -axSubTops -- (a - b ~ 5) => (5 + b ~ a) - = [ mkTopBinFamDeduction "SubT" typeNatSubTyCon $ \ a b r -> - do { _ <- isNumLitTy r; return (Pair (r .+. b) a) } ] - - axSubInteracts :: [BuiltInFamInteract] axSubInteracts - = [ -- (x-y1 ~ z, x-y2 ~ z) => (y1 ~ y2) - mkInteractBinFamDeduction "SubI-2" typeNatSubTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck x1 x2 z1 z2 y1 y2 - , -- (x1-y ~ z, x2-y ~ z) => (x1 ~ x2) - mkInteractBinFamDeduction "SubI-2" typeNatSubTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck y1 y2 z1 z2 x1 x2 ] + = [ -- (a - b ~ 5) => (5 + b ~ a) + mkTopBinFamDeduction "SubT" tc $ \ a b r -> + do { _ <- isNumLitTy r; return (Pair (r .+. b) a) } + + , mkBinBIF "SubI-xx" tc ArgX ArgX noGuard -- (x-y1 ~ x-y2) => (y1 ~ y2) + , mkBinBIF "SubI-yy" tc ArgY ArgY noGuard -- (x1-y ~ x2-y) => (x1 ~ x2) + ] + where + tc = typeNatSubTyCon {- Note [Weakened interaction rule for subtraction] @@ -492,14 +493,11 @@ something more general. typeNatMulTyCon :: TyCon typeNatMulTyCon = mkTypeNatFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axMulMatches - , sfInteractTop = axMulTops - , sfInteractInert = axMulInteracts - } + BuiltInSynFamily { sfMatchFam = axMulMatches + , sfInteract = axMulInteracts } where - name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "*") - typeNatMulTyFamNameKey typeNatMulTyCon + name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "*") + typeNatMulTyFamNameKey typeNatMulTyCon axMulMatches :: [BuiltInFamRewrite] axMulMatches @@ -512,33 +510,29 @@ axMulMatches where tc = typeNatMulTyCon -axMulTops :: [BuiltInFamInteract] -axMulTops +axMulInteracts :: [BuiltInFamInteract] +axMulInteracts = [ -- (s * t ~ 1) => (s ~ 1) - mkTopBinFamDeduction "MulT1" typeNatMulTyCon $ \ s _t r -> + mkTopBinFamDeduction "MulT1" tc $ \ s _t r -> do { _ <- known r (== 1); return (Pair s r) } , -- (s * t ~ 1) => (t ~ 1) - mkTopBinFamDeduction "MulT2" typeNatMulTyCon $ \ _s t r -> + mkTopBinFamDeduction "MulT2" tc $ \ _s t r -> do { _ <- known r (== 1); return (Pair t r) } , -- (3 * t ~ 15) => (t ~ 5) - mkTopBinFamDeduction "MulT3" typeNatMulTyCon $ \ s t r -> + mkTopBinFamDeduction "MulT3" tc $ \ s t r -> do { ns <- isNumLitTy s; nr <- isNumLitTy r; y <- divide nr ns; return (Pair t (num y)) } , -- (s * 3 ~ 15) => (s ~ 5) - mkTopBinFamDeduction "MulT4" typeNatMulTyCon $ \ s t r -> - do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- divide nr nt; return (Pair s (num y)) } ] + mkTopBinFamDeduction "MulT4" tc $ \ s t r -> + do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- divide nr nt; return (Pair s (num y)) } -axMulInteracts :: [BuiltInFamInteract] -axMulInteracts - = [ -- (x*y1 ~ z, x*y2 ~ z) => (y1~y2) if x/=0 - mkInteractBinFamDeduction "MulI1" typeNatMulTyCon $ \ x1 y1 z1 x2 y2 z2 -> - do { nx1 <- known x1 (/= 0); _ <- known x2 (== nx1); same z1 z2; return (Pair y1 y2) } - - , -- (x1*y ~ z, x2*y ~ z) => (x1~x2) if y/0 - mkInteractBinFamDeduction "MulI2" typeNatMulTyCon $ \ x1 y1 z1 x2 y2 z2 -> - do { ny1 <- known y1 (/= 0); _ <- known y2 (== ny1); same z1 z2; return (Pair x1 x2) } ] + , mkBinBIF "MulI-xx" tc ArgX ArgX (numGuard (/= 0)) -- (x*y1 ~ x*y2) {x/=0}=> (y1 ~ y2) + , mkBinBIF "MulI-yy" tc ArgY ArgY (numGuard (/= 0)) -- (x1*y ~ x2*y) {y/=0}=> (x1 ~ x2) + ] + where + tc = typeNatMulTyCon ------------------------------------------------------------------------------- @@ -547,22 +541,16 @@ axMulInteracts typeNatDivTyCon :: TyCon typeNatDivTyCon = mkTypeNatFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axDivMatches - , sfInteractTop = [] - , sfInteractInert = [] - } + BuiltInSynFamily { sfMatchFam = axDivMatches + , sfInteract = [] } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "Div") typeNatDivTyFamNameKey typeNatDivTyCon typeNatModTyCon :: TyCon typeNatModTyCon = mkTypeNatFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axModMatches - , sfInteractTop = [] - , sfInteractInert = [] - } + BuiltInSynFamily { sfMatchFam = axModMatches + , sfInteract = [] } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "Mod") typeNatModTyFamNameKey typeNatModTyCon @@ -589,11 +577,8 @@ axModMatches typeNatExpTyCon :: TyCon -- Exponentiation typeNatExpTyCon = mkTypeNatFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axExpMatches - , sfInteractTop = axExpTops - , sfInteractInert = axExpInteracts - } + BuiltInSynFamily { sfMatchFam = axExpMatches + , sfInteract = axExpInteracts } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "^") typeNatExpTyFamNameKey typeNatExpTyCon @@ -608,40 +593,34 @@ axExpMatches where tc = typeNatExpTyCon -axExpTops :: [BuiltInFamInteract] -axExpTops +axExpInteracts :: [BuiltInFamInteract] +axExpInteracts = [ -- (s ^ t ~ 0) => (s ~ 0) - mkTopBinFamDeduction "ExpT1" typeNatExpTyCon $ \ s _t r -> + mkTopBinFamDeduction "ExpT1" tc $ \ s _t r -> do { 0 <- isNumLitTy r; return (Pair s r) } , -- (2 ^ t ~ 8) => (t ~ 3) - mkTopBinFamDeduction "ExpT2" typeNatExpTyCon $ \ s t r -> + mkTopBinFamDeduction "ExpT2" tc $ \ s t r -> do { ns <- isNumLitTy s; nr <- isNumLitTy r; y <- logExact nr ns; return (Pair t (num y)) } , -- (s ^ 2 ~ 9) => (s ~ 3) - mkTopBinFamDeduction "ExpT3" typeNatExpTyCon $ \ s t r -> - do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- rootExact nr nt; return (Pair s (num y)) } ] + mkTopBinFamDeduction "ExpT3" tc $ \ s t r -> + do { nt <- isNumLitTy t; nr <- isNumLitTy r; y <- rootExact nr nt; return (Pair s (num y)) } -axExpInteracts :: [BuiltInFamInteract] -axExpInteracts - = [ -- (x1^y1 ~ z, x2^y2 ~ z) {x1=x2, x1>1}=> (y1~y2) - mkInteractBinFamDeduction "ExpI1" typeNatExpTyCon $ \ x1 y1 z1 x2 y2 z2 -> - do { nx1 <- known x1 (> 1); _ <- known x2 (== nx1); same z1 z2; return (Pair y1 y2) } + , mkBinBIF "ExpI-xx" tc ArgX ArgX (numGuard (> 1)) -- (x^y1 ~ x^y2) {x>1}=> (y1 ~ y2) + , mkBinBIF "ExpI-yy" tc ArgY ArgY (numGuard (/= 0)) -- (x1*y ~ x2*y) {y/=0}=> (x1 ~ x2) + ] + where + tc = typeNatExpTyCon - , -- (x1^y1 ~ z, x2^y2 ~ z) {y1=y2, y1>0}=> (x1~x2) - mkInteractBinFamDeduction "ExpI2" typeNatExpTyCon $ \ x1 y1 z1 x2 y2 z2 -> - do { ny1 <- known y1 (> 0); _ <- known y2 (== ny1); same z1 z2; return (Pair x1 x2) } ] ------------------------------------------------------------------------------- -- Logarithm: Log2 ------------------------------------------------------------------------------- typeNatLogTyCon :: TyCon typeNatLogTyCon = mkTypeNatFunTyCon1 name - BuiltInSynFamily - { sfMatchFam = axLogMatches - , sfInteractTop = [] - , sfInteractInert = [] - } + BuiltInSynFamily { sfMatchFam = axLogMatches + , sfInteract = [] } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS (fsLit "Log2") typeNatLogTyFamNameKey typeNatLogTyCon @@ -670,10 +649,8 @@ typeNatCmpTyCon where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPENATS_INTERNAL (fsLit "CmpNat") typeNatCmpTyFamNameKey typeNatCmpTyCon - ops = BuiltInSynFamily - { sfMatchFam = axCmpNatMatches - , sfInteractTop = axCmpNatTops - , sfInteractInert = [] } + ops = BuiltInSynFamily { sfMatchFam = axCmpNatMatches + , sfInteract = axCmpNatInteracts } axCmpNatMatches :: [BuiltInFamRewrite] axCmpNatMatches @@ -683,9 +660,10 @@ axCmpNatMatches where tc = typeNatCmpTyCon -axCmpNatTops :: [BuiltInFamInteract] -axCmpNatTops - = [ mkTopBinFamDeduction "CmpNatT3" typeNatCmpTyCon $ \ s t r -> +axCmpNatInteracts :: [BuiltInFamInteract] +axCmpNatInteracts + = [ -- s `cmp` t ~ EQ ==> s ~ t + mkTopBinFamDeduction "CmpNatT3" typeNatCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] ------------------------------------------------------------------------------- @@ -705,10 +683,8 @@ typeSymbolCmpTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS_INTERNAL (fsLit "CmpSymbol") typeSymbolCmpTyFamNameKey typeSymbolCmpTyCon - ops = BuiltInSynFamily - { sfMatchFam = axSymbolCmpMatches - , sfInteractTop = axSymbolCmpTops - , sfInteractInert = [] } + ops = BuiltInSynFamily { sfMatchFam = axSymbolCmpMatches + , sfInteract = axSymbolCmpInteracts } ss,ts :: TyVar -- Of kind Symbol (ss: ts: _) = mkTemplateTyVars (repeat typeSymbolKind) @@ -721,8 +697,8 @@ axSymbolCmpMatches where tc = typeSymbolCmpTyCon -axSymbolCmpTops :: [BuiltInFamInteract] -axSymbolCmpTops +axSymbolCmpInteracts :: [BuiltInFamInteract] +axSymbolCmpInteracts = [ mkTopBinFamDeduction "CmpSymbolT" typeSymbolCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] @@ -733,10 +709,8 @@ axSymbolCmpTops typeSymbolAppendTyCon :: TyCon typeSymbolAppendTyCon = mkTypeSymbolFunTyCon2 name - BuiltInSynFamily - { sfMatchFam = axAppendMatches - , sfInteractTop = axAppendTops - , sfInteractInert = axAppendInteracts } + BuiltInSynFamily { sfMatchFam = axAppendMatches + , sfInteract = axAppendInteracts } where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "AppendSymbol") typeSymbolAppendFamNameKey typeSymbolAppendTyCon @@ -750,34 +724,31 @@ axAppendMatches where tc = typeSymbolAppendTyCon -axAppendTops :: [BuiltInFamInteract] -axAppendTops +axAppendInteracts :: [BuiltInFamInteract] +axAppendInteracts = [ -- (AppendSymbol a b ~ "") => (a ~ "") - mkTopBinFamDeduction "AppendSymbolT1" typeSymbolAppendTyCon $ \ a _b r -> + mkTopBinFamDeduction "AppendSymbolT1" tc $ \ a _b r -> do { rs <- isStrLitTy r; guard (nullFS rs); return (Pair a nullStrLitTy) } , -- (AppendSymbol a b ~ "") => (b ~ "") - mkTopBinFamDeduction "AppendSymbolT2" typeSymbolAppendTyCon $ \ _a b r -> + mkTopBinFamDeduction "AppendSymbolT2" tc $ \ _a b r -> do { rs <- isStrLitTy r; guard (nullFS rs); return (Pair b nullStrLitTy) } , -- (AppendSymbol "foo" b ~ "foobar") => (b ~ "bar") - mkTopBinFamDeduction "AppendSymbolT3" typeSymbolAppendTyCon $ \ a b r -> + mkTopBinFamDeduction "AppendSymbolT3" tc $ \ a b r -> do { as <- isStrLitTyS a; rs <- isStrLitTyS r; guard (as `isPrefixOf` rs) ; return (Pair b (mkStrLitTyS (drop (length as) rs))) } , -- (AppendSymbol f "bar" ~ "foobar") => (f ~ "foo") - mkTopBinFamDeduction "AppendSymbolT3" typeSymbolAppendTyCon $ \ a b r -> + mkTopBinFamDeduction "AppendSymbolT3" tc $ \ a b r -> do { bs <- isStrLitTyS b; rs <- isStrLitTyS r; guard (bs `isSuffixOf` rs) - ; return (Pair a (mkStrLitTyS (take (length rs - length bs) rs))) } ] + ; return (Pair a (mkStrLitTyS (take (length rs - length bs) rs))) } -axAppendInteracts :: [BuiltInFamInteract] -axAppendInteracts - = [ -- (AppendSymbol x1 y1 ~ z, AppendSymbol x2 y2 ~ z) {x1=x2}=> (y1 ~ y2) - mkInteractBinFamDeduction "AppI1" typeSymbolAppendTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck x1 x2 z1 z2 y1 y2 - , -- (AppendSymbol x1 y1 ~ z, AppendSymbol x2 y2 ~ z) {y1=y2}=> (x1 ~ x2) - mkInteractBinFamDeduction "AppI2" typeSymbolAppendTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck y1 y2 z1 z2 x1 x2 ] + , mkBinBIF "AppI-xx" tc ArgX ArgX noGuard -- (x++y1 ~ x++y2) => (y1 ~ y2) + , mkBinBIF "AppI-yy" tc ArgY ArgY noGuard -- (x1++y ~ x2++y) => (x1 ~ x2) + ] + where + tc = typeSymbolAppendTyCon ------------------------------------------------------------------------------- -- ConsSymbol @@ -795,10 +766,8 @@ typeConsSymbolTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "ConsSymbol") typeConsSymbolTyFamNameKey typeConsSymbolTyCon - ops = BuiltInSynFamily - { sfMatchFam = axConsMatches - , sfInteractTop = axConsTops - , sfInteractInert = axConsInteracts } + ops = BuiltInSynFamily { sfMatchFam = axConsMatches + , sfInteract = axConsInteracts } axConsMatches :: [BuiltInFamRewrite] axConsMatches @@ -807,24 +776,22 @@ axConsMatches where tc = typeConsSymbolTyCon -axConsTops :: [BuiltInFamInteract] -axConsTops +axConsInteracts :: [BuiltInFamInteract] +axConsInteracts = [ -- ConsSymbol a b ~ "blah" => (a ~ 'b') - mkTopBinFamDeduction "ConsSymbolT1" typeConsSymbolTyCon $ \ a _b r -> + mkTopBinFamDeduction "ConsSymbolT1" tc $ \ a _b r -> do { rs <- isStrLitTy r; (x,_) <- unconsFS rs; return (Pair a (mkCharLitTy x)) } , -- ConsSymbol a b ~ "blah" => (b ~ "lah") - mkTopBinFamDeduction "ConsSymbolT2" typeConsSymbolTyCon $ \ _a b r -> - do { rs <- isStrLitTy r; (_,xs) <- unconsFS rs; return (Pair b (mkStrLitTy xs)) } ] + mkTopBinFamDeduction "ConsSymbolT2" tc $ \ _a b r -> + do { rs <- isStrLitTy r; (_,xs) <- unconsFS rs; return (Pair b (mkStrLitTy xs)) } -axConsInteracts :: [BuiltInFamInteract] -axConsInteracts - = [ -- (ConsSymbol x1 y1 ~ z, ConsSymbol x2 y2 ~ z) {x1=x2}=> (y1 ~ y2) - mkInteractBinFamDeduction "AppI1" typeConsSymbolTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck x1 x2 z1 z2 y1 y2 - , -- (ConsSymbol x1 y1 ~ z, AppendSymbol x2 y2 ~ z) {y1=y2}=> (x1 ~ x2) - mkInteractBinFamDeduction "AppI1" typeConsSymbolTyCon $ \ x1 y1 z1 x2 y2 z2 -> - injCheck y1 y2 z1 z2 x1 x2 ] + + , mkBinBIF "ConsI-xx" tc ArgX ArgX noGuard -- (x:y1 ~ x:y2) => (y1 ~ y2) + , mkBinBIF "ConsI-yy" tc ArgY ArgY noGuard -- (x1:y ~ x2:y) => (x1 ~ x2) + ] + where + tc = typeConsSymbolTyCon ------------------------------------------------------------------------------- -- UnconsSymbol @@ -842,10 +809,8 @@ typeUnconsSymbolTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "UnconsSymbol") typeUnconsSymbolTyFamNameKey typeUnconsSymbolTyCon - ops = BuiltInSynFamily - { sfMatchFam = axUnconsMatches - , sfInteractTop = axUnconsTops - , sfInteractInert = axUnconsInteracts } + ops = BuiltInSynFamily { sfMatchFam = axUnconsMatches + , sfInteract = axUnconsInteracts } computeUncons :: FastString -> Type computeUncons str @@ -861,25 +826,24 @@ axUnconsMatches where tc = typeUnconsSymbolTyCon -axUnconsTops :: [BuiltInFamInteract] -axUnconsTops +axUnconsInteracts :: [BuiltInFamInteract] +axUnconsInteracts = [ -- (UnconsSymbol b ~ Nothing) => (b ~ "") - mkTopUnaryFamDeduction "UnconsSymbolT1" typeUnconsSymbolTyCon $ \b r -> + mkTopUnaryFamDeduction "UnconsSymbolT1" tc $ \b r -> do { Nothing <- isPromotedMaybeTy r; return (Pair b nullStrLitTy) } , -- (UnconsSymbol b ~ Just ('f',"oobar")) => (b ~ "foobar") - mkTopUnaryFamDeduction "UnconsSymbolT2" typeUnconsSymbolTyCon $ \b r -> + mkTopUnaryFamDeduction "UnconsSymbolT2" tc $ \b r -> do { Just pr <- isPromotedMaybeTy r ; (c,s) <- isPromotedPairType pr ; chr <- isCharLitTy c ; str <- isStrLitTy s - ; return (Pair b (mkStrLitTy (consFS chr str))) } ] + ; return (Pair b (mkStrLitTy (consFS chr str))) } -axUnconsInteracts :: [BuiltInFamInteract] -axUnconsInteracts - = [ -- (UnconsSymbol x1 ~ z, UnconsSymbol x2 ~ z) => (x1 ~ x2) - mkInteractUnaryFamDeduction "UnconsI1" typeUnconsSymbolTyCon $ \ x1 z1 x2 z2 -> - do { same z1 z2; return (Pair x1 x2) } ] + , mkUnaryBIF "UnconsI1" tc -- (UnconsSymbol x1 ~ z, UnconsSymbol x2 ~ z) => (x1 ~ x2) + ] + where + tc = typeUnconsSymbolTyCon ------------------------------------------------------------------------------- -- CharToNat @@ -897,11 +861,8 @@ typeCharToNatTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "CharToNat") typeCharToNatTyFamNameKey typeCharToNatTyCon - ops = BuiltInSynFamily - { sfMatchFam = axCharToNatMatches - , sfInteractTop = axCharToNatTops - , sfInteractInert = [] - } + ops = BuiltInSynFamily { sfMatchFam = axCharToNatMatches + , sfInteract = axCharToNatInteracts } axCharToNatMatches :: [BuiltInFamRewrite] axCharToNatMatches @@ -910,8 +871,8 @@ axCharToNatMatches where tc = typeCharToNatTyCon -axCharToNatTops :: [BuiltInFamInteract] -axCharToNatTops +axCharToNatInteracts :: [BuiltInFamInteract] +axCharToNatInteracts = [ -- (CharToNat c ~ 122) => (c ~ 'z') mkTopUnaryFamDeduction "CharToNatT1" typeCharToNatTyCon $ \c r -> do { nr <- isNumLitTy r; chr <- integerToChar nr; return (Pair c (mkCharLitTy chr)) } ] @@ -932,10 +893,8 @@ typeNatToCharTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS (fsLit "NatToChar") typeNatToCharTyFamNameKey typeNatToCharTyCon - ops = BuiltInSynFamily - { sfMatchFam = axNatToCharMatches - , sfInteractTop = axNatToCharTops - , sfInteractInert = [] } + ops = BuiltInSynFamily { sfMatchFam = axNatToCharMatches + , sfInteract = axNatToCharInteracts } axNatToCharMatches :: [BuiltInFamRewrite] axNatToCharMatches @@ -944,8 +903,8 @@ axNatToCharMatches where tc = typeNatToCharTyCon -axNatToCharTops :: [BuiltInFamInteract] -axNatToCharTops +axNatToCharInteracts :: [BuiltInFamInteract] +axNatToCharInteracts = [ -- (NatToChar n ~ 'z') => (n ~ 122) mkTopUnaryFamDeduction "CharToNatT1" typeNatToCharTyCon $ \n r -> do { c <- isCharLitTy r; return (Pair n (mkNumLitTy (charToInteger c))) } ] @@ -967,11 +926,8 @@ typeCharCmpTyCon = where name = mkWiredInTyConName UserSyntax gHC_INTERNAL_TYPELITS_INTERNAL (fsLit "CmpChar") typeCharCmpTyFamNameKey typeCharCmpTyCon - ops = BuiltInSynFamily - { sfMatchFam = axCharCmpMatches - , sfInteractTop = axCharCmpTops - , sfInteractInert = [] - } + ops = BuiltInSynFamily { sfMatchFam = axCharCmpMatches + , sfInteract = axCharCmpInteracts } sc :: TyVar -- Of kind Char (sc: _) = mkTemplateTyVars (repeat charTy) @@ -984,8 +940,8 @@ axCharCmpMatches where tc = typeCharCmpTyCon -axCharCmpTops :: [BuiltInFamInteract] -axCharCmpTops +axCharCmpInteracts :: [BuiltInFamInteract] +axCharCmpInteracts = [ -- (CmpChar s t ~ EQ) => s ~ t mkTopBinFamDeduction "CmpCharT" typeCharCmpTyCon $ \ s t r -> do { EQ <- isOrderingLitTy r; return (Pair s t) } ] @@ -1101,11 +1057,6 @@ mkTypeSymbolFunTyCon2 op tcb = Nothing NotInjective -injCheck :: Type -> Type -> Type -> Type -> Type -> Type -> Maybe TypeEqn --- If x1=x2 and y1=y2, emit z1=z2 -injCheck x1 x2 y1 y2 z1 z2 - = do { guard (x1 `tcEqType` x2); guard (y1 `tcEqType` y2); return (Pair z1 z2) } - same :: Type -> Type -> Maybe () same ty1 ty2 = guard (ty1 `tcEqType` ty2) ===================================== compiler/GHC/Core/Coercion/Axiom.hs ===================================== @@ -251,7 +251,7 @@ data CoAxBranch -- cab_tvs and cab_lhs may be eta-reduced; see -- Note [Eta reduction for data families] , cab_cvs :: [CoVar] - -- ^ Bound coercion variables + -- ^ Bound coercion variables -- Always empty, for now. -- See Note [Constraints in patterns] -- in GHC.Tc.TyCl @@ -654,22 +654,14 @@ instance Outputable CoAxiomRule where data BuiltInSynFamily = BuiltInSynFamily { sfMatchFam :: [BuiltInFamRewrite] - , sfInteractTop :: [BuiltInFamInteract] + , sfInteract:: [BuiltInFamInteract] -- If given these type arguments and RHS, returns the equalities that -- are guaranteed to hold. That is, if - -- (ar, Pair s1 s2) is an element ofo (sfInteractTop tys ty) + -- (ar, Pair s1 s2) is an element of (sfInteract tys ty) -- then AxiomRule ar [co :: F tys ~ ty] :: s1~s2 - - , sfInteractInert :: [BuiltInFamInteract] - -- If given one set of arguments and result, and another set of arguments - -- and result, returns the equalities that are guaranteed to hold. } -- Provides default implementations that do nothing. trivialBuiltInFamily :: BuiltInSynFamily -trivialBuiltInFamily = BuiltInSynFamily - { sfMatchFam = [] - , sfInteractTop = [] - , sfInteractInert = [] - } +trivialBuiltInFamily = BuiltInSynFamily { sfMatchFam = [], sfInteract = [] } ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -44,7 +44,6 @@ import GHC.Types.Var.Set( anyVarSet ) import GHC.Types.Name.Reader import GHC.Types.Basic -import GHC.Builtin.Types ( anyTypeOfKind ) import GHC.Builtin.Types.Literals ( tryInteractTopFam, tryInteractInertFam ) import GHC.Utils.Outputable @@ -1716,18 +1715,11 @@ canEqCanLHS2 ev eq_rel swapped lhs1 ps_xi1 lhs2 ps_xi2 mco then finish_with_swapping else finish_without_swapping - | TyFamLHS fun_tc1 fun_args1 <- lhs1 - , TyFamLHS fun_tc2 fun_args2 <- lhs2 + | TyFamLHS _fun_tc1 fun_args1 <- lhs1 + , TyFamLHS _fun_tc2 fun_args2 <- lhs2 -- See Note [Decomposing type family applications] = do { traceTcS "canEqCanLHS2 two type families" (ppr lhs1 $$ ppr lhs2) - - ; unifications_done <- tryFamFamInjectivity ev eq_rel - fun_tc1 fun_args1 fun_tc2 fun_args2 mco - ; if unifications_done - then -- Go round again, since the unifications affect lhs/rhs - startAgainWith (mkNonCanonical ev) - else - do { tclvl <- getTcLevel + ; tclvl <- getTcLevel ; let tvs1 = tyCoVarsOfTypes fun_args1 tvs2 = tyCoVarsOfTypes fun_args2 @@ -1746,7 +1738,7 @@ canEqCanLHS2 ev eq_rel swapped lhs1 ps_xi1 lhs2 ps_xi2 mco -- if swap_for_rewriting doesn't care either way ; if swap_for_rewriting || (meta_tv_lhs == meta_tv_rhs && swap_for_size) then finish_with_swapping - else finish_without_swapping } } + else finish_without_swapping } where sym_mco = mkSymMCo mco role = eqRelRole eq_rel @@ -2945,55 +2937,6 @@ equality with the template on the left. Delicate, but it works. -} -tryFamFamInjectivity :: CtEvidence -> EqRel - -> TyCon -> [TcType] -> TyCon -> [TcType] -> MCoercion - -> TcS Bool -- True <=> some unification happened -tryFamFamInjectivity ev eq_rel fun_tc1 fun_args1 fun_tc2 fun_args2 mco - | ReprEq <- eq_rel - = return False -- Injectivity applies only for Nominal equalities - | fun_tc1 /= fun_tc2 - = return False -- If the families don't match, stop. - - -- Is F an injective type family - | isWanted ev -- Injectivity conditions only work for Wanteds - , Injective inj <- tyConInjectivityInfo fun_tc1 - = unifyFunDeps ev Nominal $ \uenv -> - uPairsTcM uenv [ Pair ty1 ty2 - | (ty1,ty2,True) <- zip3 fun_args1 fun_args2 inj ] - - -- Built-in synonym families don't have an entry point for this - -- use case. So, we just use sfInteractInert and pass two equal - -- RHSs. We *could* add another entry point, but then there would - -- be a burden to make sure the new entry point and existing ones - -- were internally consistent. This is slightly distasteful, but - -- it works well in practice and localises the problem. Ugh. - -- - -- This path works both Wanteds and Givens - | Just ops <- isBuiltInSynFamTyCon_maybe fun_tc1 - = let tc_kind = tyConKind fun_tc1 - ki1 = piResultTys tc_kind fun_args1 - ki2 | MRefl <- mco - = ki1 -- just a small optimisation - | otherwise - = piResultTys tc_kind fun_args2 - - fake_rhs1 = anyTypeOfKind ki1 - fake_rhs2 = anyTypeOfKind ki2 - - eqs :: [TypeEqn] - eqs = map snd $ tryInteractInertFam ops fun_tc1 - fun_args1 fake_rhs1 fun_args2 fake_rhs2 - in - do { traceTcS "famfam" (vcat [ppr fun_tc1 - , text "1side" <+> ppr fun_args1 <+> ppr fake_rhs1 - , text "2side" <+> ppr fun_args2 <+> ppr fake_rhs2 - , ppr eqs ]) - ; unifyFunDeps ev Nominal $ \uenv -> - uPairsTcM uenv eqs } - - | otherwise -- ordinary, non-injective type family - = return False - -------------------- tryFunDeps :: EqRel -> EqCt -> SolverStage () tryFunDeps eq_rel work_item@(EqCt { eq_lhs = lhs, eq_ev = ev }) @@ -3011,12 +2954,15 @@ tryFunDeps eq_rel work_item@(EqCt { eq_lhs = lhs, eq_ev = ev }) -------------------- improveTopFunEqs :: TyCon -> [TcType] -> EqCt -> TcS Bool +-- TyCon is definitely a type family -- See Note [FunDep and implicit parameter reactions] improveTopFunEqs fam_tc args (EqCt { eq_ev = ev, eq_rhs = rhs_ty }) | isGiven ev = improveGivenTopFunEqs fam_tc args ev rhs_ty | otherwise = improveWantedTopFunEqs fam_tc args ev rhs_ty improveGivenTopFunEqs :: TyCon -> [TcType] -> CtEvidence -> Xi -> TcS Bool +-- TyCon is definitely a type family +-- Work-item is a Given improveGivenTopFunEqs fam_tc args ev rhs_ty | Just ops <- isBuiltInSynFamTyCon_maybe fam_tc = do { traceTcS "improveGivenTopFunEqs" (ppr fam_tc <+> ppr args $$ ppr ev $$ ppr rhs_ty) @@ -3026,14 +2972,15 @@ improveGivenTopFunEqs fam_tc args ev rhs_ty , let new_co = mkAxiomRuleCo ax [given_co] ] ; return False } -- False: no unifications | otherwise - = return False -- See Note [No Given/Given fundeps] + = return False where given_co :: Coercion = ctEvCoercion ev improveWantedTopFunEqs :: TyCon -> [TcType] -> CtEvidence -> Xi -> TcS Bool +-- TyCon is definitely a type family +-- Work-item is a Wanted improveWantedTopFunEqs fam_tc args ev rhs_ty - = do { fam_envs <- getFamInstEnvs - ; eqns <- improve_top_fun_eqs fam_envs fam_tc args rhs_ty + = do { eqns <- improve_wanted_top_fun_eqs fam_tc args rhs_ty ; traceTcS "improveTopFunEqs" (vcat [ ppr fam_tc <+> ppr args <+> ppr rhs_ty , ppr eqns ]) ; unifyFunDeps ev Nominal $ \uenv -> @@ -3046,83 +2993,86 @@ improveWantedTopFunEqs fam_tc args ev rhs_ty -- ToDo: this location is wrong; it should be FunDepOrigin2 -- See #14778 -improve_top_fun_eqs :: FamInstEnvs - -> TyCon -> [TcType] -> Xi - -> TcS [TypeEqn] -improve_top_fun_eqs fam_envs fam_tc args rhs_ty +improve_wanted_top_fun_eqs :: TyCon -> [TcType] -> Xi + -> TcS [TypeEqn] +-- TyCon is definitely a type family +improve_wanted_top_fun_eqs fam_tc lhs_tys rhs_ty | Just ops <- isBuiltInSynFamTyCon_maybe fam_tc - = return (map snd $ tryInteractTopFam ops fam_tc args rhs_ty) - - -- see Note [Type inference for type families with injectivity] - | isOpenTypeFamilyTyCon fam_tc - , Injective injective_args <- tyConInjectivityInfo fam_tc - , let fam_insts = lookupFamInstEnvByTyCon fam_envs fam_tc - = -- it is possible to have several compatible equations in an open type - -- family but we only want to derive equalities from one such equation. - do { let improvs = buildImprovementData fam_insts - fi_tvs fi_tys fi_rhs (const Nothing) - - ; traceTcS "improve_top_fun_eqs2" (ppr improvs) - ; concatMapM (injImproveEqns injective_args) $ - take 1 improvs } - - | Just ax <- isClosedSynFamilyTyConWithAxiom_maybe fam_tc - , Injective injective_args <- tyConInjectivityInfo fam_tc - = concatMapM (injImproveEqns injective_args) $ - buildImprovementData (fromBranches (co_ax_branches ax)) - cab_tvs cab_lhs cab_rhs Just + = return (map snd $ tryInteractTopFam ops fam_tc lhs_tys rhs_ty) - | otherwise + -- See Note [Type inference for type families with injectivity] + | Injective inj_args <- tyConInjectivityInfo fam_tc + = do { fam_envs <- getFamInstEnvs + ; top_eqns <- improve_injective_wanted_top fam_envs inj_args fam_tc lhs_tys rhs_ty + ; let local_eqns = improve_injective_wanted_famfam inj_args fam_tc lhs_tys rhs_ty + ; return (local_eqns ++ top_eqns) } + + | otherwise -- No injectivity = return [] +improve_injective_wanted_top :: FamInstEnvs -> [Bool] -> TyCon -> [TcType] -> Xi -> TcS [TypeEqn] +-- Interact with top-level instance declarations +improve_injective_wanted_top fam_envs inj_args fam_tc lhs_tys rhs_ty + = concatMapM do_one branches where - in_scope = mkInScopeSet (tyCoVarsOfType rhs_ty) - - buildImprovementData - :: [a] -- axioms for a TF (FamInst or CoAxBranch) - -> (a -> [TyVar]) -- get bound tyvars of an axiom - -> (a -> [Type]) -- get LHS of an axiom - -> (a -> Type) -- get RHS of an axiom - -> (a -> Maybe CoAxBranch) -- Just => apartness check required - -> [( [Type], Subst, [TyVar], Maybe CoAxBranch )] - -- Result: - -- ( [arguments of a matching axiom] - -- , RHS-unifying substitution - -- , axiom variables without substitution - -- , Maybe matching axiom [Nothing - open TF, Just - closed TF ] ) - buildImprovementData axioms axiomTVs axiomLHS axiomRHS wrap = - [ (ax_args, subst, unsubstTvs, wrap axiom) - | axiom <- axioms - , let ax_args = axiomLHS axiom - ax_rhs = axiomRHS axiom - ax_tvs = axiomTVs axiom - in_scope1 = in_scope `extendInScopeSetList` ax_tvs - , Just subst <- [tcUnifyTyWithTFs False in_scope1 ax_rhs rhs_ty] - , let notInSubst tv = not (tv `elemVarEnv` getTvSubstEnv subst) - unsubstTvs = filter (notInSubst <&&> isTyVar) ax_tvs ] - -- The order of unsubstTvs is important; it must be - -- in telescope order e.g. (k:*) (a:k) - - injImproveEqns :: [Bool] - -> ([Type], Subst, [TyCoVar], Maybe CoAxBranch) - -> TcS [TypeEqn] - injImproveEqns inj_args (ax_args, subst, unsubstTvs, cabr) - = do { subst <- instFlexiX subst unsubstTvs - -- If the current substitution bind [k -> *], and - -- one of the un-substituted tyvars is (a::k), we'd better - -- be sure to apply the current substitution to a's kind. - -- Hence instFlexiX. #13135 was an example. - - ; return [ Pair (substTy subst ax_arg) arg - -- NB: the ax_arg part is on the left - -- see Note [Improvement orientation] - | case cabr of - Just cabr' -> apartnessCheck (substTys subst ax_args) cabr' - _ -> True - , (ax_arg, arg, True) <- zip3 ax_args args inj_args ] } - - -improveLocalFunEqs :: InertCans -> TyCon -> [TcType] -> EqCt -> TcS Bool + branches :: [CoAxBranch] + branches | isOpenTypeFamilyTyCon fam_tc + , (fam_inst1 : _) <- lookupFamInstEnvByTyCon fam_envs fam_tc + = fromBranches (coAxiomBranches (fi_axiom fam_inst1)) + -- fam_inst1: It is possible to have several compatible equations in an open + -- type family but we only want to derive equalities from one such equation. + + | Just ax <- isClosedSynFamilyTyConWithAxiom_maybe fam_tc + = fromBranches (coAxiomBranches ax) + + | otherwise + = [] + + do_one :: CoAxBranch -> TcS [TypeEqn] + do_one branch@(CoAxBranch { cab_tvs = branch_tvs, cab_lhs = branch_lhs_tys, cab_rhs = branch_rhs }) + | let in_scope1 = in_scope `extendInScopeSetList` branch_tvs + , Just subst <- tcUnifyTyWithTFs False in_scope1 branch_rhs rhs_ty + = do { let inSubst tv = tv `elemVarEnv` getTvSubstEnv subst + unsubstTvs = filterOut inSubst branch_tvs + -- The order of unsubstTvs is important; it must be + -- in telescope order e.g. (k:*) (a:k) + + ; subst <- instFlexiX subst unsubstTvs + -- If the current substitution bind [k -> *], and + -- one of the un-substituted tyvars is (a::k), we'd better + -- be sure to apply the current substitution to a's kind. + -- Hence instFlexiX. #13135 was an example. + + ; if apartnessCheck (substTys subst branch_lhs_tys) branch + then return (mkInjectivityEqns inj_args (map (substTy subst) branch_lhs_tys) lhs_tys) + -- NB: The fresh unification variables (from unsubstTvs) are on the left + -- See Note [Improvement orientation] + else return [] } + | otherwise + = return [] + + in_scope = mkInScopeSet (tyCoVarsOfType rhs_ty) + + +improve_injective_wanted_famfam :: [Bool] -> TyCon -> [TcType] -> Xi -> [TypeEqn] +-- Interact with itself, specifically F s1 s2 ~ F t1 t2 +improve_injective_wanted_famfam inj_args fam_tc lhs_tys rhs_ty + | Just (tc, rhs_tys) <- tcSplitTyConApp_maybe rhs_ty + , tc == fam_tc + = mkInjectivityEqns inj_args lhs_tys rhs_tys + | otherwise + = [] + +mkInjectivityEqns :: [Bool] -> [TcType] -> [TcType] -> [TypeEqn] +-- When F s1 s2 s3 ~ F t1 t2 t3, and F has injectivity info [True,False,True] +-- return the equations [Pair s1 t1, Pair s3 t3] +mkInjectivityEqns inj_args lhs_args rhs_args + = [ Pair lhs_arg rhs_arg | (True, lhs_arg, rhs_arg) <- zip3 inj_args lhs_args rhs_args ] + +--------------------------------------------- +improveLocalFunEqs :: InertCans + -> TyCon -> [TcType] -> EqCt -- F args ~ rhs + -> TcS Bool -- Emit equalities from interaction between two equalities improveLocalFunEqs inerts fam_tc args (EqCt { eq_ev = work_ev, eq_rhs = rhs }) | isGiven work_ev = improveGivenLocalFunEqs funeqs_for_tc fam_tc args work_ev rhs @@ -3138,8 +3088,8 @@ improveLocalFunEqs inerts fam_tc args (EqCt { eq_ev = work_ev, eq_rhs = rhs }) improveGivenLocalFunEqs :: [EqCt] -- Inert items, mixture of Given and Wanted - -> TyCon -> [TcType] -> CtEvidence -> Xi -- Work item - -> TcS Bool -- True <=> Something was emitted + -> TyCon -> [TcType] -> CtEvidence -> Xi -- Work item (Given) + -> TcS Bool -- Always False (no unifications) -- Emit equalities from interaction between two Given type-family equalities -- e.g. (x+y1~z, x+y2~z) => (y1 ~ y2) improveGivenLocalFunEqs funeqs_for_tc fam_tc work_args work_ev work_rhs @@ -3152,12 +3102,15 @@ improveGivenLocalFunEqs funeqs_for_tc fam_tc work_args work_ev work_rhs given_co :: Coercion = ctEvCoercion work_ev do_one :: BuiltInSynFamily -> EqCt -> TcS () - do_one ops (EqCt { eq_ev = inert_ev - , eq_lhs = TyFamLHS _ inert_args - , eq_rhs = inert_rhs }) - | isGiven inert_ev + -- Used only work-item is Given + do_one ops EqCt { eq_ev = inert_ev, eq_lhs = inert_lhs, eq_rhs = inert_rhs } + | isGiven inert_ev -- Given/Given interaction + , TyFamLHS _ inert_args <- inert_lhs -- Inert item is F inert_args ~ inert_rhs + , work_rhs `tcEqType` inert_rhs -- Both RHSs are the same , not (null pairs) - = do { traceTcS "improveGivenLocalFunEqs" (vcat[ ppr fam_tc <+> ppr work_args + = -- So we have work_ev : F work_args ~ rhs + -- inert_ev : F inert_args ~ rhs + do { traceTcS "improveGivenLocalFunEqs" (vcat[ ppr fam_tc <+> ppr work_args , text "work_ev" <+> ppr work_ev , text "inert_ev" <+> ppr inert_ev , ppr work_rhs @@ -3167,17 +3120,20 @@ improveGivenLocalFunEqs funeqs_for_tc fam_tc work_args work_ev work_rhs -- fact that it's a combination of Givens, but I don't -- this that matters. where - pairs = [ (Nominal, new_co) - | (ax, _) <- tryInteractInertFam ops fam_tc - work_args work_rhs inert_args inert_rhs - , let new_co = mkAxiomRuleCo ax [given_co, ctEvCoercion inert_ev] ] + pairs = [ (Nominal, mkAxiomRuleCo ax [combined_co]) + | (ax, _) <- tryInteractInertFam ops fam_tc work_args inert_args + , let -- given_co :: F work_args ~ rhs + -- inert_co :: F inert_args ~ rhs + -- the_co :: F work_args ~ F inert_args + inert_co = ctEvCoercion inert_ev + combined_co = given_co `mkTransCo` mkSymCo inert_co ] do_one _ _ = return () improveWantedLocalFunEqs :: [EqCt] -- Inert items (Given and Wanted) - -> TyCon -> [TcType] -> CtEvidence -> Xi -- Work item (wanted) - -> TcS Bool + -> TyCon -> [TcType] -> CtEvidence -> Xi -- Work item (Wanted) + -> TcS Bool -- True <=> some unifications -- Emit improvement equalities for a Wanted constraint, by comparing -- the current work item with inert CFunEqs (boh Given and Wanted) -- E.g. x + y ~ z, x + y' ~ z => [W] y ~ y' @@ -3212,17 +3168,18 @@ improveWantedLocalFunEqs funeqs_for_tc fam_tc args work_ev rhs -------------------- do_one_built_in ops rhs (EqCt { eq_lhs = TyFamLHS _ iargs, eq_rhs = irhs, eq_ev = inert_ev }) - = mk_fd_eqns inert_ev (map snd $ tryInteractInertFam ops fam_tc args rhs iargs irhs) + | irhs `tcEqType` rhs + = mk_fd_eqns inert_ev (map snd $ tryInteractInertFam ops fam_tc args iargs) + | otherwise + = [] do_one_built_in _ _ _ = pprPanic "interactFunEq 1" (ppr fam_tc) -- TyVarLHS -------------------- -- See Note [Type inference for type families with injectivity] do_one_injective inj_args rhs (EqCt { eq_lhs = TyFamLHS _ inert_args , eq_rhs = irhs, eq_ev = inert_ev }) - | not (isGiven inert_ev && isGiven work_ev) -- See Note [No Given/Given fundeps] - , rhs `tcEqType` irhs - = mk_fd_eqns inert_ev $ [ Pair arg iarg - | (arg, iarg, True) <- zip3 args inert_args inj_args ] + | rhs `tcEqType` irhs + = mk_fd_eqns inert_ev $ mkInjectivityEqns inj_args args inert_args | otherwise = [] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d109ecb026479ffd64b8b227fdebae2db6b2afff -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d109ecb026479ffd64b8b227fdebae2db6b2afff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:29:51 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 04 Jul 2024 10:29:51 -0400 Subject: [Git][ghc/ghc][wip/T24978] Add tests for #24845 Message-ID: <6686b1dfd8ccf_dd27fe1b6e41183a5@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: be14df42 by Simon Peyton Jones at 2024-07-04T15:29:38+01:00 Add tests for #24845 - - - - - 4 changed files: - + testsuite/tests/pmcheck/should_compile/T24845.hs - testsuite/tests/pmcheck/should_compile/all.T - + testsuite/tests/typecheck/should_compile/T24845a.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== testsuite/tests/pmcheck/should_compile/T24845.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE DataKinds, GADTs #-} +{-# OPTIONS_GHC -Wall #-} +module M where + +import Data.Proxy +import GHC.TypeLits + +data T n where + Z :: T 0 + S :: Proxy n -> T (n + 1) + +foo :: T 0 -> Bool +foo Z = True +-- Should not warn of non-exhaustive patterns ===================================== testsuite/tests/pmcheck/should_compile/all.T ===================================== @@ -170,3 +170,4 @@ test('DsIncompleteRecSel1', normal, compile, ['-Wincomplete-record-selectors']) test('DsIncompleteRecSel2', normal, compile, ['-Wincomplete-record-selectors']) test('DsIncompleteRecSel3', [collect_compiler_stats('bytes allocated', 10)], compile, ['-Wincomplete-record-selectors']) test('DoubleMatch', normal, compile, [overlapping_incomplete]) +test('T24845', [], compile, [overlapping_incomplete]) ===================================== testsuite/tests/typecheck/should_compile/T24845a.hs ===================================== @@ -0,0 +1,12 @@ +{-# LANGUAGE GHC2021 #-} + +module T24845a where + +import GHC.TypeLits +import Data.Proxy + +f :: (a+b ~ a+c) => Proxy b -> Proxy c +f x = x -- Should be accepted + +g :: (a+b ~ d, a+c ~ d) => Proxy b -> Proxy c +g x = x -- Should be accepted ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,5 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) +test('T24845a', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be14df42b66833cc1a6aa1348473ebb4848fc3f2 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be14df42b66833cc1a6aa1348473ebb4848fc3f2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 14:52:58 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 04 Jul 2024 10:52:58 -0400 Subject: [Git][ghc/ghc][wip/T24978] Wibble Message-ID: <6686b74aa3e99_dd27f1207c1c124468@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: a9123575 by Simon Peyton Jones at 2024-07-04T15:52:36+01:00 Wibble - - - - - 1 changed file: - compiler/GHC/Tc/Solver/Equality.hs Changes: ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -3107,26 +3107,28 @@ improveGivenLocalFunEqs funeqs_for_tc fam_tc work_args work_ev work_rhs | isGiven inert_ev -- Given/Given interaction , TyFamLHS _ inert_args <- inert_lhs -- Inert item is F inert_args ~ inert_rhs , work_rhs `tcEqType` inert_rhs -- Both RHSs are the same - , not (null pairs) - = -- So we have work_ev : F work_args ~ rhs + , -- So we have work_ev : F work_args ~ rhs -- inert_ev : F inert_args ~ rhs - do { traceTcS "improveGivenLocalFunEqs" (vcat[ ppr fam_tc <+> ppr work_args + let pairs :: [(CoAxiomRule, TypeEqn)] + pairs = tryInteractInertFam ops fam_tc work_args inert_args + , not (null pairs) + = do { traceTcS "improveGivenLocalFunEqs" (vcat[ ppr fam_tc <+> ppr work_args , text "work_ev" <+> ppr work_ev , text "inert_ev" <+> ppr inert_ev , ppr work_rhs , ppr pairs ]) - ; emitNewGivens (ctEvLoc inert_ev) pairs } + ; emitNewGivens (ctEvLoc inert_ev) (map mk_ax_co pairs) } -- This CtLoc for the new Givens doesn't reflect the -- fact that it's a combination of Givens, but I don't -- this that matters. where - pairs = [ (Nominal, mkAxiomRuleCo ax [combined_co]) - | (ax, _) <- tryInteractInertFam ops fam_tc work_args inert_args - , let -- given_co :: F work_args ~ rhs - -- inert_co :: F inert_args ~ rhs - -- the_co :: F work_args ~ F inert_args - inert_co = ctEvCoercion inert_ev - combined_co = given_co `mkTransCo` mkSymCo inert_co ] + inert_co = ctEvCoercion inert_ev + mk_ax_co (ax,_) = (Nominal, mkAxiomRuleCo ax [combined_co]) + where + combined_co = given_co `mkTransCo` mkSymCo inert_co + -- given_co :: F work_args ~ rhs + -- inert_co :: F inert_args ~ rhs + -- the_co :: F work_args ~ F inert_args do_one _ _ = return () View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a9123575f42bd1aa00d05bf5951f05976c655343 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a9123575f42bd1aa00d05bf5951f05976c655343 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:09:28 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:09:28 -0400 Subject: [Git][ghc/ghc][master] compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <6686bb28a7119_dd27f1739e10133059@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 2 changed files: - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Finder/Types.hs Changes: ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -5,15 +5,15 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE RecordWildCards #-} -- | Module finder module GHC.Unit.Finder ( FindResult(..), InstalledFindResult(..), FinderOpts(..), - FinderCache, + FinderCache(..), initFinderCache, - flushFinderCaches, findImportedModule, findPluginModule, findExactModule, @@ -26,14 +26,10 @@ module GHC.Unit.Finder ( mkObjPath, addModuleToFinder, addHomeModuleToFinder, - uncacheModule, mkStubPaths, findObjectLinkableMaybe, findObjectLinkable, - - -- Hash cache - lookupFileCache ) where import GHC.Prelude @@ -91,41 +87,35 @@ type BaseName = OsPath -- Basename of file initFinderCache :: IO FinderCache -initFinderCache = FinderCache <$> newIORef emptyInstalledModuleEnv - <*> newIORef M.empty - --- remove all the home modules from the cache; package modules are --- assumed to not move around during a session; also flush the file hash --- cache -flushFinderCaches :: FinderCache -> UnitEnv -> IO () -flushFinderCaches (FinderCache ref file_ref) ue = do - atomicModifyIORef' ref $ \fm -> (filterInstalledModuleEnv is_ext fm, ()) - atomicModifyIORef' file_ref $ \_ -> (M.empty, ()) - where - is_ext mod _ = not (isUnitEnvInstalledModule ue mod) - -addToFinderCache :: FinderCache -> InstalledModule -> InstalledFindResult -> IO () -addToFinderCache (FinderCache ref _) key val = - atomicModifyIORef' ref $ \c -> (extendInstalledModuleEnv c key val, ()) - -removeFromFinderCache :: FinderCache -> InstalledModule -> IO () -removeFromFinderCache (FinderCache ref _) key = - atomicModifyIORef' ref $ \c -> (delInstalledModuleEnv c key, ()) - -lookupFinderCache :: FinderCache -> InstalledModule -> IO (Maybe InstalledFindResult) -lookupFinderCache (FinderCache ref _) key = do - c <- readIORef ref - return $! lookupInstalledModuleEnv c key - -lookupFileCache :: FinderCache -> FilePath -> IO Fingerprint -lookupFileCache (FinderCache _ ref) key = do - c <- readIORef ref - case M.lookup key c of - Nothing -> do - hash <- getFileHash key - atomicModifyIORef' ref $ \c -> (M.insert key hash c, ()) - return hash - Just fp -> return fp +initFinderCache = do + mod_cache <- newIORef emptyInstalledModuleEnv + file_cache <- newIORef M.empty + let flushFinderCaches :: UnitEnv -> IO () + flushFinderCaches ue = do + atomicModifyIORef' mod_cache $ \fm -> (filterInstalledModuleEnv is_ext fm, ()) + atomicModifyIORef' file_cache $ \_ -> (M.empty, ()) + where + is_ext mod _ = not (isUnitEnvInstalledModule ue mod) + + addToFinderCache :: InstalledModule -> InstalledFindResult -> IO () + addToFinderCache key val = + atomicModifyIORef' mod_cache $ \c -> (extendInstalledModuleEnv c key val, ()) + + lookupFinderCache :: InstalledModule -> IO (Maybe InstalledFindResult) + lookupFinderCache key = do + c <- readIORef mod_cache + return $! lookupInstalledModuleEnv c key + + lookupFileCache :: FilePath -> IO Fingerprint + lookupFileCache key = do + c <- readIORef file_cache + case M.lookup key c of + Nothing -> do + hash <- getFileHash key + atomicModifyIORef' file_cache $ \c -> (M.insert key hash c, ()) + return hash + Just fp -> return fp + return FinderCache{..} -- ----------------------------------------------------------------------------- -- The three external entry points @@ -343,11 +333,6 @@ addHomeModuleToFinder fc home_unit mod_name loc = do addToFinderCache fc mod (InstalledFound loc mod) return (mkHomeModule home_unit mod_name) -uncacheModule :: FinderCache -> HomeUnit -> ModuleName -> IO () -uncacheModule fc home_unit mod_name = do - let mod = mkHomeInstalledModule home_unit mod_name - removeFromFinderCache fc mod - -- ----------------------------------------------------------------------------- -- The internal workers ===================================== compiler/GHC/Unit/Finder/Types.hs ===================================== @@ -1,6 +1,7 @@ module GHC.Unit.Finder.Types ( FinderCache (..) , FinderCacheState + , FileCacheState , FindResult (..) , InstalledFindResult (..) , FinderOpts(..) @@ -13,8 +14,8 @@ import GHC.Data.OsPath import qualified Data.Map as M import GHC.Fingerprint import GHC.Platform.Ways +import GHC.Unit.Env -import Data.IORef import GHC.Data.FastString import qualified Data.Set as Set @@ -25,8 +26,17 @@ import qualified Data.Set as Set -- type FinderCacheState = InstalledModuleEnv InstalledFindResult type FileCacheState = M.Map FilePath Fingerprint -data FinderCache = FinderCache { fcModuleCache :: (IORef FinderCacheState) - , fcFileCache :: (IORef FileCacheState) +data FinderCache = FinderCache { flushFinderCaches :: UnitEnv -> IO () + -- ^ remove all the home modules from the cache; package modules are + -- assumed to not move around during a session; also flush the file hash + -- cache. + , addToFinderCache :: InstalledModule -> InstalledFindResult -> IO () + -- ^ Add a found location to the cache for the module. + , lookupFinderCache :: InstalledModule -> IO (Maybe InstalledFindResult) + -- ^ Look for a location in the cache. + , lookupFileCache :: FilePath -> IO Fingerprint + -- ^ Look for the hash of a file in the cache. This should add it to the + -- cache. If the file doesn't exist, raise an IOException. } data InstalledFindResult View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0d170eafacba55325dc00d0434d4462275d4376e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0d170eafacba55325dc00d0434d4462275d4376e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:10:05 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:10:05 -0400 Subject: [Git][ghc/ghc][master] 2 commits: Add HasCallStack to T23221 Message-ID: <6686bb4dc1e03_dd27f1844238138816@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 5 changed files: - docs/users_guide/9.12.1-notes.rst - rts/sm/GC.c - rts/sm/Storage.c - rts/sm/Storage.h - testsuite/tests/rts/T23221.hs Changes: ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -91,6 +91,11 @@ Runtime system - Reduce fragmentation incurred by the nonmoving GC's segment allocator. In one application this reduced resident set size by 26%. See :ghc-ticket:`24150`. +- Memory return logic now uses live bytes rather than live blocks to measure the size of the heap. + This primarily affects the non-moving GC, which should now be more willing to return memory to the OS. + Users who have fine-tuned the :rts-flag:`-F ⟨factor⟩`, :rts-flag:`-Fd ⟨factor⟩`, or :rts-flag:`-O ⟨size⟩` flags, + and use the non-moving GC, should see if adjustments are needed in light of this change. + - The new runtime flag :rts-flag:`--read-tix-file=\` allows to modify whether a preexisting .tix file is read in at the beginning of a program run. The default is currently ``--read-tix-file=yes`` but will change to ``--read-tix-file=no`` in a future version of GHC. For this reason, a warning is emitted if a .tix file is read in implicitly. You can silence this warning by explicitly passing ``--read-tix-file=yes``. ===================================== rts/sm/GC.c ===================================== @@ -1005,10 +1005,15 @@ GarbageCollect (struct GcConfig config, need_copied_live = 0; need_uncopied_live = 0; for (i = 0; i < RtsFlags.GcFlags.generations; i++) { - need_copied_live += genLiveCopiedBlocks(&generations[i]); - need_uncopied_live += genLiveUncopiedBlocks(&generations[i]); + need_copied_live += genLiveCopiedWords(&generations[i]); + need_uncopied_live += genLiveUncopiedWords(&generations[i]); } + // Convert the live words into live blocks + // See Note [Statistics for retaining memory] + need_copied_live = BLOCK_ROUND_UP(need_copied_live) / BLOCK_SIZE_W; + need_uncopied_live = BLOCK_ROUND_UP(need_uncopied_live) / BLOCK_SIZE_W; + debugTrace(DEBUG_gc, "(before) copied_live: %d; uncopied_live: %d", need_copied_live, need_uncopied_live ); @@ -1032,7 +1037,7 @@ GarbageCollect (struct GcConfig config, ASSERT(need_uncopied_live + need_copied_live >= RtsFlags.GcFlags.minOldGenSize ); - debugTrace(DEBUG_gc, "(after) copyied_live: %d; uncopied_live: %d", need_copied_live, need_uncopied_live ); + debugTrace(DEBUG_gc, "(after) copied_live: %d; uncopied_live: %d", need_copied_live, need_uncopied_live ); need_prealloc = 0; for (i = 0; i < n_nurseries; i++) { @@ -1070,7 +1075,7 @@ GarbageCollect (struct GcConfig config, W_ scaled_needed = ((scaled_factor + unavoidable_copied_need_factor) * need_copied_live) + ((scaled_factor + unavoidable_uncopied_need_factor) * need_uncopied_live); - debugTrace(DEBUG_gc, "factors_2: %f %d", ((scaled_factor + unavoidable_copied_need_factor) * need_copied_live), ((scaled_factor + unavoidable_uncopied_need_factor) * need_uncopied_live)); + debugTrace(DEBUG_gc, "factors_2: %f %f", ((scaled_factor + unavoidable_copied_need_factor) * need_copied_live), ((scaled_factor + unavoidable_uncopied_need_factor) * need_uncopied_live)); need = need_prealloc + scaled_needed; /* Also, if user set heap size, do not drop below it. @@ -2426,3 +2431,39 @@ bool doIdleGCWork(Capability *cap STG_UNUSED, bool all) * */ + +/* Note [Statistics for retaining memory] +* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* +* At the end of GC, we want to determine the size of the heap in order to +* determine the amount of memory we wish to return to the OS, or if we want +* to increase the heap size to the minimum. +* +* There's two promising candidates for this metric: live words, and live blocks. +* +* Measuring live blocks is promising because blocks are the smallest unit +* that the storage manager can (de)allocate. +* Most of the time live words and live blocks are very similar. +* +* But the two metrics can come apart when the heap is dominated +* by small pinned objects, or when using the non-moving collector. +* +* In both cases, this happens because objects cannot be copied, so +* block occupancy can fall as objects in a block become garbage. +* In situations like this, using live blocks to determine memory +* retention behaviour can lead to us being overly conservative. +* +* Instead we use live words rounded up to the block size to measure +* heap size. This gives us a more accurate picture of the heap. +* +* This works particularly well with the nonmoving collector as we +* can reuse the space taken up by dead heap objects. This choice is less good +* for fragmentation caused by a few pinned objects retaining blocks. +* In that case, the block can only be reused if it is deallocated in its entirety. +* And therefore using live blocks would be more accurate in this case. +* We assume that this is relatively rare and when it does happen, +* this fragmentation is a problem that should be addressed in its own right. +* +* See: #23397 +* +*/ ===================================== rts/sm/Storage.c ===================================== @@ -1645,11 +1645,36 @@ W_ countOccupied (bdescr *bd) return words; } -// Returns the total number of live blocks +// Returns the total number of live words W_ genLiveWords (generation *gen) { - return (gen->live_estimate ? gen->live_estimate : gen->n_words) + - gen->n_large_words + gen->n_compact_blocks * BLOCK_SIZE_W; + return genLiveCopiedWords(gen) + genLiveUncopiedWords(gen); +} + +// The number of live words which will be copied by the copying collector. +W_ genLiveCopiedWords (generation *gen) +{ + if (gen == oldest_gen && RtsFlags.GcFlags.useNonmoving){ + // the non-moving generation doesn't contain any copied data + return 0; + } else { + return gen->live_estimate ? gen->live_estimate : gen->n_words; + } +} + +// The number of live words which will not be copied by the copying collector +// This includes data living in non-moving collector segments, compact blocks and large/pinned blocks. +W_ genLiveUncopiedWords(generation *gen) +{ + W_ nonmoving_blocks = 0; + // The nonmoving heap contains some blocks that live outside the regular generation structure. + if (gen == oldest_gen && RtsFlags.GcFlags.useNonmoving){ + nonmoving_blocks = + (gen->live_estimate ? gen->live_estimate : gen->n_words) + + nonmoving_large_words + + nonmoving_compact_words; + } + return gen->n_large_words + gen->n_compact_blocks * BLOCK_SIZE_W + nonmoving_blocks; } // The number of live blocks which will be copied by the copying collector. ===================================== rts/sm/Storage.h ===================================== @@ -111,6 +111,8 @@ StgWord gcThreadLiveWords (uint32_t i, uint32_t g); StgWord gcThreadLiveBlocks (uint32_t i, uint32_t g); StgWord genLiveWords (generation *gen); +StgWord genLiveCopiedWords (generation *gen); +StgWord genLiveUncopiedWords (generation *gen); StgWord genLiveBlocks (generation *gen); StgWord genLiveCopiedBlocks (generation *gen); StgWord genLiveUncopiedBlocks (generation *gen); ===================================== testsuite/tests/rts/T23221.hs ===================================== @@ -10,6 +10,7 @@ import Debug.Trace import Control.Monad import GHC.Stats import Data.Word +import GHC.Stack (HasCallStack) -- This test is for checking the memory return behaviour of blocks which will be -- copied and blocks which are not copied (#23221) @@ -25,6 +26,7 @@ main = do -- The upper_bound is the upper bound on how much total memory should be live at the end -- of the test as a factor of the expected live bytes. +loop :: HasCallStack => (Int -> IO a) -> Double -> Double -> Int -> IO () loop f lower_bound upper_bound n = do ba <- mapM (\_ -> f 128) [0..n] traceMarkerIO "Allocated_all" @@ -39,7 +41,7 @@ loop f lower_bound upper_bound n = do evaluate (length (reverse ba')) return total_mem -checkStats :: Double -> Double -> Int -> IO () +checkStats :: HasCallStack => Double -> Double -> Int -> IO () checkStats lower_bound upper_bound n = do stats <- getRTSStats let expected_live_memory = fromIntegral n -- How many objects View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d170eafacba55325dc00d0434d4462275d4376e...66919dcca33b11eca182671ae299fe09effa92fb -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d170eafacba55325dc00d0434d4462275d4376e...66919dcca33b11eca182671ae299fe09effa92fb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:12:45 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:12:45 -0400 Subject: [Git][ghc/ghc][master] Add reflections of GHC.TypeLits/Nats type families Message-ID: <6686bbecf038b_dd27f1c145481536b7@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 7 changed files: - libraries/ghc-experimental/ghc-experimental.cabal - + libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs - + libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs - testsuite/tests/interface-stability/ghc-experimental-exports.stdout - + testsuite/tests/numeric/should_run/T24245.hs - + testsuite/tests/numeric/should_run/T24245.stdout - testsuite/tests/numeric/should_run/all.T Changes: ===================================== libraries/ghc-experimental/ghc-experimental.cabal ===================================== @@ -23,9 +23,11 @@ common warnings library import: warnings exposed-modules: - GHC.Profiling.Eras - Data.Tuple.Experimental Data.Sum.Experimental + Data.Tuple.Experimental + GHC.Profiling.Eras + GHC.TypeLits.Experimental + GHC.TypeNats.Experimental Prelude.Experimental if arch(wasm32) exposed-modules: GHC.Wasm.Prim ===================================== libraries/ghc-experimental/src/GHC/TypeLits/Experimental.hs ===================================== @@ -0,0 +1,24 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE NoStarIsType #-} +{-# LANGUAGE TypeOperators #-} +module GHC.TypeLits.Experimental ( + appendSSymbol, + consSSymbol, + sCharToSNat, + sNatToSChar, +) where + +import GHC.Internal.TypeLits +import Data.Char (ord, chr) + +appendSSymbol :: SSymbol a -> SSymbol b -> SSymbol (AppendSymbol a b) +appendSSymbol (UnsafeSSymbol a) (UnsafeSSymbol b) = UnsafeSSymbol (a ++ b) + +consSSymbol :: SChar a -> SSymbol b -> SSymbol (ConsSymbol a b) +consSSymbol (UnsafeSChar a) (UnsafeSSymbol b) = UnsafeSSymbol (a : b) + +sCharToSNat :: SChar a -> SNat (CharToNat a) +sCharToSNat (UnsafeSChar a) = UnsafeSNat (fromIntegral (ord a)) + +sNatToSChar :: (n <= 1114111) => SNat n -> SChar (NatToChar n) +sNatToSChar (UnsafeSNat n) = UnsafeSChar (chr (fromIntegral n)) ===================================== libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs ===================================== @@ -0,0 +1,36 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE NoStarIsType #-} +{-# LANGUAGE TypeOperators #-} +module GHC.TypeNats.Experimental ( + plusSNat, + timesSNat, + powerSNat, + minusSNat, + divSNat, + modSNat, + log2SNat, +) where + +import GHC.Internal.TypeNats +import GHC.Num.Natural (naturalLog2) + +plusSNat :: SNat n -> SNat m -> SNat (n + m) +plusSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n + m) + +timesSNat :: SNat n -> SNat m -> SNat (n * m) +timesSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n * m) + +powerSNat :: SNat n -> SNat m -> SNat (n ^ m) +powerSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n ^ m) + +minusSNat :: (m <= n) => SNat n -> SNat m -> SNat (n - m) +minusSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (n - m) + +divSNat :: (1 <= m) => SNat n -> SNat m -> SNat (Div n m) +divSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (div n m) + +modSNat :: (1 <= m) => SNat n -> SNat m -> SNat (Mod n m) +modSNat (UnsafeSNat n) (UnsafeSNat m) = UnsafeSNat (mod n m) + +log2SNat :: (1 <= n) => SNat n -> SNat (Log2 n) +log2SNat (UnsafeSNat n) = UnsafeSNat (fromIntegral (naturalLog2 n)) ===================================== testsuite/tests/interface-stability/ghc-experimental-exports.stdout ===================================== @@ -4322,6 +4322,23 @@ module GHC.Profiling.Eras where incrementUserEra :: GHC.Types.Word -> GHC.Types.IO GHC.Types.Word setUserEra :: GHC.Types.Word -> GHC.Types.IO () +module GHC.TypeLits.Experimental where + -- Safety: Safe-Inferred + appendSSymbol :: forall (a :: GHC.Types.Symbol) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SSymbol a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.AppendSymbol a b) + consSSymbol :: forall (a :: GHC.Types.Char) (b :: GHC.Types.Symbol). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeLits.SSymbol b -> GHC.Internal.TypeLits.SSymbol (GHC.Internal.TypeLits.ConsSymbol a b) + sCharToSNat :: forall (a :: GHC.Types.Char). GHC.Internal.TypeLits.SChar a -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeLits.CharToNat a) + sNatToSChar :: forall (n :: GHC.Num.Natural.Natural). (n GHC.Internal.Data.Type.Ord.<= 1114111) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeLits.SChar (GHC.Internal.TypeLits.NatToChar n) + +module GHC.TypeNats.Experimental where + -- Safety: None + divSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Div n m) + log2SNat :: forall (n :: GHC.Num.Natural.Natural). (1 GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Log2 n) + minusSNat :: forall (m :: GHC.Internal.TypeNats.Nat) (n :: GHC.Internal.TypeNats.Nat). (m GHC.Internal.Data.Type.Ord.<= n) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.- m) + modSNat :: forall (m :: GHC.Num.Natural.Natural) (n :: GHC.Internal.TypeNats.Nat). (1 GHC.Internal.Data.Type.Ord.<= m) => GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (GHC.Internal.TypeNats.Mod n m) + plusSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.+ m) + powerSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.^ m) + timesSNat :: forall (n :: GHC.Internal.TypeNats.Nat) (m :: GHC.Internal.TypeNats.Nat). GHC.Internal.TypeNats.SNat n -> GHC.Internal.TypeNats.SNat m -> GHC.Internal.TypeNats.SNat (n GHC.Internal.TypeNats.* m) + module Prelude.Experimental where -- Safety: Trustworthy type CSolo :: Constraint -> Constraint ===================================== testsuite/tests/numeric/should_run/T24245.hs ===================================== @@ -0,0 +1,83 @@ +{-# LANGUAGE DataKinds #-} +module Main where + +import GHC.TypeLits +import GHC.TypeNats.Experimental +import GHC.TypeLits.Experimental + +main :: IO () +main = do + testBinary plusSNat (SNat @2) (SNat @3) SNat + testBinary timesSNat (SNat @2) (SNat @3) SNat + testBinary powerSNat (SNat @2) (SNat @3) SNat + testBinary minusSNat (SNat @7) (SNat @3) SNat + testBinary divSNat (SNat @7) (SNat @3) SNat + testBinary modSNat (SNat @7) (SNat @3) SNat + testUnary log2SNat (SNat @7) SNat + + testBinaryS appendSSymbol (SSymbol @"foo") (SSymbol @"bar") SSymbol + testBinaryCSS consSSymbol (SChar @'x') (SSymbol @"yz") SSymbol + testUnaryCN sCharToSNat (SChar @'x') SNat + testUnaryNC sNatToSChar (SNat @62) SChar + +testBinary + :: (SNat a -> SNat b -> SNat c) + -> SNat a + -> SNat b + -> SNat c + -> IO () +testBinary f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testUnary + :: (SNat a -> SNat b) + -> SNat a + -> SNat b + -> IO () +testUnary f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +testBinaryS + :: (SSymbol a -> SSymbol b -> SSymbol c) + -> SSymbol a + -> SSymbol b + -> SSymbol c + -> IO () +testBinaryS f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testBinaryCSS + :: (SChar a -> SSymbol b -> SSymbol c) + -> SChar a + -> SSymbol b + -> SSymbol c + -> IO () +testBinaryCSS f n m p = do + print (f n m, p) + assertEqualOnShow (f n m) p + +testUnaryCN + :: (SChar a -> SNat b) + -> SChar a + -> SNat b + -> IO () +testUnaryCN f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +testUnaryNC + :: (SNat a -> SChar b) + -> SNat a + -> SChar b + -> IO () +testUnaryNC f n m = do + print (f n, m) + assertEqualOnShow (f n) m + +assertEqualOnShow :: Show a => a -> a -> IO () +assertEqualOnShow x y + | show x == show y = return () + | otherwise = fail "inequality" ===================================== testsuite/tests/numeric/should_run/T24245.stdout ===================================== @@ -0,0 +1,11 @@ +(SNat @5,SNat @5) +(SNat @6,SNat @6) +(SNat @8,SNat @8) +(SNat @4,SNat @4) +(SNat @2,SNat @2) +(SNat @1,SNat @1) +(SNat @2,SNat @2) +(SSymbol @"foobar",SSymbol @"foobar") +(SSymbol @"xyz",SSymbol @"xyz") +(SNat @120,SNat @120) +(SChar @'>',SChar @'>') ===================================== testsuite/tests/numeric/should_run/all.T ===================================== @@ -85,3 +85,4 @@ test('T22671', js_fragile(24259), compile_and_run, ['']) test('foundation', [when(js_arch(), run_timeout_multiplier(2)), js_fragile(24259)], compile_and_run, ['-O -package transformers']) test('T24066', normal, compile_and_run, ['']) test('div01', normal, compile_and_run, ['']) +test('T24245', normal, compile_and_run, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8dfca66a1eb1732e443600fc7a7c71df7f5786b7 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8dfca66a1eb1732e443600fc7a7c71df7f5786b7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:13:56 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:13:56 -0400 Subject: [Git][ghc/ghc][master] Correct -Wpartial-fields warning to say "Definition" rather than "Use" Message-ID: <6686bc34dc360_dd27f1f36d5c15824d@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 5 changed files: - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - docs/users_guide/using-warnings.rst - testsuite/tests/overloadedrecflds/should_fail/DRFPartialFields.stderr - testsuite/tests/typecheck/should_compile/T7169.stderr Changes: ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -1501,8 +1501,9 @@ instance Diagnostic TcRnMessage where text "You may define an abstract closed type family" $$ text "only in a .hs-boot file" TcRnPartialFieldSelector fld -> mkSimpleDecorated $ - sep [text "Use of partial record field selector" <> colon, - nest 2 $ quotes (ppr (occName fld))] + vcat [ sep [ text "Definition of partial record field" <> colon + , nest 2 $ quotes (ppr (occName fld)) ] + , text "Record selection and update using this field will be partial." ] TcRnHasFieldResolvedIncomplete name -> mkSimpleDecorated $ text "The invocation of `getField` on the record field" <+> quotes (ppr name) <+> text "may produce an error since it is not defined for all data constructors" ===================================== compiler/GHC/Tc/Errors/Types.hs ===================================== @@ -3503,7 +3503,7 @@ data TcRnMessage where -} TcRnAbstractClosedTyFamDecl :: TcRnMessage - {-| TcRnPartialFieldSelector is a warning indicating that a record selector + {-| TcRnPartialFieldSelector is a warning indicating that a record field was not defined for all constructors of a data type. Test cases: ===================================== docs/users_guide/using-warnings.rst ===================================== @@ -2154,7 +2154,7 @@ of ``-W(no-)*``. The option :ghc-flag:`-Wpartial-fields` warns about a record field ``f`` that is defined in some, but not all, of the constructors of a - data type, as such selector functions are partial. For example, when + data type, as record selection and update will be partial. For example, when :ghc-flag:`-Wpartial-fields` is enabled the compiler will emit a warning at the definition of ``Foo`` below: :: @@ -2164,8 +2164,9 @@ of ``-W(no-)*``. data Foo = Foo { _f :: Int } | Bar - Another related warning is :ghc-flag:`-Wincomplete-record-selectors`, - which warns at use sites rather than definition sites. + Related warnings are :ghc-flag:`-Wincomplete-record-selectors` and + :ghc-flag:`-Wincomplete-record-updates`, + which warn at use sites rather than definition sites. .. ghc-flag:: -Wunused-packages :shortdesc: warn when package is requested on command line, but not needed. ===================================== testsuite/tests/overloadedrecflds/should_fail/DRFPartialFields.stderr ===================================== @@ -1,3 +1,4 @@ DRFPartialFields.hs:4:17: error: [GHC-82712] [-Wpartial-fields, Werror=partial-fields] - Use of partial record field selector: ‘foo’ + Definition of partial record field: ‘foo’ + Record selection and update using this field will be partial. ===================================== testsuite/tests/typecheck/should_compile/T7169.stderr ===================================== @@ -1,2 +1,3 @@ T7169.hs:11:5: warning: [GHC-82712] [-Wpartial-fields] - Use of partial record field selector: ‘m2’ + Definition of partial record field: ‘m2’ + Record selection and update using this field will be partial. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6c469bd2f5632ca59b691d07956ee61c717efbc0 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6c469bd2f5632ca59b691d07956ee61c717efbc0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:14:27 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:14:27 -0400 Subject: [Git][ghc/ghc][master] GHCi: Support local Prelude Message-ID: <6686bc53b9138_dd27f1f36d5c16253@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 13 changed files: - compiler/GHC.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Utils/TmpFs.hs - docs/users_guide/9.12.1-notes.rst - ghc/GHCi/UI.hs - testsuite/tests/diagnostic-codes/codes.stdout - + testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs - + testsuite/tests/ghci/should_run/T10920.hs - + testsuite/tests/ghci/should_run/T10920.script - + testsuite/tests/ghci/should_run/T10920.stderr - + testsuite/tests/ghci/should_run/T10920.stdout - testsuite/tests/ghci/should_run/all.T Changes: ===================================== compiler/GHC.hs ===================================== @@ -365,6 +365,7 @@ import GHC.Parser.Lexer import GHC.Parser.Annotation import GHC.Parser.Utils +import GHC.Iface.Env ( trace_if ) import GHC.Iface.Load ( loadSysInterface ) import GHC.Hs import GHC.Builtin.Types.Prim ( alphaTyVars ) @@ -1713,6 +1714,7 @@ findModule mod_name maybe_pkg = do findQualifiedModule :: GhcMonad m => PkgQual -> ModuleName -> m Module findQualifiedModule pkgqual mod_name = withSession $ \hsc_env -> do + liftIO $ trace_if (hsc_logger hsc_env) (text "findQualifiedModule" <+> ppr mod_name <+> ppr pkgqual) let mhome_unit = hsc_home_unit_maybe hsc_env let dflags = hsc_dflags hsc_env case pkgqual of @@ -1775,7 +1777,8 @@ lookupQualifiedModule NoPkgQual mod_name = withSession $ \hsc_env -> do lookupQualifiedModule pkgqual mod_name = findQualifiedModule pkgqual mod_name lookupLoadedHomeModule :: GhcMonad m => UnitId -> ModuleName -> m (Maybe Module) -lookupLoadedHomeModule uid mod_name = withSession $ \hsc_env -> +lookupLoadedHomeModule uid mod_name = withSession $ \hsc_env -> do + liftIO $ trace_if (hsc_logger hsc_env) (text "lookupLoadedHomeModule" <+> ppr mod_name <+> ppr uid) case lookupHug (hsc_HUG hsc_env) uid mod_name of Just mod_info -> return (Just (mi_module (hm_iface mod_info))) _not_a_home_module -> return Nothing ===================================== compiler/GHC/Iface/Env.hs ===================================== @@ -269,9 +269,9 @@ newIfaceNames occs | (occ,uniq) <- occs `zip` uniqs] } trace_if :: Logger -> SDoc -> IO () -{-# INLINE trace_if #-} +{-# INLINE trace_if #-} -- see Note [INLINE conditional tracing utilities] trace_if logger doc = when (logHasDumpFlag logger Opt_D_dump_if_trace) $ putMsg logger doc trace_hi_diffs :: Logger -> SDoc -> IO () -{-# INLINE trace_hi_diffs #-} +{-# INLINE trace_hi_diffs #-} -- see Note [INLINE conditional tracing utilities] trace_hi_diffs logger doc = when (logHasDumpFlag logger Opt_D_dump_hi_diffs) $ putMsg logger doc ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -444,9 +444,6 @@ loadInterface doc_str mod from ; case lookupIfaceByModule hug (eps_PIT eps) mod of { Just iface -> return (Succeeded iface) ; -- Already loaded - -- The (src_imp == mi_boot iface) test checks that the already-loaded - -- interface isn't a boot iface. This can conceivably happen, - -- if an earlier import had a before we got to real imports. I think. _ -> do { -- READ THE MODULE IN ===================================== compiler/GHC/Utils/TmpFs.hs ===================================== @@ -377,18 +377,27 @@ the process id). This is ok, as the temporary directory used contains the pid (see getTempDir). -} + +manyWithTrace :: Logger -> String -> ([FilePath] -> IO ()) -> [FilePath] -> IO () +manyWithTrace _ _ _ [] = pure () -- do silent nothing on zero filepaths +manyWithTrace logger phase act paths + = traceCmd logger phase ("Deleting: " ++ unwords paths) (act paths) + removeTmpDirs :: Logger -> [FilePath] -> IO () -removeTmpDirs logger ds - = traceCmd logger "Deleting temp dirs" - ("Deleting: " ++ unwords ds) - (mapM_ (removeWith logger removeDirectory) ds) +removeTmpDirs logger + = manyWithTrace logger "Deleting temp dirs" + (mapM_ (removeWith logger removeDirectory)) + +removeTmpSubdirs :: Logger -> [FilePath] -> IO () +removeTmpSubdirs logger + = manyWithTrace logger "Deleting temp subdirs" + (mapM_ (removeWith logger removeDirectory)) removeTmpFiles :: Logger -> [FilePath] -> IO () removeTmpFiles logger fs = warnNon $ - traceCmd logger "Deleting temp files" - ("Deleting: " ++ unwords deletees) - (mapM_ (removeWith logger removeFile) deletees) + manyWithTrace logger "Deleting temp files" + (mapM_ (removeWith logger removeFile)) deletees where -- Flat out refuse to delete files that are likely to be source input -- files (is there a worse bug than having a compiler delete your source @@ -405,12 +414,6 @@ removeTmpFiles logger fs (non_deletees, deletees) = partition isHaskellUserSrcFilename fs -removeTmpSubdirs :: Logger -> [FilePath] -> IO () -removeTmpSubdirs logger fs - = traceCmd logger "Deleting temp subdirs" - ("Deleting: " ++ unwords fs) - (mapM_ (removeWith logger removeDirectory) fs) - removeWith :: Logger -> (FilePath -> IO ()) -> FilePath -> IO () removeWith logger remover f = remover f `Exception.catchIO` (\e -> ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -85,6 +85,9 @@ Compiler GHCi ~~~~ +- Fix a bug where GHCi would not start alongside a local file called ``Prelude.hs`` + or ``Prelude.lhs`` (:ghc-ticket:`10920`). + Runtime system ~~~~~~~~~~~~~~ ===================================== ghc/GHCi/UI.hs ===================================== @@ -2255,7 +2255,7 @@ keepPackageImports = filterM is_pkg_import is_pkg_import :: GHC.GhcMonad m => InteractiveImport -> m Bool is_pkg_import (IIModule _) = return False is_pkg_import (IIDecl d) - = do pkgqual <- GHC.renameRawPkgQualM (unLoc $ ideclName d) (ideclPkgQual d) + = do pkgqual <- GHC.renameRawPkgQualM mod_name (ideclPkgQual d) e <- MC.try $ GHC.findQualifiedModule pkgqual mod_name case e :: Either SomeException Module of Left _ -> return False @@ -2263,7 +2263,30 @@ keepPackageImports = filterM is_pkg_import where mod_name = unLoc (ideclName d) +{- Note [GHCi and local Preludes] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +GHC's compilation manager has no issues when the package being compiled +defines its own local Prelude module. It'll just shadow the Prelude from base. +GHCi however must check this condition, when it calls setContext ["Prelude"] +to prepopulate the interactive session's scope. This is because of two facts. + +1. setContext must use previously compiled .hi interfaces only; it cannot +recurse into compiling .hs modules (even with LinkIntoMemory), simply because +it's not the right phase to do it. Import resolution happens way before GHC +properly "loads" modules (GHC.Linker.Loader.loadModule, GHC.load & siblings); +or in other words, at time of setContext the linker isn't even initialized yet. + +2. The local Prelude.hs (or .lhs) may've never been compiled before, so its +interface file Prelude.hi can be outdated or altogether missing. + +Thankfully, there's a simple solution: just let CM load the local Prelude normally +(either as a :load target, or as a dependency of another target) later. To do that, +detect if the implicit `import Prelude` resolves to the "home unit" (i.e. not base), +and if so, omit it from the early setContext call. + +If we don't, a HomeModError will be (correctly) thrown. See #10920. +-} modulesLoadedMsg :: GHC.GhcMonad m => SuccessFlag -> [GHC.ModSummary] -> LoadType -> m () modulesLoadedMsg ok mods load_type = do @@ -2827,7 +2850,7 @@ checkAdd ii = do m <- GHC.lookupQualifiedModule pkgqual modname when safe $ do t <- GHC.isModuleTrusted m - when (not t) $ throwGhcException $ ProgramError $ "" + unless t $ throwGhcException $ ProgramError $ "" -- ----------------------------------------------------------------------------- -- Update the GHC API's view of the context @@ -2881,7 +2904,8 @@ getImplicitPreludeImports iidecls = do , not (any (sameImpModule imp) iidecls) ] else [] - return prel_iidecls + -- See Note [GHCi and local Preludes] + keepPackageImports prel_iidecls -- ----------------------------------------------------------------------------- -- Utils on InteractiveImport ===================================== testsuite/tests/diagnostic-codes/codes.stdout ===================================== @@ -92,7 +92,6 @@ [GHC-41843] is untested (constructor = IOResultExpected) [GHC-07641] is untested (constructor = AtLeastOneArgExpected) [GHC-64852] is untested (constructor = BadSourceImport) -[GHC-58427] is untested (constructor = HomeModError) [GHC-94559] is untested (constructor = CouldntFindInFiles) [GHC-22211] is untested (constructor = MissingPackageFiles) [GHC-88719] is untested (constructor = MissingPackageWayFiles) ===================================== testsuite/tests/ghci/should_run/LocalPrelude/Prelude.hs ===================================== @@ -0,0 +1,9 @@ +module Prelude + (storefront, module Reexport) where + +import Data.Semigroup as Reexport ((<>)) +import System.IO as Reexport (putStrLn) + +storefront = "A project-local Prelude" + +backyard = "unexported local definition -- shall be visible only after *-import" ===================================== testsuite/tests/ghci/should_run/T10920.hs ===================================== @@ -0,0 +1,5 @@ +module Main where + +-- implicitly imports a custom Prelude module under LocalPrelude/ + +main = putStrLn ("it's fine: " <> storefront) ===================================== testsuite/tests/ghci/should_run/T10920.script ===================================== @@ -0,0 +1,47 @@ +-- +-- Tests that we can don't crash with a local Prelude module present (bug #10920). +-- + +-- this is default, but the test makes zero sense with NoImplicitPrelude, it should *not* be set here +:seti -XImplicitPrelude +-- this is default too, (ab)used in the following macro +:seti -fimplicit-import-qualified +-- for a bit neater output +:def! section \title -> let echo=System.IO.putStrLn in (echo "" GHC.Base.>> echo title GHC.Base.>> GHC.Base.return "") + +:section -- should not crash with local prelude +:load T10920.hs +:main +:show imports +:show modules + +:load +:section -- unless loaded, HomeModError is expected (on stderr) +import Prelude +:show imports + +:load +:section -- but if loaded, can be imported +:load T10920 +import Prelude +:t Prelude.storefront +:show imports +:show modules + +:load +:section -- can also be star-imported +:load T10920 +:module *Prelude +:t Prelude.backyard +:show imports +:show modules + +-- also test ghci-script similar to what stack repl generates... +-- the sequence is a tad weird, but it is what it is. +:load +:section -- double-loading is fine as well +:add Prelude ./T10920.hs +:module + Prelude +:show imports +:show modules +:main ===================================== testsuite/tests/ghci/should_run/T10920.stderr ===================================== @@ -0,0 +1,3 @@ +:1:1: error: [GHC-58427] + attempting to use module ‘main:Prelude’ (./Prelude.hs) which is not loaded + ===================================== testsuite/tests/ghci/should_run/T10920.stdout ===================================== @@ -0,0 +1,28 @@ + +-- should not crash with local prelude +it's fine: A project-local Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- unless loaded, HomeModError is expected (on stderr) + +-- but if loaded, can be imported +Prelude.storefront :: GHC.Internal.Base.String +import Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- can also be star-imported +Prelude.backyard :: GHC.Internal.Base.String +:module +*Prelude +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) + +-- double-loading is fine as well +import Prelude +:module +*Main -- added automatically +Main ( T10920.hs, interpreted ) +Prelude ( Prelude.hs, interpreted ) +it's fine: A project-local Prelude ===================================== testsuite/tests/ghci/should_run/all.T ===================================== @@ -94,3 +94,5 @@ test('GhciMainIs', just_ghci, compile_and_run, ['-main-is otherMain']) test('LargeBCO', [extra_files(['LargeBCO_A.hs']), req_interp, extra_hc_opts("-O -fbyte-code-and-object-code -fprefer-byte-code")], compile_and_run, ['']) test('T24115', just_ghci + [extra_run_opts("-e ':add T24115.hs'")], ghci_script, ['T24115.script']) + +test('T10920', [only_ways(ghci_ways), extra_files(['LocalPrelude/Prelude.hs'])], ghci_script, ['T10920.script']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/977b6b64e184795f3f12ac5b2637707f0696457c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/977b6b64e184795f3f12ac5b2637707f0696457c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:15:16 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:15:16 -0400 Subject: [Git][ghc/ghc][master] Add missing gParPat in cvtp's ViewP case Message-ID: <6686bc84159d3_dd27f228290c1696e7@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - 4 changed files: - compiler/GHC/ThToHs.hs - + testsuite/tests/th/T24894.hs - + testsuite/tests/th/T24894.stderr - testsuite/tests/th/all.T Changes: ===================================== compiler/GHC/ThToHs.hs ===================================== @@ -1488,7 +1488,7 @@ cvtp (SigP p t) = do { p' <- cvtPat p; t' <- cvtType t ; let pp = parenthesizePat sigPrec p' ; return $ SigPat noAnn pp (mkHsPatSigType noAnn t') } cvtp (ViewP e p) = do { e' <- cvtl e; p' <- cvtPat p - ; return $ ViewPat noAnn e' p'} + ; wrapParLA gParPat $ ViewPat noAnn e' p'} cvtp (TypeP t) = do { t' <- cvtType t ; return $ EmbTyPat noAnn (mkHsTyPat t') } cvtp (InvisP t) = do { t' <- cvtType t ===================================== testsuite/tests/th/T24894.hs ===================================== @@ -0,0 +1,6 @@ +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE ViewPatterns #-} +module T24894 where + +$([d| pattern P x <- (id -> x) |]) ===================================== testsuite/tests/th/T24894.stderr ===================================== @@ -0,0 +1,2 @@ +T24894.hs:6:2-34: Splicing declarations + [d| pattern P x <- (id -> x) |] ======> pattern P x <- (id -> x) ===================================== testsuite/tests/th/all.T ===================================== @@ -615,5 +615,6 @@ test('T24557e', normal, compile, ['']) test('T24702a', normal, compile, ['']) test('T24702b', normal, compile, ['']) test('T24837', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T24894', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T24911', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T24997', normal, compile_and_run, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87cf41111ef6a650e360e4a9b9ac691feecc4973 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/87cf41111ef6a650e360e4a9b9ac691feecc4973 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:16:18 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:16:18 -0400 Subject: [Git][ghc/ghc][master] 4 commits: Use structured error representation for module cycle errors (see #18516) Message-ID: <6686bcc2e84e_dd27f2472208172998@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - 16 changed files: - compiler/GHC.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Unit/Module/Location.hs - testsuite/tests/backpack/should_fail/bkpfail51.stderr - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/diagnostic-codes/codes.stdout - testsuite/tests/driver/T20459.stderr - testsuite/tests/driver/T24196/T24196.stderr - testsuite/tests/driver/T24275/T24275.stderr - testsuite/tests/ghc-e/should_fail/T18441fail5.stderr - testsuite/tests/ghci/scripts/ghci021.stderr Changes: ===================================== compiler/GHC.hs ===================================== @@ -315,11 +315,8 @@ module GHC ( parser, -- * API Annotations - AnnKeywordId(..),EpaComment(..), - - -- * Miscellaneous - --sessionHscEnv, - cyclicModuleErr, + AnnKeywordId(..), + EpaComment(..) ) where {- ===================================== compiler/GHC/Driver/Errors/Ppr.hs ===================================== @@ -20,7 +20,10 @@ import GHC.Types.Error import GHC.Types.Error.Codes import GHC.Unit.Types import GHC.Utils.Outputable +import GHC.Utils.Panic import GHC.Unit.Module +import GHC.Unit.Module.Graph +import GHC.Unit.Module.ModSummary import GHC.Unit.State import GHC.Types.Hint import GHC.Types.SrcLoc @@ -238,6 +241,33 @@ instance Diagnostic DriverMessage where -> mkSimpleDecorated $ text $ "unrecognised warning flag: -" ++ arg DriverDeprecatedFlag arg msg -> mkSimpleDecorated $ text $ arg ++ " is deprecated: " ++ msg + DriverModuleGraphCycle path + -> mkSimpleDecorated $ vcat + [ text "Module graph contains a cycle:" + , nest 2 (show_path path) ] + where + show_path :: [ModuleGraphNode] -> SDoc + show_path [] = panic "show_path" + show_path [m] = ppr_node m <+> text "imports itself" + show_path (m1:m2:ms) = vcat ( nest 14 (ppr_node m1) + : nest 6 (text "imports" <+> ppr_node m2) + : go ms ) + where + go [] = [text "which imports" <+> ppr_node m1] + go (m:ms) = (text "which imports" <+> ppr_node m) : go ms + + ppr_node :: ModuleGraphNode -> SDoc + ppr_node (ModuleNode _deps m) = text "module" <+> ppr_ms m + ppr_node (InstantiationNode _uid u) = text "instantiated unit" <+> ppr u + ppr_node (LinkNode uid _) = pprPanic "LinkNode should not be in a cycle" (ppr uid) + + ppr_ms :: ModSummary -> SDoc + ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+> + (parens (text (msHsFilePath ms))) + DriverInstantiationNodeInDependencyGeneration node -> + mkSimpleDecorated $ + vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" + , nest 2 $ ppr node ] diagnosticReason = \case DriverUnknownMessage m @@ -303,6 +333,10 @@ instance Diagnostic DriverMessage where -> WarningWithFlag Opt_WarnUnrecognisedWarningFlags DriverDeprecatedFlag {} -> WarningWithFlag Opt_WarnDeprecatedFlags + DriverModuleGraphCycle {} + -> ErrorWithoutFlag + DriverInstantiationNodeInDependencyGeneration {} + -> ErrorWithoutFlag diagnosticHints = \case DriverUnknownMessage m @@ -370,5 +404,9 @@ instance Diagnostic DriverMessage where -> noHints DriverDeprecatedFlag {} -> noHints + DriverModuleGraphCycle {} + -> noHints + DriverInstantiationNodeInDependencyGeneration {} + -> noHints diagnosticCode = constructorCode ===================================== compiler/GHC/Driver/Errors/Types.hs ===================================== @@ -28,6 +28,7 @@ import GHC.Driver.DynFlags (DynFlags, PackageArg, gopt) import GHC.Driver.Flags (GeneralFlag (Opt_BuildingCabalPackage)) import GHC.Types.Error import GHC.Unit.Module +import GHC.Unit.Module.Graph import GHC.Unit.State import GHC.Parser.Errors.Types ( PsMessage(PsHeaderMessage) ) @@ -384,6 +385,23 @@ data DriverMessage where DriverDeprecatedFlag :: String -> String -> DriverMessage + {-| DriverModuleGraphCycle is an error that occurs if the module graph + contains cyclic imports. + + Test cases: + tests/backpack/should_fail/bkpfail51 + tests/driver/T20459 + tests/driver/T24196/T24196 + tests/driver/T24275/T24275 + + -} + DriverModuleGraphCycle :: [ModuleGraphNode] -> DriverMessage + + {- | DriverInstantiationNodeInDependencyGeneration is an error that occurs + if the module graph used for dependency generation contains + Backpack 'InstantiationNode's. -} + DriverInstantiationNodeInDependencyGeneration :: InstantiatedUnit -> DriverMessage + deriving instance Generic DriverMessage data DriverMessageOpts = ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -724,9 +724,9 @@ load' mhmi_cache how_much diag_wrapper mHscMessage mod_graph = do checkMod m and_then | m `Set.member` all_home_mods = and_then | otherwise = do - liftIO $ errorMsg logger - (text "no such module:" <+> quotes (ppr (moduleUnit m) <> colon <> ppr (moduleName m))) - return Failed + throwOneError $ mkPlainErrorMsgEnvelope noSrcSpan + $ GhcDriverMessage + $ DriverModuleNotFound (moduleName m) checkHowMuch how_much $ do @@ -1265,9 +1265,7 @@ upsweep n_jobs hsc_env hmi_cache diag_wrapper mHscMessage old_hpt build_plan = d -- of the upsweep. case cycle of Just mss -> do - let logger = hsc_logger hsc_env - liftIO $ fatalErrorMsg logger (cyclicModuleErr mss) - return (Failed, []) + throwOneError $ cyclicModuleErr mss Nothing -> do let success_flag = successIf (all isJust res) return (success_flag, completed) @@ -2388,16 +2386,17 @@ multiRootsErr summs@(summ1:_) mod = ms_mod summ1 files = map (expectJust "checkDup" . ml_hs_file . ms_location) summs -cyclicModuleErr :: [ModuleGraphNode] -> SDoc +cyclicModuleErr :: [ModuleGraphNode] -> MsgEnvelope GhcMessage -- From a strongly connected component we find -- a single cycle to report cyclicModuleErr mss = assert (not (null mss)) $ case findCycle graph of - Nothing -> text "Unexpected non-cycle" <+> ppr mss - Just path0 -> vcat - [ text "Module graph contains a cycle:" - , nest 2 (show_path path0)] + Nothing -> pprPanic "Unexpected non-cycle" (ppr mss) + Just path -> mkPlainErrorMsgEnvelope src_span $ + GhcDriverMessage $ DriverModuleGraphCycle path + where + src_span = maybe noSrcSpan (mkFileSrcSpan . ms_location) (moduleGraphNodeModSum (head path)) where graph :: [Node NodeKey ModuleGraphNode] graph = @@ -2409,26 +2408,6 @@ cyclicModuleErr mss | ms <- mss ] - show_path :: [ModuleGraphNode] -> SDoc - show_path [] = panic "show_path" - show_path [m] = ppr_node m <+> text "imports itself" - show_path (m1:m2:ms) = vcat ( nest 14 (ppr_node m1) - : nest 6 (text "imports" <+> ppr_node m2) - : go ms ) - where - go [] = [text "which imports" <+> ppr_node m1] - go (m:ms) = (text "which imports" <+> ppr_node m) : go ms - - ppr_node :: ModuleGraphNode -> SDoc - ppr_node (ModuleNode _deps m) = text "module" <+> ppr_ms m - ppr_node (InstantiationNode _uid u) = text "instantiated unit" <+> ppr u - ppr_node (LinkNode uid _) = pprPanic "LinkNode should not be in a cycle" (ppr uid) - - ppr_ms :: ModSummary -> SDoc - ppr_ms ms = quotes (ppr (moduleName (ms_mod ms))) <+> - (parens (text (msHsFilePath ms))) - - cleanCurrentModuleTempFilesMaybe :: MonadIO m => Logger -> TmpFs -> DynFlags -> m () cleanCurrentModuleTempFilesMaybe logger tmpfs dflags = if gopt Opt_KeepTmpFiles dflags ===================================== compiler/GHC/Driver/MakeFile.hs ===================================== @@ -16,9 +16,9 @@ where import GHC.Prelude import qualified GHC +import GHC.Driver.Make import GHC.Driver.Monad import GHC.Driver.DynFlags -import GHC.Driver.Ppr import GHC.Utils.Misc import GHC.Driver.Env import GHC.Driver.Errors.Types @@ -210,17 +210,16 @@ processDeps :: DynFlags -- -- For {-# SOURCE #-} imports the "hi" will be "hi-boot". -processDeps dflags _ _ _ _ (CyclicSCC nodes) +processDeps _ _ _ _ _ (CyclicSCC nodes) = -- There shouldn't be any cycles; report them - throwGhcExceptionIO $ ProgramError $ - showSDoc dflags $ GHC.cyclicModuleErr nodes + throwOneError $ cyclicModuleErr nodes -processDeps dflags _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) +processDeps _ _ _ _ _ (AcyclicSCC (InstantiationNode _uid node)) = -- There shouldn't be any backpack instantiations; report them as well - throwGhcExceptionIO $ ProgramError $ - showSDoc dflags $ - vcat [ text "Unexpected backpack instantiation in dependency graph while constructing Makefile:" - , nest 2 $ ppr node ] + throwOneError $ + mkPlainErrorMsgEnvelope noSrcSpan $ + GhcDriverMessage $ DriverInstantiationNodeInDependencyGeneration node + processDeps _dflags _ _ _ _ (AcyclicSCC (LinkNode {})) = return () processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC (ModuleNode _ node)) ===================================== compiler/GHC/HsToCore.hs ===================================== @@ -64,7 +64,6 @@ import GHC.Builtin.Names import GHC.Builtin.Types.Prim import GHC.Builtin.Types -import GHC.Data.FastString import GHC.Data.Maybe ( expectJust ) import GHC.Data.OrdList import GHC.Data.SizedSeq ( sizeSS ) @@ -289,12 +288,6 @@ deSugar hsc_env ; return (msgs, Just mod_guts) }}}} -mkFileSrcSpan :: ModLocation -> SrcSpan -mkFileSrcSpan mod_loc - = case ml_hs_file mod_loc of - Just file_path -> mkGeneralSrcSpan (mkFastString file_path) - Nothing -> interactiveSrcSpan -- Presumably - dsImpSpecs :: [LTcSpecPrag] -> DsM (OrdList (Id,CoreExpr), [CoreRule]) dsImpSpecs imp_specs = do { spec_prs <- mapMaybeM (dsSpec Nothing) imp_specs ===================================== compiler/GHC/Types/Error/Codes.hs ===================================== @@ -320,6 +320,8 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "DriverPackageTrustIgnored" = 83552 GhcDiagnosticCode "DriverUnrecognisedFlag" = 93741 GhcDiagnosticCode "DriverDeprecatedFlag" = 53692 + GhcDiagnosticCode "DriverModuleGraphCycle" = 92213 + GhcDiagnosticCode "DriverInstantiationNodeInDependencyGeneration" = 74284 -- Constraint solver diagnostic codes GhcDiagnosticCode "BadTelescope" = 97739 ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -18,6 +18,7 @@ module GHC.Unit.Module.Location , addBootSuffixLocn , addBootSuffixLocnOut , removeBootSuffix + , mkFileSrcSpan ) where @@ -25,7 +26,9 @@ import GHC.Prelude import GHC.Data.OsPath import GHC.Unit.Types +import GHC.Types.SrcLoc import GHC.Utils.Outputable +import GHC.Data.FastString (mkFastString) import qualified System.OsString as OsString @@ -128,6 +131,13 @@ addBootSuffixLocnOut locn , ml_hie_file_ospath = addBootSuffix (ml_hie_file_ospath locn) } +-- | Compute a 'SrcSpan' from a 'ModLocation'. +mkFileSrcSpan :: ModLocation -> SrcSpan +mkFileSrcSpan mod_loc + = case ml_hs_file mod_loc of + Just file_path -> mkGeneralSrcSpan (mkFastString file_path) + Nothing -> interactiveSrcSpan -- Presumably + -- ---------------------------------------------------------------------------- -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- ===================================== testsuite/tests/backpack/should_fail/bkpfail51.stderr ===================================== @@ -2,7 +2,9 @@ [1 of 2] Compiling H[sig] ( p/H.hsig, nothing ) [2 of 2] Compiling I ( p/I.hs, nothing ) [2 of 2] Processing q -Module graph contains a cycle: - instantiated unit p[H=A] - imports module ‘A’ (q/A.hsig) - which imports instantiated unit p[H=A] +: error: [GHC-92213] + Module graph contains a cycle: + instantiated unit p[H=] + imports module ‘A’ (q/A.hsig) + which imports instantiated unit p[H=] + ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -113,6 +113,7 @@ GHC.Iface.Ext.Fields GHC.Iface.Recomp.Binary GHC.Iface.Syntax GHC.Iface.Type +GHC.Linker.Static.Utils GHC.Parser GHC.Parser.Annotation GHC.Parser.CharClass @@ -189,6 +190,7 @@ GHC.Types.SafeHaskell GHC.Types.SourceFile GHC.Types.SourceText GHC.Types.SrcLoc +GHC.Types.Target GHC.Types.Tickish GHC.Types.TyThing GHC.Types.Unique @@ -208,9 +210,11 @@ GHC.Unit.Info GHC.Unit.Module GHC.Unit.Module.Deps GHC.Unit.Module.Env +GHC.Unit.Module.Graph GHC.Unit.Module.Imported GHC.Unit.Module.Location GHC.Unit.Module.ModIface +GHC.Unit.Module.ModSummary GHC.Unit.Module.Warnings GHC.Unit.Parser GHC.Unit.Ppr ===================================== testsuite/tests/diagnostic-codes/codes.stdout ===================================== @@ -41,6 +41,7 @@ [GHC-19971] is untested (constructor = DriverBackpackModuleNotFound) [GHC-37141] is untested (constructor = DriverCannotLoadInterfaceFile) [GHC-29747] is untested (constructor = DriverMissingSafeHaskellMode) +[GHC-74284] is untested (constructor = DriverInstantiationNodeInDependencyGeneration) [GHC-06200] is untested (constructor = BlockedEquality) [GHC-81325] is untested (constructor = ExpectingMoreArguments) [GHC-78125] is untested (constructor = AmbiguityPreventsSolvingCt) ===================================== testsuite/tests/driver/T20459.stderr ===================================== @@ -1,2 +1,4 @@ -Module graph contains a cycle: - module ‘T20459A’ (./T20459A.hs) imports itself +./T20459A.hs: error: [GHC-92213] + Module graph contains a cycle: + module ‘T20459A’ (./T20459A.hs) imports itself + ===================================== testsuite/tests/driver/T24196/T24196.stderr ===================================== @@ -1,4 +1,6 @@ -Module graph contains a cycle: - module ‘T24196A’ (./T24196A.hs-boot) - imports module ‘T24196B’ (T24196B.hs) - which imports module ‘T24196A’ (./T24196A.hs-boot) +./T24196A.hs-boot: error: [GHC-92213] + Module graph contains a cycle: + module ‘T24196A’ (./T24196A.hs-boot) + imports module ‘T24196B’ (T24196B.hs) + which imports module ‘T24196A’ (./T24196A.hs-boot) + ===================================== testsuite/tests/driver/T24275/T24275.stderr ===================================== @@ -1,4 +1,6 @@ -Module graph contains a cycle: - module ‘T24275A’ (./T24275A.hs-boot) - imports module ‘T24275B’ (T24275B.hs) - which imports module ‘T24275A’ (./T24275A.hs-boot) +./T24275A.hs-boot: error: [GHC-92213] + Module graph contains a cycle: + module ‘T24275A’ (./T24275A.hs-boot) + imports module ‘T24275B’ (T24275B.hs) + which imports module ‘T24275A’ (./T24275A.hs-boot) + ===================================== testsuite/tests/ghc-e/should_fail/T18441fail5.stderr ===================================== @@ -1,3 +1,4 @@ +: error: [GHC-82272] + module ‘Abcde’ cannot be found locally -: error: no such module: ‘main:Abcde’ 1 ===================================== testsuite/tests/ghci/scripts/ghci021.stderr ===================================== @@ -1,2 +1,3 @@ +: error: [GHC-82272] + module ‘ThisDoesNotExist’ cannot be found locally -: error: no such module: ‘main:ThisDoesNotExist’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/87cf41111ef6a650e360e4a9b9ac691feecc4973...97c6d6de3fa3a5595a1b62873750c8b2330c3f16 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/87cf41111ef6a650e360e4a9b9ac691feecc4973...97c6d6de3fa3a5595a1b62873750c8b2330c3f16 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:17:36 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:17:36 -0400 Subject: [Git][ghc/ghc][master] 10 commits: ttg: Remove SourceText from OverloadedLabel Message-ID: <6686bd10ce20_dd27f2282894180561@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 30 changed files: - compiler/GHC/Builtin/Types.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Id/Make.hs - compiler/GHC/Types/Var.hs - compiler/GHC/Types/Var.hs-boot - compiler/GHC/Unit/Types.hs - compiler/Language/Haskell/Syntax/Basic.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97c6d6de3fa3a5595a1b62873750c8b2330c3f16...24757fec56ac41f0a0041407119c92d91bf67510 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97c6d6de3fa3a5595a1b62873750c8b2330c3f16...24757fec56ac41f0a0041407119c92d91bf67510 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:18:13 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:18:13 -0400 Subject: [Git][ghc/ghc][master] Fix #25032 Refer to Cabal's `includes` field, not `include-files` Message-ID: <6686bd35d6207_dd27f291ea7c180762@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 1 changed file: - docs/users_guide/exts/ffi.rst Changes: ===================================== docs/users_guide/exts/ffi.rst ===================================== @@ -764,7 +764,7 @@ calls across module and package boundaries: there's no need for the header file to be available when compiling an inlined version of a foreign call, so the compiler is free to inline foreign calls in any context. -The ``-#include`` option is now deprecated, and the ``include-files`` +The ``-#include`` option is now deprecated, and the ``includes`` field in a Cabal package specification is ignored. Memory Allocation View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9be49379a71b0bb191c1ba28182054d64d6d2c12 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9be49379a71b0bb191c1ba28182054d64d6d2c12 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:18:32 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:18:32 -0400 Subject: [Git][ghc/ghc][master] base: fix more missing changelog entries Message-ID: <6686bd4837a62_dd27f29b231c1809c1@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - 2 changed files: - libraries/base/changelog.md - libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc Changes: ===================================== libraries/base/changelog.md ===================================== @@ -4,6 +4,7 @@ * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) + * Refactor `GHC.RTS.Flags` in preparation for new I/O managers: introduce `data IoManagerFlag` and use it in `MiscFlags`, remove `getIoManagerFlag`, deprecate re-export of `IoSubSystem` ([CLC proposal #263](https://github.com/haskell/core-libraries-committee/issues/263)) * Add the `MonadFix` instance for `(,) a`, similar to the one for `Writer a` ([CLC proposal #238](https://github.com/haskell/core-libraries-committee/issues/238)) * Improve `toInteger :: Word32 -> Integer` on 64-bit platforms ([CLC proposal #259](https://github.com/haskell/core-libraries-committee/issues/259)) * Make `flip` representation polymorphic ([CLC proposal #245](https://github.com/haskell/core-libraries-committee/issues/245)) @@ -27,11 +28,12 @@ * Implement `sconcat` for `instance Semigroup Data.Semigroup.First` and `instance Semigroup Data.Monoid.First` explicitly, increasing laziness ([CLC proposal #246](https://github.com/haskell/core-libraries-committee/issues/246)) * Add laws relating between `Foldable` / `Traversable` with `Bifoldable` / `Bitraversable` ([CLC proposal #205](https://github.com/haskell/core-libraries-committee/issues/205)) * The `Enum Int64` and `Enum Word64` instances now use native operations on 32-bit platforms, increasing performance by up to 1.5x on i386 and up to 5.6x with the JavaScript backend. ([CLC proposal #187](https://github.com/haskell/core-libraries-committee/issues/187)) - * Exceptions can now be decorated with user-defined annotations via `ExceptionContext`. + * Exceptions can now be decorated with user-defined annotations via `ExceptionContext` ([CLC proposal #200](https://github.com/haskell/core-libraries-committee/issues/200)) * Exceptions now capture backtrace information via their `ExceptionContext`. GHC supports several mechanisms by which backtraces can be collected which can be individually enabled and disabled via - `GHC.Exception.Backtrace.setBacktraceMechanismState`. + `GHC.Exception.Backtrace.setBacktraceMechanismState` ([CLC proposal #199](https://github.com/haskell/core-libraries-committee/issues/199)) + * Add `HasCallStack` constraint to `Control.Exception.throw{,IO}` ([CLC proposal #201](https://github.com/haskell/core-libraries-committee/issues/201)) * Update to [Unicode 15.1.0](https://www.unicode.org/versions/Unicode15.1.0/). * Fix `withFile`, `withFileBlocking`, and `withBinaryFile` to not incorrectly annotate exceptions raised in wrapped computation. ([CLC proposal #237](https://github.com/haskell/core-libraries-committee/issues/237)) * Fix `fdIsNonBlocking` to always be `0` for regular files and block devices on unix, regardless of `O_NONBLOCK` @@ -74,6 +76,8 @@ ([CLC proposal #254](https://github.com/haskell/core-libraries-committee/issues/254)) * Document that certain modules are unstable and not meant to be consumed by the general public ([CLC proposal #146](https://github.com/haskell/core-libraries-committee/issues/146)) * Add unaligned `Addr#` primops ([CLC proposal #154](https://github.com/haskell/core-libraries-committee/issues/154)) + * Deprecate `stgDoubleToWord{32,64}` and `stgWord{32,64}ToDouble` in favor of new primops `castDoubleToWord{32,64}#` and `castWord{32,64}ToDouble#` ([CLC proposal #253](https://github.com/haskell/core-libraries-committee/issues/253)) + * Add `unsafeThawByteArray#`, opposite to the existing `unsafeFreezeByteArray#` ([CLC proposal #184](https://github.com/haskell/core-libraries-committee/issues/184)) ## 4.19.0.0 *October 2023* * Shipped with GHC 9.8.1 ===================================== libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc ===================================== @@ -170,6 +170,9 @@ data MiscFlags = MiscFlags , Generic -- ^ @since base-4.15.0.0 ) +-- | +-- +-- @since base-4.21.0.0 data IoManagerFlag = IoManagerFlagAuto | IoManagerFlagSelect -- ^ Unix only, non-threaded RTS only View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e2ecf140a7f8a49b704514eeae0ce4461129d9a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9e2ecf140a7f8a49b704514eeae0ce4461129d9a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:18:53 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:18:53 -0400 Subject: [Git][ghc/ghc][master] X86 NCG: Fix argument promotion in foreign C calls Message-ID: <6686bd5d652c4_dd27f28822e41826e2@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - 2 changed files: - compiler/GHC/CmmToAsm/X86/CodeGen.hs - testsuite/tests/codeGen/should_run/all.T Changes: ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -2638,10 +2638,11 @@ genCCall32 :: CmmExpr -- ^ address of the function to call -> [CmmFormal] -- ^ where to put the result -> [CmmActual] -- ^ arguments (of mixed type) -> NatM InstrBlock -genCCall32 addr _ dest_regs args = do +genCCall32 addr (ForeignConvention _ argHints _ _) dest_regs args = do config <- getConfig let platform = ncgPlatform config - prom_args = map (maybePromoteCArg platform W32) args + args_hints = zip args (argHints ++ repeat NoHint) + prom_args = map (maybePromoteCArg platform W32) args_hints -- If the size is smaller than the word, we widen things (see maybePromoteCArg) arg_size_bytes :: CmmType -> Int @@ -2785,10 +2786,11 @@ genCCall64 :: CmmExpr -- ^ address of function to call -> [CmmFormal] -- ^ where to put the result -> [CmmActual] -- ^ arguments (of mixed type) -> NatM InstrBlock -genCCall64 addr conv dest_regs args = do +genCCall64 addr conv@(ForeignConvention _ argHints _ _) dest_regs args = do platform <- getPlatform -- load up the register arguments - let prom_args = map (maybePromoteCArg platform W32) args + let args_hints = zip args (argHints ++ repeat NoHint) + let prom_args = map (maybePromoteCArg platform W32) args_hints let load_args :: [CmmExpr] -> [Reg] -- int regs avail for args @@ -3023,9 +3025,11 @@ genCCall64 addr conv dest_regs args = do assign_code dest_regs) -maybePromoteCArg :: Platform -> Width -> CmmExpr -> CmmExpr -maybePromoteCArg platform wto arg - | wfrom < wto = CmmMachOp (MO_UU_Conv wfrom wto) [arg] +maybePromoteCArg :: Platform -> Width -> (CmmExpr, ForeignHint) -> CmmExpr +maybePromoteCArg platform wto (arg, hint) + | wfrom < wto = case hint of + SignedHint -> CmmMachOp (MO_SS_Conv wfrom wto) [arg] + _ -> CmmMachOp (MO_UU_Conv wfrom wto) [arg] | otherwise = arg where wfrom = cmmExprWidth platform arg ===================================== testsuite/tests/codeGen/should_run/all.T ===================================== @@ -247,6 +247,4 @@ test('T24295b', normal, compile_and_run, ['-O -floopification -fpedantic-bottoms test('T24664a', normal, compile_and_run, ['-O']) test('T24664b', normal, compile_and_run, ['-O']) test('CtzClz0', normal, compile_and_run, ['']) -test('T23034', [req_c - , when(arch('x86_64') and opsys('darwin'), expect_broken(25018)) - ], compile_and_run, ['-O2 T23034_c.c']) +test('T23034', req_c, compile_and_run, ['-O2 T23034_c.c']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a82121b3b6fdc2ac47211f71871b3ab21e5f6276 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a82121b3b6fdc2ac47211f71871b3ab21e5f6276 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 15:19:10 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 04 Jul 2024 11:19:10 -0400 Subject: [Git][ghc/ghc][master] Add .gitlab/README.md with creds instructions Message-ID: <6686bd6e3bdcc_dd27f269628c182912@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 1 changed file: - + .gitlab/README.md Changes: ===================================== .gitlab/README.md ===================================== @@ -0,0 +1,36 @@ +# Where the GitLab happens + + +## Updating PERF_NOTES_PUSH_CREDENTIALS + +This CI variable is used by test-metrics.sh to push performance data as a git +note to https://gitlab.haskell.org/ghc/ghc-performance-notes. + +The current token will expire on 2025-07-02. + +### STEPS + +Set and fetch the updated token: + +``` +GITLAB_WRITE= + +one_year_later="$(date --date='1 year' --iso-8601)" +curl -X POST --header "PRIVATE-TOKEN: $GITLAB_WRITE" -H "Content-Type: application/json" \ + --data '{"name":"test-metrics.sh", "scopes":["write_repository"], "expires_at":"$one_year_later"}' \ + https://gitlab.haskell.org/api/v4/projects/117/access_tokens \ + | jq .token +``` + +Update the variable: + +``` +GITLAB_WRITE= + +NEW_VALUE= + +curl --fail-with-body --request PUT --header "PRIVATE-TOKEN: $GITLAB_WRITE" \ + "https://gitlab.haskell.org/api/v4/projects/1/variables/PERF_NOTES_PUSH_CREDENTIALS" \ + --form "value=$NEW_VALUE" + +``` View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fab13100f23dd0fc231c0e8fe8faf237b7d1bbcc -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fab13100f23dd0fc231c0e8fe8faf237b7d1bbcc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 16:12:08 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Thu, 04 Jul 2024 12:12:08 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/ncg-perf Message-ID: <6686c9d8c6cfd_dd27f31aca401908b1@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/ncg-perf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 4 22:37:38 2024 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Thu, 04 Jul 2024 18:37:38 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/az/epa-span-in-delta Message-ID: <668724324455f_891c8a635881002a5@gitlab.mail> Alan Zimmerman pushed new branch wip/az/epa-span-in-delta at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/az/epa-span-in-delta You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 03:05:24 2024 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Thu, 04 Jul 2024 23:05:24 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 31 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668762f4e112e_3bc964161c23010357d@gitlab.mail> Cheng Shao pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 33bb115c by Cheng Shao at 2024-07-05T00:17:43+00:00 compiler: always generate dynamic stub objects when generating bytecode When foreign stub objects are compiled during bytecode generation (e.g. when using whole core bindings), ensure they are dynamic so they can be properly loaded. - - - - - 207a0c64 by Cheng Shao at 2024-07-05T00:17:43+00:00 compiler: generate stub objects before writing iface This commit promotes foreign stub compilation a bit earlier before we actually write iface, to make it possible to actually serialize them into the final iface when compiling with `-fwrite-if-simplified-core`. Also ensures dynamic stub objects are generated if we're compiling with `-fwrite-if-simplified-core`. - - - - - ac1dec2a by Cheng Shao at 2024-07-05T00:17:43+00:00 compiler: add mi_stub_objs to ModIface This commit adds the mi_stub_objs field to ModIface, representing serialized foreign stub dynamic objects that can be reloaded later when compiling a downstream module with `-fprefer-byte-code` that loads whole core bindings from an upstream module that requires foreign stubs, see #24634 for such an example. - - - - - 92cd3f08 by Cheng Shao at 2024-07-05T00:17:43+00:00 compiler: serialize foreign stub dynamic objects in interface file when compiling with -fwrite-if-simplified-core This commit makes the compiler serialize foreign stub dynamic objects in mi_stub_objs when compiling with -fwrite-if-simplified-core. This is needed when we compile a downstream module with -fprefer-byte-code, in which case we want to make use of whole core bindings in upstream modules instead of having to load their dynamic objects, but the foreign stub information has been lost across different ghc invocations previously. Hence the fix in this commit. See #24634 for such an example. - - - - - dee75dbc by Cheng Shao at 2024-07-05T00:17:43+00:00 testsuite: fix T24634 This commit fixes T24634 and marks it as unbroken. - - - - - 29df022f by Cheng Shao at 2024-07-05T03:04:53+00:00 WIP: oneshot bytecode support - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f0167c0c8af3c0b30dd00593c72868f86d7bdef...29df022f7ea42494da0c771611be181aa4310d4c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f0167c0c8af3c0b30dd00593c72868f86d7bdef...29df022f7ea42494da0c771611be181aa4310d4c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 05:12:22 2024 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Fri, 05 Jul 2024 01:12:22 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/ghc-9.8-T24634-oneshot-bytecode Message-ID: <668780b69f107_3bc96425cfe98106162@gitlab.mail> Cheng Shao pushed new branch wip/ghc-9.8-T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/ghc-9.8-T24634-oneshot-bytecode You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 08:20:02 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 05 Jul 2024 04:20:02 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Accept CountDeps changes Message-ID: <6687acb246bc_192bf139d5dc76881@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 06f2598d by Simon Peyton Jones at 2024-07-05T09:19:23+01:00 Accept CountDeps changes - - - - - c92444cf by Simon Peyton Jones at 2024-07-05T09:19:37+01:00 Fix bug in fundeps - - - - - 3 changed files: - compiler/GHC/Tc/Solver/Equality.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout Changes: ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -3017,10 +3017,11 @@ improve_injective_wanted_top fam_envs inj_args fam_tc lhs_tys rhs_ty where branches :: [CoAxBranch] branches | isOpenTypeFamilyTyCon fam_tc - , (fam_inst1 : _) <- lookupFamInstEnvByTyCon fam_envs fam_tc - = fromBranches (coAxiomBranches (fi_axiom fam_inst1)) + , let fam_insts = lookupFamInstEnvByTyCon fam_envs fam_tc + = concatMap (fromBranches . coAxiomBranches . fi_axiom) fam_insts -- fam_inst1: It is possible to have several compatible equations in an open -- type family but we only want to derive equalities from one such equation. + -- ToDo: fix this comment | Just ax <- isClosedSynFamilyTyConWithAxiom_maybe fam_tc = fromBranches (coAxiomBranches ax) ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -2,6 +2,7 @@ Found Language.Haskell.Syntax module dependencies GHC.Builtin.Names GHC.Builtin.PrimOps GHC.Builtin.Types +GHC.Builtin.Types.Literals GHC.Builtin.Types.Prim GHC.Builtin.Uniques GHC.ByteCode.Types ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -2,6 +2,7 @@ Found GHC.Parser module dependencies GHC.Builtin.Names GHC.Builtin.PrimOps GHC.Builtin.Types +GHC.Builtin.Types.Literals GHC.Builtin.Types.Prim GHC.Builtin.Uniques GHC.ByteCode.Types View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a9123575f42bd1aa00d05bf5951f05976c655343...c92444cf0385a74ec2441e44f7952cdbcaed0859 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a9123575f42bd1aa00d05bf5951f05976c655343...c92444cf0385a74ec2441e44f7952cdbcaed0859 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 08:55:34 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 05 Jul 2024 04:55:34 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 29 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <6687b506661ef_192bf187b0b8839ef@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 68d8fa93 by Matthew Pickering at 2024-07-05T04:55:22-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - 4d37de6e by Matthew Pickering at 2024-07-05T04:55:22-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - d5110e3b by Matthew Pickering at 2024-07-05T04:55:23-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - d2c779b4 by Matthew Pickering at 2024-07-05T04:55:23-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/Splice.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/993195c836fdb59d8e62a767354850fef130abc6...d2c779b4bdfa00ce71b7bd52db24a64f65219d66 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/993195c836fdb59d8e62a767354850fef130abc6...d2c779b4bdfa00ce71b7bd52db24a64f65219d66 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 08:56:15 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 05 Jul 2024 04:56:15 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/dont_link Message-ID: <6687b52f9e48e_192bf19c1d50888a9@gitlab.mail> Matthew Pickering pushed new branch wip/dont_link at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/dont_link You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 09:42:37 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 05 Jul 2024 05:42:37 -0400 Subject: [Git][ghc/ghc][wip/T25009] 70 commits: base: Add inits1 and tails1 to Data.List Message-ID: <6687c00d77f8f_192bf111686bc10082e@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25009 at Glasgow Haskell Compiler / GHC Commits: 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - cf78b5fa by Simon Peyton Jones at 2024-07-05T09:34:43+01:00 Improved type comparision Needs documentation! - - - - - 26665451 by Simon Peyton Jones at 2024-07-05T10:39:49+01:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See #25009. - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51c99cc21119357945b989b0d129c36a22f3d61f...26665451402310b978326f721f7829b76105620c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51c99cc21119357945b989b0d129c36a22f3d61f...26665451402310b978326f721f7829b76105620c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 11:36:35 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 05 Jul 2024 07:36:35 -0400 Subject: [Git][ghc/ghc][master] 2 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <6687dac32f9dd_192bf12569e7c12841e@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 2 changed files: - configure.ac - hadrian/src/Settings/Flavours/GhcInGhci.hs Changes: ===================================== configure.ac ===================================== @@ -176,6 +176,12 @@ if test "$WithGhc" != ""; then if test -z "$LD_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[ld command]) + # ld command is removed in 9.10.1 as a boot compiler and supplies "Merge objects + # command" instead + if test -z "$LD_STAGE0"; then + BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[Merge objects command]) + fi + fi if test -z "$AR_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command]) ===================================== hadrian/src/Settings/Flavours/GhcInGhci.hs ===================================== @@ -17,7 +17,7 @@ ghcInGhciFlavour = defaultFlavour -- checking for Windows seems simpler for now. , libraryWays = pure (Set.fromList [vanilla]) <> pure (Set.fromList [ dynamic | not windowsHost ]) , rtsWays = pure (Set.fromList [vanilla]) <> (targetSupportsThreadedRts ? pure (Set.fromList [threaded])) <> pure (Set.fromList [ dynamic | not windowsHost ]) - , dynamicGhcPrograms = return False } + } ghciArgs :: Args ghciArgs = sourceArgs SourceArgs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fab13100f23dd0fc231c0e8fe8faf237b7d1bbcc...a949c792388b5662dd199497541f9ad51c78d1a8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fab13100f23dd0fc231c0e8fe8faf237b7d1bbcc...a949c792388b5662dd199497541f9ad51c78d1a8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 11:37:06 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 05 Jul 2024 07:37:06 -0400 Subject: [Git][ghc/ghc][master] 2 commits: hadrian: Remove STG dump from ticky_ghc flavour transformer Message-ID: <6687dae2c8f47_192bf127558941301f@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - 2 changed files: - hadrian/doc/flavours.md - hadrian/src/Flavour.hs Changes: ===================================== hadrian/doc/flavours.md ===================================== @@ -320,6 +320,10 @@ The supported transformers are listed below: late_ccs Enable -fprof-late in profiled libraries. + + dump_stg + Dump STG of all modules compiled by a stage1 compiler to a file + ### Static ===================================== hadrian/src/Flavour.hs ===================================== @@ -68,6 +68,7 @@ flavourTransformers = M.fromList , "hi_core" =: enableHiCore , "late_ccs" =: enableLateCCS , "boot_nonmoving_gc" =: enableBootNonmovingGc + , "dump_stg" =: enableDumpStg ] where (=:) = (,) @@ -176,11 +177,13 @@ tickyArgs = mconcat [ arg "-ticky" , arg "-ticky-allocd" , arg "-ticky-dyn-thunk" - -- You generally need STG dumps to interpret ticky profiles - , arg "-ddump-to-file" - , arg "-ddump-stg-final" ] +enableDumpStg :: Flavour -> Flavour +enableDumpStg = + addArgs $ stage1 ? + builder (Ghc CompileHs) ? mconcat [ arg "-ddump-to-file", arg "-ddump-stg-final" ] + -- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler. enableLinting :: Flavour -> Flavour enableLinting = View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a949c792388b5662dd199497541f9ad51c78d1a8...5b1aefb70edbd54ac899896df39d8f3d6c579518 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a949c792388b5662dd199497541f9ad51c78d1a8...5b1aefb70edbd54ac899896df39d8f3d6c579518 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 12:27:02 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 05 Jul 2024 08:27:02 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/alpine_3_20 Message-ID: <6687e6968e8d5_192bf12e7eb5c13648@gitlab.mail> Matthew Pickering pushed new branch wip/alpine_3_20 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/alpine_3_20 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 13:37:07 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 05 Jul 2024 09:37:07 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] 3 commits: ngc: Workaround WW vs SPEC bug in pprinting Message-ID: <6687f7035773b_ac4ef7ec1ec727d1@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC Commits: 9a60f33d by Rodrigo Mesquita at 2024-07-05T14:32:11+01:00 ngc: Workaround WW vs SPEC bug in pprinting Adds INLINABLE to `pprName` and `pprCLabelStyle` which turned up in a profile as unspecialised at types where it should have been specialised. The INLINABLE pragma works around a bug which causes specialisation to be missed due to Worker Wrapper (#25060). See also #25060 and #21851 Specialising these functions improves compile time allocations: geo. mean -0.5% minimum -3.2% maximum +0.2% ------------------------- Metric Decrease: ManyAlternatives ManyConstructors T12707 T13035 T13379 T1969 T9961 ------------------------- - - - - - 993c1dc5 by Rodrigo Mesquita at 2024-07-05T14:36:55+01:00 ncg: Don't execute dwarfGen for SDoc unnecessarily `dwarfGen @SDoc` is only needed if -ddump-asm is enabled (see emitNativeCode). Matching on the tuple forced unnecessary execution since the unique supply is threaded through -- use a lazy pattern instead. - - - - - e2d7632b by Rodrigo Mesquita at 2024-07-05T14:36:55+01:00 ncg: INLINEABLE regAlloc regAlloc showed up in a time profile unspecialised, and making sure it is specialised is noticeable in the profile. Enabling it shaved off some 15ms compiling Cabal on my machine. - - - - - 4 changed files: - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/Types/Name.hs Changes: ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -1583,6 +1583,7 @@ pprCLabelStyle !platform !sty lbl = -- see Note [Bangs in CLabel] CmmLabel _ _ fs CmmRetInfo -> maybe_underscore $ ftext fs <> text "_info" CmmLabel _ _ fs CmmRet -> maybe_underscore $ ftext fs <> text "_ret" CmmLabel _ _ fs CmmClosure -> maybe_underscore $ ftext fs <> text "_closure" +{-# INLINABLE pprCLabelStyle #-} -- Workaround a bug which prevented pprCLabelStyle from specialising (see #25060). {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> SDoc #-} {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -234,7 +234,10 @@ finishNativeGen logger config modLoc bufh us ngs else do compPath <- getCurrentDirectory let (dwarf_h, us') = dwarfGen compPath config modLoc us (ngs_debug ngs) - (dwarf_s, _) = dwarfGen compPath config modLoc us (ngs_debug ngs) + -- `dwarfGen @SDoc` is only needed if -ddump-asm is enabled (see emitNativeCode) + -- Matching on the tuple forced unnecessary execution since the unique supply + -- is threaded through -- use a lazy pattern instead. + ~(dwarf_s, _) = dwarfGen compPath config modLoc us (ngs_debug ngs) emitNativeCode logger config bufh dwarf_h dwarf_s return us' ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -189,6 +189,9 @@ regAlloc config (CmmProc static lbl live sccs) -- bogus. to make non-exhaustive match warning go away. regAlloc _ (CmmProc _ _ _ _) = panic "RegAllocLinear.regAlloc: no match" +-- regAlloc showed up in a profile unspecialised. +-- Enabling it shaved off some 15ms compiling Cabal: +{-# INLINEABLE regAlloc #-} -- ----------------------------------------------------------------------------- ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -713,6 +713,7 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) handlePuns :: Bool -> Maybe FastString -> SDoc -> SDoc handlePuns True (Just pun) _ = ftext pun handlePuns _ _ r = r +{-# INLINABLE pprName #-} -- Workaround a bug which prevented pprName from specialising (see #25060). {-# SPECIALISE pprName :: Name -> SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/658780cb6f231e56a6a50ed9ff4f7489816bf475...e2d7632b3be674d005e535297e85ec394a507a89 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/658780cb6f231e56a6a50ed9ff4f7489816bf475...e2d7632b3be674d005e535297e85ec394a507a89 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 14:12:31 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 05 Jul 2024 10:12:31 -0400 Subject: [Git][ghc/ghc][wip/T25009] Wibble notes Message-ID: <6687ff4fcb9ff_ac4efd41a9889761@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25009 at Glasgow Haskell Compiler / GHC Commits: d10be80d by Simon Peyton Jones at 2024-07-05T15:12:12+01:00 Wibble notes - - - - - 1 changed file: - compiler/GHC/Core/Type.hs Changes: ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonums] in GHC.Core.TyCon + -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,8 +3275,9 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing -nullary type synonyms] in "GHC.Core.Type". +applications (e.g. things like @TyConApp typeTyCon []@). See +* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" +* Note [Unifying type synonyms] in "GHC.Core.Unify" To accomplish these we use a number of tricks, implemented by mkTyConApp. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d10be80d28236df81234acbd9bfb52b79d93ff30 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d10be80d28236df81234acbd9bfb52b79d93ff30 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 14:27:45 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 05 Jul 2024 10:27:45 -0400 Subject: [Git][ghc/ghc][wip/T24978] Big refacor, combining AxInstCo and AxRuleCo Message-ID: <668802e0d829d_ac4effcbe3096186@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 03beee71 by Simon Peyton Jones at 2024-07-05T15:26:51+01:00 Big refacor, combining AxInstCo and AxRuleCo - - - - - 21 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/TyCo/FVs.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCo/Subst.hs - compiler/GHC/Core/TyCo/Tidy.hs - compiler/GHC/Core/TyCon.hs-boot - compiler/GHC/Core/Type.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Iface/Rename.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Type.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Tc/TyCl/Utils.hs - compiler/GHC/Tc/Utils/TcMType.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -159,14 +159,14 @@ tryInteractInertFam builtin_fam fam_tc tys1 tys2 eqn = Pair (mkTyConApp fam_tc tys1) (mkTyConApp fam_tc tys2) tryMatchFam :: BuiltInSynFamily -> [Type] - -> Maybe (CoAxiomRule, [Type], Type) + -> Maybe (BuiltInFamRewrite, [Type], Type) -- Does this reduce on the given arguments? -- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) --- That is: mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) +-- That is: mkAxiomRuleCo ax (zipWith mkReflCo (coAxArgRuleRoles ax) ts) -- :: F tys ~r rhs, tryMatchFam builtin_fam arg_tys = listToMaybe $ -- Pick first rule to match - [ (BuiltInFamRewrite rw_ax, inst_tys, res_ty) + [ (rw_ax, inst_tys, res_ty) | rw_ax <- sfMatchFam builtin_fam , Just (inst_tys,res_ty) <- [bifrw_match rw_ax arg_tys] ] @@ -353,20 +353,16 @@ typeNatTyCons = ] -tyConAxiomRules :: TyCon -> [CoAxiomRule] -tyConAxiomRules tc - | Just ops <- isBuiltInSynFamTyCon_maybe tc - = map BuiltInFamInteract (sfInteract ops) - ++ map BuiltInFamRewrite (sfMatchFam ops) - | otherwise - = [] - -- The list of built-in type family axioms that GHC uses. -- If you define new axioms, make sure to include them in this list. -- See Note [Adding built-in type families] typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule -typeNatCoAxiomRules = listToUFM $ map (\x -> (coaxrName x, x)) $ - concatMap tyConAxiomRules typeNatTyCons +typeNatCoAxiomRules + = listToUFM $ + [ pr | tc <- typeNatTyCons + , Just ops <- [isBuiltInSynFamTyCon_maybe tc] + , pr <- [ (bifint_name bif, BuiltInFamInteract bif) | bif <- sfInteract ops ] + ++ [ (bifrw_name bif, BuiltInFamRewrite bif) | bif <- sfMatchFam ops ] ] ------------------------------------------------------------------------------- -- Addition (+) ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -44,7 +44,7 @@ module GHC.Core.Coercion ( mkNakedForAllCo, mkForAllCo, mkHomoForAllCos, mkPhantomCo, mkHoleCo, mkUnivCo, mkSubCo, - mkAxiomInstCo, mkProofIrrelCo, + mkProofIrrelCo, downgradeRole, mkAxiomRuleCo, mkGReflRightCo, mkGReflLeftCo, mkCoherenceLeftCo, mkCoherenceRightCo, mkKindCo, @@ -1022,41 +1022,39 @@ it's a relatively expensive test and perhaps better done in optCoercion. Not a big deal either way. -} -mkAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] +mkAxInstCo :: Role + -> CoAxiomRule -- Always BranchedAxiom or UnbranchedAxiom + -> [Type] -> [Coercion] -> Coercion -- mkAxInstCo can legitimately be called over-saturated; -- i.e. with more type arguments than the coercion requires -mkAxInstCo role ax index tys cos +-- Only called with BranchedAxiom or UnbranchedAxiom +mkAxInstCo role axr tys cos | arity == n_tys = downgradeRole role ax_role $ - mkAxiomInstCo ax_br index (rtys `chkAppend` cos) + AxiomRuleCo axr (rtys `chkAppend` cos) | otherwise = assert (arity < n_tys) $ downgradeRole role ax_role $ - mkAppCos (mkAxiomInstCo ax_br index - (ax_args `chkAppend` cos)) + mkAppCos (AxiomRuleCo axr (ax_args `chkAppend` cos)) leftover_args where - n_tys = length tys - ax_br = toBranchedAxiom ax - branch = coAxiomNthBranch ax_br index - tvs = coAxBranchTyVars branch - arity = length tvs - arg_roles = coAxBranchRoles branch - rtys = zipWith mkReflCo (arg_roles ++ repeat Nominal) tys - (ax_args, leftover_args) - = splitAt arity rtys - ax_role = coAxiomRole ax + (ax_role, branch) = case coAxiomRuleBranch_maybe axr of + Just (_tc, ax_role, branch) -> (ax_role, branch) + Nothing -> pprPanic "mkAxInstCo" (ppr axr) + n_tys = length tys + arity = length (coAxBranchTyVars branch) + arg_roles = coAxBranchRoles branch + rtys = zipWith mkReflCo (arg_roles ++ repeat Nominal) tys + (ax_args, leftover_args) = splitAt arity rtys -- worker function -mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion -mkAxiomInstCo ax index args - = assert (args `lengthIs` coAxiomArity ax index) $ - AxiomInstCo ax index args +mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion +mkAxiomRuleCo = AxiomRuleCo -- to be used only with unbranched axioms mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched -> [Type] -> [Coercion] -> Coercion mkUnbranchedAxInstCo role ax tys cos - = mkAxInstCo role ax 0 tys cos + = mkAxInstCo role (UnbranchedAxiom ax) tys cos mkAxInstRHS :: CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type -- Instantiate the axiom with specified types, @@ -1386,9 +1384,6 @@ downgradeRole r1 r2 co Just co' -> co' Nothing -> pprPanic "downgradeRole" (ppr co) -mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion -mkAxiomRuleCo = AxiomRuleCo - -- | Make a "coercion between coercions". mkProofIrrelCo :: Role -- ^ role of the created coercion, "r" -> CoercionN -- ^ :: phi1 ~N phi2 @@ -1580,7 +1575,6 @@ promoteCoercion co = case co of CoVarCo {} -> mkKindCo co HoleCo {} -> mkKindCo co - AxiomInstCo {} -> mkKindCo co AxiomRuleCo {} -> mkKindCo co UnivCo {} -> mkKindCo co @@ -2402,7 +2396,6 @@ seqCo (FunCo r af1 af2 w co1 co2) = r `seq` af1 `seq` af2 `seq` seqCo w `seq` seqCo co1 `seq` seqCo co2 seqCo (CoVarCo cv) = cv `seq` () seqCo (HoleCo h) = coHoleCoVar h `seq` () -seqCo (AxiomInstCo con ind cos) = con `seq` ind `seq` seqCos cos seqCo (UnivCo { uco_prov = p, uco_role = r , uco_lty = t1, uco_rty = t2, uco_deps = deps }) = p `seq` r `seq` seqType t1 `seq` seqType t2 `seq` seqCos deps @@ -2472,22 +2465,7 @@ coercionLKind co go (KindCo co) = typeKind (go co) go (SubCo co) = go co go (SelCo d co) = selectFromType d (go co) - go (AxiomInstCo ax ind cos) = go_ax_inst ax ind (map go cos) - go (AxiomRuleCo ax cos) = pFst $ expectJust "coercionKind" $ - coaxrProves ax $ map coercionKind cos - - go_ax_inst ax ind tys - | CoAxBranch { cab_tvs = tvs, cab_cvs = cvs - , cab_lhs = lhs } <- coAxiomNthBranch ax ind - , let (tys1, cotys1) = splitAtList tvs tys - cos1 = map stripCoercionTy cotys1 - = assert (tys `equalLength` (tvs ++ cvs)) $ - -- Invariant of AxiomInstCo: cos should - -- exactly saturate the axiom branch - substTyWith tvs tys1 $ - substTyWithCoVars cvs cos1 $ - mkTyConApp (coAxiomTyCon ax) lhs - + go (AxiomRuleCo ax cos) = pFst (coAxRuleKind ax (map coercionKind cos)) go_app :: Coercion -> [Type] -> Type -- Collect up all the arguments and apply all at once -- See Note [Nested InstCos] @@ -2516,9 +2494,7 @@ coercionRKind co go (KindCo co) = typeKind (go co) go (SubCo co) = go co go (SelCo d co) = selectFromType d (go co) - go (AxiomInstCo ax ind cos) = go_ax_inst ax ind (map go cos) - go (AxiomRuleCo ax cos) = pSnd $ expectJust "coercionKind" $ - coaxrProves ax $ map coercionKind cos + go (AxiomRuleCo ax cos) = pSnd (coAxRuleKind ax (map coercionKind cos)) go co@(ForAllCo { fco_tcv = tv1, fco_visR = visR , fco_kind = k_co, fco_body = co1 }) -- works for both tyvar and covar @@ -2528,17 +2504,6 @@ coercionRKind co where empty_subst = mkEmptySubst (mkInScopeSet $ tyCoVarsOfCo co) - go_ax_inst ax ind tys - | CoAxBranch { cab_tvs = tvs, cab_cvs = cvs - , cab_rhs = rhs } <- coAxiomNthBranch ax ind - , let (tys2, cotys2) = splitAtList tvs tys - cos2 = map stripCoercionTy cotys2 - = assert (tys `equalLength` (tvs ++ cvs)) $ - -- Invariant of AxiomInstCo: cos should - -- exactly saturate the axiom branch - substTyWith tvs tys2 $ - substTyWithCoVars cvs cos2 rhs - go_app :: Coercion -> [Type] -> Type -- Collect up all the arguments and apply all at once -- See Note [Nested InstCos] @@ -2588,6 +2553,26 @@ coercionRKind co -- when other_co is not a ForAllCo = substTy subst (go other_co) +coAxRuleKind :: CoAxiomRule -> [Pair Type] -> Pair Type +coAxRuleKind ax prs + = case ax of + BuiltInFamRewrite bif -> expectJust "coAxRuleKind" (bifrw_proves bif prs) + BuiltInFamInteract bif -> expectJust "coAxRuleKind" (bifint_proves bif prs) + UnbranchedAxiom ax -> go_branch ax (coAxiomSingleBranch ax) + BranchedAxiom ax i -> go_branch ax (coAxiomNthBranch ax i) + where + go_branch :: CoAxiom br -> CoAxBranch -> Pair Type + go_branch ax (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_lhs = lhs_tys, cab_rhs = rhs_ty }) + = assert (prs `equalLength` tcvs) $ + -- Invariant of AxiomRuleCo: cos should + -- exactly saturate the axiom branch + Pair (substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys)) + (substTy (zipTCvSubst tcvs rtys) rhs_ty) + where + (ltys, rtys) = unzipPairs prs + tc = coAxiomTyCon ax + tcvs = tvs ++ cvs + {- Note [Nested ForAllCos] @@ -2617,7 +2602,6 @@ coercionRole = go go (FunCo { fco_role = r }) = r go (CoVarCo cv) = coVarRole cv go (HoleCo h) = coVarRole (coHoleCoVar h) - go (AxiomInstCo ax _ _) = coAxiomRole ax go (UnivCo { uco_role = r }) = r go (SymCo co) = go co go (TransCo co1 _co2) = go co1 @@ -2626,7 +2610,7 @@ coercionRole = go go (InstCo co _) = go co go (KindCo {}) = Nominal go (SubCo _) = Representational - go (AxiomRuleCo ax _) = coaxrRole ax + go (AxiomRuleCo ax _) = coAxiomRuleRole ax {- Note [Nested InstCos] ===================================== compiler/GHC/Core/Coercion.hs-boot ===================================== @@ -21,7 +21,6 @@ mkFunCo :: Role -> FunTyFlag -> CoercionN -> Coercion -> Coercion -> Coerci mkNakedFunCo :: Role -> FunTyFlag -> CoercionN -> Coercion -> Coercion -> Coercion mkFunCo2 :: Role -> FunTyFlag -> FunTyFlag -> CoercionN -> Coercion -> Coercion -> Coercion mkCoVarCo :: CoVar -> Coercion -mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion mkPhantomCo :: Coercion -> Type -> Type -> Coercion mkUnivCo :: UnivCoProvenance -> [Coercion] -> Role -> Type -> Type -> Coercion mkSymCo :: Coercion -> Coercion ===================================== compiler/GHC/Core/Coercion/Axiom.hs ===================================== @@ -31,7 +31,8 @@ module GHC.Core.Coercion.Axiom ( Role(..), fsFromRole, CoAxiomRule(..), BuiltInFamRewrite(..), BuiltInFamInteract(..), TypeEqn, - coaxrName, coaxrAsmpRoles, coaxrRole, coaxrProves, + coAxiomRuleArgRoles, coAxiomRuleRole, + coAxiomRuleBranch_maybe, isNewtypeAxiomRule_maybe, BuiltInSynFamily(..), trivialBuiltInFamily ) where @@ -41,7 +42,7 @@ import Language.Haskell.Syntax.Basic (Role(..)) import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type ) import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType, pprTyVar ) -import {-# SOURCE #-} GHC.Core.TyCon ( TyCon ) +import {-# SOURCE #-} GHC.Core.TyCon ( TyCon, isNewTyCon ) import GHC.Utils.Outputable import GHC.Data.FastString import GHC.Types.Name @@ -80,12 +81,12 @@ axF :: { F [Int] ~ Bool ; forall (k :: *) (a :: k -> *) (b :: k). F (a b) ~ Char } -The axiom is used with the AxiomInstCo constructor of Coercion. If we wish +The axiom is used with the AxiomRuleCo constructor of Coercion. If we wish to have a coercion showing that F (Maybe Int) ~ Char, it will look like axF[2] <*> :: F (Maybe Int) ~ Char -- or, written using concrete-ish syntax -- -AxiomInstCo axF 2 [Refl *, Refl Maybe, Refl Int] +AxiomRuleCo axF 2 [Refl *, Refl Maybe, Refl Int] Note that the index is 0-based. @@ -128,8 +129,21 @@ type variable is accurate. ************************************************************************ -} -type BranchIndex = Int -- The index of the branch in the list of branches - -- Counting from zero +{- Note [BranchIndex] +~~~~~~~~~~~~~~~~~~~~ +A CoAxiom has 1 or more branches. Each branch has contains a list +of the free type variables in that branch, the LHS type patterns, +and the RHS type for that branch. When we apply an axiom to a list +of coercions, we must choose which branch of the axiom we wish to +use, as the different branches may have different numbers of free +type variables. (The number of type patterns is always the same +among branches, but that doesn't quite concern us here.) +-} + + +type BranchIndex = Int -- Counting from zero + -- The index of the branch in the list of branches + -- See Note [BranchIndex] -- promoted data type data BranchFlag = Branched | Unbranched @@ -279,10 +293,6 @@ toUnbranchedAxiom (CoAxiom unique name role tc branches implicit) coAxiomNumPats :: CoAxiom br -> Int coAxiomNumPats = length . coAxBranchLHS . (flip coAxiomNthBranch 0) -coAxiomNthBranch :: CoAxiom br -> BranchIndex -> CoAxBranch -coAxiomNthBranch (CoAxiom { co_ax_branches = bs }) index - = branchesNth bs index - coAxiomArity :: CoAxiom br -> BranchIndex -> Arity coAxiomArity ax index = length tvs + length cvs @@ -297,6 +307,14 @@ coAxiomRole = co_ax_role coAxiomBranches :: CoAxiom br -> Branches br coAxiomBranches = co_ax_branches +coAxiomNthBranch :: CoAxiom br -> BranchIndex -> CoAxBranch +coAxiomNthBranch (CoAxiom { co_ax_branches = bs }) index + = branchesNth bs index + +coAxiomSingleBranch :: CoAxiom Unbranched -> CoAxBranch +coAxiomSingleBranch (CoAxiom { co_ax_branches = MkBranches arr }) + = arr ! 0 + coAxiomSingleBranch_maybe :: CoAxiom br -> Maybe CoAxBranch coAxiomSingleBranch_maybe (CoAxiom { co_ax_branches = MkBranches arr }) | snd (bounds arr) == 0 @@ -304,10 +322,6 @@ coAxiomSingleBranch_maybe (CoAxiom { co_ax_branches = MkBranches arr }) | otherwise = Nothing -coAxiomSingleBranch :: CoAxiom Unbranched -> CoAxBranch -coAxiomSingleBranch (CoAxiom { co_ax_branches = MkBranches arr }) - = arr ! 0 - coAxiomTyCon :: CoAxiom br -> TyCon coAxiomTyCon = co_ax_tc @@ -580,29 +594,79 @@ CoAxiomRules come in two flavours: -} --- | A more explicit representation for `t1 ~ t2`. -type TypeEqn = Pair Type - -- | CoAxiomRule is a sum type that joins BuiltInFamRewrite and BuiltInFamInteract data CoAxiomRule = BuiltInFamRewrite BuiltInFamRewrite | BuiltInFamInteract BuiltInFamInteract + | BranchedAxiom (CoAxiom Branched) BranchIndex + | UnbranchedAxiom (CoAxiom Unbranched) + +instance Eq CoAxiomRule where + (BuiltInFamRewrite bif1) == (BuiltInFamRewrite bif2) = bifrw_name bif1 == bifrw_name bif2 + (BuiltInFamInteract bif1) == (BuiltInFamInteract bif2) = bifint_name bif1 == bifint_name bif2 + (UnbranchedAxiom ax1) == (UnbranchedAxiom ax2) = getUnique ax1 == getUnique ax2 + (BranchedAxiom ax1 i1) == (BranchedAxiom ax2 i2) = getUnique ax1 == getUnique ax2 && i1 == i2 + _ == _ = False + +coAxiomRuleRole :: CoAxiomRule -> Role +coAxiomRuleRole (BuiltInFamRewrite bif) = bifrw_res_role bif +coAxiomRuleRole (BuiltInFamInteract bif) = bifint_res_role bif +coAxiomRuleRole (UnbranchedAxiom ax) = coAxiomRole ax +coAxiomRuleRole (BranchedAxiom ax _) = coAxiomRole ax + +coAxiomRuleArgRoles :: CoAxiomRule -> [Role] +coAxiomRuleArgRoles (BuiltInFamRewrite bif) = bifrw_arg_roles bif +coAxiomRuleArgRoles (BuiltInFamInteract bif) = bifint_arg_roles bif +coAxiomRuleArgRoles (UnbranchedAxiom ax) = coAxBranchRoles (coAxiomSingleBranch ax) +coAxiomRuleArgRoles (BranchedAxiom ax i) = coAxBranchRoles (coAxiomNthBranch ax i) + +coAxiomRuleBranch_maybe :: CoAxiomRule -> Maybe (TyCon, Role, CoAxBranch) +coAxiomRuleBranch_maybe (UnbranchedAxiom ax) = Just (co_ax_tc ax, co_ax_role ax, coAxiomSingleBranch ax) +coAxiomRuleBranch_maybe (BranchedAxiom ax i) = Just (co_ax_tc ax, co_ax_role ax, coAxiomNthBranch ax i) +coAxiomRuleBranch_maybe _ = Nothing + +isNewtypeAxiomRule_maybe :: CoAxiomRule -> Maybe (TyCon, CoAxBranch) +isNewtypeAxiomRule_maybe (UnbranchedAxiom ax) + | let tc = coAxiomTyCon ax, isNewTyCon tc = Just (tc, coAxiomSingleBranch ax) +isNewtypeAxiomRule_maybe _ = Nothing + +instance Data.Data CoAxiomRule where + -- don't traverse? + toConstr _ = abstractConstr "CoAxiomRule" + gunfold _ _ = error "gunfold" + dataTypeOf _ = mkNoRepType "CoAxiomRule" -coaxrName :: CoAxiomRule -> FastString -coaxrName (BuiltInFamRewrite bif) = bifrw_name bif -coaxrName (BuiltInFamInteract bif) = bifint_name bif +--instance Ord CoAxiomRule where +-- -- we compare lexically to avoid non-deterministic output when sets of rules +-- -- are printed +-- compare x y = lexicalCompareFS (coaxrName x) (coaxrName y) -coaxrAsmpRoles :: CoAxiomRule -> [Role] -coaxrAsmpRoles (BuiltInFamRewrite bif) = bifrw_arg_roles bif -coaxrAsmpRoles (BuiltInFamInteract bif) = bifint_arg_roles bif +instance Outputable CoAxiomRule where + ppr (BuiltInFamRewrite bif) = ppr (bifrw_name bif) + ppr (BuiltInFamInteract bif) = ppr (bifint_name bif) + ppr (UnbranchedAxiom ax) = ppr (coAxiomName ax) + ppr (BranchedAxiom ax i) = ppr (coAxiomName ax) <> brackets (int i) -coaxrRole :: CoAxiomRule -> Role -coaxrRole (BuiltInFamRewrite bif) = bifrw_res_role bif -coaxrRole (BuiltInFamInteract bif) = bifint_res_role bif +{- ********************************************************************* +* * + Built-in families +* * +********************************************************************* -} -coaxrProves :: CoAxiomRule -> [TypeEqn] -> Maybe TypeEqn -coaxrProves (BuiltInFamRewrite bif) = bifrw_proves bif -coaxrProves (BuiltInFamInteract bif) = bifint_proves bif + +-- | A more explicit representation for `t1 ~ t2`. +type TypeEqn = Pair Type + +-- Type checking of built-in families +data BuiltInSynFamily = BuiltInSynFamily + { sfMatchFam :: [BuiltInFamRewrite] + + , sfInteract:: [BuiltInFamInteract] + -- If given these type arguments and RHS, returns the equalities that + -- are guaranteed to hold. That is, if + -- (ar, Pair s1 s2) is an element of (sfInteract tys ty) + -- then AxiomRule ar [co :: F tys ~ ty] :: s1~s2 + } data BuiltInFamInteract = BIF_Interact @@ -610,7 +674,7 @@ data BuiltInFamInteract , bifint_arg_roles :: [Role] -- roles of parameter equations , bifint_res_role :: Role -- role of resulting equation , bifint_proves :: [TypeEqn] -> Maybe TypeEqn - -- ^ coaxrProves returns @Nothing@ when it doesn't like + -- ^ Returns @Nothing@ when it doesn't like -- the supplied arguments. When this happens in a coercion -- that means that the coercion is ill-formed, and Core Lint -- checks for that. @@ -625,43 +689,11 @@ data BuiltInFamRewrite , bifrw_match :: [Type] -> Maybe ([Type], Type) -- Instantiating types and result type -- coaxrMatch: does this reduce on the given arguments? -- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) - -- That is: mkAxiomRuleCo coax (zipWith mkReflCo coaxrAsmpRoles ts) + -- That is: mkAxiomRuleCo ax (zipWith mkReflCo coAxiomRuleArgRoles ts) -- :: F tys ~coaxrRole rhs, , bifrw_proves :: [TypeEqn] -> Maybe TypeEqn } -instance Data.Data CoAxiomRule where - -- don't traverse? - toConstr _ = abstractConstr "CoAxiomRule" - gunfold _ _ = error "gunfold" - dataTypeOf _ = mkNoRepType "CoAxiomRule" - -instance Uniquable CoAxiomRule where - getUnique = getUnique . coaxrName - -instance Eq CoAxiomRule where - x == y = coaxrName x == coaxrName y - -instance Ord CoAxiomRule where - -- we compare lexically to avoid non-deterministic output when sets of rules - -- are printed - compare x y = lexicalCompareFS (coaxrName x) (coaxrName y) - -instance Outputable CoAxiomRule where - ppr = ppr . coaxrName - --- Type checking of built-in families -data BuiltInSynFamily = BuiltInSynFamily - { sfMatchFam :: [BuiltInFamRewrite] - - , sfInteract:: [BuiltInFamInteract] - -- If given these type arguments and RHS, returns the equalities that - -- are guaranteed to hold. That is, if - -- (ar, Pair s1 s2) is an element of (sfInteract tys ty) - -- then AxiomRule ar [co :: F tys ~ ty] :: s1~s2 - } - -- Provides default implementations that do nothing. trivialBuiltInFamily :: BuiltInSynFamily trivialBuiltInFamily = BuiltInSynFamily { sfMatchFam = [], sfInteract = [] } - ===================================== compiler/GHC/Core/Coercion/Opt.hs ===================================== @@ -355,19 +355,19 @@ opt_co4 env sym rep r (CoVarCo cv) opt_co4 _ _ _ _ (HoleCo h) = pprPanic "opt_univ fell into a hole" (ppr h) -opt_co4 env sym rep r (AxiomInstCo con ind cos) +opt_co4 env sym rep r (AxiomRuleCo con cos) -- Do *not* push sym inside top-level axioms -- e.g. if g is a top-level axiom -- g a : f a ~ a -- then (sym (g ty)) /= g (sym ty) !! - = assert (r == coAxiomRole con ) - wrapRole rep (coAxiomRole con) $ + = assert (r == coAxiomRuleRole con ) + wrapRole rep (coAxiomRuleRole con) $ wrapSym sym $ -- some sub-cos might be P: use opt_co2 -- See Note [Optimising coercion optimisation] - AxiomInstCo con ind (zipWith (opt_co2 env False) - (coAxBranchRoles (coAxiomNthBranch con ind)) - cos) + AxiomRuleCo con (zipWith (opt_co2 env False) + (coAxiomRuleArgRoles con) + cos) -- Note that the_co does *not* have sym pushed into it opt_co4 env sym rep r (UnivCo { uco_prov = prov, uco_lty = t1 @@ -506,13 +506,6 @@ opt_co4 env sym _ r (SubCo co) = assert (r == Representational) $ opt_co4_wrap env sym True Nominal co --- This could perhaps be optimized more. -opt_co4 env sym rep r (AxiomRuleCo co cs) - = assert (r == coaxrRole co) $ - wrapRole rep r $ - wrapSym sym $ - AxiomRuleCo co (zipWith (opt_co2 env False) (coaxrAsmpRoles co) cs) - {- Note [Optimise CoVarCo to Refl] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have (c :: t~t) we can optimise it to Refl. That increases the @@ -840,15 +833,13 @@ opt_trans_rule is co1 co2 -- If we put TrPushSymAxR first, we'll get -- (axN ty ; sym (axN ty)) :: N ty ~ N ty -- Obviously Refl -- --> axN (sym (axN ty)) :: N ty ~ N ty -- Very stupid - | Just (sym1, ax1, ind1, cos1) <- isAxiom_maybe co1 - , Just (sym2, ax2, ind2, cos2) <- isAxiom_maybe co2 - , ax1 == ax2 - , ind1 == ind2 + | Just (sym1, axr1, cos1) <- isAxiomRuleCo_maybe co1 + , Just (sym2, axr2, cos2) <- isAxiomRuleCo_maybe co2 + , axr1 == axr2 , sym1 == not sym2 - , let branch = coAxiomNthBranch ax1 ind1 - role = coAxiomRole ax1 - qtvs = coAxBranchTyVars branch ++ coAxBranchCoVars branch - lhs = coAxNthLHS ax1 ind1 + , Just (tc, role, branch) <- coAxiomRuleBranch_maybe axr1 + , let qtvs = coAxBranchTyVars branch ++ coAxBranchCoVars branch + lhs = mkTyConApp tc (coAxBranchLHS branch) rhs = coAxBranchRHS branch pivot_tvs = exactTyCoVarsOfType (if sym2 then rhs else lhs) , all (`elemVarSet` pivot_tvs) qtvs @@ -862,35 +853,31 @@ opt_trans_rule is co1 co2 -- See Note [Push transitivity inside axioms] and -- Note [Push transitivity inside newtype axioms only] -- TrPushSymAxR - | Just (sym, con, ind, cos1) <- isAxiom_maybe co1 - , isNewTyCon (coAxiomTyCon con) + | Just (sym, axr, cos1) <- isAxiomRuleCo_maybe co1 , True <- sym - , Just cos2 <- matchAxiom sym con ind co2 - , let newAxInst = AxiomInstCo con ind (opt_transList is (map mkSymCo cos2) cos1) + , Just cos2 <- matchNewtypeBranch sym axr co2 + , let newAxInst = AxiomRuleCo axr (opt_transList is (map mkSymCo cos2) cos1) = fireTransRule "TrPushSymAxR" co1 co2 $ SymCo newAxInst -- TrPushAxR - | Just (sym, con, ind, cos1) <- isAxiom_maybe co1 - , isNewTyCon (coAxiomTyCon con) + | Just (sym, axr, cos1) <- isAxiomRuleCo_maybe co1 , False <- sym - , Just cos2 <- matchAxiom sym con ind co2 - , let newAxInst = AxiomInstCo con ind (opt_transList is cos1 cos2) + , Just cos2 <- matchNewtypeBranch sym axr co2 + , let newAxInst = AxiomRuleCo axr (opt_transList is cos1 cos2) = fireTransRule "TrPushAxR" co1 co2 newAxInst -- TrPushSymAxL - | Just (sym, con, ind, cos2) <- isAxiom_maybe co2 - , isNewTyCon (coAxiomTyCon con) + | Just (sym, axr, cos2) <- isAxiomRuleCo_maybe co2 , True <- sym - , Just cos1 <- matchAxiom (not sym) con ind co1 - , let newAxInst = AxiomInstCo con ind (opt_transList is cos2 (map mkSymCo cos1)) + , Just cos1 <- matchNewtypeBranch (not sym) axr co1 + , let newAxInst = AxiomRuleCo axr (opt_transList is cos2 (map mkSymCo cos1)) = fireTransRule "TrPushSymAxL" co1 co2 $ SymCo newAxInst -- TrPushAxL - | Just (sym, con, ind, cos2) <- isAxiom_maybe co2 - , isNewTyCon (coAxiomTyCon con) + | Just (sym, axr, cos2) <- isAxiomRuleCo_maybe co2 , False <- sym - , Just cos1 <- matchAxiom (not sym) con ind co1 - , let newAxInst = AxiomInstCo con ind (opt_transList is cos1 cos2) + , Just cos1 <- matchNewtypeBranch (not sym) axr co1 + , let newAxInst = AxiomRuleCo axr (opt_transList is cos1 cos2) = fireTransRule "TrPushAxL" co1 co2 newAxInst @@ -1145,24 +1132,24 @@ chooseRole True _ = Representational chooseRole _ r = r ----------- -isAxiom_maybe :: Coercion -> Maybe (Bool, CoAxiom Branched, Int, [Coercion]) +isAxiomRuleCo_maybe :: Coercion -> Maybe (SymFlag, CoAxiomRule, [Coercion]) -- We don't expect to see nested SymCo; and that lets us write a simple, -- non-recursive function. (If we see a nested SymCo we'll just fail, -- which is ok.) -isAxiom_maybe (SymCo (AxiomInstCo ax ind cos)) - = Just (True, ax, ind, cos) -isAxiom_maybe (AxiomInstCo ax ind cos) - = Just (False, ax, ind, cos) -isAxiom_maybe _ = Nothing - -matchAxiom :: Bool -- True = match LHS, False = match RHS - -> CoAxiom br -> Int -> Coercion -> Maybe [Coercion] -matchAxiom sym ax@(CoAxiom { co_ax_tc = tc }) ind co - | CoAxBranch { cab_tvs = qtvs +isAxiomRuleCo_maybe (SymCo (AxiomRuleCo ax cos)) = Just (True, ax, cos) +isAxiomRuleCo_maybe (AxiomRuleCo ax cos) = Just (False, ax, cos) +isAxiomRuleCo_maybe _ = Nothing + +matchNewtypeBranch :: Bool -- True = match LHS, False = match RHS + -> CoAxiomRule + -> Coercion -> Maybe [Coercion] +matchNewtypeBranch sym axr co + | Just (tc,branch) <- isNewtypeAxiomRule_maybe axr + , CoAxBranch { cab_tvs = qtvs , cab_cvs = [] -- can't infer these, so fail if there are any , cab_roles = roles , cab_lhs = lhs - , cab_rhs = rhs } <- coAxiomNthBranch ax ind + , cab_rhs = rhs } <- branch , Just subst <- liftCoMatch (mkVarSet qtvs) (if sym then (mkTyConApp tc lhs) else rhs) co ===================================== compiler/GHC/Core/FVs.hs ===================================== @@ -40,7 +40,7 @@ module GHC.Core.FVs ( -- * Orphan names orphNamesOfType, orphNamesOfTypes, - orphNamesOfCo, orphNamesOfCoCon, orphNamesOfAxiomLHS, + orphNamesOfCo, orphNamesOfAxiomLHS, exprsOrphNames, -- * Core syntax tree annotation with free variables @@ -394,7 +394,7 @@ orphNamesOfCo (FunCo { fco_mult = co_mult, fco_arg = co1, fco_res = co2 }) `unionNameSet` orphNamesOfCo co1 `unionNameSet` orphNamesOfCo co2 orphNamesOfCo (CoVarCo _) = emptyNameSet -orphNamesOfCo (AxiomInstCo con _ cos) = orphNamesOfCoCon con `unionNameSet` orphNamesOfCos cos +orphNamesOfCo (AxiomRuleCo con cos) = orphNamesOfAxRule con `unionNameSet` orphNamesOfCos cos orphNamesOfCo (UnivCo { uco_lty = t1, uco_rty = t2 }) = orphNamesOfType t1 `unionNameSet` orphNamesOfType t2 orphNamesOfCo (SymCo co) = orphNamesOfCo co @@ -404,14 +404,19 @@ orphNamesOfCo (LRCo _ co) = orphNamesOfCo co orphNamesOfCo (InstCo co arg) = orphNamesOfCo co `unionNameSet` orphNamesOfCo arg orphNamesOfCo (KindCo co) = orphNamesOfCo co orphNamesOfCo (SubCo co) = orphNamesOfCo co -orphNamesOfCo (AxiomRuleCo _ cs) = orphNamesOfCos cs orphNamesOfCo (HoleCo _) = emptyNameSet orphNamesOfCos :: [Coercion] -> NameSet orphNamesOfCos = orphNamesOfThings orphNamesOfCo -orphNamesOfCoCon :: CoAxiom br -> NameSet -orphNamesOfCoCon (CoAxiom { co_ax_tc = tc, co_ax_branches = branches }) +orphNamesOfAxRule :: CoAxiomRule -> NameSet +orphNamesOfAxRule (BuiltInFamRewrite {}) = emptyNameSet +orphNamesOfAxRule (BuiltInFamInteract {}) = emptyNameSet +orphNamesOfAxRule (UnbranchedAxiom ax) = orphNamesOfCoAx ax +orphNamesOfAxRule (BranchedAxiom ax _) = orphNamesOfCoAx ax + +orphNamesOfCoAx :: CoAxiom br -> NameSet +orphNamesOfCoAx (CoAxiom { co_ax_tc = tc, co_ax_branches = branches }) = orphNamesOfTyCon tc `unionNameSet` orphNamesOfCoAxBranches branches orphNamesOfCoAxBranches :: Branches br -> NameSet ===================================== compiler/GHC/Core/FamInstEnv.hs ===================================== @@ -1193,13 +1193,14 @@ reduceTyFamApp_maybe envs role tc tys | Just ax <- isClosedSynFamilyTyConWithAxiom_maybe tc , Just (ind, inst_tys, inst_cos) <- chooseBranch ax tys - = let co = mkAxInstCo role ax ind inst_tys inst_cos + = let co = mkAxInstCo role (BranchedAxiom ax ind) inst_tys inst_cos in Just $ coercionRedn co | Just builtin_fam <- isBuiltInSynFamTyCon_maybe tc - , Just (coax,ts,ty) <- tryMatchFam builtin_fam tys - , role == coaxrRole coax - = let co = mkAxiomRuleCo coax (zipWith mkReflCo (coaxrAsmpRoles coax) ts) + , Just (rewrite,ts,ty) <- tryMatchFam builtin_fam tys + , role == bifrw_res_role rewrite + = let co = mkAxiomRuleCo (BuiltInFamRewrite rewrite) + (zipWith mkReflCo (bifrw_arg_roles rewrite) ts) in Just $ mkReduction co ty | otherwise ===================================== compiler/GHC/Core/Lint.hs ===================================== @@ -2611,42 +2611,47 @@ lintCoercion (InstCo co arg) ; _ -> failWithL (text "Bad argument of inst") }}} -lintCoercion co@(AxiomInstCo con ind cos) - = do { unless (0 <= ind && ind < numBranches (coAxiomBranches con)) - (bad_ax (text "index out of range")) - ; let CoAxBranch { cab_tvs = ktvs - , cab_cvs = cvs - , cab_roles = roles } = coAxiomNthBranch con ind - ; unless (cos `equalLength` (ktvs ++ cvs)) $ - bad_ax (text "lengths") - ; cos' <- mapM lintCoercion cos - ; subst <- getSubst - ; let empty_subst = zapSubst subst - ; _ <- foldlM check_ki (empty_subst, empty_subst) - (zip3 (ktvs ++ cvs) roles cos') - ; let fam_tc = coAxiomTyCon con - ; case checkAxInstCo co of - Just bad_branch -> bad_ax $ text "inconsistent with" <+> - pprCoAxBranch fam_tc bad_branch - Nothing -> return () - ; return (AxiomInstCo con ind cos') } +lintCoercion this_co@(AxiomRuleCo ax cos) + = do { cos' <- mapM lintCoercion cos + ; let arg_kinds :: [Pair Type] = map coercionKind cos' + ; lint_roles 0 (coAxiomRuleArgRoles ax) cos' + ; lint_ax ax arg_kinds + ; return (AxiomRuleCo ax cos') } where - bad_ax what = addErrL (hang (text "Bad axiom application" <+> parens what) - 2 (ppr co)) + lint_ax :: CoAxiomRule -> [Pair Type] -> LintM () + lint_ax (BuiltInFamRewrite bif) prs + = checkL (isJust (bifrw_proves bif prs)) bad_bif + lint_ax (BuiltInFamInteract bif) prs + = checkL (isJust (bifint_proves bif prs)) bad_bif + lint_ax (UnbranchedAxiom ax) prs + = lintBranch this_co (coAxiomTyCon ax) (coAxiomSingleBranch ax) prs + lint_ax (BranchedAxiom ax ind) prs + = do { checkL (0 <= ind && ind < numBranches (coAxiomBranches ax)) + (bad_ax this_co (text "index out of range")) + ; lintBranch this_co (coAxiomTyCon ax) (coAxiomNthBranch ax ind) prs } + + bad_bif = bad_ax this_co (text "Proves returns Nothing") + + err :: forall a. String -> [SDoc] -> LintM a + err m xs = failWithL $ + hang (text m) 2 $ vcat (text "Rule:" <+> ppr ax : xs) + + lint_roles n (e : es) (co : cos) + | e == coercionRole co + = lint_roles (n+1) es cos + | otherwise = err "Argument roles mismatch" + [ text "In argument:" <+> int (n+1) + , text "Expected:" <+> ppr e + , text "Found:" <+> ppr (coercionRole co) ] + lint_roles _ [] [] = return () + lint_roles n [] rs = err "Too many coercion arguments" + [ text "Expected:" <+> int n + , text "Provided:" <+> int (n + length rs) ] + + lint_roles n es [] = err "Not enough coercion arguments" + [ text "Expected:" <+> int (n + length es) + , text "Provided:" <+> int n ] - check_ki (subst_l, subst_r) (ktv, role, arg') - = do { let Pair s' t' = coercionKind arg' - sk' = typeKind s' - tk' = typeKind t' - ; lintRole arg' role (coercionRole arg') - ; let ktv_kind_l = substTy subst_l (tyVarKind ktv) - ktv_kind_r = substTy subst_r (tyVarKind ktv) - ; unless (sk' `eqType` ktv_kind_l) - (bad_ax (text "check_ki1" <+> vcat [ ppr co, ppr sk', ppr ktv, ppr ktv_kind_l ] )) - ; unless (tk' `eqType` ktv_kind_r) - (bad_ax (text "check_ki2" <+> vcat [ ppr co, ppr tk', ppr ktv, ppr ktv_kind_r ] )) - ; return (extendTCvSubst subst_l ktv s', - extendTCvSubst subst_r ktv t') } lintCoercion (KindCo co) = do { co' <- lintCoercion co @@ -2657,40 +2662,14 @@ lintCoercion (SubCo co') ; lintRole co' Nominal (coercionRole co') ; return (SubCo co') } -lintCoercion this@(AxiomRuleCo ax cos) - = do { cos' <- mapM lintCoercion cos - ; lint_roles 0 (coaxrAsmpRoles ax) cos' - ; case coaxrProves ax (map coercionKind cos') of - Nothing -> err "Malformed use of AxiomRuleCo" [ ppr this ] - Just _ -> return (AxiomRuleCo ax cos') } - where - err :: forall a. String -> [SDoc] -> LintM a - err m xs = failWithL $ - hang (text m) 2 $ vcat (text "Rule:" <+> ppr (coaxrName ax) : xs) - - lint_roles n (e : es) (co : cos) - | e == coercionRole co = lint_roles (n+1) es cos - | otherwise = err "Argument roles mismatch" - [ text "In argument:" <+> int (n+1) - , text "Expected:" <+> ppr e - , text "Found:" <+> ppr (coercionRole co) ] - lint_roles _ [] [] = return () - lint_roles n [] rs = err "Too many coercion arguments" - [ text "Expected:" <+> int n - , text "Provided:" <+> int (n + length rs) ] - - lint_roles n es [] = err "Not enough coercion arguments" - [ text "Expected:" <+> int (n + length es) - , text "Provided:" <+> int n ] - lintCoercion (HoleCo h) = do { addErrL $ text "Unfilled coercion hole:" <+> ppr h ; lintCoercion (CoVarCo (coHoleCoVar h)) } {- -Note [Conflict checking with AxiomInstCo] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Conflict checking for axiom applications] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the following type family and axiom: type family Equal (a :: k) (b :: k) :: Bool @@ -2718,28 +2697,53 @@ docs/core-spec, which defines the corresponding no_conflict function used by the Co_AxiomInstCo rule in the section "Coercion typing". -} --- | Check to make sure that an AxInstCo is internally consistent. +-- | Check to make sure that an axiom application is internally consistent. -- Returns the conflicting branch, if it exists --- See Note [Conflict checking with AxiomInstCo] -checkAxInstCo :: Coercion -> Maybe CoAxBranch +-- Note [Conflict checking for axiom applications] +lintBranch :: Coercion -> TyCon-> CoAxBranch -> [Pair Type] -> LintM () -- defined here to avoid dependencies in GHC.Core.Coercion -- If you edit this function, you may need to update the GHC formalism -- See Note [GHC Formalism] in GHC.Core.Lint -checkAxInstCo (AxiomInstCo ax ind cos) - = let branch = coAxiomNthBranch ax ind - tvs = coAxBranchTyVars branch - cvs = coAxBranchCoVars branch - incomps = coAxBranchIncomps branch - (tys, cotys) = splitAtList tvs (map coercionLKind cos) - co_args = map stripCoercionTy cotys - subst = zipTvSubst tvs tys `composeTCvSubst` - zipCvSubst cvs co_args - target = Type.substTys subst (coAxBranchLHS branch) - in_scope = mkInScopeSet $ - unionVarSets (map (tyCoVarsOfTypes . coAxBranchLHS) incomps) - flattened_target = flattenTys in_scope target in - check_no_conflict flattened_target incomps +lintBranch this_co fam_tc branch arg_kinds + | CoAxBranch { cab_tvs = ktvs, cab_cvs = cvs } <- branch + = do { checkL (arg_kinds `equalLength` (ktvs ++ cvs)) $ + (bad_ax this_co (text "lengths")) + + ; subst <- getSubst + ; let empty_subst = zapSubst subst + ; _ <- foldlM check_ki (empty_subst, empty_subst) + (zip (ktvs ++ cvs) arg_kinds) + + ; case check_no_conflict flattened_target incomps of + Nothing -> return () + Just bad_branch -> failWithL $ bad_ax this_co $ + text "inconsistent with" <+> + pprCoAxBranch fam_tc bad_branch } where + check_ki (subst_l, subst_r) (ktv, Pair s' t') + = do { let sk' = typeKind s' + tk' = typeKind t' + ; let ktv_kind_l = substTy subst_l (tyVarKind ktv) + ktv_kind_r = substTy subst_r (tyVarKind ktv) + ; checkL (sk' `eqType` ktv_kind_l) + (bad_ax this_co (text "check_ki1" <+> vcat [ ppr this_co, ppr sk', ppr ktv, ppr ktv_kind_l ] )) + ; checkL (tk' `eqType` ktv_kind_r) + (bad_ax this_co (text "check_ki2" <+> vcat [ ppr this_co, ppr tk', ppr ktv, ppr ktv_kind_r ] )) + ; return (extendTCvSubst subst_l ktv s', + extendTCvSubst subst_r ktv t') } + + tvs = coAxBranchTyVars branch + cvs = coAxBranchCoVars branch + incomps = coAxBranchIncomps branch + (tys, cotys) = splitAtList tvs (map pFst arg_kinds) + co_args = map stripCoercionTy cotys + subst = zipTvSubst tvs tys `composeTCvSubst` + zipCvSubst cvs co_args + target = Type.substTys subst (coAxBranchLHS branch) + in_scope = mkInScopeSet $ + unionVarSets (map (tyCoVarsOfTypes . coAxBranchLHS) incomps) + flattened_target = flattenTys in_scope target + check_no_conflict :: [Type] -> [CoAxBranch] -> Maybe CoAxBranch check_no_conflict _ [] = Nothing check_no_conflict flat (b at CoAxBranch { cab_lhs = lhs_incomp } : rest) @@ -2748,7 +2752,10 @@ checkAxInstCo (AxiomInstCo ax ind cos) = check_no_conflict flat rest | otherwise = Just b -checkAxInstCo _ = Nothing + +bad_ax :: Coercion -> SDoc -> SDoc +bad_ax this_co what + = hang (text "Bad axiom application" <+> parens what) 2 (ppr this_co) {- ===================================== compiler/GHC/Core/TyCo/FVs.hs ===================================== @@ -62,7 +62,7 @@ import GHC.Builtin.Types.Prim( funTyFlagTyCon ) import Data.Monoid as DM ( Any(..) ) import GHC.Core.TyCo.Rep import GHC.Core.TyCon -import GHC.Core.Coercion.Axiom( coAxiomTyCon ) +import GHC.Core.Coercion.Axiom( CoAxiomRule(..), coAxiomTyCon ) import GHC.Utils.FV import GHC.Types.Var @@ -668,7 +668,7 @@ tyCoFVsOfCo (CoVarCo v) fv_cand in_scope acc tyCoFVsOfCo (HoleCo h) fv_cand in_scope acc = tyCoFVsOfCoVar (coHoleCoVar h) fv_cand in_scope acc -- See Note [CoercionHoles and coercion free variables] -tyCoFVsOfCo (AxiomInstCo _ _ cos) fv_cand in_scope acc = tyCoFVsOfCos cos fv_cand in_scope acc +tyCoFVsOfCo (AxiomRuleCo _ cs) fv_cand in_scope acc = tyCoFVsOfCos cs fv_cand in_scope acc tyCoFVsOfCo (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps}) fv_cand in_scope acc = (tyCoFVsOfCos deps `unionFV` tyCoFVsOfType t1 `unionFV` tyCoFVsOfType t2) fv_cand in_scope acc @@ -679,7 +679,6 @@ tyCoFVsOfCo (LRCo _ co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in tyCoFVsOfCo (InstCo co arg) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOfCo arg) fv_cand in_scope acc tyCoFVsOfCo (KindCo co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in_scope acc tyCoFVsOfCo (SubCo co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in_scope acc -tyCoFVsOfCo (AxiomRuleCo _ cs) fv_cand in_scope acc = tyCoFVsOfCos cs fv_cand in_scope acc tyCoFVsOfCoVar :: CoVar -> FV tyCoFVsOfCoVar v fv_cand in_scope acc @@ -717,8 +716,8 @@ almost_devoid_co_var_of_co (FunCo { fco_mult = w, fco_arg = co1, fco_res = co2 } && almost_devoid_co_var_of_co co2 cv almost_devoid_co_var_of_co (CoVarCo v) cv = v /= cv almost_devoid_co_var_of_co (HoleCo h) cv = (coHoleCoVar h) /= cv -almost_devoid_co_var_of_co (AxiomInstCo _ _ cos) cv - = almost_devoid_co_var_of_cos cos cv +almost_devoid_co_var_of_co (AxiomRuleCo _ cs) cv + = almost_devoid_co_var_of_cos cs cv almost_devoid_co_var_of_co (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) cv = almost_devoid_co_var_of_cos deps cv && almost_devoid_co_var_of_type t1 cv @@ -739,8 +738,6 @@ almost_devoid_co_var_of_co (KindCo co) cv = almost_devoid_co_var_of_co co cv almost_devoid_co_var_of_co (SubCo co) cv = almost_devoid_co_var_of_co co cv -almost_devoid_co_var_of_co (AxiomRuleCo _ cs) cv - = almost_devoid_co_var_of_cos cs cv almost_devoid_co_var_of_cos :: [Coercion] -> CoVar -> Bool almost_devoid_co_var_of_cos [] _ = True @@ -1129,7 +1126,7 @@ tyConsOfType ty = go_co kind_co `unionUniqSets` go_co co go_co (FunCo { fco_mult = m, fco_arg = a, fco_res = r }) = go_co m `unionUniqSets` go_co a `unionUniqSets` go_co r - go_co (AxiomInstCo ax _ args) = go_ax ax `unionUniqSets` go_cos args + go_co (AxiomRuleCo ax args) = go_ax ax `unionUniqSets` go_cos args go_co (UnivCo { uco_lty = t1, uco_rty = t2 }) = go t1 `unionUniqSets` go t2 go_co (CoVarCo {}) = emptyUniqSet go_co (HoleCo {}) = emptyUniqSet @@ -1140,7 +1137,6 @@ tyConsOfType ty go_co (InstCo co arg) = go_co co `unionUniqSets` go_co arg go_co (KindCo co) = go_co co go_co (SubCo co) = go_co co - go_co (AxiomRuleCo _ cs) = go_cos cs go_mco MRefl = emptyUniqSet go_mco (MCo co) = go_co co @@ -1148,7 +1144,11 @@ tyConsOfType ty go_cos cos = foldr (unionUniqSets . go_co) emptyUniqSet cos go_tc tc = unitUniqSet tc - go_ax ax = go_tc $ coAxiomTyCon ax + + go_ax (UnbranchedAxiom ax) = go_tc $ coAxiomTyCon ax + go_ax (BranchedAxiom ax _) = go_tc $ coAxiomTyCon ax + go_ax (BuiltInFamRewrite {}) = emptyUniqSet + go_ax (BuiltInFamInteract {}) = emptyUniqSet tyConsOfTypes :: [Type] -> UniqSet TyCon tyConsOfTypes tys = foldr (unionUniqSets . tyConsOfType) emptyUniqSet tys @@ -1326,8 +1326,8 @@ occCheckExpand vs_to_avoid ty | bad_var_occ as (ch_co_var h) = Nothing | otherwise = return co - go_co cxt (AxiomInstCo ax ind args) = do { args' <- mapM (go_co cxt) args - ; return (AxiomInstCo ax ind args') } + go_co cxt (AxiomRuleCo ax cs) = do { cs' <- mapM (go_co cxt) cs + ; return (AxiomRuleCo ax cs') } go_co cxt co@(UnivCo { uco_lty = ty1, uco_rty = ty2 }) = do { ty1' <- go cxt ty1 ; ty2' <- go cxt ty2 @@ -1348,6 +1348,4 @@ occCheckExpand vs_to_avoid ty ; return (KindCo co') } go_co cxt (SubCo co) = do { co' <- go_co cxt co ; return (SubCo co') } - go_co cxt (AxiomRuleCo ax cs) = do { cs' <- mapM (go_co cxt) cs - ; return (AxiomRuleCo ax cs') } ===================================== compiler/GHC/Core/TyCo/Rep.hs ===================================== @@ -907,9 +907,7 @@ data Coercion | CoVarCo CoVar -- :: _ -> (N or R) -- result role depends on the tycon of the variable's type - -- AxiomInstCo :: e -> _ -> ?? -> e - | AxiomInstCo (CoAxiom Branched) BranchIndex [Coercion] - -- See also [CoAxiom index] + | AxiomRuleCo CoAxiomRule [Coercion] -- The coercion arguments always *precisely* saturate -- arity of (that branch of) the CoAxiom. If there are -- any left over, we use AppCo. @@ -917,11 +915,6 @@ data Coercion -- The roles of the argument coercions are determined -- by the cab_roles field of the relevant branch of the CoAxiom - | AxiomRuleCo CoAxiomRule [Coercion] - -- AxiomRuleCo is very like AxiomInstCo, but for a CoAxiomRule - -- The number of coercions should match exactly the expectations - -- of the CoAxiomRule (i.e., the rule is fully saturated). - | UnivCo -- See Note [UnivCo] -- Of kind (lty ~role rty) { uco_prov :: UnivCoProvenance @@ -1198,19 +1191,6 @@ Now we have which can be optimized to F g. -Note [CoAxiom index] -~~~~~~~~~~~~~~~~~~~~ -A CoAxiom has 1 or more branches. Each branch has contains a list -of the free type variables in that branch, the LHS type patterns, -and the RHS type for that branch. When we apply an axiom to a list -of coercions, we must choose which branch of the axiom we wish to -use, as the different branches may have different numbers of free -type variables. (The number of type patterns is always the same -among branches, but that doesn't quite concern us here.) - -The Int in the AxiomInstCo constructor is the 0-indexed number -of the chosen branch. - Note [Required foralls in Core] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the CoreExpr (Lam a e) where `a` is a TyVar, and (e::e_ty). @@ -1981,14 +1961,13 @@ foldTyCo (TyCoFolder { tcf_view = view go_co env (TyConAppCo _ _ args) = go_cos env args go_co env (AppCo c1 c2) = go_co env c1 `mappend` go_co env c2 go_co env (CoVarCo cv) = covar env cv - go_co env (AxiomInstCo _ _ args) = go_cos env args + go_co env (AxiomRuleCo _ cos) = go_cos env cos go_co env (HoleCo hole) = cohole env hole go_co env (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) = go_ty env t1 `mappend` go_ty env t2 `mappend` go_cos env deps go_co env (SymCo co) = go_co env co go_co env (TransCo c1 c2) = go_co env c1 `mappend` go_co env c2 - go_co env (AxiomRuleCo _ cos) = go_cos env cos go_co env (SelCo _ co) = go_co env co go_co env (LRCo _ co) = go_co env co go_co env (InstCo co arg) = go_co env co `mappend` go_co env arg @@ -2054,7 +2033,7 @@ coercionSize (FunCo _ _ _ w c1 c2) = 1 + coercionSize c1 + coercionSize c2 + coercionSize w coercionSize (CoVarCo _) = 1 coercionSize (HoleCo _) = 1 -coercionSize (AxiomInstCo _ _ args) = 1 + sum (map coercionSize args) +coercionSize (AxiomRuleCo _ cs) = 1 + sum (map coercionSize cs) coercionSize (UnivCo { uco_lty = t1, uco_rty = t2 }) = 1 + typeSize t1 + typeSize t2 coercionSize (SymCo co) = 1 + coercionSize co coercionSize (TransCo co1 co2) = 1 + coercionSize co1 + coercionSize co2 @@ -2063,7 +2042,6 @@ coercionSize (LRCo _ co) = 1 + coercionSize co coercionSize (InstCo co arg) = 1 + coercionSize co + coercionSize arg coercionSize (KindCo co) = 1 + coercionSize co coercionSize (SubCo co) = 1 + coercionSize co -coercionSize (AxiomRuleCo _ cs) = 1 + sum (map coercionSize cs) {- ************************************************************************ ===================================== compiler/GHC/Core/TyCo/Subst.hs ===================================== @@ -57,7 +57,7 @@ import {-# SOURCE #-} GHC.Core.Coercion ( mkCoVarCo, mkKindCo, mkSelCo, mkTransCo , mkNomReflCo, mkSubCo, mkSymCo , mkFunCo2, mkForAllCo, mkUnivCo - , mkAxiomInstCo, mkAppCo, mkGReflCo + , mkAxiomRuleCo, mkAppCo, mkGReflCo , mkInstCo, mkLRCo, mkTyConAppCo , mkCoercionType , coercionKind, coercionLKind, coVarKindsTypesRole ) @@ -879,6 +879,7 @@ subst_co subst co go (Refl ty) = mkNomReflCo $! (go_ty ty) go (GRefl r ty mco) = (mkGReflCo r $! (go_ty ty)) $! (go_mco mco) go (TyConAppCo r tc args)= mkTyConAppCo r tc $! go_cos args + go (AxiomRuleCo con cos) = mkAxiomRuleCo con $! go_cos cos go (AppCo co arg) = (mkAppCo $! go co) $! go arg go (ForAllCo tv visL visR kind_co co) = case substForAllCoBndrUnchecked subst tv kind_co of @@ -886,7 +887,6 @@ subst_co subst co ((mkForAllCo $! tv') visL visR $! kind_co') $! subst_co subst' co go (FunCo r afl afr w co1 co2) = ((mkFunCo2 r afl afr $! go w) $! go co1) $! go co2 go (CoVarCo cv) = substCoVar subst cv - go (AxiomInstCo con ind cos) = mkAxiomInstCo con ind $! map go cos go (UnivCo { uco_prov = p, uco_role = r , uco_lty = t1, uco_rty = t2, uco_deps = deps }) = ((((mkUnivCo $! p) $! go_cos deps) $! r) $! @@ -898,8 +898,6 @@ subst_co subst co go (InstCo co arg) = (mkInstCo $! (go co)) $! go arg go (KindCo co) = mkKindCo $! (go co) go (SubCo co) = mkSubCo $! (go co) - go (AxiomRuleCo c cs) = let cs1 = map go cs - in cs1 `seqList` AxiomRuleCo c cs1 go (HoleCo h) = HoleCo $! go_hole h go_cos cos = let cos' = map go cos ===================================== compiler/GHC/Core/TyCo/Tidy.hs ===================================== @@ -342,8 +342,8 @@ tidyCo env co go (FunCo r afl afr w co1 co2) = ((FunCo r afl afr $! go w) $! go co1) $! go co2 go (CoVarCo cv) = CoVarCo $! go_cv cv go (HoleCo h) = HoleCo $! go_hole h - go (AxiomInstCo con ind cos) = AxiomInstCo con ind $! strictMap go cos - go co@(UnivCo { uco_lty = t1, uco_rty = t2 }) + go (AxiomRuleCo ax cos) = AxiomRuleCo ax $ strictMap go cos + go co@(UnivCo { uco_lty = t1, uco_rty = t2 }) = co { uco_lty = tidyType env t1, uco_rty = tidyType env t2 } -- Don't bother to tidy the uco_deps field go (SymCo co) = SymCo $! go co @@ -353,7 +353,6 @@ tidyCo env co go (InstCo co ty) = (InstCo $! go co) $! go ty go (KindCo co) = KindCo $! go co go (SubCo co) = SubCo $! go co - go (AxiomRuleCo ax cos) = AxiomRuleCo ax $ strictMap go cos go_cv cv = tidyTyCoVarOcc env cv ===================================== compiler/GHC/Core/TyCon.hs-boot ===================================== @@ -12,6 +12,7 @@ instance Outputable TyCon type TyConRepName = Name +isNewTyCon :: TyCon -> Bool isTupleTyCon :: TyCon -> Bool isUnboxedTupleTyCon :: TyCon -> Bool ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -274,7 +274,7 @@ import GHC.Core.Coercion.Axiom import {-# SOURCE #-} GHC.Core.Coercion ( mkNomReflCo, mkGReflCo, mkReflCo , mkTyConAppCo, mkAppCo - , mkForAllCo, mkFunCo2, mkAxiomInstCo, mkUnivCo + , mkForAllCo, mkFunCo2, mkAxiomRuleCo, mkUnivCo , mkSymCo, mkTransCo, mkSelCo, mkLRCo, mkInstCo , mkKindCo, mkSubCo, mkFunCo, funRole , decomposePiCos, coercionKind @@ -556,8 +556,8 @@ expandTypeSynonyms ty = mkFunCo2 r afl afr (go_co subst w) (go_co subst co1) (go_co subst co2) go_co subst (CoVarCo cv) = substCoVar subst cv - go_co subst (AxiomInstCo ax ind args) - = mkAxiomInstCo ax ind (map (go_co subst) args) + go_co subst (AxiomRuleCo ax cs) + = mkAxiomRuleCo ax (map (go_co subst) cs) go_co subst co@(UnivCo { uco_lty = lty, uco_rty = rty }) = co { uco_lty = go subst lty, uco_rty = go subst rty } go_co subst (SymCo co) @@ -574,8 +574,6 @@ expandTypeSynonyms ty = mkKindCo (go_co subst co) go_co subst (SubCo co) = mkSubCo (go_co subst co) - go_co subst (AxiomRuleCo ax cs) - = AxiomRuleCo ax (map (go_co subst) cs) go_co _ (HoleCo h) = pprPanic "expandTypeSynonyms hit a hole" (ppr h) @@ -976,13 +974,12 @@ mapTyCoX (TyCoMapper { tcm_tyvar = tyvar <*> go_ty env t1 <*> go_ty env t2 go_co !env (SymCo co) = mkSymCo <$> go_co env co go_co !env (TransCo c1 c2) = mkTransCo <$> go_co env c1 <*> go_co env c2 - go_co !env (AxiomRuleCo r cos) = AxiomRuleCo r <$> go_cos env cos + go_co !env (AxiomRuleCo r cos) = mkAxiomRuleCo r <$> go_cos env cos go_co !env (SelCo i co) = mkSelCo i <$> go_co env co go_co !env (LRCo lr co) = mkLRCo lr <$> go_co env co go_co !env (InstCo co arg) = mkInstCo <$> go_co env co <*> go_co env arg go_co !env (KindCo co) = mkKindCo <$> go_co env co go_co !env (SubCo co) = mkSubCo <$> go_co env co - go_co !env (AxiomInstCo ax i cos) = mkAxiomInstCo ax i <$> go_cos env cos go_co !env co@(TyConAppCo r tc cos) | isTcTyCon tc = do { tc' <- tycon tc ===================================== compiler/GHC/CoreToIface.hs ===================================== @@ -296,8 +296,7 @@ toIfaceCoercionX fr co go (InstCo co arg) = IfaceInstCo (go co) (go arg) go (KindCo c) = IfaceKindCo (go c) go (SubCo co) = IfaceSubCo (go co) - go (AxiomRuleCo co cs) = IfaceAxiomRuleCo (mkIfLclName (coaxrName co)) (map go cs) - go (AxiomInstCo c i cs) = IfaceAxiomInstCo (coAxiomName c) i (map go cs) + go (AxiomRuleCo co cs) = IfaceAxiomRuleCo (toIfaceAxiomRule co) (map go cs) go (UnivCo { uco_prov = p, uco_role = r, uco_lty = t1, uco_rty = t2, uco_deps = deps }) = IfaceUnivCo p r (toIfaceTypeX fr t1) (toIfaceTypeX fr t2) (map go deps) @@ -317,6 +316,12 @@ toIfaceCoercionX fr co where fr' = fr `delVarSet` tv +toIfaceAxiomRule :: CoAxiomRule -> IfaceAxiomRule +toIfaceAxiomRule (BuiltInFamRewrite bif) = IfaceAR_X (mkIfLclName (bifrw_name bif)) +toIfaceAxiomRule (BuiltInFamInteract bif) = IfaceAR_X (mkIfLclName (bifint_name bif)) +toIfaceAxiomRule (BranchedAxiom ax i) = IfaceAR_B (coAxiomName ax) i +toIfaceAxiomRule (UnbranchedAxiom ax) = IfaceAR_U (coAxiomName ax) + toIfaceTcArgs :: TyCon -> [Type] -> IfaceAppArgs toIfaceTcArgs = toIfaceTcArgsX emptyVarSet ===================================== compiler/GHC/Iface/Rename.hs ===================================== @@ -661,39 +661,29 @@ rnIfaceMCo IfaceMRefl = pure IfaceMRefl rnIfaceMCo (IfaceMCo co) = IfaceMCo <$> rnIfaceCo co rnIfaceCo :: Rename IfaceCoercion -rnIfaceCo (IfaceReflCo ty) = IfaceReflCo <$> rnIfaceType ty -rnIfaceCo (IfaceGReflCo role ty mco) - = IfaceGReflCo role <$> rnIfaceType ty <*> rnIfaceMCo mco -rnIfaceCo (IfaceFunCo role w co1 co2) - = IfaceFunCo role <$> rnIfaceCo w <*> rnIfaceCo co1 <*> rnIfaceCo co2 -rnIfaceCo (IfaceTyConAppCo role tc cos) - = IfaceTyConAppCo role <$> rnIfaceTyCon tc <*> mapM rnIfaceCo cos -rnIfaceCo (IfaceAppCo co1 co2) - = IfaceAppCo <$> rnIfaceCo co1 <*> rnIfaceCo co2 +rnIfaceCo (IfaceReflCo ty) = IfaceReflCo <$> rnIfaceType ty +rnIfaceCo (IfaceGReflCo role ty mco) = IfaceGReflCo role <$> rnIfaceType ty <*> rnIfaceMCo mco +rnIfaceCo (IfaceFunCo role w co1 co2) = IfaceFunCo role <$> rnIfaceCo w <*> rnIfaceCo co1 <*> rnIfaceCo co2 +rnIfaceCo (IfaceTyConAppCo role tc cos) = IfaceTyConAppCo role <$> rnIfaceTyCon tc <*> mapM rnIfaceCo cos +rnIfaceCo (IfaceAppCo co1 co2) = IfaceAppCo <$> rnIfaceCo co1 <*> rnIfaceCo co2 +rnIfaceCo (IfaceFreeCoVar c) = pure (IfaceFreeCoVar c) +rnIfaceCo (IfaceCoVarCo lcl) = IfaceCoVarCo <$> pure lcl +rnIfaceCo (IfaceHoleCo lcl) = IfaceHoleCo <$> pure lcl +rnIfaceCo (IfaceSymCo c) = IfaceSymCo <$> rnIfaceCo c +rnIfaceCo (IfaceTransCo c1 c2) = IfaceTransCo <$> rnIfaceCo c1 <*> rnIfaceCo c2 +rnIfaceCo (IfaceInstCo c1 c2) = IfaceInstCo <$> rnIfaceCo c1 <*> rnIfaceCo c2 +rnIfaceCo (IfaceSelCo d c) = IfaceSelCo d <$> rnIfaceCo c +rnIfaceCo (IfaceLRCo lr c) = IfaceLRCo lr <$> rnIfaceCo c +rnIfaceCo (IfaceSubCo c) = IfaceSubCo <$> rnIfaceCo c +rnIfaceCo (IfaceAxiomRuleCo ax cos) = IfaceAxiomRuleCo ax <$> mapM rnIfaceCo cos +rnIfaceCo (IfaceKindCo c) = IfaceKindCo <$> rnIfaceCo c rnIfaceCo (IfaceForAllCo bndr visL visR co1 co2) = (\bndr' co1' co2' -> IfaceForAllCo bndr' visL visR co1' co2') <$> rnIfaceBndr bndr <*> rnIfaceCo co1 <*> rnIfaceCo co2 -rnIfaceCo (IfaceFreeCoVar c) = pure (IfaceFreeCoVar c) -rnIfaceCo (IfaceCoVarCo lcl) = IfaceCoVarCo <$> pure lcl -rnIfaceCo (IfaceHoleCo lcl) = IfaceHoleCo <$> pure lcl -rnIfaceCo (IfaceAxiomInstCo n i cs) - = IfaceAxiomInstCo <$> rnIfaceGlobal n <*> pure i <*> mapM rnIfaceCo cs rnIfaceCo (IfaceUnivCo s r t1 t2 deps) = IfaceUnivCo s r <$> rnIfaceType t1 <*> rnIfaceType t2 <*> mapM rnIfaceCo deps -- Renaming affects only type constructors, not coercion variables, -- so no need to recurse into the free-var fields -rnIfaceCo (IfaceSymCo c) - = IfaceSymCo <$> rnIfaceCo c -rnIfaceCo (IfaceTransCo c1 c2) - = IfaceTransCo <$> rnIfaceCo c1 <*> rnIfaceCo c2 -rnIfaceCo (IfaceInstCo c1 c2) - = IfaceInstCo <$> rnIfaceCo c1 <*> rnIfaceCo c2 -rnIfaceCo (IfaceSelCo d c) = IfaceSelCo d <$> rnIfaceCo c -rnIfaceCo (IfaceLRCo lr c) = IfaceLRCo lr <$> rnIfaceCo c -rnIfaceCo (IfaceSubCo c) = IfaceSubCo <$> rnIfaceCo c -rnIfaceCo (IfaceAxiomRuleCo ax cos) - = IfaceAxiomRuleCo ax <$> mapM rnIfaceCo cos -rnIfaceCo (IfaceKindCo c) = IfaceKindCo <$> rnIfaceCo c rnIfaceTyCon :: Rename IfaceTyCon rnIfaceTyCon (IfaceTyCon n info) ===================================== compiler/GHC/Iface/Syntax.hs ===================================== @@ -1781,8 +1781,6 @@ freeNamesIfCoercion (IfaceForAllCo _tcv _visL _visR kind_co co) freeNamesIfCoercion (IfaceFreeCoVar _) = emptyNameSet freeNamesIfCoercion (IfaceCoVarCo _) = emptyNameSet freeNamesIfCoercion (IfaceHoleCo _) = emptyNameSet -freeNamesIfCoercion (IfaceAxiomInstCo ax _ cos) - = unitNameSet ax &&& fnList freeNamesIfCoercion cos freeNamesIfCoercion (IfaceUnivCo _ _ t1 t2 _) = freeNamesIfType t1 &&& freeNamesIfType t2 -- Ignoring uco_deps field, which are all local, @@ -1801,9 +1799,13 @@ freeNamesIfCoercion (IfaceKindCo c) = freeNamesIfCoercion c freeNamesIfCoercion (IfaceSubCo co) = freeNamesIfCoercion co -freeNamesIfCoercion (IfaceAxiomRuleCo _ax cos) - -- the axiom is just a string, so we don't count it as a name. - = fnList freeNamesIfCoercion cos +freeNamesIfCoercion (IfaceAxiomRuleCo ax cos) + = fnAxRule ax &&& fnList freeNamesIfCoercion cos + +fnAxRule :: IfaceAxiomRule -> NameSet +fnAxRule (IfaceAR_X _) = emptyNameSet -- the axiom is just a string, so we don't count it as a name. +fnAxRule (IfaceAR_U n) = unitNameSet n +fnAxRule (IfaceAR_B n _) = unitNameSet n freeNamesIfVarBndr :: VarBndr IfaceBndr vis -> NameSet freeNamesIfVarBndr (Bndr bndr _) = freeNamesIfBndr bndr ===================================== compiler/GHC/Iface/Type.hs ===================================== @@ -14,7 +14,7 @@ module GHC.Iface.Type ( IfLclName(..), mkIfLclName, ifLclNameFS, IfaceType(..), IfacePredType, IfaceKind, IfaceCoercion(..), - IfaceMCoercion(..), + IfaceAxiomRule(..),IfaceMCoercion(..), IfaceMult, IfaceTyCon(..), IfaceTyConInfo(..), mkIfaceTyConInfo, @@ -476,8 +476,7 @@ data IfaceCoercion | IfaceAppCo IfaceCoercion IfaceCoercion | IfaceForAllCo IfaceBndr !ForAllTyFlag !ForAllTyFlag IfaceCoercion IfaceCoercion | IfaceCoVarCo IfLclName - | IfaceAxiomInstCo IfExtName BranchIndex [IfaceCoercion] - | IfaceAxiomRuleCo IfLclName [IfaceCoercion] + | IfaceAxiomRuleCo IfaceAxiomRule [IfaceCoercion] -- ^ There are only a fixed number of CoAxiomRules, so it suffices -- to use an IfaceLclName to distinguish them. -- See Note [Adding built-in type families] in GHC.Builtin.Types.Literals @@ -494,6 +493,12 @@ data IfaceCoercion deriving (Eq, Ord) -- Why Ord? See Note [Ord instance of IfaceType] +data IfaceAxiomRule + = IfaceAR_X IfLclName -- Built-in + | IfaceAR_B IfExtName BranchIndex -- Branched + | IfaceAR_U IfExtName -- Unbranched + deriving (Eq, Ord) + {- Note [Holes in IfaceCoercion] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When typechecking fails the typechecker will produce a HoleCo to stand @@ -698,7 +703,6 @@ substIfaceType env ty go_co (IfaceFreeCoVar cv) = IfaceFreeCoVar cv go_co (IfaceCoVarCo cv) = IfaceCoVarCo cv go_co (IfaceHoleCo cv) = IfaceHoleCo cv - go_co (IfaceAxiomInstCo a i cos) = IfaceAxiomInstCo a i (go_cos cos) go_co (IfaceUnivCo p r t1 t2 ds) = IfaceUnivCo p r (go t1) (go t2) (go_cos ds) go_co (IfaceSymCo co) = IfaceSymCo (go_co co) go_co (IfaceTransCo co1 co2) = IfaceTransCo (go_co co1) (go_co co2) @@ -2009,11 +2013,8 @@ ppr_co ctxt_prec (IfaceInstCo co ty) text "Inst" <+> sep [ pprParendIfaceCoercion co , pprParendIfaceCoercion ty ] -ppr_co ctxt_prec (IfaceAxiomRuleCo tc cos) - = maybeParen ctxt_prec appPrec $ ppr tc <+> parens (interpp'SP cos) - -ppr_co ctxt_prec (IfaceAxiomInstCo n i cos) - = ppr_special_co ctxt_prec (ppr n <> brackets (ppr i)) cos +ppr_co ctxt_prec (IfaceAxiomRuleCo ax cos) + = ppr_special_co ctxt_prec (pprIfAxRule ax) cos ppr_co ctxt_prec (IfaceSymCo co) = ppr_special_co ctxt_prec (text "Sym") [co] ppr_co ctxt_prec (IfaceTransCo co1 co2) @@ -2036,6 +2037,11 @@ ppr_special_co ctxt_prec doc cos = maybeParen ctxt_prec appPrec (sep [doc, nest 4 (sep (map pprParendIfaceCoercion cos))]) +pprIfAxRule :: IfaceAxiomRule -> SDoc +pprIfAxRule (IfaceAR_X n) = ppr n +pprIfAxRule (IfaceAR_U n) = ppr n +pprIfAxRule (IfaceAR_B n i) = ppr n <> brackets (int i) + ppr_role :: Role -> SDoc ppr_role r = underscore <> pp_role where pp_role = case r of @@ -2361,11 +2367,6 @@ instance Binary IfaceCoercion where put_ bh (IfaceCoVarCo a) = do putByte bh 7 put_ bh a - put_ bh (IfaceAxiomInstCo a b c) = do - putByte bh 8 - put_ bh a - put_ bh b - put_ bh c put_ bh (IfaceUnivCo a b c d deps) = do putByte bh 9 put_ bh a @@ -2438,10 +2439,6 @@ instance Binary IfaceCoercion where return $ IfaceForAllCo a visL visR b c 7 -> do a <- get bh return $ IfaceCoVarCo a - 8 -> do a <- get bh - b <- get bh - c <- get bh - return $ IfaceAxiomInstCo a b c 9 -> do a <- get bh b <- get bh c <- get bh @@ -2471,6 +2468,17 @@ instance Binary IfaceCoercion where return $ IfaceAxiomRuleCo a b _ -> panic ("get IfaceCoercion " ++ show tag) +instance Binary IfaceAxiomRule where + put_ bh (IfaceAR_X n) = putByte bh 0 >> put_ bh n + put_ bh (IfaceAR_U n) = putByte bh 1 >> put_ bh n + put_ bh (IfaceAR_B n i) = putByte bh 1 >> put_ bh n >> put_ bh i + + get bh = do h <- getByte bh + case h of + 0 -> do { n <- get bh; return (IfaceAR_X n) } + 1 -> do { n <- get bh; return (IfaceAR_U n) } + _ -> do { n <- get bh; i <- get bh; return (IfaceAR_B n i) } + instance Binary (DefMethSpec IfaceType) where put_ bh VanillaDM = putByte bh 0 put_ bh (GenericDM t) = putByte bh 1 >> put_ bh t @@ -2508,7 +2516,6 @@ instance NFData IfaceCoercion where IfaceAppCo f1 f2 -> rnf f1 `seq` rnf f2 IfaceForAllCo f1 f2 f3 f4 f5 -> rnf f1 `seq` rnf f2 `seq` rnf f3 `seq` rnf f4 `seq` rnf f5 IfaceCoVarCo f1 -> rnf f1 - IfaceAxiomInstCo f1 f2 f3 -> rnf f1 `seq` rnf f2 `seq` rnf f3 IfaceAxiomRuleCo f1 f2 -> rnf f1 `seq` rnf f2 IfaceUnivCo f1 f2 f3 f4 deps -> rnf f1 `seq` f2 `seq` rnf f3 `seq` rnf f4 `seq` rnf deps IfaceSymCo f1 -> rnf f1 @@ -2521,6 +2528,12 @@ instance NFData IfaceCoercion where IfaceFreeCoVar f1 -> f1 `seq` () IfaceHoleCo f1 -> f1 `seq` () +instance NFData IfaceAxiomRule where + rnf = \case + IfaceAR_X n -> rnf n + IfaceAR_U n -> rnf n + IfaceAR_B n i -> rnf n `seq` rnf i + instance NFData IfaceMCoercion where rnf x = seq x () ===================================== compiler/GHC/IfaceToCore.hs ===================================== @@ -707,11 +707,10 @@ tc_iface_decl _ _ (IfaceData {ifName = tc_name, = do { tc_rep_name <- newTyConRepName tc_name ; return (VanillaAlgTyCon tc_rep_name) } tc_parent _ (IfDataInstance ax_name _ arg_tys) - = do { ax <- tcIfaceCoAxiom ax_name + = do { ax <- tcIfaceUnbranchedAxiom ax_name ; let fam_tc = coAxiomTyCon ax - ax_unbr = toUnbranchedAxiom ax ; lhs_tys <- tcIfaceAppArgs arg_tys - ; return (DataFamInstTyCon ax_unbr fam_tc lhs_tys) } + ; return (DataFamInstTyCon ax fam_tc lhs_tys) } tc_iface_decl _ _ (IfaceSynonym {ifName = tc_name, ifRoles = roles, @@ -748,7 +747,7 @@ tc_iface_decl parent _ (IfaceFamily {ifName = tc_name, ; return (DataFamilyTyCon tc_rep_name) } tc_fam_flav _ IfaceOpenSynFamilyTyCon= return OpenSynFamilyTyCon tc_fam_flav _ (IfaceClosedSynFamilyTyCon mb_ax_name_branches) - = do { ax <- traverse (tcIfaceCoAxiom . fst) mb_ax_name_branches + = do { ax <- traverse (tcIfaceBranchedAxiom . fst) mb_ax_name_branches ; return (ClosedSynFamilyTyCon ax) } tc_fam_flav _ IfaceAbstractClosedSynFamilyTyCon = return AbstractClosedSynFamilyTyCon @@ -1244,11 +1243,10 @@ tcIfaceFamInst (IfaceFamInst { ifFamInstFam = fam, ifFamInstTys = mb_tcs , ifFamInstAxiom = axiom_name , ifFamInstOrph = orphan } ) = do { axiom' <- forkM (text "Axiom" <+> ppr axiom_name) $ - tcIfaceCoAxiom axiom_name + tcIfaceUnbranchedAxiom axiom_name -- will panic if branched, but that's OK - ; let axiom'' = toUnbranchedAxiom axiom' - mb_tcs' = map tcRoughTyCon mb_tcs - ; return (mkImportedFamInst fam mb_tcs' axiom'' orphan) } + ; let mb_tcs' = map tcRoughTyCon mb_tcs + ; return (mkImportedFamInst fam mb_tcs' axiom' orphan) } {- ************************************************************************ @@ -1472,7 +1470,6 @@ tcIfaceCo = go ; bindIfaceBndr tv $ \ tv' -> ForAllCo tv' visL visR k' <$> go c } go (IfaceCoVarCo n) = CoVarCo <$> go_var n - go (IfaceAxiomInstCo n i cs) = AxiomInstCo <$> tcIfaceCoAxiom n <*> pure i <*> mapM go cs go (IfaceUnivCo p r t1 t2 ds) = do { t1' <- tcIfaceType t1; t2' <- tcIfaceType t2 ; ds' <- mapM go ds ; return (UnivCo { uco_prov = p, uco_role = r @@ -2023,21 +2020,28 @@ tcIfaceTyCon (IfaceTyCon name _info) AConLike (RealDataCon dc) -> return (promoteDataCon dc) _ -> pprPanic "tcIfaceTyCon" (ppr thing) } -tcIfaceCoAxiom :: Name -> IfL (CoAxiom Branched) -tcIfaceCoAxiom name = do { thing <- tcIfaceImplicit name - ; return (tyThingCoAxiom thing) } - - -tcIfaceCoAxiomRule :: IfLclName -> IfL CoAxiomRule +tcIfaceCoAxiomRule :: IfaceAxiomRule -> IfL CoAxiomRule -- Unlike CoAxioms, which arise from user 'type instance' declarations, -- there are a fixed set of CoAxiomRules: -- - axioms for type-level literals (Nat and Symbol), -- enumerated in typeNatCoAxiomRules -tcIfaceCoAxiomRule n - | Just ax <- lookupUFM typeNatCoAxiomRules (ifLclNameFS n) - = return ax +tcIfaceCoAxiomRule (IfaceAR_X n) + | Just axr <- lookupUFM typeNatCoAxiomRules (ifLclNameFS n) + = return axr | otherwise = pprPanic "tcIfaceCoAxiomRule" (ppr n) +tcIfaceCoAxiomRule (IfaceAR_U name) = do { ax <- tcIfaceUnbranchedAxiom name; return (UnbranchedAxiom ax) } +tcIfaceCoAxiomRule (IfaceAR_B name i) = do { ax <- tcIfaceBranchedAxiom name; return (BranchedAxiom ax i) } + +tcIfaceUnbranchedAxiom :: IfExtName -> IfL (CoAxiom Unbranched) +tcIfaceUnbranchedAxiom name + = do { thing <- tcIfaceImplicit name + ; return (toUnbranchedAxiom (tyThingCoAxiom thing)) } + +tcIfaceBranchedAxiom :: IfExtName -> IfL (CoAxiom Branched) +tcIfaceBranchedAxiom name + = do { thing <- tcIfaceImplicit name + ; return (tyThingCoAxiom thing) } tcIfaceDataCon :: Name -> IfL DataCon tcIfaceDataCon name = do { thing <- tcIfaceGlobal name ===================================== compiler/GHC/Tc/TyCl/Utils.hs ===================================== @@ -142,7 +142,7 @@ synonymTyConsOfType ty = go_co m `plusNameEnv` go_co a `plusNameEnv` go_co r go_co (CoVarCo _) = emptyNameEnv go_co (HoleCo {}) = emptyNameEnv - go_co (AxiomInstCo _ _ cs) = go_co_s cs + go_co (AxiomRuleCo _ cs) = go_co_s cs go_co (UnivCo { uco_lty = t1, uco_rty = t2}) = go t1 `plusNameEnv` go t2 go_co (SymCo co) = go_co co @@ -152,7 +152,6 @@ synonymTyConsOfType ty go_co (InstCo co co') = go_co co `plusNameEnv` go_co co' go_co (KindCo co) = go_co co go_co (SubCo co) = go_co co - go_co (AxiomRuleCo _ cs) = go_co_s cs go_tc tc | isTypeSynonymTyCon tc = unitNameEnv (tyConName tc) tc | otherwise = emptyNameEnv ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -1563,7 +1563,6 @@ collect_cand_qtvs_co orig_ty cur_lvl bound = go_co go_co dv (TyConAppCo _ _ cos) = foldlM go_co dv cos go_co dv (AppCo co1 co2) = foldlM go_co dv [co1, co2] go_co dv (FunCo _ _ _ w co1 co2) = foldlM go_co dv [w, co1, co2] - go_co dv (AxiomInstCo _ _ cos) = foldlM go_co dv cos go_co dv (AxiomRuleCo _ cos) = foldlM go_co dv cos go_co dv (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) = do { dv1 <- collect_cand_qtvs orig_ty True cur_lvl bound dv t1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/03beee7128a77a43f9de4ad9b2ec64bf4e5d4c39 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/03beee7128a77a43f9de4ad9b2ec64bf4e5d4c39 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 14:44:11 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 05 Jul 2024 10:44:11 -0400 Subject: [Git][ghc/ghc][wip/alpine_3_20] 2 commits: Update alpine release job to 3.20 Message-ID: <668806bb77cab_ac4ef12f21a4967c3@gitlab.mail> Matthew Pickering pushed to branch wip/alpine_3_20 at Glasgow Haskell Compiler / GHC Commits: dc325172 by Matthew Pickering at 2024-07-05T15:40:56+01:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 6c26034a by Matthew Pickering at 2024-07-05T15:41:20+01:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 4 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - testsuite/tests/plugins/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: 2e2497036a91104be281a0eb24b37889aaf98341 + DOCKER_REV: c7dc16857283a373986a49cd521ab480dc41421a # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -117,6 +117,7 @@ data LinuxDistro | Centos7 | Alpine312 | Alpine318 + | Alpine320 | AlpineWasm | Rocky8 deriving (Eq) @@ -302,6 +303,7 @@ distroName Ubuntu2004 = "ubuntu20_04" distroName Centos7 = "centos7" distroName Alpine312 = "alpine3_12" distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" distroName AlpineWasm = "alpine3_18-wasm" distroName Rocky8 = "rocky8" @@ -452,6 +454,7 @@ alpineVariables = mconcat distroVariables :: LinuxDistro -> Variables distroVariables Alpine312 = alpineVariables distroVariables Alpine318 = alpineVariables +distroVariables Alpine320 = alpineVariables distroVariables Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" , "BROKEN_TESTS" =: "T22012" -- due to #23979 @@ -1015,7 +1018,7 @@ job_groups = -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine318) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) ===================================== .gitlab/jobs.yaml ===================================== @@ -897,7 +897,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-validate": { + "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -908,7 +908,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-validate.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -918,14 +918,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -951,17 +951,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-validate", - "BROKEN_TESTS": "encoding004 T10458", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", - "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BUILD_FLAVOUR": "release+fully_static+text_simdutf", + "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CROSS_TARGET": "wasm32-wasi", + "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-validate", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -972,7 +972,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1014,18 +1014,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1036,7 +1036,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1078,18 +1078,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_20-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1100,7 +1100,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_20-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1110,14 +1110,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1143,13 +1143,13 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", - "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", - "CROSS_TARGET": "wasm32-wasi", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-validate", + "BROKEN_TESTS": "encoding004 T10458", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_20-validate", "XZ_OPT": "-9" } }, @@ -3343,7 +3343,7 @@ "XZ_OPT": "-9" } }, - "release-x86_64-linux-alpine3_18-release+no_split_sections": { + "release-x86_64-linux-alpine3_20-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -3354,7 +3354,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-x86_64-linux-alpine3_18-release+no_split_sections.tar.xz", + "ghc-x86_64-linux-alpine3_20-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -3364,14 +3364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -3397,7 +3397,7 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-release+no_split_sections", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-release+no_split_sections", "BROKEN_TESTS": "encoding004 T10458", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", @@ -3405,7 +3405,7 @@ "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-release+no_split_sections", + "TEST_ENV": "x86_64-linux-alpine3_20-release+no_split_sections", "XZ_OPT": "-9" } }, ===================================== testsuite/tests/plugins/all.T ===================================== @@ -11,11 +11,15 @@ setTestOpts([ when(opsys('mingw32'), multi_cpu_race), ]) -import itertools # Check the simple-plugin tests without # caring about the order of loading of interfaces def normalizeIfaces(unnormalized_str): + # Why is this not at the top-level? Probably a python bug which I didn't fancy + # investigating deeply. + # NameError: name 'itertools' is not defined. Did you forget to import 'itertools' + # if placed at the top-level + import itertools iface_plugin_prefix = "interfacePlugin: " grouped_plugins = itertools.groupby( unnormalized_str.split('\n'), View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/991d70609539a70630c98a636c71e9fd5351d6a6...6c26034a84f70807ee99a253a0eac83213875b0f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/991d70609539a70630c98a636c71e9fd5351d6a6...6c26034a84f70807ee99a253a0eac83213875b0f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 15:24:40 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 05 Jul 2024 11:24:40 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 79 commits: Clarify -XGADTs enables existential quantification Message-ID: <668810388ffcb_ac4ef19c78f810471e@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - b5ba73c3 by Matthew Pickering at 2024-07-03T15:33:57+01:00 Run on test-abi label - - - - - 5e9eb03b by Rodrigo Mesquita at 2024-07-03T15:33:57+01:00 Write a test for object determinism Extend abi_test with object determinism check Standalone run abi test Disable local test on CI - - - - - de03d11f by Rodrigo Mesquita at 2024-07-03T15:34:31+01:00 Remame uniques straight off stgtocmm, before cmm pipeline WIP Progress Work around LLVM assembler bug! In a really stupid way) Fix ordering of CLabels for IdLabels Local test script tweaks Do uniq renaming before SRTs Revert "Do uniq renaming before SRTs" This reverts commit db38b635d626106e40b3ab18091e0a24046c30c5. Do on CmmGroup Do uniq-renaming pass right at `codeGen` not better Revert "Do uniq-renaming pass right at `codeGen`" This reverts commit 74e9068aaaf736bf815a36bf74a0dde19a074a7a. Reapply "Do uniq renaming before SRTs" This reverts commit 682f89732fc2a95fa011f530c0c6922bf576d229. Try ALSO after SRT Revert "Try ALSO after SRT" This reverts commit c5dd7b426cde768126402aac3f39617ccb99f5c5. Renaming before and after SRTs bc of procs and srts and ... Wait no that was way too slow... cleaner approach, same idea Revert "Reapply "Do uniq renaming before SRTs"" This reverts commit 70ff49b7efc8c1fca46cba6eff630c5d39a99213. Finfixes Add traces Fix bug triggered by static data generated during SRT Wait, that was still there?! StableNmCmp is invalid for internal names... also, rename all Id uniques This fixes a really awful bug. Tweaks - - - - - 3406f4d9 by Rodrigo Mesquita at 2024-07-03T15:34:49+01:00 cmm: Back LabelMap with UDFM Use a deterministic unique map to back the implementation of `LabelMap`. This is necessary towards the goal of object code determinism in #12935. Our intended solution requires renaming uniques in a deterministic order (which will be the order in which they were created), but storing them label map makes us lose this order. Backing it with a UDFM fixes this issue. - - - - - e4a32990 by Rodrigo Mesquita at 2024-07-05T16:24:22+01:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - c7f32e37 by Rodrigo Mesquita at 2024-07-05T16:24:25+01:00 UniqDSM det uniques + use in Cmm.Info Now for SRTs SRT generation using deterministic uniq supply Back LabelMap with deterministic UDFM TSAN uniq rename hard Revert "TSAN uniq rename hard" This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda. improvements to uniqdsm UniqDSM ProcPoint CmmLayoutStack UniqDet 90% of cpsTop UniqDSM Major progress in using UniqDSM in CmmToAsm and Ncg backends Fix imports Un-back label map with udfm Revert "Un-back label map with udfm" This reverts commit f5d2e4257214a3f7b7d845651e6662c5babfd6a3. - - - - - 5a1b1cf7 by Rodrigo Mesquita at 2024-07-05T16:24:25+01:00 Tweaks - - - - - e4951b4c by Rodrigo Mesquita at 2024-07-05T16:24:25+01:00 Make UDSM oneshot deriving via state - - - - - cd028287 by Rodrigo Mesquita at 2024-07-05T16:24:25+01:00 Put deterministic renaming behind a flag - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Switch.hs - compiler/GHC/Cmm/Switch/Implement.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0a4b1b54cd8bf6f28422eafe4e84c7a978b9251...cd0282879ceda8f57f63b40a87b862a9301570ad -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0a4b1b54cd8bf6f28422eafe4e84c7a978b9251...cd0282879ceda8f57f63b40a87b862a9301570ad You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 15:40:31 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 05 Jul 2024 11:40:31 -0400 Subject: [Git][ghc/ghc][wip/alpine_3_20] 27 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668813ef4ee9e_ac4ef1c6e2b4107638@gitlab.mail> Matthew Pickering pushed to branch wip/alpine_3_20 at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 9d30c0d3 by Matthew Pickering at 2024-07-05T16:40:20+01:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 01f136d3 by Matthew Pickering at 2024-07-05T16:40:20+01:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c26034a84f70807ee99a253a0eac83213875b0f...01f136d3efbd506d93d0e7860d43da1fc57bce0d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c26034a84f70807ee99a253a0eac83213875b0f...01f136d3efbd506d93d0e7860d43da1fc57bce0d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 15:42:31 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 05 Jul 2024 11:42:31 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 2 commits: Make UDSM oneshot deriving via state Message-ID: <66881467e1525_ac4ef1e02b5c109574@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 85339224 by Rodrigo Mesquita at 2024-07-05T16:42:21+01:00 Make UDSM oneshot deriving via state - - - - - 1ccb91d2 by Rodrigo Mesquita at 2024-07-05T16:42:21+01:00 Put deterministic renaming behind a flag - - - - - 6 changed files: - compiler/GHC/Driver/Config/StgToCmm.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Config.hs - compiler/GHC/Types/Unique/DSM.hs Changes: ===================================== compiler/GHC/Driver/Config/StgToCmm.hs ===================================== @@ -53,6 +53,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig , stgToCmmExtDynRefs = gopt Opt_ExternalDynamicRefs dflags , stgToCmmDoBoundsCheck = gopt Opt_DoBoundsChecking dflags , stgToCmmDoTagCheck = gopt Opt_DoTagInferenceChecks dflags + , stgToCmmDeterministicObjs = gopt Opt_DeterministicObjects dflags -- backend flags: ===================================== compiler/GHC/Driver/Flags.hs ===================================== @@ -820,6 +820,9 @@ data GeneralFlag -- Error message suppression | Opt_ShowErrorContext + -- Object code determinism + | Opt_DeterministicObjects + -- temporary flags | Opt_AutoLinkPackages | Opt_ImplicitImportQualified @@ -930,6 +933,7 @@ codeGenFlags = EnumSet.fromList , Opt_ExposeAllUnfoldings , Opt_ExposeOverloadedUnfoldings , Opt_NoTypeableBinds + , Opt_DeterministicObjects , Opt_Haddock -- Flags that affect catching of runtime errors ===================================== compiler/GHC/Driver/Session.hs ===================================== @@ -1290,6 +1290,8 @@ dynamic_flags_deps = [ (NoArg (unSetGeneralFlag Opt_KeepOFiles)) ------- Miscellaneous ---------------------------------------------- + , make_ord_flag defGhcFlag "fdeterministic-objects" + (NoArg (setGeneralFlag Opt_DeterministicObjects)) , make_ord_flag defGhcFlag "no-auto-link-packages" (NoArg (unSetGeneralFlag Opt_AutoLinkPackages)) , make_ord_flag defGhcFlag "no-hs-main" ===================================== compiler/GHC/StgToCmm.hs ===================================== @@ -103,7 +103,12 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons let ((a, cmm), st') = runC cfg fstate st (getCmm fcode) - (rnm1, cmm_renamed) = detRenameUniques rnm0 cmm -- The yielded cmm will already be renamed. + (rnm1, cmm_renamed) = + -- Enable deterministic object code generation by + -- renaming uniques deterministically. + if stgToCmmDeterministicObjs cfg + then detRenameUniques rnm0 cmm -- The yielded cmm will already be renamed. + else (rnm0, cmm) -- NB. stub-out cgs_tops and cgs_stmts. This fixes -- a big space leak. DO NOT REMOVE! @@ -152,7 +157,6 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons | otherwise = mkNameEnv (Prelude.map extractInfo (nonDetEltsUFM cg_id_infos)) - -- if gopt Opt_DeterministicObjects dflags ; rn_mapping <- liftIO (readIORef uniqRnRef) ; liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping) ===================================== compiler/GHC/StgToCmm/Config.hs ===================================== @@ -63,6 +63,7 @@ data StgToCmmConfig = StgToCmmConfig , stgToCmmDoBoundsCheck :: !Bool -- ^ decides whether to check array bounds in StgToCmm.Prim -- or not , stgToCmmDoTagCheck :: !Bool -- ^ Verify tag inference predictions. + , stgToCmmDeterministicObjs :: !Bool -- ^ Enable deterministic code generation (more precisely, the deterministic unique-renaming pass in StgToCmm) ------------------------------ Backend Flags ---------------------------------- , stgToCmmAllowArith64 :: !Bool -- ^ Allowed to emit 64-bit arithmetic operations , stgToCmmAllowQuot64 :: !Bool -- ^ Allowed to emit 64-bit division operations ===================================== compiler/GHC/Types/Unique/DSM.hs ===================================== @@ -1,10 +1,12 @@ -{-# LANGUAGE UnboxedTuples, PatternSynonyms #-} +{-# LANGUAGE UnboxedTuples, PatternSynonyms, DerivingVia #-} module GHC.Types.Unique.DSM where +import GHC.Exts (oneShot) import GHC.Prelude import GHC.Word import Control.Monad.Fix import GHC.Types.Unique +import qualified GHC.Utils.Monad.State.Strict as Strict import qualified GHC.Types.Unique.Supply as USM -- todo: Do I need to use the one-shot state monad trick? Probably yes. @@ -24,29 +26,19 @@ pattern DUniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's deterministically. -- There's no splitting. -newtype UniqDSM result = UDSM { unUDSM :: DUniqSupply -> DUniqResult result } - deriving Functor - -instance Monad UniqDSM where - (>>=) (UDSM f) cont = UDSM $ \us0 -> case f us0 of - DUniqResult result us1 -> unUDSM (cont result) us1 - (>>) = (*>) - {-# INLINE (>>=) #-} - {-# INLINE (>>) #-} - -instance Applicative UniqDSM where - pure result = UDSM (DUniqResult result) - (UDSM f) <*> (UDSM x) = UDSM $ \us0 -> case f us0 of - DUniqResult ff us1 -> case x us1 of - DUniqResult xx us2 -> DUniqResult (ff xx) us2 - (*>) (UDSM expr) (UDSM cont) = UDSM $ \us0 -> case expr us0 of - DUniqResult _ us1 -> cont us1 - {-# INLINE pure #-} - {-# INLINE (*>) #-} +newtype UniqDSM result = UDSM' { unUDSM :: DUniqSupply -> DUniqResult result } + deriving (Functor, Applicative, Monad) via (Strict.State DUniqSupply) instance MonadFix UniqDSM where mfix m = UDSM (\us0 -> let (r,us1) = runUniqueDSM us0 (m r) in DUniqResult r us1) +-- See Note [The one-shot state monad trick] in GHC.Utils.Monad +pattern UDSM :: (DUniqSupply -> DUniqResult a) -> UniqDSM a +pattern UDSM m <- UDSM' m + where + UDSM m = UDSM' (oneShot $ \s -> m s) +{-# COMPLETE UDSM #-} + getUniqueDSM :: UniqDSM Unique getUniqueDSM = UDSM (\(DUS us0) -> DUniqResult (mkUniqueGrimily us0) (DUS $ us0+1)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cd0282879ceda8f57f63b40a87b862a9301570ad...1ccb91d2e33d86377ef988c0dd1c8f33b5cfcf50 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cd0282879ceda8f57f63b40a87b862a9301570ad...1ccb91d2e33d86377ef988c0dd1c8f33b5cfcf50 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 17:09:46 2024 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Fri, 05 Jul 2024 13:09:46 -0400 Subject: [Git][ghc/ghc][wip/az/epa-span-in-delta] EPA: Bring back SrcSpan in EpaDelta Message-ID: <668828daa43f9_ac4ef2a33c50116360@gitlab.mail> Alan Zimmerman pushed to branch wip/az/epa-span-in-delta at Glasgow Haskell Compiler / GHC Commits: 99612d18 by Alan Zimmerman at 2024-07-05T18:09:22+01:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 12 changed files: - compiler/GHC/Hs/Dump.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Types/SrcLoc.hs - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/T14189.stderr - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== compiler/GHC/Hs/Dump.hs ===================================== @@ -147,9 +147,9 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0 epaAnchor :: EpaLocation -> SDoc epaAnchor (EpaSpan s) = parens $ text "EpaSpan" <+> srcSpan s - epaAnchor (EpaDelta d cs) = case ba of - NoBlankEpAnnotations -> parens $ text "EpaDelta" <+> deltaPos d <+> showAstData' cs - BlankEpAnnotations -> parens $ text "EpaDelta" <+> deltaPos d <+> text "blanked" + epaAnchor (EpaDelta s d cs) = case ba of + NoBlankEpAnnotations -> parens $ text "EpaDelta" <+> srcSpan s <+> deltaPos d <+> showAstData' cs + BlankEpAnnotations -> parens $ text "EpaDelta" <+> srcSpan s <+> deltaPos d <+> text "blanked" deltaPos :: DeltaPos -> SDoc deltaPos (SameLine c) = parens $ text "SameLine" <+> ppr c ===================================== compiler/GHC/Parser/Annotation.hs ===================================== @@ -459,12 +459,12 @@ type EpaLocation = EpaLocation' [LEpaComment] epaToNoCommentsLocation :: EpaLocation -> NoCommentsLocation epaToNoCommentsLocation (EpaSpan ss) = EpaSpan ss -epaToNoCommentsLocation (EpaDelta dp []) = EpaDelta dp NoComments -epaToNoCommentsLocation (EpaDelta _ _ ) = panic "epaToNoCommentsLocation" +epaToNoCommentsLocation (EpaDelta ss dp []) = EpaDelta ss dp NoComments +epaToNoCommentsLocation (EpaDelta _ _ _ ) = panic "epaToNoCommentsLocation" noCommentsToEpaLocation :: NoCommentsLocation -> EpaLocation noCommentsToEpaLocation (EpaSpan ss) = EpaSpan ss -noCommentsToEpaLocation (EpaDelta dp NoComments) = EpaDelta dp [] +noCommentsToEpaLocation (EpaDelta ss dp NoComments) = EpaDelta ss dp [] -- | Tokens embedded in the AST have an EpaLocation, unless they come from -- generated code (e.g. by TH). @@ -550,8 +550,8 @@ spanAsAnchor ss = EpaSpan ss realSpanAsAnchor :: RealSrcSpan -> (EpaLocation' a) realSpanAsAnchor s = EpaSpan (RealSrcSpan s Strict.Nothing) -noSpanAnchor :: (NoAnn a) => (EpaLocation' a) -noSpanAnchor = EpaDelta (SameLine 0) noAnn +noSpanAnchor :: (NoAnn a) => EpaLocation' a +noSpanAnchor = EpaDelta noSrcSpan (SameLine 0) noAnn -- --------------------------------------------------------------------- @@ -1044,7 +1044,7 @@ instance HasLoc (EpAnn a) where instance HasLoc EpaLocation where getHasLoc (EpaSpan l) = l - getHasLoc (EpaDelta _ _) = noSrcSpan + getHasLoc (EpaDelta l _ _) = l getHasLocList :: HasLoc a => [a] -> SrcSpan getHasLocList [] = noSrcSpan @@ -1088,7 +1088,7 @@ widenSpan s as = foldl combineSrcSpans s (go as) go [] = [] go (AddEpAnn _ (EpaSpan (RealSrcSpan s mb)):rest) = RealSrcSpan s mb : go rest go (AddEpAnn _ (EpaSpan _):rest) = go rest - go (AddEpAnn _ (EpaDelta _ _):rest) = go rest + go (AddEpAnn _ (EpaDelta _ _ _):rest) = go rest -- | The annotations need to all come after the anchor. Make sure -- this is the case. @@ -1132,7 +1132,7 @@ widenAnchor :: Anchor -> [AddEpAnn] -> Anchor widenAnchor (EpaSpan (RealSrcSpan s mb)) as = EpaSpan (RealSrcSpan (widenRealSpan s as) (liftA2 combineBufSpans mb (bufSpanFromAnns as))) widenAnchor (EpaSpan us) _ = EpaSpan us -widenAnchor a@(EpaDelta _ _) as = case (realSpanFromAnns as) of +widenAnchor a at EpaDelta{} as = case (realSpanFromAnns as) of Strict.Nothing -> a Strict.Just r -> EpaSpan (RealSrcSpan r Strict.Nothing) @@ -1140,7 +1140,7 @@ widenAnchorS :: Anchor -> SrcSpan -> Anchor widenAnchorS (EpaSpan (RealSrcSpan s mbe)) (RealSrcSpan r mbr) = EpaSpan (RealSrcSpan (combineRealSrcSpans s r) (liftA2 combineBufSpans mbe mbr)) widenAnchorS (EpaSpan us) _ = EpaSpan us -widenAnchorS (EpaDelta _ _) (RealSrcSpan r mb) = EpaSpan (RealSrcSpan r mb) +widenAnchorS EpaDelta{} (RealSrcSpan r mb) = EpaSpan (RealSrcSpan r mb) widenAnchorS anc _ = anc widenLocatedAn :: EpAnn an -> [AddEpAnn] -> EpAnn an @@ -1290,7 +1290,7 @@ instance Semigroup EpaLocation where EpaSpan s1 <> EpaSpan s2 = EpaSpan (combineSrcSpans s1 s2) EpaSpan s1 <> _ = EpaSpan s1 _ <> EpaSpan s2 = EpaSpan s2 - EpaDelta dp1 cs1 <> EpaDelta _dp2 cs2 = EpaDelta dp1 (cs1<>cs2) + EpaDelta s1 dp1 cs1 <> EpaDelta s2 _dp2 cs2 = EpaDelta (combineSrcSpans s1 s2) dp1 (cs1<>cs2) instance Semigroup EpAnnComments where EpaComments cs1 <> EpaComments cs2 = EpaComments (cs1 ++ cs2) @@ -1314,7 +1314,7 @@ instance Monoid (AnnSortKey tag) where -- --------------------------------------------------------------------- instance NoAnn EpaLocation where - noAnn = EpaDelta (SameLine 0) [] + noAnn = EpaDelta noSrcSpan (SameLine 0) [] instance NoAnn AnnKeywordId where noAnn = Annlarrowtail {- gotta pick one -} ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -482,7 +482,7 @@ valid_anchor _ = False -- If the decl list for where binds is empty, the anchor ends up -- invalid. In this case, use the parent one patch_anchor :: RealSrcSpan -> Anchor -> Anchor -patch_anchor r (EpaDelta _ _) = EpaSpan (RealSrcSpan r Strict.Nothing) +patch_anchor r EpaDelta{} = EpaSpan (RealSrcSpan r Strict.Nothing) patch_anchor r1 (EpaSpan (RealSrcSpan r0 mb)) = EpaSpan (RealSrcSpan r mb) where r = if srcSpanStartLine r0 < 0 then r1 else r0 @@ -976,7 +976,7 @@ checkTyVars pp_what equals_or_where tc tparms -- Return an AddEpAnn for use in widenLocatedAn. The AnnKeywordId is not used. for_widening :: HsBndrVis GhcPs -> AddEpAnn for_widening (HsBndrInvisible (EpTok loc)) = AddEpAnn AnnAnyclass loc - for_widening _ = AddEpAnn AnnAnyclass (EpaDelta (SameLine 0) []) + for_widening _ = AddEpAnn AnnAnyclass noAnn whereDots, equalsDots :: SDoc @@ -3277,7 +3277,7 @@ epTokenWidenR :: EpToken tok -> SrcSpan -> EpToken tok' epTokenWidenR NoEpTok _ = NoEpTok epTokenWidenR (EpTok l) (UnhelpfulSpan _) = EpTok l epTokenWidenR (EpTok (EpaSpan s1)) s2 = EpTok (EpaSpan (combineSrcSpans s1 s2)) -epTokenWidenR (EpTok (EpaDelta _ _)) _ = +epTokenWidenR (EpTok EpaDelta{}) _ = -- Never happens because the parser does not produce EpaDelta. panic "epTokenWidenR: EpaDelta" ===================================== compiler/GHC/Types/SrcLoc.hs ===================================== @@ -914,9 +914,12 @@ mkSrcSpanPs (PsSpan r b) = RealSrcSpan r (Strict.Just b) -- version, to provide a position for the item relative to the end of -- the previous item in the source. This is useful when editing an -- AST prior to exact printing the changed one. +-- The EpaDelta also contains the original @'SrcSpan'@ for use by +-- tools wanting to manipulate the AST after converting it using +-- ghc-exactprint' @'makeDeltaAst'@. data EpaLocation' a = EpaSpan !SrcSpan - | EpaDelta !DeltaPos !a + | EpaDelta !SrcSpan !DeltaPos !a deriving (Data,Eq,Show) type NoCommentsLocation = EpaLocation' NoComments @@ -957,7 +960,7 @@ instance Outputable NoComments where instance (Outputable a) => Outputable (EpaLocation' a) where ppr (EpaSpan r) = text "EpaSpan" <+> ppr r - ppr (EpaDelta d cs) = text "EpaDelta" <+> ppr d <+> ppr cs + ppr (EpaDelta s d cs) = text "EpaDelta" <+> ppr s <+> ppr d <+> ppr cs instance Outputable DeltaPos where ppr (SameLine c) = text "SameLine" <+> ppr c ===================================== testsuite/tests/parser/should_compile/DumpRenamedAst.stderr ===================================== @@ -74,10 +74,10 @@ [])) (GRHS (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (GrhsAnn (Nothing) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [] @@ -276,8 +276,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:13:11-16 }) @@ -370,8 +370,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:13:27-35 }) @@ -796,8 +796,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:19:23-36 }) @@ -899,8 +899,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:19:43-51 }) @@ -1012,8 +1012,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:20:11-33 }) @@ -1025,10 +1025,10 @@ (NoExtField) (HsForAllInvis (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) ((,) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) [])) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) [])) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [(L @@ -1350,8 +1350,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:22:26-28 }) @@ -1822,8 +1822,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:24:18-26 }) @@ -2256,9 +2256,9 @@ (ImportDecl (XImportDeclPass (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (EpAnnImportDecl - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (Nothing) (Nothing) (Nothing) ===================================== testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr ===================================== @@ -1975,10 +1975,10 @@ [])) (GRHS (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (GrhsAnn (Nothing) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [] ===================================== testsuite/tests/parser/should_compile/T14189.stderr ===================================== @@ -217,9 +217,9 @@ (ImportDecl (XImportDeclPass (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (EpAnnImportDecl - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (Nothing) (Nothing) (Nothing) @@ -318,11 +318,13 @@ ,{Name: T14189.NT}])])]) (Nothing) (Just - (L + (L (EpAnn - (EpaSpan { T14189.hs:1:8-13 }) - (AnnListItem + (EpaSpan { T14189.hs:1:8-13 }) + (AnnListItem []) - (EpaComments + (EpaComments [])) {ModuleName: T14189})))) + + ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -406,8 +406,8 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do acceptSpan <- getAcceptSpan setAcceptSpan False case anchor' of - EpaDelta _ _ -> setAcceptSpan True - _ -> return () + EpaDelta _ _ _ -> setAcceptSpan True + _ -> return () p <- getPosP pe0 <- getPriorEndD debugM $ "enterAnn:starting:(anchor',p,pe,a) =" ++ show (showAst anchor', p, pe0, astId a) @@ -420,7 +420,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do CanUpdateAnchor -> pushAppliedComments _ -> return () case anchor' of - EpaDelta _ dcs -> do + EpaDelta _ _ dcs -> do debugM $ "enterAnn:Printing comments:" ++ showGhc (priorComments cs) mapM_ printOneComment (concatMap tokComment $ priorComments cs) debugM $ "enterAnn:Printing EpaDelta comments:" ++ showGhc dcs @@ -433,7 +433,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do priorCs <- cua canUpdateAnchor takeAppliedComments -- no pop -- ------------------------- case anchor' of - EpaDelta dp _ -> do + EpaDelta _ dp _ -> do debugM $ "enterAnn: EpaDelta:" ++ show dp -- Set the original anchor as prior end, so the rest of this AST -- fragment has a reference @@ -475,14 +475,14 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do off (ss2delta priorEndAfterComments curAnchor) debugM $ "enterAnn: (edp',off,priorEndAfterComments,curAnchor):" ++ show (edp',off,priorEndAfterComments,rs2range curAnchor) let edp'' = case anchor' of - EpaDelta dp _ -> dp + EpaDelta _ dp _ -> dp _ -> edp' -- --------------------------------------------- med <- getExtraDP setExtraDP Nothing let edp = case med of Nothing -> edp'' - Just (EpaDelta dp _) -> dp + Just (EpaDelta _ dp _) -> dp -- Replace original with desired one. Allows all -- list entry values to be DP (1,0) Just (EpaSpan (RealSrcSpan r _)) -> dp @@ -536,7 +536,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do debugM $ "enterAnn:done:(anchor,p,pe,a) =" ++ show (showAst anchor', p1, pe1, astId a') case anchor' of - EpaDelta _ _ -> return () + EpaDelta _ _ _ -> return () EpaSpan (RealSrcSpan rss _) -> do setAcceptSpan False setPriorEndD (snd $ rs2range rss) @@ -554,7 +554,8 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do trailing' <- markTrailing trailing_anns -- Update original anchor, comments based on the printing process - let newAchor = EpaDelta edp [] + -- TODO:AZ: probably need to put something appropriate in instead of noSrcSpan + let newAchor = EpaDelta noSrcSpan edp [] let r = case canUpdateAnchor of CanUpdateAnchor -> setAnnotationAnchor a' newAchor trailing' (mkEpaComments (priorCs ++ postCs) []) CanUpdateAnchorOnly -> setAnnotationAnchor a' newAchor [] emptyComments @@ -653,8 +654,8 @@ printSourceText (NoSourceText) txt = printStringAdvance txt >> return () printSourceText (SourceText txt) _ = printStringAdvance (unpackFS txt) >> return () printSourceTextAA :: (Monad m, Monoid w) => SourceText -> String -> EP w m () -printSourceTextAA (NoSourceText) txt = printStringAtAA (EpaDelta (SameLine 0) []) txt >> return () -printSourceTextAA (SourceText txt) _ = printStringAtAA (EpaDelta (SameLine 0) []) (unpackFS txt) >> return () +printSourceTextAA (NoSourceText) txt = printStringAtAA noAnn txt >> return () +printSourceTextAA (SourceText txt) _ = printStringAtAA noAnn (unpackFS txt) >> return () -- --------------------------------------------------------------------- @@ -681,9 +682,9 @@ printStringAtRsC capture pa str = do NoCaptureComments -> return [] debugM $ "printStringAtRsC:cs'=" ++ show cs' debugM $ "printStringAtRsC:p'=" ++ showAst p' - debugM $ "printStringAtRsC: (EpaDelta p' [])=" ++ showAst (EpaDelta p' NoComments) - debugM $ "printStringAtRsC: (EpaDelta p' (map comment2LEpaComment cs'))=" ++ showAst (EpaDelta p' (map comment2LEpaComment cs')) - return (EpaDelta p' (map comment2LEpaComment cs')) + debugM $ "printStringAtRsC: (EpaDelta p' [])=" ++ showAst (EpaDelta noSrcSpan p' NoComments) + debugM $ "printStringAtRsC: (EpaDelta p' (map comment2LEpaComment cs'))=" ++ showAst (EpaDelta noSrcSpan p' (map comment2LEpaComment cs')) + return (EpaDelta noSrcSpan p' (map comment2LEpaComment cs')) printStringAtRs' :: (Monad m, Monoid w) => RealSrcSpan -> String -> EP w m () printStringAtRs' pa str = printStringAtRsC NoCaptureComments pa str >> return () @@ -695,7 +696,7 @@ printStringAtMLoc' :: (Monad m, Monoid w) printStringAtMLoc' (Just aa) s = Just <$> printStringAtAA aa s printStringAtMLoc' Nothing s = do printStringAtLsDelta (SameLine 1) s - return (Just (EpaDelta (SameLine 1) [])) + return (Just (EpaDelta noSrcSpan (SameLine 1) [])) printStringAtMLocL :: (Monad m, Monoid w) => EpAnn a -> Lens a (Maybe EpaLocation) -> String -> EP w m (EpAnn a) @@ -706,7 +707,7 @@ printStringAtMLocL (EpAnn anc an cs) l s = do go (Just aa) str = Just <$> printStringAtAA aa str go Nothing str = do printStringAtLsDelta (SameLine 1) str - return (Just (EpaDelta (SameLine 1) [])) + return (Just (EpaDelta noSrcSpan (SameLine 1) [])) printStringAtAA :: (Monad m, Monoid w) => EpaLocation -> String -> EP w m EpaLocation printStringAtAA el str = printStringAtAAC CaptureComments el str @@ -726,7 +727,7 @@ printStringAtAAC :: (Monad m, Monoid w) => CaptureComments -> EpaLocation -> String -> EP w m EpaLocation printStringAtAAC capture (EpaSpan (RealSrcSpan r _)) s = printStringAtRsC capture r s printStringAtAAC _capture (EpaSpan ss@(UnhelpfulSpan _)) _s = error $ "printStringAtAAC:ss=" ++ show ss -printStringAtAAC capture (EpaDelta d cs) s = do +printStringAtAAC capture (EpaDelta ss d cs) s = do mapM_ printOneComment $ concatMap tokComment cs pe1 <- getPriorEndD p1 <- getPosP @@ -739,7 +740,7 @@ printStringAtAAC capture (EpaDelta d cs) s = do CaptureComments -> takeAppliedComments NoCaptureComments -> return [] debugM $ "printStringAtAA:(pe1,pe2,p1,p2,cs')=" ++ show (pe1,pe2,p1,p2,cs') - return (EpaDelta d (map comment2LEpaComment cs')) + return (EpaDelta ss d (map comment2LEpaComment cs')) -- --------------------------------------------------------------------- @@ -1486,7 +1487,7 @@ printOneComment :: (Monad m, Monoid w) => Comment -> EP w m () printOneComment c@(Comment _str loc _r _mo) = do debugM $ "printOneComment:c=" ++ showGhc c dp <-case loc of - EpaDelta dp _ -> return dp + EpaDelta _ dp _ -> return dp EpaSpan (RealSrcSpan r _) -> do pe <- getPriorEndD debugM $ "printOneComment:pe=" ++ showGhc pe @@ -1496,7 +1497,7 @@ printOneComment c@(Comment _str loc _r _mo) = do EpaSpan (UnhelpfulSpan _) -> return (SameLine 0) mep <- getExtraDP dp' <- case mep of - Just (EpaDelta edp _) -> do + Just (EpaDelta _ edp _) -> do debugM $ "printOneComment:edp=" ++ show edp adjustDeltaForOffsetM edp _ -> return dp @@ -1513,7 +1514,7 @@ updateAndApplyComment (Comment str anc pp mo) dp = do where (r,c) = ss2posEnd pp dp'' = case anc of - EpaDelta dp1 _ -> dp1 + EpaDelta _ dp1 _ -> dp1 EpaSpan (RealSrcSpan la _) -> if r == 0 then (ss2delta (r,c+0) la) @@ -1527,12 +1528,12 @@ updateAndApplyComment (Comment str anc pp mo) dp = do _ -> dp'' op' = case dp' of SameLine n -> if n >= 0 - then EpaDelta dp' NoComments - else EpaDelta dp NoComments - _ -> EpaDelta dp' NoComments - anc' = if str == "" && op' == EpaDelta (SameLine 0) NoComments -- EOF comment - then EpaDelta dp NoComments - else EpaDelta dp NoComments + then EpaDelta noSrcSpan dp' NoComments + else EpaDelta noSrcSpan dp NoComments + _ -> EpaDelta noSrcSpan dp' NoComments + anc' = if str == "" && op' == EpaDelta noSrcSpan (SameLine 0) NoComments -- EOF comment + then EpaDelta noSrcSpan dp NoComments + else EpaDelta noSrcSpan dp NoComments -- --------------------------------------------------------------------- @@ -4265,11 +4266,11 @@ printUnicode anc n = do -- TODO: unicode support? "forall" -> if spanLength (anchor anc) == 1 then "∀" else "forall" s -> s - loc <- printStringAtAAC NoCaptureComments (EpaDelta (SameLine 0) []) str + loc <- printStringAtAAC NoCaptureComments (EpaDelta noSrcSpan (SameLine 0) []) str case loc of EpaSpan _ -> return anc - EpaDelta dp [] -> return $ EpaDelta dp [] - EpaDelta _ _cs -> error "printUnicode should not capture comments" + EpaDelta ss dp [] -> return $ EpaDelta ss dp [] + EpaDelta _ _ _cs -> error "printUnicode should not capture comments" markName :: (Monad m, Monoid w) ===================================== utils/check-exact/Main.hs ===================================== @@ -451,9 +451,9 @@ changeLetIn1 _libdir parsed [l2,_l1] = map wrapDecl decls decls' = concatMap decl2Bind [l2] (L _ e) = expr - a = EpAnn (EpaDelta (SameLine 1) []) noAnn emptyComments + a = EpAnn (EpaDelta noSrcSpan (SameLine 1) []) noAnn emptyComments expr' = L a e - tkIn' = EpTok (EpaDelta (DifferentLine 1 0) []) + tkIn' = EpTok (EpaDelta noSrcSpan (DifferentLine 1 0) []) in (HsLet (tkLet, tkIn') (HsValBinds x (ValBinds xv decls' sigs)) expr') @@ -525,7 +525,7 @@ changeLocalDecls libdir (L l p) = do os' = setEntryDP os (DifferentLine 2 0) let sortKey = captureOrderBinds decls let (EpAnn anc (AnnList (Just _) a b c dd) cs) = van - let van' = (EpAnn anc (AnnList (Just (EpaDelta (DifferentLine 1 5) [])) a b c dd) cs) + let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 5) [])) a b c dd) cs) -- let (EpAnn anc (AnnList (Just _) a b c dd) cs) = van -- let van' = (EpAnn anc (AnnList (Just (EpaDelta (DifferentLine 1 5) [])) a b c dd) cs) let binds' = (HsValBinds van' @@ -551,11 +551,11 @@ changeLocalDecls2 libdir (L l p) = do replaceLocalBinds :: LMatch GhcPs (LHsExpr GhcPs) -> Transform (LMatch GhcPs (LHsExpr GhcPs)) replaceLocalBinds (L lm (Match ma mln pats (GRHSs _ rhs EmptyLocalBinds{}))) = do - let anc = (EpaDelta (DifferentLine 1 3) []) - let anc2 = (EpaDelta (DifferentLine 1 5) []) + let anc = (EpaDelta noSrcSpan (DifferentLine 1 3) []) + let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 5) []) let an = EpAnn anc (AnnList (Just anc2) Nothing Nothing - [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] []) + [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] []) emptyComments let decls = [s,d] let sortKey = captureOrderBinds decls ===================================== utils/check-exact/Transform.hs ===================================== @@ -218,8 +218,8 @@ captureTypeSigSpacing (L l (SigD x (TypeSig (AnnSig dc rs') ns (HsWC xw ty)))) rd = case last ns of L (EpAnn anc' _ _) _ -> anchor anc' -- TODO MovedAnchor? dc' = case dca of - EpaSpan (RealSrcSpan r _) -> AddEpAnn kw (EpaDelta (ss2delta (ss2posEnd rd) r) []) - _ -> AddEpAnn kw dca + EpaSpan ss@(RealSrcSpan r _) -> AddEpAnn kw (EpaDelta ss (ss2delta (ss2posEnd rd) r) []) + _ -> AddEpAnn kw dca -- --------------------------------- @@ -228,10 +228,10 @@ captureTypeSigSpacing (L l (SigD x (TypeSig (AnnSig dc rs') ns (HsWC xw ty)))) (L (EpAnn anc0 a c) b) -> let anc' = case anc0 of - EpaDelta _ _ -> anc0 + EpaDelta _ _ _ -> anc0 _ -> case dca of - EpaSpan _ -> EpaDelta (SameLine 1) [] - EpaDelta _ cs0 -> EpaDelta (SameLine 1) cs0 + EpaSpan ss -> EpaDelta ss (SameLine 1) [] + EpaDelta ss _ cs0 -> EpaDelta ss (SameLine 1) cs0 in (L (EpAnn anc' a c) b) captureTypeSigSpacing s = s @@ -254,12 +254,12 @@ setEntryDPDecl d dp = setEntryDP d dp -- |Set the true entry 'DeltaPos' from the annotation for a given AST -- element. This is the 'DeltaPos' ignoring any comments. setEntryDP :: NoAnn t => LocatedAn t a -> DeltaPos -> LocatedAn t a -setEntryDP (L (EpAnn (EpaSpan (UnhelpfulSpan _)) an cs) a) dp - = L (EpAnn (EpaDelta dp []) an cs) a -setEntryDP (L (EpAnn (EpaSpan _) an (EpaComments [])) a) dp - = L (EpAnn (EpaDelta dp []) an (EpaComments [])) a -setEntryDP (L (EpAnn (EpaDelta d csd) an cs) a) dp - = L (EpAnn (EpaDelta d' csd') an cs') a +setEntryDP (L (EpAnn (EpaSpan ss@(UnhelpfulSpan _)) an cs) a) dp + = L (EpAnn (EpaDelta ss dp []) an cs) a +setEntryDP (L (EpAnn (EpaSpan ss) an (EpaComments [])) a) dp + = L (EpAnn (EpaDelta ss dp []) an (EpaComments [])) a +setEntryDP (L (EpAnn (EpaDelta ss d csd) an cs) a) dp + = L (EpAnn (EpaDelta ss d' csd') an cs') a where (d', csd', cs') = case cs of EpaComments (h:t) -> @@ -283,22 +283,22 @@ setEntryDP (L (EpAnn (EpaDelta d csd) an cs) a) dp in (dp0, c':t, EpaCommentsBalanced [] ts) go :: GenLocated NoCommentsLocation e -> (DeltaPos, GenLocated NoCommentsLocation e) - go (L (EpaDelta _ c0) c) = (d, L (EpaDelta dp c0) c) - go (L (EpaSpan _) c) = (d, L (EpaDelta dp NoComments) c) -setEntryDP (L (EpAnn (EpaSpan (RealSrcSpan r _)) an cs) a) dp + go (L (EpaDelta ss0 _ c0) c) = (d, L (EpaDelta ss0 dp c0) c) + go (L (EpaSpan ss0) c) = (d, L (EpaDelta ss0 dp NoComments) c) +setEntryDP (L (EpAnn (EpaSpan ss@(RealSrcSpan r _)) an cs) a) dp = case sortEpaComments (priorComments cs) of [] -> - L (EpAnn (EpaDelta dp []) an cs) a + L (EpAnn (EpaDelta ss dp []) an cs) a (L ca c:cs') -> - L (EpAnn (EpaDelta edp csd) an cs'') a + L (EpAnn (EpaDelta ss edp csd) an cs'') a where cs'' = setPriorComments cs [] - csd = L (EpaDelta dp NoComments) c:cs' + csd = L (EpaDelta ss dp NoComments) c:cs' lc = last $ (L ca c:cs') delta = case getLoc lc of EpaSpan (RealSrcSpan rr _) -> ss2delta (ss2pos rr) r EpaSpan _ -> (SameLine 0) - EpaDelta _dp _ -> DifferentLine 1 0 + EpaDelta _ _dp _ -> DifferentLine 1 0 line = getDeltaLine delta col = deltaColumn delta edp' = if line == 0 then SameLine col @@ -309,27 +309,27 @@ setEntryDP (L (EpAnn (EpaSpan (RealSrcSpan r _)) an cs) a) dp -- --------------------------------------------------------------------- getEntryDP :: LocatedAn t a -> DeltaPos -getEntryDP (L (EpAnn (EpaDelta dp _) _ _) _) = dp +getEntryDP (L (EpAnn (EpaDelta _ dp _) _ _) _) = dp getEntryDP _ = SameLine 1 -- --------------------------------------------------------------------- addEpaLocationDelta :: LayoutStartCol -> RealSrcSpan -> EpaLocation -> EpaLocation -addEpaLocationDelta _off _anc (EpaDelta d cs) = EpaDelta d cs -addEpaLocationDelta _off _anc (EpaSpan (UnhelpfulSpan _)) = EpaDelta (SameLine 0) [] -addEpaLocationDelta off anc (EpaSpan (RealSrcSpan r _)) - = EpaDelta (adjustDeltaForOffset off (ss2deltaEnd anc r)) [] +addEpaLocationDelta _off _anc (EpaDelta ss d cs) = EpaDelta ss d cs +addEpaLocationDelta _off _anc (EpaSpan ss@(UnhelpfulSpan _)) = EpaDelta ss (SameLine 0) [] +addEpaLocationDelta off anc (EpaSpan ss@(RealSrcSpan r _)) + = EpaDelta ss (adjustDeltaForOffset off (ss2deltaEnd anc r)) [] -- Set the entry DP for an element coming after an existing keyword annotation setEntryDPFromAnchor :: LayoutStartCol -> EpaLocation -> LocatedA t -> LocatedA t -setEntryDPFromAnchor _off (EpaDelta _ _) (L la a) = L la a +setEntryDPFromAnchor _off (EpaDelta _ _ _) (L la a) = L la a setEntryDPFromAnchor _off (EpaSpan (UnhelpfulSpan _)) (L la a) = L la a setEntryDPFromAnchor off (EpaSpan (RealSrcSpan anc _)) ll@(L la _) = setEntryDP ll dp' where dp' = case la of (EpAnn (EpaSpan (RealSrcSpan r' _)) _ _) -> adjustDeltaForOffset off (ss2deltaEnd anc r') (EpAnn (EpaSpan _) _ _) -> adjustDeltaForOffset off (SameLine 0) - (EpAnn (EpaDelta dp _) _ _) -> adjustDeltaForOffset off dp + (EpAnn (EpaDelta _ dp _) _ _) -> adjustDeltaForOffset off dp -- --------------------------------------------------------------------- @@ -559,7 +559,7 @@ balanceComments' la1 la2 = do trailingCommentsDeltas :: RealSrcSpan -> [LEpaComment] -> [(Int, LEpaComment)] trailingCommentsDeltas _ [] = [] -trailingCommentsDeltas r (la@(L (EpaDelta dp _) _):las) +trailingCommentsDeltas r (la@(L (EpaDelta _ dp _) _):las) = (getDeltaLine dp, la): trailingCommentsDeltas r las trailingCommentsDeltas r (la@(L l _):las) = deltaComment r la : trailingCommentsDeltas (anchor l) las @@ -576,7 +576,7 @@ priorCommentsDeltas r cs = go r (reverse $ sortEpaComments cs) where go :: RealSrcSpan -> [LEpaComment] -> [(Int, LEpaComment)] go _ [] = [] - go _ (la@(L l@(EpaDelta dp _) _):las) = (deltaLine dp, la) : go (anchor l) las + go _ (la@(L l@(EpaDelta _ dp _) _):las) = (deltaLine dp, la) : go (anchor l) las go rs' (la@(L l _):las) = deltaComment rs' la : go (anchor l) las deltaComment :: RealSrcSpan -> LEpaComment -> (Int, LEpaComment) @@ -705,7 +705,7 @@ anchorEof (L l m@(HsModule (XModulePs an _lo _ _) _mn _exps _imps _decls)) = L l -- | Create a @SrcSpanAnn@ with a @MovedAnchor@ operation using the -- given @DeltaPos at . noAnnSrcSpanDP :: (NoAnn ann) => DeltaPos -> EpAnn ann -noAnnSrcSpanDP dp = EpAnn (EpaDelta dp []) noAnn emptyComments +noAnnSrcSpanDP dp = EpAnn (EpaDelta noSrcSpan dp []) noAnn emptyComments noAnnSrcSpanDP0 :: (NoAnn ann) => EpAnn ann noAnnSrcSpanDP0 = noAnnSrcSpanDP (SameLine 0) @@ -717,13 +717,13 @@ noAnnSrcSpanDPn :: (NoAnn ann) => Int -> EpAnn ann noAnnSrcSpanDPn s = noAnnSrcSpanDP (SameLine s) d0 :: EpaLocation -d0 = EpaDelta (SameLine 0) [] +d0 = EpaDelta noSrcSpan (SameLine 0) [] d1 :: EpaLocation -d1 = EpaDelta (SameLine 1) [] +d1 = EpaDelta noSrcSpan (SameLine 1) [] dn :: Int -> EpaLocation -dn n = EpaDelta (SameLine n) [] +dn n = EpaDelta noSrcSpan (SameLine n) [] addComma :: SrcSpanAnnA -> SrcSpanAnnA addComma (EpAnn anc (AnnListItem as) cs) @@ -888,8 +888,8 @@ instance HasDecls (LocatedA (HsExpr GhcPs)) where off = case l of (EpaSpan (RealSrcSpan r _)) -> LayoutStartCol $ snd $ ss2pos r (EpaSpan (UnhelpfulSpan _)) -> LayoutStartCol 0 - (EpaDelta (SameLine _) _) -> LayoutStartCol 0 - (EpaDelta (DifferentLine _ c) _) -> LayoutStartCol c + (EpaDelta _ (SameLine _) _) -> LayoutStartCol 0 + (EpaDelta _ (DifferentLine _ c) _) -> LayoutStartCol c ex'' = setEntryDPFromAnchor off i ex newDecls'' = case newDecls of [] -> newDecls @@ -1095,7 +1095,7 @@ oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = do -- TODO: when we set DP (0,0) for the HsValBinds EpEpaLocation, change the AnnList anchor to have the correct DP too let (AnnList ancl o c _r t) = an let w = case ww of - WithWhere -> [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] + WithWhere -> [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] WithoutWhere -> [] (anc', ancl') <- do case ww of @@ -1108,10 +1108,10 @@ oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = do newWhereAnnotation :: (Monad m) => WithWhere -> TransformT m (EpAnn AnnList) newWhereAnnotation ww = do - let anc = EpaDelta (DifferentLine 1 3) [] - let anc2 = EpaDelta (DifferentLine 1 5) [] + let anc = EpaDelta noSrcSpan (DifferentLine 1 3) [] + let anc2 = EpaDelta noSrcSpan (DifferentLine 1 5) [] let w = case ww of - WithWhere -> [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] + WithWhere -> [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] WithoutWhere -> [] let an = EpAnn anc (AnnList (Just anc2) Nothing Nothing w []) ===================================== utils/check-exact/Utils.hs ===================================== @@ -184,8 +184,8 @@ isPointSrcSpan ss = spanLength ss == 0 -- `MovedAnchor` operation based on the original location, only if it -- does not already have one. commentOrigDelta :: LEpaComment -> LEpaComment -commentOrigDelta (L (EpaSpan (RealSrcSpan la _)) (GHC.EpaComment t pp)) - = (L (EpaDelta dp NoComments) (GHC.EpaComment t pp)) +commentOrigDelta (L (EpaSpan ss@(RealSrcSpan la _)) (GHC.EpaComment t pp)) + = (L (EpaDelta ss dp NoComments) (GHC.EpaComment t pp)) `debug` ("commentOrigDelta: (la, pp, r,c, dp)=" ++ showAst (la, pp, r,c, dp)) where (r,c) = ss2posEnd pp @@ -330,10 +330,10 @@ sortEpaComments cs = sortBy cmp cs mkKWComment :: AnnKeywordId -> NoCommentsLocation -> Comment mkKWComment kw (EpaSpan (RealSrcSpan ss mb)) = Comment (keywordToString kw) (EpaSpan (RealSrcSpan ss mb)) ss (Just kw) -mkKWComment kw (EpaSpan (UnhelpfulSpan _)) - = Comment (keywordToString kw) (EpaDelta (SameLine 0) NoComments) placeholderRealSpan (Just kw) -mkKWComment kw (EpaDelta dp cs) - = Comment (keywordToString kw) (EpaDelta dp cs) placeholderRealSpan (Just kw) +mkKWComment kw (EpaSpan ss@(UnhelpfulSpan _)) + = Comment (keywordToString kw) (EpaDelta ss (SameLine 0) NoComments) placeholderRealSpan (Just kw) +mkKWComment kw (EpaDelta ss dp cs) + = Comment (keywordToString kw) (EpaDelta ss dp cs) placeholderRealSpan (Just kw) -- | Detects a comment which originates from a specific keyword. isKWComment :: Comment -> Bool @@ -434,11 +434,11 @@ To be absolutely sure, we make the delta versions use -ve values. hackSrcSpanToAnchor :: SrcSpan -> Anchor hackSrcSpanToAnchor (UnhelpfulSpan s) = error $ "hackSrcSpanToAnchor : UnhelpfulSpan:" ++ show s -hackSrcSpanToAnchor (RealSrcSpan r mb) +hackSrcSpanToAnchor ss@(RealSrcSpan r mb) = case mb of (Strict.Just (BufSpan (BufPos s) (BufPos e))) -> if s <= 0 && e <= 0 - then EpaDelta (deltaPos (-s) (-e)) [] + then EpaDelta ss (deltaPos (-s) (-e)) [] `debug` ("hackSrcSpanToAnchor: (r,s,e)=" ++ showAst (r,s,e) ) else EpaSpan (RealSrcSpan r mb) _ -> EpaSpan (RealSrcSpan r mb) ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -1046,7 +1046,7 @@ instance NFData NoComments where instance NFData a => NFData (EpaLocation' a) where rnf (EpaSpan ss) = rnf ss - rnf (EpaDelta dp lc) = dp `seq` lc `deepseq` () + rnf (EpaDelta ss dp lc) = ss `seq` dp `seq` lc `deepseq` () instance NFData EpAnnComments where rnf (EpaComments cs) = rnf cs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/99612d1871995bf34b8ee53d0afc52aa15eabd1b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/99612d1871995bf34b8ee53d0afc52aa15eabd1b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 5 22:15:26 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 05 Jul 2024 18:15:26 -0400 Subject: [Git][ghc/ghc][wip/T24978] Fix typo Message-ID: <6688707e5dff7_ac4ef51df9fc124769@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: c1e2c733 by Simon Peyton Jones at 2024-07-05T23:15:05+01:00 Fix typo - - - - - 1 changed file: - compiler/GHC/Iface/Type.hs Changes: ===================================== compiler/GHC/Iface/Type.hs ===================================== @@ -2471,7 +2471,7 @@ instance Binary IfaceCoercion where instance Binary IfaceAxiomRule where put_ bh (IfaceAR_X n) = putByte bh 0 >> put_ bh n put_ bh (IfaceAR_U n) = putByte bh 1 >> put_ bh n - put_ bh (IfaceAR_B n i) = putByte bh 1 >> put_ bh n >> put_ bh i + put_ bh (IfaceAR_B n i) = putByte bh 2 >> put_ bh n >> put_ bh i get bh = do h <- getByte bh case h of View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c1e2c733a66c1a3a220db1c8236bbb7382210d7c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c1e2c733a66c1a3a220db1c8236bbb7382210d7c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 6 10:19:14 2024 From: gitlab at gitlab.haskell.org (adam (@adamse)) Date: Sat, 06 Jul 2024 06:19:14 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/adamse/mmap-init Message-ID: <66891a2280c06_281b1a35db3a064984@gitlab.mail> adam pushed new branch wip/adamse/mmap-init at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/adamse/mmap-init You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 6 21:39:38 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sat, 06 Jul 2024 17:39:38 -0400 Subject: [Git][ghc/ghc][wip/T24978] Improve coercionKind Message-ID: <6689b99a1c5e1_12536e3c62d047666d@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: b9fb355d by Simon Peyton Jones at 2024-07-06T22:39:11+01:00 Improve coercionKind - - - - - 1 changed file: - compiler/GHC/Core/Coercion.hs Changes: ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -2465,13 +2465,36 @@ coercionLKind co go (KindCo co) = typeKind (go co) go (SubCo co) = go co go (SelCo d co) = selectFromType d (go co) - go (AxiomRuleCo ax cos) = pFst (coAxRuleKind ax (map coercionKind cos)) + go (AxiomRuleCo ax cos) = go_ax ax cos + go_app :: Coercion -> [Type] -> Type -- Collect up all the arguments and apply all at once -- See Note [Nested InstCos] go_app (InstCo co arg) args = go_app co (go arg:args) go_app co args = piResultTys (go co) args + -- Tiresome to near-duplicate this, but coercionKind + -- is a very hot cod path + go_ax (BuiltInFamRewrite bif) cos = go_bif (bifrw_proves bif) cos + go_ax (BuiltInFamInteract bif) cos = go_bif (bifint_proves bif) cos + go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos + go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos + + go_bif proves cos = pFst $ expectJust "coAxRuleKind" $ proves $ + map coercionKind cos + + go_branch :: CoAxiom br -> CoAxBranch -> [Coercion] -> Type + go_branch ax (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_lhs = lhs_tys }) cos + = assert (cos `equalLength` tcvs) $ + -- Invariant of AxiomRuleCo: cos should + -- exactly saturate the axiom branch + substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys) + where + tc = coAxiomTyCon ax + tcvs | null cvs = tvs -- Very common case (currently always!) + | otherwise = tvs ++ cvs + ltys = map go cos -- `go` is `coercionLKind` + coercionRKind :: HasDebugCallStack => Coercion -> Type coercionRKind co = go co @@ -2494,7 +2517,7 @@ coercionRKind co go (KindCo co) = typeKind (go co) go (SubCo co) = go co go (SelCo d co) = selectFromType d (go co) - go (AxiomRuleCo ax cos) = pSnd (coAxRuleKind ax (map coercionKind cos)) + go (AxiomRuleCo ax cos) = go_ax ax cos go co@(ForAllCo { fco_tcv = tv1, fco_visR = visR , fco_kind = k_co, fco_body = co1 }) -- works for both tyvar and covar @@ -2553,26 +2576,26 @@ coercionRKind co -- when other_co is not a ForAllCo = substTy subst (go other_co) -coAxRuleKind :: CoAxiomRule -> [Pair Type] -> Pair Type -coAxRuleKind ax prs - = case ax of - BuiltInFamRewrite bif -> expectJust "coAxRuleKind" (bifrw_proves bif prs) - BuiltInFamInteract bif -> expectJust "coAxRuleKind" (bifint_proves bif prs) - UnbranchedAxiom ax -> go_branch ax (coAxiomSingleBranch ax) - BranchedAxiom ax i -> go_branch ax (coAxiomNthBranch ax i) - where - go_branch :: CoAxiom br -> CoAxBranch -> Pair Type - go_branch ax (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_lhs = lhs_tys, cab_rhs = rhs_ty }) - = assert (prs `equalLength` tcvs) $ + -- Tiresome to near-duplicate this, but coercionKind + -- is a very hot cod path + go_ax (BuiltInFamRewrite bif) cos = go_bif (bifrw_proves bif) cos + go_ax (BuiltInFamInteract bif) cos = go_bif (bifint_proves bif) cos + go_ax (UnbranchedAxiom ax) cos = go_branch (coAxiomSingleBranch ax) cos + go_ax (BranchedAxiom ax i) cos = go_branch (coAxiomNthBranch ax i) cos + + go_bif proves cos = pSnd $ expectJust "coAxRuleKind" $ proves $ + map coercionKind cos + + go_branch :: CoAxBranch -> [Coercion] -> Type + go_branch (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_rhs = rhs_ty }) cos + = assert (cos `equalLength` tcvs) $ -- Invariant of AxiomRuleCo: cos should -- exactly saturate the axiom branch - Pair (substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys)) - (substTy (zipTCvSubst tcvs rtys) rhs_ty) + substTy (zipTCvSubst tcvs rtys) rhs_ty where - (ltys, rtys) = unzipPairs prs - tc = coAxiomTyCon ax - tcvs = tvs ++ cvs - + tcvs | null cvs = tvs -- Very common case (currently always!) + | otherwise = tvs ++ cvs + rtys = map go cos -- `go` is `coercionRKind` {- Note [Nested ForAllCos] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b9fb355dacae92b373e6ed09c597862119c74172 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b9fb355dacae92b373e6ed09c597862119c74172 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 7 20:29:00 2024 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Sun, 07 Jul 2024 16:29:00 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25046_impl Message-ID: <668afa8c84012_38951f2f3e04c164ec@gitlab.mail> Serge S. Gulin pushed new branch wip/T25046_impl at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25046_impl You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 7 22:14:04 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sun, 07 Jul 2024 18:14:04 -0400 Subject: [Git][ghc/ghc][wip/T24978] Better coercionKind Message-ID: <668b132c9d9b0_38951f3d177402443b@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 06af46d3 by Simon Peyton Jones at 2024-07-07T23:13:09+01:00 Better coercionKind In particular * Avoid #25066 * Do coercionLKind, coercionRKing by specialisation rather than duplication - - - - - 4 changed files: - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Subst.hs Changes: ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -24,7 +24,7 @@ module GHC.Core.Coercion ( -- ** Functions over coercions coVarRType, coVarLType, coVarTypes, - coVarKind, coVarKindsTypesRole, coVarRole, + coVarKind, coVarTypesRole, coVarRole, coercionType, mkCoercionType, coercionKind, coercionLKind, coercionRKind,coercionKinds, coercionRole, coercionKindRole, @@ -581,20 +581,18 @@ splitForAllCo_co_maybe _ = Nothing -- and some coercion kind stuff coVarLType, coVarRType :: HasDebugCallStack => CoVar -> Type -coVarLType cv | (_, _, ty1, _, _) <- coVarKindsTypesRole cv = ty1 -coVarRType cv | (_, _, _, ty2, _) <- coVarKindsTypesRole cv = ty2 +coVarLType cv | (ty1, _, _) <- coVarTypesRole cv = ty1 +coVarRType cv | (_, ty2, _) <- coVarTypesRole cv = ty2 coVarTypes :: HasDebugCallStack => CoVar -> Pair Type -coVarTypes cv - | (_, _, ty1, ty2, _) <- coVarKindsTypesRole cv - = Pair ty1 ty2 - -coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind,Kind,Type,Type,Role) -coVarKindsTypesRole cv - | Just (tc, [k1,k2,ty1,ty2]) <- splitTyConApp_maybe (varType cv) - = (k1, k2, ty1, ty2, eqTyConRole tc) +coVarTypes cv | (ty1, ty2, _) <- coVarTypesRole cv = Pair ty1 ty2 + +coVarTypesRole :: HasDebugCallStack => CoVar -> (Type,Type,Role) +coVarTypesRole cv + | Just (tc, [_,_,ty1,ty2]) <- splitTyConApp_maybe (varType cv) + = (ty1, ty2, eqTyConRole tc) | otherwise - = pprPanic "coVarKindsTypesRole, non coercion variable" + = pprPanic "coVarTypesRole, non coercion variable" (ppr cv $$ ppr (varType cv)) coVarKind :: CoVar -> Type @@ -2091,7 +2089,7 @@ extendLiftingContextEx lc@(LC subst env) ((v,ty):rest) -- lift_s2 :: s2 ~r s2' -- kco :: (s1 ~r s2) ~N (s1' ~r s2') assert (isCoVar v) $ - let (_, _, s1, s2, r) = coVarKindsTypesRole v + let (s1, s2, r) = coVarTypesRole v lift_s1 = ty_co_subst lc r s1 lift_s2 = ty_co_subst lc r s2 kco = mkTyConAppCo Nominal (equalityTyCon r) @@ -2442,23 +2440,26 @@ coercionType co = case coercionKindRole co of coercionKind :: HasDebugCallStack => Coercion -> Pair Type coercionKind co = Pair (coercionLKind co) (coercionRKind co) -coercionLKind :: HasDebugCallStack => Coercion -> Type -coercionLKind co +coercionLKind, coercionRKind :: HasDebugCallStack => Coercion -> Type +coercionLKind co = coercion_lr_kind CLeft co +coercionRKind co = coercion_lr_kind CRight co + +coercion_lr_kind :: HasDebugCallStack => LeftOrRight -> Coercion -> Type +{-# INLINE coercion_lr_kind #-} +coercion_lr_kind which co = go co where go (Refl ty) = ty go (GRefl _ ty _) = ty go (TyConAppCo _ tc cos) = mkTyConApp tc (map go cos) go (AppCo co1 co2) = mkAppTy (go co1) (go co2) - go (ForAllCo { fco_tcv = tv1, fco_visL = visL, fco_body = co1 }) - = mkTyCoForAllTy tv1 visL (go co1) go (FunCo { fco_afl = af, fco_mult = mult, fco_arg = arg, fco_res = res}) {- See Note [FunCo] -} = FunTy { ft_af = af, ft_mult = go mult , ft_arg = go arg, ft_res = go res } - go (CoVarCo cv) = coVarLType cv - go (HoleCo h) = coVarLType (coHoleCoVar h) + go (CoVarCo cv) = go_covar cv + go (HoleCo h) = go_covar (coHoleCoVar h) go (UnivCo { uco_lty = ty1}) = ty1 - go (SymCo co) = coercionRKind co + go (SymCo co) = pickLR which (coercionRKind co, coercionLKind co) go (TransCo co1 _) = go co1 go (LRCo lr co) = pickLR lr (splitAppTy (go co)) go (InstCo aco arg) = go_app aco [go arg] @@ -2467,77 +2468,66 @@ coercionLKind co go (SelCo d co) = selectFromType d (go co) go (AxiomRuleCo ax cos) = go_ax ax cos + go co@(ForAllCo { fco_tcv = tv1, fco_visL = visL, fco_visR = visR + , fco_kind = k_co, fco_body = co1 }) + = case which of + CLeft -> mkTyCoForAllTy tv1 visL (go co1) + CRight | isGReflCo k_co -- kind_co always has kind `Type`, thus `isGReflCo` + -> mkTyCoForAllTy tv1 visR (go co1) + | otherwise + -> go_forall_right empty_subst co + where + empty_subst = mkEmptySubst (mkInScopeSet $ tyCoVarsOfCo co) + + ------------- + go_covar cv = pickLR which (coVarLType cv, coVarRType cv) + + ------------- go_app :: Coercion -> [Type] -> Type -- Collect up all the arguments and apply all at once -- See Note [Nested InstCos] go_app (InstCo co arg) args = go_app co (go arg:args) go_app co args = piResultTys (go co) args - -- Tiresome to near-duplicate this, but coercionKind - -- is a very hot cod path + ------------- go_ax (BuiltInFamRewrite bif) cos = go_bif (bifrw_proves bif) cos go_ax (BuiltInFamInteract bif) cos = go_bif (bifint_proves bif) cos go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos - go_bif proves cos = pFst $ expectJust "coAxRuleKind" $ proves $ - map coercionKind cos + ------------- + go_bif proves cos = case proves (map coercionKind cos) of + Nothing -> pprPanic "coercionKind" (ppr cos) + Just (Pair lty rty) -> pickLR which (lty, rty) + ------------- go_branch :: CoAxiom br -> CoAxBranch -> [Coercion] -> Type - go_branch ax (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_lhs = lhs_tys }) cos + go_branch ax (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs + , cab_lhs = lhs_tys, cab_rhs = rhs_ty }) cos = assert (cos `equalLength` tcvs) $ -- Invariant of AxiomRuleCo: cos should -- exactly saturate the axiom branch - substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys) + let (tys1, cotys1) = splitAtList tvs tys + cos1 = map stripCoercionTy cotys1 + in +-- You might think to use +-- substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys) +-- but #25066 makes it much less efficient than the silly calls below + substTyWith tvs tys1 $ + substTyWithCoVars cvs cos1 $ + pickLR which (mkTyConApp tc lhs_tys, rhs_ty) where tc = coAxiomTyCon ax tcvs | null cvs = tvs -- Very common case (currently always!) | otherwise = tvs ++ cvs - ltys = map go cos -- `go` is `coercionLKind` - -coercionRKind :: HasDebugCallStack => Coercion -> Type -coercionRKind co - = go co - where - go (Refl ty) = ty - go (GRefl _ ty MRefl) = ty - go (GRefl _ ty (MCo co1)) = mkCastTy ty co1 - go (TyConAppCo _ tc cos) = mkTyConApp tc (map go cos) - go (AppCo co1 co2) = mkAppTy (go co1) (go co2) - go (CoVarCo cv) = coVarRType cv - go (HoleCo h) = coVarRType (coHoleCoVar h) - go (FunCo { fco_afr = af, fco_mult = mult, fco_arg = arg, fco_res = res}) - {- See Note [FunCo] -} = FunTy { ft_af = af, ft_mult = go mult - , ft_arg = go arg, ft_res = go res } - go (UnivCo { uco_rty = ty2 })= ty2 - go (SymCo co) = coercionLKind co - go (TransCo _ co2) = go co2 - go (LRCo lr co) = pickLR lr (splitAppTy (go co)) - go (InstCo aco arg) = go_app aco [go arg] - go (KindCo co) = typeKind (go co) - go (SubCo co) = go co - go (SelCo d co) = selectFromType d (go co) - go (AxiomRuleCo ax cos) = go_ax ax cos + tys = map go cos - go co@(ForAllCo { fco_tcv = tv1, fco_visR = visR - , fco_kind = k_co, fco_body = co1 }) -- works for both tyvar and covar - | isGReflCo k_co = mkTyCoForAllTy tv1 visR (go co1) - -- kind_co always has kind @Type@, thus @isGReflCo@ - | otherwise = go_forall empty_subst co - where - empty_subst = mkEmptySubst (mkInScopeSet $ tyCoVarsOfCo co) - - go_app :: Coercion -> [Type] -> Type - -- Collect up all the arguments and apply all at once - -- See Note [Nested InstCos] - go_app (InstCo co arg) args = go_app co (go arg:args) - go_app co args = piResultTys (go co) args - - go_forall subst (ForAllCo { fco_tcv = tv1, fco_visR = visR - , fco_kind = k_co, fco_body = co }) + ------------- + go_forall_right subst (ForAllCo { fco_tcv = tv1, fco_visR = visR + , fco_kind = k_co, fco_body = co }) -- See Note [Nested ForAllCos] | isTyVar tv1 - = mkForAllTy (Bndr tv2 visR) (go_forall subst' co) + = mkForAllTy (Bndr tv2 visR) (go_forall_right subst' co) where k2 = coercionRKind k_co tv2 = setTyVarKind tv1 (substTy subst k2) @@ -2546,10 +2536,10 @@ coercionRKind co | otherwise = extendTvSubst (extendSubstInScope subst tv2) tv1 $ TyVarTy tv2 `mkCastTy` mkSymCo k_co - go_forall subst (ForAllCo { fco_tcv = cv1, fco_visR = visR - , fco_kind = k_co, fco_body = co }) + go_forall_right subst (ForAllCo { fco_tcv = cv1, fco_visR = visR + , fco_kind = k_co, fco_body = co }) | isCoVar cv1 - = mkTyCoForAllTy cv2 visR (go_forall subst' co) + = mkTyCoForAllTy cv2 visR (go_forall_right subst' co) where k2 = coercionRKind k_co r = coVarRole cv1 @@ -2572,30 +2562,10 @@ coercionRKind co | otherwise = extendCvSubst (extendSubstInScope subst cv2) cv1 n_subst - go_forall subst other_co + go_forall_right subst other_co -- when other_co is not a ForAllCo = substTy subst (go other_co) - -- Tiresome to near-duplicate this, but coercionKind - -- is a very hot cod path - go_ax (BuiltInFamRewrite bif) cos = go_bif (bifrw_proves bif) cos - go_ax (BuiltInFamInteract bif) cos = go_bif (bifint_proves bif) cos - go_ax (UnbranchedAxiom ax) cos = go_branch (coAxiomSingleBranch ax) cos - go_ax (BranchedAxiom ax i) cos = go_branch (coAxiomNthBranch ax i) cos - - go_bif proves cos = pSnd $ expectJust "coAxRuleKind" $ proves $ - map coercionKind cos - - go_branch :: CoAxBranch -> [Coercion] -> Type - go_branch (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs, cab_rhs = rhs_ty }) cos - = assert (cos `equalLength` tcvs) $ - -- Invariant of AxiomRuleCo: cos should - -- exactly saturate the axiom branch - substTy (zipTCvSubst tcvs rtys) rhs_ty - where - tcvs | null cvs = tvs -- Very common case (currently always!) - | otherwise = tvs ++ cvs - rtys = map go cos -- `go` is `coercionRKind` {- Note [Nested ForAllCos] ===================================== compiler/GHC/Core/Coercion.hs-boot ===================================== @@ -41,7 +41,7 @@ isGReflCo :: Coercion -> Bool isReflCo :: Coercion -> Bool isReflexiveCo :: Coercion -> Bool decomposePiCos :: HasDebugCallStack => Coercion -> Pair Type -> [Type] -> ([Coercion], Coercion) -coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind, Kind, Type, Type, Role) +coVarTypesRole :: HasDebugCallStack => CoVar -> (Type, Type, Role) coVarRole :: CoVar -> Role mkCoercionType :: Role -> Type -> Type -> Type ===================================== compiler/GHC/Core/DataCon.hs ===================================== @@ -1338,7 +1338,7 @@ dataConKindEqSpec (MkData {dcExTyCoVars = ex_tcvs}) = [ EqSpec tv ty | cv <- ex_tcvs , isCoVar cv - , let (_, _, ty1, ty, _) = coVarKindsTypesRole cv + , let (ty1, ty, _) = coVarTypesRole cv tv = getTyVar ty1 ] ===================================== compiler/GHC/Core/TyCo/Subst.hs ===================================== @@ -60,7 +60,7 @@ import {-# SOURCE #-} GHC.Core.Coercion , mkAxiomRuleCo, mkAppCo, mkGReflCo , mkInstCo, mkLRCo, mkTyConAppCo , mkCoercionType - , coercionKind, coercionLKind, coVarKindsTypesRole ) + , coercionKind, coercionLKind, coVarTypesRole ) import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprTyVar ) import {-# SOURCE #-} GHC.Core.Ppr ( ) -- instance Outputable CoreExpr import {-# SOURCE #-} GHC.Core ( CoreExpr ) @@ -1086,7 +1086,7 @@ substCoVarBndrUsing subst_fn subst@(Subst in_scope idenv tenv cenv) old_var new_var = uniqAway in_scope subst_old_var subst_old_var = mkCoVar (varName old_var) new_var_type - (_, _, t1, t2, role) = coVarKindsTypesRole old_var + (t1, t2, role) = coVarTypesRole old_var t1' = subst_fn subst t1 t2' = subst_fn subst t2 new_var_type = mkCoercionType role t1' t2' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/06af46d317de4d016ece6a699b9f5a042863f41a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/06af46d317de4d016ece6a699b9f5a042863f41a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 7 23:19:08 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Sun, 07 Jul 2024 19:19:08 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 102 commits: compiler: Rejects RULES whose LHS immediately fails to type-check Message-ID: <668b226c37123_38951f4600ab425298@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - 717874a0 by Apoorv Ingle at 2024-07-07T18:05:07-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Multiplicity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a86288800ecf18f91bbbeb924c8d7d897d33c54...717874a0a1cad3ddc408d4e71ea5f407d20c32a4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a86288800ecf18f91bbbeb924c8d7d897d33c54...717874a0a1cad3ddc408d4e71ea5f407d20c32a4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 04:12:15 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 08 Jul 2024 00:12:15 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 2 commits: Make ApplicativeDo work with HsExpansions Message-ID: <668b671fa13af_38951f6f77e24292a9@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 73091d9e by Apoorv Ingle at 2024-07-07T22:30:05-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 4dbb7a0b by Apoorv Ingle at 2024-07-07T23:10:36-05:00 simplify splitHsApps - - - - - 29 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -473,11 +473,15 @@ type instance XXExpr GhcTc = XXExprGhcTc * * ********************************************************************* -} +-- | Hint to the typechecker how to typecheck the expanded expression +data TCFunInfo = TcApp -- use tcApp to typecheck + | TcExpr -- use tcExpr to typecheck + -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) HsDoFlavour (Maybe (ExprLStmt GhcRn)) isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -491,7 +495,10 @@ isHsThingRnPat _ = False data XXExprGhcRn = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_TCFunInfo :: TCFunInfo } -- A Hint to the type checker of how to proceed + -- TcApp <=> use GHC.Tc.Gen.Expr.tcApp + -- TcExpr <=> use GHC.Tc.Gen.Expr.tcExpr | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +522,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_TCFunInfo = TcExpr }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour + -> TCFunInfo -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav tc_fun eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_TCFunInfo = tc_fun}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_TCFunInfo = TcExpr}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression an associate with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> TCFunInfo -- ^ should type check with tcApp or tcExpr -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav tcFun eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav tcFun eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav tcFun eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +608,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +856,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +903,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1014,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1066,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1586,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1627,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1687,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,7 +1709,7 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the @@ -1733,7 +1750,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1769,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1815,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1835,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1863,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -569,6 +569,7 @@ deriving instance Eq (IE GhcTc) -- --------------------------------------------------------------------- deriving instance Data HsThingRn +deriving instance Data TCFunInfo deriving instance Data XXExprGhcRn deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -1965,15 +1965,10 @@ ApplicativeDo touches a few phases in the compiler: don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match - -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -2221,12 +2216,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -649,10 +649,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -845,6 +845,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; return (mkScaled mult_ty arg_nu) } + -- Is the argument supposed to instantiate a forall? -- -- In other words, given a function application `fn arg`, @@ -897,23 +898,32 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of - VACall fun arg_no _ | not in_generated_code + VACall{} + | XExpr (PopErrCtxt{}) <- arg + -> thing_inside + VACall{} + | XExpr (ExpandedThingRn o _ _) <- arg + , isHsThingRnStmt o || isHsThingRnPat o + -> thing_inside + + VACall fun arg_no _ + | not in_generated_code -> do setSrcSpanA arg_loc $ addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1054,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2262,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Gen.Pat import GHC.Tc.Utils.TcMType @@ -53,66 +53,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav TcExpr body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav TcExpr expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour TcExpr expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -121,29 +108,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr doFlavour Nothing pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour TcApp expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour TcApp expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -163,12 +150,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -184,33 +171,114 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (body <$> e1 <*> e2 ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) + , is_body_stmt = is_body_stmt + }) = + do let xx_expr = mkExpandedStmtAt addPop rhs_loc stmt doFlavour TcExpr rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = rebuild_stmt is_body_stmt rhs_loc rhs pat + do_arg (ApplicativeArgMany _ stmts ret@(L ret_loc _) pat ctxt) = + do { xx_expr <- expand_do_stmts False ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret] + ; traceTc "do_arg" (text "ManyArg" <+> vcat [ppr stmts, text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + + + rebuild_stmt is_body_stmt rhs_loc rhs pat = if is_body_stmt + then (L rhs_loc (BodyStmt NoExtField (L rhs_loc rhs) NoSyntaxExprRn NoSyntaxExprRn)) + else (L rhs_loc (BindStmt xbsn pat (L rhs_loc rhs))) + xbsn :: XBindStmtRn + xbsn = XBindStmtRn NoSyntaxExprRn Nothing + + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) -- checks the pattern `pat`for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict - ; irrf_pat <- isIrrefutableHsPatRnTcM is_strict pat - ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat + ; irrf_pat <- isIrrefutableHsPatRnTcM is_strict lpat + ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr lpat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> wrapGenSpan (mkExpandedStmt s doFlav TcExpr + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -218,22 +286,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -302,12 +370,29 @@ They capture the essence of statement expansions as implemented in `expand_do_st (5) DO【 s 】 = s + (4) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [ApplicativeDo] in GHC.Rename.Expr (dsDo) + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (7) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,27 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' tc_info) res_ty + | OrigStmt ls@(L loc s at LetStmt{}) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc s) flav <- o + , TcExpr <- tc_info + = setSrcSpanA loc $ + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty + + | OrigStmt ls@(L loc _) flav <- o + , TcApp <- tc_info = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,24 +325,12 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context + go (XExpr (ExpandedThingRn o e _)) ctxt args + | OrigPat (L loc _) _ _ <- o -- so that we set the compiler generated fail context = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern -- See Part 1. Wrinkle 2. of (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] -- in `GHC.Tc.Gen.Do` - | otherwise = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,17 +561,20 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = + do traceTc "addHeadCtxt stmt" (ppr stmt) + setSrcSpanA loc $ + addStmtCtxt stmt flav $ thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt fun_loc" (ppr fun_ctxt) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just stmt)) _ _ -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1258,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1273,7 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -78,13 +78,9 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) -import qualified GHC.LanguageExtensions as LangExt - - {- ************************************************************************ * * @@ -353,22 +349,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -999,18 +987,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1062,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,19 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In the second argument of ‘($)’, namely ‘MkT fa’ - In a stmt of a 'do' block: return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,11 +63,17 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) + • In a stmt of a 'do' block: x4 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -67,11 +81,20 @@ ado002.hs:24:11: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +102,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/717874a0a1cad3ddc408d4e71ea5f407d20c32a4...4dbb7a0bd32852596acae8080ada5c8448d4c480 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/717874a0a1cad3ddc408d4e71ea5f407d20c32a4...4dbb7a0bd32852596acae8080ada5c8448d4c480 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 08:50:39 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 08 Jul 2024 04:50:39 -0400 Subject: [Git][ghc/ghc][wip/T24978] Wibbles Message-ID: <668ba85fe8a60_12a3092141e08672ca@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 51db59f2 by Simon Peyton Jones at 2024-07-08T09:50:16+01:00 Wibbles - - - - - 1 changed file: - compiler/GHC/Core/Coercion.hs Changes: ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -2449,24 +2449,27 @@ coercion_lr_kind :: HasDebugCallStack => LeftOrRight -> Coercion -> Type coercion_lr_kind which co = go co where - go (Refl ty) = ty - go (GRefl _ ty _) = ty - go (TyConAppCo _ tc cos) = mkTyConApp tc (map go cos) - go (AppCo co1 co2) = mkAppTy (go co1) (go co2) + go (Refl ty) = ty + go (GRefl _ ty MRefl) = ty + go (GRefl _ ty (MCo co1)) = pickLR which (ty, mkCastTy ty co1) + go (TyConAppCo _ tc cos) = mkTyConApp tc (map go cos) + go (AppCo co1 co2) = mkAppTy (go co1) (go co2) + go (CoVarCo cv) = go_covar cv + go (HoleCo h) = go_covar (coHoleCoVar h) + go (SymCo co) = pickLR which (coercionRKind co, coercionLKind co) + go (TransCo co1 co2) = pickLR which (go co1, go co2) + go (LRCo lr co) = pickLR lr (splitAppTy (go co)) + go (InstCo aco arg) = go_app aco [go arg] + go (KindCo co) = typeKind (go co) + go (SubCo co) = go co + go (SelCo d co) = selectFromType d (go co) + go (AxiomRuleCo ax cos) = go_ax ax cos + + go (UnivCo { uco_lty = lty, uco_rty = rty}) + = pickLR which (lty, rty) go (FunCo { fco_afl = af, fco_mult = mult, fco_arg = arg, fco_res = res}) - {- See Note [FunCo] -} = FunTy { ft_af = af, ft_mult = go mult - , ft_arg = go arg, ft_res = go res } - go (CoVarCo cv) = go_covar cv - go (HoleCo h) = go_covar (coHoleCoVar h) - go (UnivCo { uco_lty = ty1}) = ty1 - go (SymCo co) = pickLR which (coercionRKind co, coercionLKind co) - go (TransCo co1 _) = go co1 - go (LRCo lr co) = pickLR lr (splitAppTy (go co)) - go (InstCo aco arg) = go_app aco [go arg] - go (KindCo co) = typeKind (go co) - go (SubCo co) = go co - go (SelCo d co) = selectFromType d (go co) - go (AxiomRuleCo ax cos) = go_ax ax cos + = -- See Note [FunCo] + FunTy { ft_af = af, ft_mult = go mult, ft_arg = go arg, ft_res = go res } go co@(ForAllCo { fco_tcv = tv1, fco_visL = visL, fco_visR = visR , fco_kind = k_co, fco_body = co1 }) @@ -2510,9 +2513,9 @@ coercion_lr_kind which co let (tys1, cotys1) = splitAtList tvs tys cos1 = map stripCoercionTy cotys1 in --- You might think to use --- substTy (zipTCvSubst tcvs ltys) (mkTyConApp tc lhs_tys) --- but #25066 makes it much less efficient than the silly calls below + -- You might think to use + -- substTy (zipTCvSubst tcvs ltys) (pickLR ...) + -- but #25066 makes it much less efficient than the silly calls below substTyWith tvs tys1 $ substTyWithCoVars cvs cos1 $ pickLR which (mkTyConApp tc lhs_tys, rhs_ty) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51db59f2f029cfc526b6ee6d7668c30ec10f7d74 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51db59f2f029cfc526b6ee6d7668c30ec10f7d74 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 09:01:03 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 08 Jul 2024 05:01:03 -0400 Subject: [Git][ghc/ghc][wip/T25033] 30 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668baacf30595_12a309232a54469850@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25033 at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - cd8509f5 by Simon Peyton Jones at 2024-07-08T10:00:52+01:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Tc/Deriv/Generics.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/010445e101bd5d62e3568b15d8c4a0b9fb8b68fb...cd8509f56e824388ace9432a4f1de28a104656fc -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/010445e101bd5d62e3568b15d8c4a0b9fb8b68fb...cd8509f56e824388ace9432a4f1de28a104656fc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 09:54:44 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 08 Jul 2024 05:54:44 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25066 Message-ID: <668bb7648c85d_12a3092b6edb81080de@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25066 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25066 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 10:09:12 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 08 Jul 2024 06:09:12 -0400 Subject: [Git][ghc/ghc][wip/andreask/aarch64_reg_graph] 30 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668bbac83b8f0_12a3092e40e601159b2@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/aarch64_reg_graph at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - 222c6336 by Andreas Klebinger at 2024-07-08T12:08:52+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bec54654999871492497ce42581c2419706bc075...222c6336f1517e1650721b940339e2e90129acc1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bec54654999871492497ce42581c2419706bc075...222c6336f1517e1650721b940339e2e90129acc1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 11:13:49 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 08 Jul 2024 07:13:49 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <668bc9ed77519_29d13257373047022@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - a66c5454 by Sven Tennie at 2024-07-08T07:13:31-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 2c1bcbd6 by Sven Tennie at 2024-07-08T07:13:31-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 5cc08d8d by Simon Peyton Jones at 2024-07-08T07:13:31-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 8 changed files: - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - configure.ac - hadrian/doc/flavours.md - hadrian/src/Flavour.hs - hadrian/src/Settings/Flavours/GhcInGhci.hs - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -51,7 +51,6 @@ import GHC.Data.OrdList import GHC.Utils.Outputable import Control.Monad ( mapAndUnzipM, foldM ) -import Data.Maybe import GHC.Float import GHC.Types.Basic @@ -149,8 +148,8 @@ basicBlockCodeGen block = do let line = srcSpanStartLine span; col = srcSpanStartCol span return $ unitOL $ LOCATION fileId line col (unpackFS name) _ -> return nilOL - (mid_instrs,mid_bid) <- stmtsToInstrs id stmts - (!tail_instrs,_) <- stmtToInstrs mid_bid tail + mid_instrs <- stmtsToInstrs stmts + (!tail_instrs) <- stmtToInstrs tail let instrs = header_comment_instr `appOL` loc_instrs `appOL` mid_instrs `appOL` tail_instrs -- TODO: Then x86 backend run @verifyBasicBlock@ here and inserts -- unwinding info. See Ticket 19913 @@ -252,38 +251,27 @@ generateJumpTableForInstr _ _ = Nothing -- ----------------------------------------------------------------------------- -- Top-level of the instruction selector --- See Note [Keeping track of the current block] for why --- we pass the BlockId. -stmtsToInstrs :: BlockId -- ^ Basic block these statement will start to be placed in. - -> [CmmNode O O] -- ^ Cmm Statement - -> NatM (InstrBlock, BlockId) -- ^ Resulting instruction -stmtsToInstrs bid stmts = - go bid stmts nilOL +stmtsToInstrs :: [CmmNode O O] -- ^ Cmm Statements + -> NatM InstrBlock -- ^ Resulting instructions +stmtsToInstrs stmts = + go stmts nilOL where - go bid [] instrs = return (instrs,bid) - go bid (s:stmts) instrs = do - (instrs',bid') <- stmtToInstrs bid s - -- If the statement introduced a new block, we use that one - let !newBid = fromMaybe bid bid' - go newBid stmts (instrs `appOL` instrs') - --- | `bid` refers to the current block and is used to update the CFG --- if new blocks are inserted in the control flow. --- See Note [Keeping track of the current block] for more details. -stmtToInstrs :: BlockId -- ^ Basic block this statement will start to be placed in. - -> CmmNode e x - -> NatM (InstrBlock, Maybe BlockId) - -- ^ Instructions, and bid of new block if successive - -- statements are placed in a different basic block. -stmtToInstrs bid stmt = do + go [] instrs = return instrs + go (s:stmts) instrs = do + instrs' <- stmtToInstrs s + go stmts (instrs `appOL` instrs') + +stmtToInstrs :: CmmNode e x -- ^ Cmm Statement + -> NatM InstrBlock -- ^ Resulting Instructions +stmtToInstrs stmt = do -- traceM $ "-- -------------------------- stmtToInstrs -------------------------- --\n" -- ++ showSDocUnsafe (ppr stmt) platform <- getPlatform case stmt of CmmUnsafeForeignCall target result_regs args - -> genCCall target result_regs args bid + -> genCCall target result_regs args - _ -> (,Nothing) <$> case stmt of + _ -> case stmt of CmmComment s -> return (unitOL (COMMENT (ftext s))) CmmTick {} -> return nilOL @@ -304,7 +292,7 @@ stmtToInstrs bid stmt = do --We try to arrange blocks such that the likely branch is the fallthrough --in GHC.Cmm.ContFlowOpt. So we can assume the condition is likely false here. CmmCondBranch arg true false _prediction -> - genCondBranch bid true false arg + genCondBranch true false arg CmmSwitch arg ids -> genSwitch arg ids @@ -1456,14 +1444,12 @@ genCondFarJump cond far_target = do , B far_target , NEWBLOCK skip_lbl_id] -genCondBranch - :: BlockId -- the source of the jump - -> BlockId -- the true branch target +genCondBranch :: BlockId -- the true branch target -> BlockId -- the false branch target -> CmmExpr -- the condition on which to branch -> NatM InstrBlock -- Instructions -genCondBranch _ true false expr = do +genCondBranch true false expr = do b1 <- genCondJump true expr b2 <- genBranch false return (b1 `appOL` b2) @@ -1549,11 +1535,10 @@ genCCall :: ForeignTarget -- function to call -> [CmmFormal] -- where to put the result -> [CmmActual] -- arguments (of mixed type) - -> BlockId -- The block we are in - -> NatM (InstrBlock, Maybe BlockId) + -> NatM InstrBlock -- TODO: Specialize where we can. -- Generic impl -genCCall target dest_regs arg_regs bid = do +genCCall target dest_regs arg_regs = do -- we want to pass arg_regs into allArgRegs -- pprTraceM "genCCall target" (ppr target) -- pprTraceM "genCCall formal" (ppr dest_regs) @@ -1617,7 +1602,7 @@ genCCall target dest_regs arg_regs bid = do `appOL` (unitOL $ BL call_target passRegs) -- branch and link. `appOL` readResultsCode -- parse the results into registers `appOL` moveStackUp (stackSpace `div` 8) - return (code, Nothing) + return code PrimTarget MO_F32_Fabs | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> @@ -1642,7 +1627,7 @@ genCCall target dest_regs arg_regs bid = do let lo = getRegisterReg platform (CmmLocal dst_lo) hi = getRegisterReg platform (CmmLocal dst_hi) nd = getRegisterReg platform (CmmLocal dst_needed) - return ( + return $ code_x `appOL` code_y `snocOL` MUL (OpReg W64 lo) (OpReg W64 reg_a) (OpReg W64 reg_b) `snocOL` @@ -1651,7 +1636,6 @@ genCCall target dest_regs arg_regs bid = do -- nd = (hi == ASR(lo,width-1)) ? 1 : 0 CMP (OpReg W64 hi) (OpRegShift W64 lo SASR (widthInBits w - 1)) `snocOL` CSET (OpReg W64 nd) NE - , Nothing) -- For sizes < platform width, we can just perform a multiply and shift -- using the normal 64 bit multiply. Calculating the dst_needed value is -- complicated a little by the need to be careful when truncation happens. @@ -1674,7 +1658,7 @@ genCCall target dest_regs arg_regs bid = do (reg_a, code_a') <- signExtendReg w w' reg_a' (reg_b, code_b') <- signExtendReg w w' reg_b' - return ( + return $ code_a `appOL` code_b `appOL` code_a' `appOL` @@ -1704,7 +1688,6 @@ genCCall target dest_regs arg_regs bid = do CSET (OpReg w' nd) EQ `appOL` -- Finally truncate hi to drop any extraneous sign bits. truncateReg w' w hi - , Nothing) -- Can't handle > 64 bit operands | otherwise -> unsupported (MO_S_Mul2 w) PrimTarget (MO_U_Mul2 w) @@ -1724,7 +1707,7 @@ genCCall target dest_regs arg_regs bid = do code_y `snocOL` MUL (OpReg W64 lo) (OpReg W64 reg_a) (OpReg W64 reg_b) `snocOL` UMULH (OpReg W64 hi) (OpReg W64 reg_a) (OpReg W64 reg_b) - , Nothing) + ) -- For sizes < platform width, we can just perform a multiply and shift -- Need to be careful to truncate the low half, but the upper half should be -- be ok if the invariant in [Signed arithmetic on AArch64] is maintained. @@ -1755,7 +1738,7 @@ genCCall target dest_regs arg_regs bid = do (OpImm (ImmInt $ widthInBits w)) -- width to extract `appOL` truncateReg W64 w lo - , Nothing) + ) | otherwise -> unsupported (MO_U_Mul2 w) PrimTarget (MO_Clz w) | w == W64 || w == W32 @@ -1767,7 +1750,7 @@ genCCall target dest_regs arg_regs bid = do return ( code_x `snocOL` CLZ (OpReg w dst_reg) (OpReg w reg_a) - , Nothing) + ) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1783,7 +1766,7 @@ genCCall target dest_regs arg_regs bid = do , ORR (r dst') (r dst') (imm 0x00008000) , CLZ (r dst') (r dst') ] - , Nothing) + ) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1793,13 +1776,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(x << 24 | 0x0080_0000) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 24) , ORR (r dst') (r dst') (imm 0x00800000) , CLZ (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_Clz w) PrimTarget (MO_Ctz w) | w == W64 || w == W32 @@ -1808,11 +1790,10 @@ genCCall target dest_regs arg_regs bid = do -> do (reg_a, _format_x, code_x) <- getSomeReg src let dst_reg = getRegisterReg platform (CmmLocal dst) - return ( + return $ code_x `snocOL` RBIT (OpReg w dst_reg) (OpReg w reg_a) `snocOL` CLZ (OpReg w dst_reg) (OpReg w dst_reg) - , Nothing) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1822,13 +1803,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(reverseBits(x) | 0x0000_8000) -} - return ( + return $ code_x `appOL` toOL [ RBIT (r dst') (r reg_a) , ORR (r dst') (r dst') (imm 0x00008000) , CLZ (r dst') (r dst') ] - , Nothing) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1838,13 +1818,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(reverseBits(x) | 0x0080_0000) -} - return ( + return $ code_x `appOL` toOL [ RBIT (r dst') (r reg_a) , ORR (r dst') (r dst') (imm 0x00800000) , CLZ (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_Ctz w) PrimTarget (MO_BRev w) | w == W64 || w == W32 @@ -1853,10 +1832,9 @@ genCCall target dest_regs arg_regs bid = do -> do (reg_a, _format_x, code_x) <- getSomeReg src let dst_reg = getRegisterReg platform (CmmLocal dst) - return ( + return $ code_x `snocOL` RBIT (OpReg w dst_reg) (OpReg w reg_a) - , Nothing) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1866,12 +1844,11 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = reverseBits32(x << 16) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 16) , RBIT (r dst') (r dst') ] - , Nothing) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1881,12 +1858,11 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = reverseBits32(x << 24) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 24) , RBIT (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_BRev w) @@ -1989,12 +1965,12 @@ genCCall target dest_regs arg_regs bid = do MO_SubIntC _w -> unsupported mop -- Memory Ordering - MO_AcquireFence -> return (unitOL DMBISH, Nothing) - MO_ReleaseFence -> return (unitOL DMBISH, Nothing) - MO_SeqCstFence -> return (unitOL DMBISH, Nothing) - MO_Touch -> return (nilOL, Nothing) -- Keep variables live (when using interior pointers) + MO_AcquireFence -> return (unitOL DMBISH) + MO_ReleaseFence -> return (unitOL DMBISH) + MO_SeqCstFence -> return (unitOL DMBISH) + MO_Touch -> return nilOL -- Keep variables live (when using interior pointers) -- Prefetch - MO_Prefetch_Data _n -> return (nilOL, Nothing) -- Prefetch hint. + MO_Prefetch_Data _n -> return nilOL -- Prefetch hint. -- Memory copy/set/move/cmp, with alignment for optimization @@ -2029,7 +2005,7 @@ genCCall target dest_regs arg_regs bid = do code = code_p `snocOL` instr (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p) - return (code, Nothing) + return code | otherwise -> panic "mal-formed AtomicRead" MO_AtomicWrite w ord | [p_reg, val_reg] <- arg_regs -> do @@ -2042,7 +2018,7 @@ genCCall target dest_regs arg_regs bid = do code_p `appOL` code_val `snocOL` instr fmt_val (OpReg w val) (OpAddr $ AddrReg p) - return (code, Nothing) + return code | otherwise -> panic "mal-formed AtomicWrite" MO_AtomicRMW w amop -> mkCCall (atomicRMWLabel w amop) MO_Cmpxchg w -> mkCCall (cmpxchgLabel w) @@ -2055,13 +2031,13 @@ genCCall target dest_regs arg_regs bid = do unsupported :: Show a => a -> b unsupported mop = panic ("outOfLineCmmOp: " ++ show mop ++ " not supported here") - mkCCall :: FastString -> NatM (InstrBlock, Maybe BlockId) + mkCCall :: FastString -> NatM InstrBlock mkCCall name = do config <- getConfig target <- cmmMakeDynamicReference config CallReference $ mkForeignLabel name ForeignLabelInThisPackage IsFunction let cconv = ForeignConvention CCallConv [NoHint] [NoHint] CmmMayReturn - genCCall (ForeignTarget target cconv) dest_regs arg_regs bid + genCCall (ForeignTarget target cconv) dest_regs arg_regs -- TODO: Optimize using paired stores and loads (STP, LDP). It is -- automatically done by the allocator for us. However it's not optimal, @@ -2227,7 +2203,7 @@ genCCall target dest_regs arg_regs bid = do (reg_fx, _format_x, code_fx) <- getFloatReg arg_reg let dst = getRegisterReg platform (CmmLocal dest_reg) let code = code_fx `appOL` op (OpReg w dst) (OpReg w reg_fx) - return (code, Nothing) + return code {- Note [AArch64 far jumps] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -1611,7 +1611,7 @@ cpeArgArity env float_decision floats1 arg -- See wrinkle (EA2) in Note [Eta expansion of arguments in CorePrep] | Just ao <- cp_arityOpts (cpe_config env) -- Just <=> -O1 or -O2 - , not (has_join_in_tail_context arg) + , not (eta_would_wreck_join arg) -- See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] = case exprEtaExpandArity ao arg of Nothing -> 0 @@ -1620,15 +1620,15 @@ cpeArgArity env float_decision floats1 arg | otherwise = exprArity arg -- this is cheap enough for -O0 -has_join_in_tail_context :: CoreExpr -> Bool +eta_would_wreck_join :: CoreExpr -> Bool -- ^ Identify the cases where we'd generate invalid `CpeApp`s as described in -- Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] -has_join_in_tail_context (Let bs e) = isJoinBind bs || has_join_in_tail_context e -has_join_in_tail_context (Lam b e) | isTyVar b = has_join_in_tail_context e -has_join_in_tail_context (Cast e _) = has_join_in_tail_context e -has_join_in_tail_context (Tick _ e) = has_join_in_tail_context e -has_join_in_tail_context (Case _ _ _ alts) = any has_join_in_tail_context (rhssOfAlts alts) -has_join_in_tail_context _ = False +eta_would_wreck_join (Let bs e) = isJoinBind bs || eta_would_wreck_join e +eta_would_wreck_join (Lam _ e) = eta_would_wreck_join e +eta_would_wreck_join (Cast e _) = eta_would_wreck_join e +eta_would_wreck_join (Tick _ e) = eta_would_wreck_join e +eta_would_wreck_join (Case _ _ _ alts) = any eta_would_wreck_join (rhssOfAlts alts) +eta_would_wreck_join _ = False maybeSaturate :: Id -> CpeApp -> Int -> [CoreTickish] -> UniqSM CpeRhs maybeSaturate fn expr n_args unsat_ticks @@ -1761,7 +1761,8 @@ There is a nasty Wrinkle: (EA1) When eta expanding an argument headed by a join point, we might get "crap", as Note [Eta expansion for join points] in GHC.Core.Opt.Arity puts - it. + it. This crap means the output does not conform to the syntax in + Note [CorePrep invariants], which then makes later passes crash (#25033). Consider f (join j x = rhs in ...(j 1)...(j 2)...) @@ -1776,15 +1777,22 @@ There is a nasty Wrinkle: In our case, (join j x = rhs in ...(j 1)...(j 2)...) is not a valid `CpeApp` (see Note [CorePrep invariants]) and we'd get a crash in the App case of `coreToStgExpr`. - Hence we simply check for the cases where an intervening join point - binding in the tail context of the argument would lead to the introduction - of such crap via `has_join_in_tail_context`, in which case we abstain from - eta expansion. + + Hence, in `eta_would_wreck_join`, we check for the cases where an + intervening join point binding in the tail context of the argument would + make eta-expansion break Note [CorePrep invariants], in which + case we abstain from eta expansion. This scenario occurs rarely; hence it's OK to generate sub-optimal code. The alternative would be to fix Note [Eta expansion for join points], but that's quite challenging due to unfoldings of (recursive) join points. + `eta_would_wreck_join` sees if there are any join points, like `j` above + that would be messed up. It must look inside lambdas (#25033); consider + f (\x. join j y = ... in ...(j 1)...(j 3)...) + We can't eta expand that `\x` any more than we could if the join was at + the top. (And when there's a lambda, we don't have a thunk anyway.) + (EA2) In cpeArgArity, if float_decision=FloatNone the `arg` will look like let in rhs where is non-empty and can't be floated out of a lazy context (see ===================================== configure.ac ===================================== @@ -176,6 +176,12 @@ if test "$WithGhc" != ""; then if test -z "$LD_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[ld command]) + # ld command is removed in 9.10.1 as a boot compiler and supplies "Merge objects + # command" instead + if test -z "$LD_STAGE0"; then + BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[Merge objects command]) + fi + fi if test -z "$AR_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command]) ===================================== hadrian/doc/flavours.md ===================================== @@ -320,6 +320,10 @@ The supported transformers are listed below: late_ccs Enable -fprof-late in profiled libraries. + + dump_stg + Dump STG of all modules compiled by a stage1 compiler to a file + ### Static ===================================== hadrian/src/Flavour.hs ===================================== @@ -68,6 +68,7 @@ flavourTransformers = M.fromList , "hi_core" =: enableHiCore , "late_ccs" =: enableLateCCS , "boot_nonmoving_gc" =: enableBootNonmovingGc + , "dump_stg" =: enableDumpStg ] where (=:) = (,) @@ -176,11 +177,13 @@ tickyArgs = mconcat [ arg "-ticky" , arg "-ticky-allocd" , arg "-ticky-dyn-thunk" - -- You generally need STG dumps to interpret ticky profiles - , arg "-ddump-to-file" - , arg "-ddump-stg-final" ] +enableDumpStg :: Flavour -> Flavour +enableDumpStg = + addArgs $ stage1 ? + builder (Ghc CompileHs) ? mconcat [ arg "-ddump-to-file", arg "-ddump-stg-final" ] + -- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler. enableLinting :: Flavour -> Flavour enableLinting = ===================================== hadrian/src/Settings/Flavours/GhcInGhci.hs ===================================== @@ -17,7 +17,7 @@ ghcInGhciFlavour = defaultFlavour -- checking for Windows seems simpler for now. , libraryWays = pure (Set.fromList [vanilla]) <> pure (Set.fromList [ dynamic | not windowsHost ]) , rtsWays = pure (Set.fromList [vanilla]) <> (targetSupportsThreadedRts ? pure (Set.fromList [threaded])) <> pure (Set.fromList [ dynamic | not windowsHost ]) - , dynamicGhcPrograms = return False } + } ghciArgs :: Args ghciArgs = sourceArgs SourceArgs ===================================== testsuite/tests/simplCore/should_compile/T25033.hs ===================================== @@ -0,0 +1,18 @@ +{-# OPTIONS_GHC -fno-do-lambda-eta-expansion #-} +-- It's hard to trigger #25033, because the Simplier eta-expands +-- lambdas. So I switched off that Simplifier ability, and thereby +-- triggered the bug on this nice small example. + +module T25033 where + +{-# NOINLINE woo #-} +woo x = x + +foo v = woo (\xs -> let + j ys = \ws -> xs ++ (reverse . reverse . reverse . reverse . + reverse . reverse . reverse . reverse) ws + in + case v of + "a" -> j "wim" + _ -> j "wam" + ) ===================================== testsuite/tests/simplCore/should_compile/all.T ===================================== @@ -527,3 +527,4 @@ test('T24808', [ grep_errmsg(r'myFunction') ], compile, ['-O -ddump-simpl']) test('T24944', [extra_files(['T24944a.hs'])], multimod_compile, ['T24944', '-v0 -O2']) test('T24725a', [ grep_errmsg(r'testedRule')], compile, ['-O -ddump-rule-firings']) +test('T25033', normal, compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d2c779b4bdfa00ce71b7bd52db24a64f65219d66...5cc08d8d280fea12e52c0cefd3cf2d93f6bfd6e1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d2c779b4bdfa00ce71b7bd52db24a64f65219d66...5cc08d8d280fea12e52c0cefd3cf2d93f6bfd6e1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 12:38:56 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 08 Jul 2024 08:38:56 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] 49 commits: GHCi interpreter: Tag constructor closures when possible. Message-ID: <668bdde03bd44_29d13210e47906028d@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - dce476ed by Matthew Pickering at 2024-07-08T13:35:50+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 36299161 by Matthew Pickering at 2024-07-08T13:35:50+01:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 30 changed files: - + .gitlab/README.md - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f417afa17427b092755f08b9081fa378fd92a2f4...362991616d350dddcd6f2634eae162ee9186746d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f417afa17427b092755f08b9081fa378fd92a2f4...362991616d350dddcd6f2634eae162ee9186746d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 13:48:01 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 08 Jul 2024 09:48:01 -0400 Subject: [Git][ghc/ghc][wip/alpine_3_20] 2 commits: Update alpine release job to 3.20 Message-ID: <668bee116e4ad_29d1321b4daec949e2@gitlab.mail> Matthew Pickering pushed to branch wip/alpine_3_20 at Glasgow Haskell Compiler / GHC Commits: 9a271521 by Matthew Pickering at 2024-07-08T14:47:50+01:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - bdd965e6 by Matthew Pickering at 2024-07-08T14:47:50+01:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 6 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - testsuite/tests/plugins/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: 2e2497036a91104be281a0eb24b37889aaf98341 + DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -117,6 +117,7 @@ data LinuxDistro | Centos7 | Alpine312 | Alpine318 + | Alpine320 | AlpineWasm | Rocky8 deriving (Eq) @@ -302,6 +303,7 @@ distroName Ubuntu2004 = "ubuntu20_04" distroName Centos7 = "centos7" distroName Alpine312 = "alpine3_12" distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" distroName AlpineWasm = "alpine3_18-wasm" distroName Rocky8 = "rocky8" @@ -452,6 +454,7 @@ alpineVariables = mconcat distroVariables :: LinuxDistro -> Variables distroVariables Alpine312 = alpineVariables distroVariables Alpine318 = alpineVariables +distroVariables Alpine320 = alpineVariables distroVariables Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" , "BROKEN_TESTS" =: "T22012" -- due to #23979 @@ -1015,7 +1018,7 @@ job_groups = -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine318) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) ===================================== .gitlab/jobs.yaml ===================================== @@ -897,7 +897,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-validate": { + "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -908,7 +908,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-validate.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -918,14 +918,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -951,17 +951,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-validate", - "BROKEN_TESTS": "encoding004 T10458", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", - "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BUILD_FLAVOUR": "release+fully_static+text_simdutf", + "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CROSS_TARGET": "wasm32-wasi", + "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-validate", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -972,7 +972,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1014,18 +1014,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1036,7 +1036,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1078,18 +1078,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_20-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1100,7 +1100,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_20-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1110,14 +1110,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1143,13 +1143,13 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", - "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", - "CROSS_TARGET": "wasm32-wasi", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-validate", + "BROKEN_TESTS": "encoding004 T10458", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_20-validate", "XZ_OPT": "-9" } }, @@ -3343,7 +3343,7 @@ "XZ_OPT": "-9" } }, - "release-x86_64-linux-alpine3_18-release+no_split_sections": { + "release-x86_64-linux-alpine3_20-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -3354,7 +3354,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-x86_64-linux-alpine3_18-release+no_split_sections.tar.xz", + "ghc-x86_64-linux-alpine3_20-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -3364,14 +3364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -3397,7 +3397,7 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-release+no_split_sections", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-release+no_split_sections", "BROKEN_TESTS": "encoding004 T10458", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", @@ -3405,7 +3405,7 @@ "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-release+no_split_sections", + "TEST_ENV": "x86_64-linux-alpine3_20-release+no_split_sections", "XZ_OPT": "-9" } }, ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -34,7 +34,7 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-release+fully_static': 'x86_64-alpine3_12-linux-static', 'release-x86_64-linux-alpine3_12-release': 'x86_64-alpine3_12-linux', 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', - 'release-x86_64-linux-alpine3_18-release': 'x86_64-alpine3_18-linux', + 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -198,7 +198,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): darwin_arm64 = mk(darwin("aarch64")) windows = mk(windowsArtifact) alpine3_12 = mk(alpine("3_12")) - alpine3_18 = mk(alpine("3_18")) + alpine3_20 = mk(alpine("3_20")) alpine3_18_arm64 = mk(alpine("3_18", arch='aarch64')) deb9 = mk(debian(9, "x86_64")) deb10 = mk(debian(10, "x86_64")) @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 - , ">= 3.18": alpine3_18 + , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } } ===================================== testsuite/tests/plugins/all.T ===================================== @@ -11,11 +11,15 @@ setTestOpts([ when(opsys('mingw32'), multi_cpu_race), ]) -import itertools # Check the simple-plugin tests without # caring about the order of loading of interfaces def normalizeIfaces(unnormalized_str): + # Why is this not at the top-level? Probably a python bug which I didn't fancy + # investigating deeply. + # NameError: name 'itertools' is not defined. Did you forget to import 'itertools' + # if placed at the top-level + import itertools iface_plugin_prefix = "interfacePlugin: " grouped_plugins = itertools.groupby( unnormalized_str.split('\n'), View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/01f136d3efbd506d93d0e7860d43da1fc57bce0d...bdd965e60f7000e1ae3ea0868e68f5309d5db993 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/01f136d3efbd506d93d0e7860d43da1fc57bce0d...bdd965e60f7000e1ae3ea0868e68f5309d5db993 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 14:45:47 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 08 Jul 2024 10:45:47 -0400 Subject: [Git][ghc/ghc][wip/T25009] 5 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <668bfb9b35d15_29d13225133ec10538e@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25009 at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - e0a7d53c by Simon Peyton Jones at 2024-07-08T15:44:34+01:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 11 changed files: - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - configure.ac - hadrian/doc/flavours.md - hadrian/src/Flavour.hs - hadrian/src/Settings/Flavours/GhcInGhci.hs Changes: ===================================== compiler/GHC/Core/Map/Type.hs ===================================== @@ -38,6 +38,7 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.TyCo.Rep +import GHC.Core.TyCon( isForgetfulSynTyCon ) import GHC.Core.TyCo.Compare( eqForAllVis ) import GHC.Data.TrieMap @@ -228,10 +229,11 @@ eqDeBruijnType env_t1@(D env1 t1) env_t2@(D env2 t2) = andEq TEQX e = hasCast e andEq TEQ e = e - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare - go (D _ (TyConApp tc1 [])) (D _ (TyConApp tc2 [])) - | tc1 == tc2 - = TEQ + -- See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare + go (D env1 (TyConApp tc1 tys1)) (D env2 (TyConApp tc2 tys2)) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) + = gos env1 env2 tys1 tys2 + go env_t@(D env t) env_t'@(D env' t') | Just new_t <- coreView t = go (D env new_t) env_t' | Just new_t' <- coreView t' = go env_t (D env' new_t') ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -138,35 +138,52 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing nullary type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form - TyConApp tc [] + TyConApp tc tys1 = TyConApp tc tys2 -where @tc@ is a type synonym. A naive way to perform this comparison these +where `tc` is a type synonym. A naive way to perform this comparison these would first expand the synonym and then compare the resulting expansions. -However, this is obviously wasteful and the RHS of @tc@ may be large; it is -much better to rather compare the TyCons directly. Consequently, before -expanding type synonyms in type comparisons we first look for a nullary -TyConApp and simply compare the TyCons if we find one. Of course, if we find -that the TyCons are *not* equal then we still need to perform the expansion as -their RHSs may still be equal. +However, this is obviously wasteful and the RHS of `tc` may be large. We'd +prefer to compare `tys1 = tys2`. When is that sound? Precisely when the +synonym is not /forgetful/; that is, all its type variables appear in its +RHS -- see `GHC.Core.TyCon.isForgetfulSynTyCon`. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be equal. + +This works fine for /equality/, but not for /comparison/. Consider + type S a b = (b, a) +Now consider + S Int Bool `compare` S Char Char +The ordering may depend on whether we expand the synonym or not, and we +don't want the result to depend on that. So for comparison we stick to +/nullary/ synonyms only, which is still useful. We perform this optimisation in a number of places: - * GHC.Core.Types.eqType - * GHC.Core.Types.nonDetCmpType - * GHC.Core.Unify.unify_ty - * GHC.Tc.Solver.Equality.can_eq_nc' - * TcUnify.uType + * GHC.Core.TyCo.Compare.eqType (works for non-nullary synonyms) + * GHC.Core.Map.TYpe.eqDeBruijnType (works for non-nullary synonyms) + * GHC.Core.Types.nonDetCmpType (nullary only) This optimisation is especially helpful for the ubiquitous GHC.Types.Type, since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. +Currently-missed opportunity (#25009): +* In the case of forgetful synonyms, we could still compare the args, pairwise, + and then compare the RHS's with a suitably extended RnEnv2. That would avoid + comparing the same arg repeatedly. e.g. + type S a b = (a,a) + Compare S y ~ S y + If we expand, we end up compare with itself twice. + + But since forgetful synonyms are rare, we have not tried this. + Note [Type comparisons using object pointer comparisons] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Quite often we substitute the type from a definition site into @@ -341,16 +358,26 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env = \ t1 t2 -> t1 `seq` t2 `seq` let go = generic_eq_type_x syn_flag mult_flag mb_env -- Abbreviation for recursive calls + + gos [] [] = True + gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 + gos _ _ = False + in case (t1,t2) of _ | 1# <- reallyUnsafePtrEquality# t1 t2 -> True -- See Note [Type comparisons using object pointer comparisons] - (TyConApp tc1 [], TyConApp tc2 []) | tc1 == tc2 -> True - -- See Note [Comparing nullary type synonyms] + (TyConApp tc1 tys1, TyConApp tc2 tys2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + -> gos tys1 tys2 _ | ExpandSynonyms <- syn_flag, Just t1' <- coreView t1 -> go t1' t2 | ExpandSynonyms <- syn_flag, Just t2' <- coreView t2 -> go t1 t2' + (TyConApp tc1 ts1, TyConApp tc2 ts2) + | tc1 == tc2 -> gos ts1 ts2 + | otherwise -> False + (TyVarTy tv1, TyVarTy tv2) -> case mb_env of Nothing -> tv1 == tv2 @@ -381,14 +408,6 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env | Just (s1, t1') <- tcSplitAppTyNoView_maybe t1 -> go s1 s2 && go t1' t2' - (TyConApp tc1 ts1, TyConApp tc2 ts2) - | tc1 == tc2 -> gos ts1 ts2 - | otherwise -> False - where - gos [] [] = True - gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 - gos _ _ = False - (ForAllTy (Bndr tv1 vis1) body1, ForAllTy (Bndr tv2 vis2) body2) -> case mb_env of Nothing -> generic_eq_type_x syn_flag mult_flag @@ -666,10 +685,11 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - -- See Note [Comparing nullary type synonyms] + go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 - = TEQ + = TEQ -- See Note [Comparing type synonyms] + go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -758,8 +778,10 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] - go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + + go env (TyConApp tc1 ts1) (TyConApp tc2 ts2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + = gos env (tyConBinders tc1) ts1 ts2 go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -841,7 +841,8 @@ data TyConDetails = -- are fine), again after expanding any -- nested synonyms - synIsForgetful :: Bool, -- True <= at least one argument is not mentioned + synIsForgetful :: Bool, -- See Note [Forgetful type synonyms] + -- True <= at least one argument is not mentioned -- in the RHS (or is mentioned only under -- forgetful synonyms) -- Test is conservative, so True does not guarantee @@ -2121,11 +2122,43 @@ isFamFreeTyCon (TyCon { tyConDetails = details }) -- True. Thus, False means that all bound variables appear on the RHS; -- True may not mean anything, as the test to set this flag is -- conservative. +-- +-- See Note [Forgetful type synonyms] isForgetfulSynTyCon :: TyCon -> Bool isForgetfulSynTyCon (TyCon { tyConDetails = details }) | SynonymTyCon { synIsForgetful = forget } <- details = forget | otherwise = False +{- Note [Forgetful type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A type synonyms is /forgetful/ if its RHS fails to mention one (or more) of its bound variables. + +Forgetfulness is conservative: + * A non-forgetful synonym /guarantees/ to mention all its bound variables in its RHS. + * It is always safe to classify a synonym as forgetful. + +Examples: + type R = Int -- Not forgetful + type S a = Int -- Forgetful + type T1 a = Int -> S a -- Forgetful + type T2 a = a -> S a -- Not forgetful + type T3 a = Int -> F a -- Not forgetful + where type family F a + +* R shows that nullary synonyms are not forgetful. + +* T2 shows that forgetfulness needs to account for uses of forgetful + synonyms. `a` appears on the RHS, but only under a forgetful S + +* T3 shows that non-forgetfulness is not the same as injectivity. T3 mentions its + bound variable on its RHS, but under a type family. So it is entirely possible + that T3 Int ~ T3 Bool + +* Since type synonyms are non-recursive, we don't need a fixpoint analysis to + determine forgetfulness. It's rather easy -- see `GHC.Core.Type.buildSynTyCon`, + which is a bit over-conservative for over-saturated synonyms. +-} + -- As for newtypes, it is in some contexts important to distinguish between -- closed synonyms and synonym families, as synonym families have no unique -- right hand side to which a synonym family application can expand. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon + -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,8 +3275,9 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing -nullary type synonyms] in "GHC.Core.Type". +applications (e.g. things like @TyConApp typeTyCon []@). See +* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" +* Note [Unifying type synonyms] in "GHC.Core.Unify" To accomplish these we use a number of tricks, implemented by mkTyConApp. ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1089,6 +1089,47 @@ of arity n: If we couldn't decompose in the previous step, we return SurelyApart. Afterwards, the rest of the code doesn't have to worry about type families. + +Note [Unifying type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the task of unifying two 'Type's of the form + + TyConApp tc [] ~ TyConApp tc [] + +where `tc` is a type synonym. A naive way to perform this comparison these +would first expand the synonym and then compare the resulting expansions. + +However, this is obviously wasteful and the RHS of `tc` may be large; it is +much better to rather compare the TyCons directly. Consequently, before +expanding type synonyms in type comparisons we first look for a nullary +TyConApp and simply compare the TyCons if we find one. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be unifiable. E.g + type T = S (a->a) + type S a = [a] +and consider + T Int ~ S (Int -> Int) + +We can't decompose non-nullary synonyms. E.g. + type R a = F a -- Where F is a type family +and consider + R (a->a) ~ R Int +We can't conclude that (a->) ~ Int. (There is a currently-missed opportunity +here; if we knew that R was /injective/, perhaps we could decompose.) + +We perform the nullary-type-synonym optimisation in a number of places: + + * GHC.Core.Unify.unify_ty + * GHC.Tc.Solver.Equality.can_eq_nc' + * GHC.Tc.Utils.Unify.uType + +This optimisation is especially helpful for the ubiquitous GHC.Types.Type, +since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications +whenever possible. See Note [Using synonyms to compress types] in +GHC.Core.Type for details. + +c.f. Note [Comparing type synonyms] in GHC.Core.TyCo.Compare -} -------------- unify_ty: the main workhorse ----------- @@ -1107,7 +1148,7 @@ unify_ty :: UMEnv -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare + -- See Note [Unifying type synonyms] | tc1 == tc2 = return () ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,7 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare +-- See Note [Unifying type synonyms] in GHC.Core.Unify can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2187,11 +2187,12 @@ uType env@(UE { u_role = role }) orig_ty1 orig_ty2 ; uType env orig_ty1 ty2 } Nothing -> uUnfilledVar env IsSwapped tv2 ty1 } - -- See Note [Expanding synonyms during unification] + -- See Note [Unifying type synonyms] in GHC.Core.Unify go ty1@(TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = return $ mkReflCo role ty1 + -- Now expand synonyms -- See Note [Expanding synonyms during unification] -- -- Also NB that we recurse to 'go' so that we don't push a @@ -2349,7 +2350,7 @@ We expand synonyms during unification, but: * The problem case immediately above can happen only with arguments to the tycon. So we check for nullary tycons *before* expanding. This is particularly helpful when checking (* ~ *), because * is - now a type synonym. + now a type synonym. See Note [Unifying type synonyms] in GHC.Core.Unify. Note [Deferred unification] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== configure.ac ===================================== @@ -176,6 +176,12 @@ if test "$WithGhc" != ""; then if test -z "$LD_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[ld command]) + # ld command is removed in 9.10.1 as a boot compiler and supplies "Merge objects + # command" instead + if test -z "$LD_STAGE0"; then + BOOTSTRAPPING_GHC_INFO_FIELD([LD_STAGE0],[Merge objects command]) + fi + fi if test -z "$AR_STAGE0"; then BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command]) ===================================== hadrian/doc/flavours.md ===================================== @@ -320,6 +320,10 @@ The supported transformers are listed below: late_ccs Enable -fprof-late in profiled libraries. + + dump_stg + Dump STG of all modules compiled by a stage1 compiler to a file + ### Static ===================================== hadrian/src/Flavour.hs ===================================== @@ -68,6 +68,7 @@ flavourTransformers = M.fromList , "hi_core" =: enableHiCore , "late_ccs" =: enableLateCCS , "boot_nonmoving_gc" =: enableBootNonmovingGc + , "dump_stg" =: enableDumpStg ] where (=:) = (,) @@ -176,11 +177,13 @@ tickyArgs = mconcat [ arg "-ticky" , arg "-ticky-allocd" , arg "-ticky-dyn-thunk" - -- You generally need STG dumps to interpret ticky profiles - , arg "-ddump-to-file" - , arg "-ddump-stg-final" ] +enableDumpStg :: Flavour -> Flavour +enableDumpStg = + addArgs $ stage1 ? + builder (Ghc CompileHs) ? mconcat [ arg "-ddump-to-file", arg "-ddump-stg-final" ] + -- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler. enableLinting :: Flavour -> Flavour enableLinting = ===================================== hadrian/src/Settings/Flavours/GhcInGhci.hs ===================================== @@ -17,7 +17,7 @@ ghcInGhciFlavour = defaultFlavour -- checking for Windows seems simpler for now. , libraryWays = pure (Set.fromList [vanilla]) <> pure (Set.fromList [ dynamic | not windowsHost ]) , rtsWays = pure (Set.fromList [vanilla]) <> (targetSupportsThreadedRts ? pure (Set.fromList [threaded])) <> pure (Set.fromList [ dynamic | not windowsHost ]) - , dynamicGhcPrograms = return False } + } ghciArgs :: Args ghciArgs = sourceArgs SourceArgs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d10be80d28236df81234acbd9bfb52b79d93ff30...e0a7d53c1d9428f4def16b56078e436274fce154 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d10be80d28236df81234acbd9bfb52b79d93ff30...e0a7d53c1d9428f4def16b56078e436274fce154 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 15:31:21 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Mon, 08 Jul 2024 11:31:21 -0400 Subject: [Git][ghc/ghc][wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0] Allow stage1 compilers to load plugins with -fplugin-library Message-ID: <668c0649116e8_3c535f4a47a085921@gitlab.mail> doyougnu pushed to branch wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0 at Glasgow Haskell Compiler / GHC Commits: 6dc885ca by doyougnu at 2024-07-08T11:29:23-04:00 Allow stage1 compilers to load plugins with -fplugin-library part of the haskell.nix upstream patches project This exposes the GHCi.ObjLink module even if no internal interpreter is available. This may be unsafe. - - - - - 2 changed files: - compiler/GHC/Driver/Plugins.hs - libraries/ghci/ghci.cabal.in Changes: ===================================== compiler/GHC/Driver/Plugins.hs ===================================== @@ -1,7 +1,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} -#if defined(HAVE_INTERNAL_INTERPRETER) && defined(CAN_LOAD_DLL) +#if defined(CAN_LOAD_DLL) {-# LANGUAGE MagicHash #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE UnboxedTuples #-} @@ -109,7 +109,7 @@ import qualified Data.Semigroup import Control.Monad -#if defined(HAVE_INTERNAL_INTERPRETER) && defined(CAN_LOAD_DLL) +#if defined(CAN_LOAD_DLL) import GHCi.ObjLink import GHC.Exts (addrToAny#, Ptr(..)) import GHC.Utils.Encoding @@ -387,10 +387,7 @@ defaultFrontendPlugin = FrontendPlugin { frontend = \_ _ -> return () } -- | Load external plugins loadExternalPlugins :: [ExternalPluginSpec] -> IO [ExternalPlugin] loadExternalPlugins [] = return [] -#if !defined(HAVE_INTERNAL_INTERPRETER) -loadExternalPlugins _ = do - panic "loadExternalPlugins: can't load external plugins with GHC built without internal interpreter" -#elif !defined(CAN_LOAD_DLL) +#if !defined(CAN_LOAD_DLL) loadExternalPlugins _ = do panic "loadExternalPlugins: loading shared libraries isn't supported by this compiler" #else ===================================== libraries/ghci/ghci.cabal.in ===================================== @@ -61,7 +61,6 @@ library exposed-modules: GHCi.Run GHCi.CreateBCO - GHCi.ObjLink GHCi.Signals GHCi.StaticPtrTable GHCi.TH @@ -72,6 +71,7 @@ library GHCi.InfoTable exposed-modules: + GHCi.ObjLink GHCi.BreakArray GHCi.BinaryArray GHCi.Message View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6dc885ca5a7078f5ad2e75d4ae08a21fe01f9797 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6dc885ca5a7078f5ad2e75d4ae08a21fe01f9797 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 15:56:18 2024 From: gitlab at gitlab.haskell.org (doyougnu (@doyougnu)) Date: Mon, 08 Jul 2024 11:56:18 -0400 Subject: [Git][ghc/ghc][wip/haskell-nix-patches/native/sanity-check-find-file-name] darwin: prevent macos linker from loading clang++ Message-ID: <668c0c22604c9_3c535f84808c927a6@gitlab.mail> doyougnu pushed to branch wip/haskell-nix-patches/native/sanity-check-find-file-name at Glasgow Haskell Compiler / GHC Commits: ee76db2f by doyougnu at 2024-07-08T11:51:51-04:00 darwin: prevent macos linker from loading clang++ -- part of upstreaming the haskell.nix patches -- see https://github.com/input-output-hk/haskell.nix/pull/2050 -- on macOS GHC queries `clang --print-file-name=c++` which will return `c++` which GHC then tries to load. This patch ensures that GHC will not try to load the executable. - - - - - 1 changed file: - compiler/GHC/Linker/Loader.hs Changes: ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -1486,7 +1486,8 @@ searchForLibUsingGcc logger dflags so dirs = do if (file == so) then return Nothing else do b <- doesFileExist file -- file could be a folder (see #16063) - return (if b then Just file else Nothing) + let c = any (`isExtensionOf` file) [".o", ".a", ".so", ".dylib", ".lib", ".dll"] + return (if b && c then Just file else Nothing) -- | Retrieve the list of search directory GCC and the System use to find -- libraries and components. See Note [Fork/Exec Windows]. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ee76db2f26085fedca103c8be680dbe5e092ef58 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ee76db2f26085fedca103c8be680dbe5e092ef58 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 16:24:55 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 08 Jul 2024 12:24:55 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 2 commits: Introduce back LabelMap non deterministic Message-ID: <668c12d73a21_3c535fd00994108952@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 0b22b090 by Rodrigo Mesquita at 2024-07-08T11:10:47+01:00 Introduce back LabelMap non deterministic - - - - - 8a2a3d80 by Rodrigo Mesquita at 2024-07-08T17:24:06+01:00 Use NonDeterministic Label map in multiple passes (TODO: More could be available. Look through Det LabelMap uses again) - - - - - 29 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - + compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/StgToCmm/Heap.hs - compiler/GHC/StgToCmm/Monad.hs - compiler/GHC/Types/Unique/DFM.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/Dataflow.hs ===================================== @@ -43,7 +43,9 @@ import Data.Kind (Type) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap) +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label.NonDet hiding (LabelMap) type family Fact (x :: Extensibility) f :: Type type instance Fact C f = FactBase f @@ -156,7 +158,7 @@ fixpointAnalysis direction lattice do_block entry blockmap = loop start -- information in fbase1 and (if something changed) we update it -- and add the affected blocks to the worklist. (todo2, fbase2) = {-# SCC "mapFoldWithKey" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts in loop todo2 fbase2 loop _ !fbase1 = fbase1 @@ -227,9 +229,9 @@ fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap let block = block_arr ! index (new_block, out_facts) <- {-# SCC "do_block_rewrite" #-} do_block block fbase1 - let blocks2 = mapInsert (entryLabel new_block) new_block blocks1 + let blocks2 = Det.mapInsert (entryLabel new_block) new_block blocks1 (todo2, fbase2) = {-# SCC "mapFoldWithKey_rewrite" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts loop todo2 blocks2 fbase2 loop _ !blocks1 !fbase1 = return (blocks1, fbase1) @@ -320,16 +322,16 @@ sortBlocks direction entry blockmap = -- * for a forward analysis, we only need to re-analyze the current block -- (and that will in turn propagate facts into its successors). mkDepBlocks :: NonLocal node => Direction -> [Block node C C] -> LabelMap IntSet -mkDepBlocks Fwd blocks = go blocks 0 mapEmpty +mkDepBlocks Fwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - go bs (n + 1) $ mapInsert (entryLabel b) (IntSet.singleton n) dep_map -mkDepBlocks Bwd blocks = go blocks 0 mapEmpty + go bs (n + 1) $ Det.mapInsert (entryLabel b) (IntSet.singleton n) dep_map +mkDepBlocks Bwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - let insert m l = mapInsertWith IntSet.union l (IntSet.singleton n) m + let insert m l = Det.mapInsertWith IntSet.union l (IntSet.singleton n) m in go bs (n + 1) $ foldl' insert dep_map (successors b) -- | After some new facts have been generated by analysing a block, we @@ -353,7 +355,7 @@ updateFact fact_join dep_blocks (todo, fbase) lbl new_fact (Changed f) -> let !z = mapInsert lbl f fbase in (changed, z) where changed = todo `IntSet.union` - mapFindWithDefault IntSet.empty lbl dep_blocks + Det.mapFindWithDefault IntSet.empty lbl dep_blocks {- Note [No old fact] ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -7,11 +7,9 @@ {-# OPTIONS_GHC -Wno-unused-top-binds #-} module GHC.Cmm.Dataflow.Label - ( Label + ( Label(..) , LabelMap , LabelSet - , FactBase - , lookupFact , mkHooplLabel -- * Set , setEmpty @@ -296,10 +294,3 @@ instance TrieMap LabelMap where foldTM k m z = mapFoldr k z m filterTM f m = mapFilter f m ------------------------------------------------------------------------------ --- FactBase - -type FactBase f = LabelMap f - -lookupFact :: Label -> FactBase f -> Maybe f -lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -0,0 +1,297 @@ +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -Wno-unused-top-binds #-} + +-- | Non-deterministic 'LabelMap' and 'LabelSet': +-- +-- Labels that use non-deterministic Uniques will make this map +-- non-deterministic. In contrast, 'GHC.Cmm.Dataflow.Label.LabelMap' will be +-- deterministically ordered regardless of the non-deterministic origin of the +-- Uniques in the labels. +-- +-- We want to make sure that non-deterministic label maps are only used when +-- the non-determinism of the map cannot affect the determinism of the code +-- generation output. To that effect, this label map only exposes operations +-- which don't allow non-determinism from the outside, e.g., it exposes maps +-- and lookups, but not traversals or to-list functions. +module GHC.Cmm.Dataflow.Label.NonDet + ( Label + , LabelMap + , LabelSet + , FactBase + , lookupFact + , mkHooplLabel + -- * Set + , setEmpty + , setNull + , setSize + , setMember + , setSingleton + , setInsert + , setDelete + , setUnion + , setUnions + , setDifference + , setIntersection + , setIsSubsetOf + , setFilter + , setFromList + , nonDetSetFoldl + , nonDetSetFoldr + , nonDetSetElems + -- * Map + , mapNull + , mapSize + , mapMember + , mapLookup + , mapFindWithDefault + , mapEmpty + , mapSingleton + , mapInsert + , mapInsertWith + , mapDelete + , mapAlter + , mapAdjust + , mapUnion + , mapUnions + , mapUnionWithKey + , mapDifference + , mapIntersection + , mapIsSubmapOf + , mapMap + , mapMapWithKey + , mapFilter + , mapFilterWithKey + , mapFromList + , mapFromListWith + , nonDetMapElems + , nonDetMapFoldl + , nonDetMapFoldr + , nonDetMapFoldlWithKey + , nonDetMapFoldMapWithKey + , nonDetMapKeys + , nonDetMapToList + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable + +-- The code generator will eventually be using all the labels stored in a +-- LabelSet and LabelMap. For these reasons we use the strict variants of these +-- data structures. We inline selectively to enable the RULES in Word64Map/Set +-- to fire. +import GHC.Data.Word64Set (Word64Set) +import qualified GHC.Data.Word64Set as S +import GHC.Data.Word64Map.Strict (Word64Map) +import qualified GHC.Data.Word64Map.Strict as M + +import Data.List (foldl1') + +import GHC.Cmm.Dataflow.Label (Label(..), mkHooplLabel) + +----------------------------------------------------------------------------- +-- LabelSet + +newtype LabelSet = LS Word64Set + deriving newtype (Eq, Ord, Show, Monoid, Semigroup) + +setNull :: LabelSet -> Bool +setNull (LS s) = S.null s + +setSize :: LabelSet -> Int +setSize (LS s) = S.size s + +setMember :: Label -> LabelSet -> Bool +setMember (Label k) (LS s) = S.member k s + +setEmpty :: LabelSet +setEmpty = LS S.empty + +setSingleton :: Label -> LabelSet +setSingleton (Label k) = LS (S.singleton k) + +setInsert :: Label -> LabelSet -> LabelSet +setInsert (Label k) (LS s) = LS (S.insert k s) + +setDelete :: Label -> LabelSet -> LabelSet +setDelete (Label k) (LS s) = LS (S.delete k s) + +setUnion :: LabelSet -> LabelSet -> LabelSet +setUnion (LS x) (LS y) = LS (S.union x y) + +{-# INLINE setUnions #-} +setUnions :: [LabelSet] -> LabelSet +setUnions [] = setEmpty +setUnions sets = foldl1' setUnion sets + +setDifference :: LabelSet -> LabelSet -> LabelSet +setDifference (LS x) (LS y) = LS (S.difference x y) + +setIntersection :: LabelSet -> LabelSet -> LabelSet +setIntersection (LS x) (LS y) = LS (S.intersection x y) + +setIsSubsetOf :: LabelSet -> LabelSet -> Bool +setIsSubsetOf (LS x) (LS y) = S.isSubsetOf x y + +setFilter :: (Label -> Bool) -> LabelSet -> LabelSet +setFilter f (LS s) = LS (S.filter (f . mkHooplLabel) s) + +{-# INLINE setFromList #-} +setFromList :: [Label] -> LabelSet +setFromList ks = LS (S.fromList (map lblToUnique ks)) + +{-# INLINE nonDetSetFoldl #-} +nonDetSetFoldl :: (t -> Label -> t) -> t -> LabelSet -> t +nonDetSetFoldl k z (LS s) = S.foldl (\a v -> k a (mkHooplLabel v)) z s + +{-# INLINE nonDetSetFoldr #-} +nonDetSetFoldr :: (Label -> t -> t) -> t -> LabelSet -> t +nonDetSetFoldr k z (LS s) = S.foldr (\v a -> k (mkHooplLabel v) a) z s + +{-# INLINE nonDetSetElems #-} +nonDetSetElems :: LabelSet -> [Label] +nonDetSetElems (LS s) = map mkHooplLabel (S.elems s) + +----------------------------------------------------------------------------- +-- LabelMap + +newtype LabelMap v = LM (Word64Map v) + deriving newtype (Eq, Ord, Show, Functor) + +mapNull :: LabelMap a -> Bool +mapNull (LM m) = M.null m + +{-# INLINE mapSize #-} +mapSize :: LabelMap a -> Int +mapSize (LM m) = M.size m + +mapMember :: Label -> LabelMap a -> Bool +mapMember (Label k) (LM m) = M.member k m + +mapLookup :: Label -> LabelMap a -> Maybe a +mapLookup (Label k) (LM m) = M.lookup k m + +mapFindWithDefault :: a -> Label -> LabelMap a -> a +mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m + +mapEmpty :: LabelMap v +mapEmpty = LM M.empty + +mapSingleton :: Label -> v -> LabelMap v +mapSingleton (Label k) v = LM (M.singleton k v) + +mapInsert :: Label -> v -> LabelMap v -> LabelMap v +mapInsert (Label k) v (LM m) = LM (M.insert k v m) + +mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v +mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) + +mapDelete :: Label -> LabelMap v -> LabelMap v +mapDelete (Label k) (LM m) = LM (M.delete k m) + +mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v +mapAlter f (Label k) (LM m) = LM (M.alter f k m) + +mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v +mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) + +mapUnion :: LabelMap v -> LabelMap v -> LabelMap v +mapUnion (LM x) (LM y) = LM (M.union x y) + +{-# INLINE mapUnions #-} +mapUnions :: [LabelMap a] -> LabelMap a +mapUnions [] = mapEmpty +mapUnions maps = foldl1' mapUnion maps + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) + +mapDifference :: LabelMap v -> LabelMap b -> LabelMap v +mapDifference (LM x) (LM y) = LM (M.difference x y) + +mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v +mapIntersection (LM x) (LM y) = LM (M.intersection x y) + +mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool +mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y + +mapMap :: (a -> v) -> LabelMap a -> LabelMap v +mapMap f (LM m) = LM (M.map f m) + +mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v +mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) + +{-# INLINEABLE mapFilter #-} +mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v +mapFilter f (LM m) = LM (M.filter f m) + +{-# INLINEABLE mapFilterWithKey #-} +mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v +mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) + +{-# INLINE mapFromList #-} +mapFromList :: [(Label, v)] -> LabelMap v +mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) + +mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v +mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) + +{-# INLINE nonDetMapElems #-} +nonDetMapElems :: LabelMap a -> [a] +nonDetMapElems (LM m) = M.elems m + +{-# INLINE nonDetMapFoldl #-} +nonDetMapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a +nonDetMapFoldl k z (LM m) = M.foldl k z m + +{-# INLINE nonDetMapFoldr #-} +nonDetMapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b +nonDetMapFoldr k z (LM m) = M.foldr k z m + +{-# INLINE nonDetMapFoldlWithKey #-} +nonDetMapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t +nonDetMapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m + +nonDetMapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m +nonDetMapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m + +{-# INLINE nonDetMapKeys #-} +nonDetMapKeys :: LabelMap a -> [Label] +nonDetMapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) + +{-# INLINE nonDetMapToList #-} +nonDetMapToList :: LabelMap b -> [(Label, b)] +nonDetMapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] + +----------------------------------------------------------------------------- +-- Instances + +instance Outputable LabelSet where + ppr = ppr . nonDetSetElems + +instance Outputable a => Outputable (LabelMap a) where + ppr = ppr . nonDetMapToList + +instance OutputableP env a => OutputableP env (LabelMap a) where + pdoc env = pdoc env . nonDetMapToList + +-- instance TrieMap LabelMap where +-- type Key LabelMap = Label +-- emptyTM = mapEmpty +-- lookupTM k m = mapLookup k m +-- alterTM k f m = mapAlter f k m +-- foldTM k m z = mapFoldr k z m -- TODO:ERROR? +-- filterTM f m = mapFilter f m + +----------------------------------------------------------------------------- +-- FactBase + +type FactBase f = LabelMap f + +lookupFact :: Label -> FactBase f -> Maybe f +lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Graph.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Cmm.Switch (SwitchTargets) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.FastString import GHC.Types.ForeignCall import GHC.Data.OrdList ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -27,6 +27,8 @@ import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet (lookupFact) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module import GHC.Data.Graph.Directed @@ -536,7 +538,7 @@ newtype CAFfyLabel = CAFfyLabel CLabel deriving newtype instance OutputableP env CLabel => OutputableP env CAFfyLabel type CAFSet = Set CAFfyLabel -type CAFEnv = LabelMap CAFSet +type CAFEnv = NonDet.LabelMap CAFSet -- | Records the CAFfy references of a set of static data decls. type DataCAFEnv = Map CLabel CAFSet @@ -603,7 +605,7 @@ cafAnal -> CAFEnv cafAnal platform contLbls topLbl cmmGraph = analyzeCmmBwd cafLattice - (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty + (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph NonDet.mapEmpty cafLattice :: DataflowLattice CAFSet @@ -663,7 +665,7 @@ cafTransfers platform contLbls entry topLbl text "topLbl:" <+> pdoc platform topLbl $$ text "cafs in exit:" <+> pdoc platform joined $$ text "result:" <+> pdoc platform result) $ - mapSingleton (entryLabel eNode) result + NonDet.mapSingleton (entryLabel eNode) result -- ----------------------------------------------------------------------------- @@ -779,7 +781,7 @@ depAnalSRTs platform cafEnv cafEnv_static decls = | (l, lbl) <- labelledBlocks , Just (cafs :: Set CAFfyLabel) <- [case l of - BlockLabel l -> mapLookup l cafEnv + BlockLabel l -> NonDet.mapLookup l cafEnv DeclLabel cl -> Map.lookup cl cafEnv_static] , let cafs' = Set.delete lbl cafs ] @@ -814,7 +816,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep - , Just cafs <- mapLookup (g_entry g) cafEnv + , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv = Just (Just (g_entry g), mkCAFfyLabel platform top_lbl, cafs) | otherwise @@ -907,7 +909,7 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do CmmStaticsRaw lbl _ -> (lbl, set) (proc_envs, procss) = unzip procs - cafEnv = mapUnions proc_envs + cafEnv = NonDet.mapUnions proc_envs decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss staticFuns = mapFromList (getStaticFuns decls) ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards, GADTs #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Cmm.LayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where @@ -25,6 +26,7 @@ import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Data.Maybe import GHC.Types.Unique.FM import GHC.Types.Unique.DSM @@ -235,7 +237,7 @@ instance Outputable StackMap where cmmLayoutStack :: CmmConfig -> ProcPointSet -> ByteOff -> CmmGraph - -> UniqDSM (CmmGraph, LabelMap StackMap) + -> UniqDSM (CmmGraph, NonDet.LabelMap StackMap) cmmLayoutStack cfg procpoints entry_args graph@(CmmGraph { g_entry = entry }) = do @@ -262,17 +264,17 @@ cmmLayoutStack cfg procpoints entry_args layout :: CmmConfig -> LabelSet -- proc points - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> BlockId -- entry -> ByteOff -- stack args on entry - -> LabelMap StackMap -- [final] stack maps + -> NonDet.LabelMap StackMap -- [final] stack maps -> ByteOff -- [final] Sp high water mark -> [CmmBlock] -- [in] blocks -> UniqDSM - ( LabelMap StackMap -- [out] stack maps + ( NonDet.LabelMap StackMap -- [out] stack maps , ByteOff -- [out] Sp high water mark , [CmmBlock] -- [out] new blocks ) @@ -282,12 +284,18 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl where (updfr, cont_info) = collectContInfo blocks - init_stackmap = mapSingleton entry StackMap{ sm_sp = entry_args - , sm_args = entry_args - , sm_ret_off = updfr - , sm_regs = emptyUFM - } - + init_stackmap = NonDet.mapSingleton entry + StackMap{ sm_sp = entry_args + , sm_args = entry_args + , sm_ret_off = updfr + , sm_regs = emptyUFM + } + + go :: [Block CmmNode C C] + -> NonDet.LabelMap StackMap + -> StackLoc + -> [CmmBlock] + -> UniqDSM (NonDet.LabelMap StackMap, StackLoc, [CmmBlock]) go [] acc_stackmaps acc_hwm acc_blocks = return (acc_stackmaps, acc_hwm, acc_blocks) @@ -296,7 +304,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl let (entry0@(CmmEntry entry_lbl tscope), middle0, last0) = blockSplit b0 let stack0 at StackMap { sm_sp = sp0 } - = mapFindWithDefault + = NonDet.mapFindWithDefault (pprPanic "no stack map for" (ppr entry_lbl)) entry_lbl acc_stackmaps @@ -328,7 +336,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl manifestSp cfg final_stackmaps stack0 sp0 final_sp_high entry0 middle_pre sp_off last1 fixup_blocks - let acc_stackmaps' = mapUnion acc_stackmaps out + let acc_stackmaps' = NonDet.mapUnion acc_stackmaps out -- If this block jumps to the GC, then we do not take its -- stack usage into account for the high-water mark. @@ -340,7 +348,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl this_sp_hwm | isGcJump last0 = 0 | otherwise = sp0 - sp_off - hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (mapElems out)) + hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (NonDet.nonDetMapElems out)) go bs acc_stackmaps' hwm' (final_blocks ++ acc_blocks) @@ -393,7 +401,7 @@ collectContInfo blocks -- on the stack and need to be immediately saved across a call, we -- want to just leave them where they are on the stack. -- -procMiddle :: LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap +procMiddle :: NonDet.LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap procMiddle stackmaps node sm = case node of CmmAssign (CmmLocal r) (CmmLoad (CmmStackSlot area off) _ _) @@ -404,10 +412,10 @@ procMiddle stackmaps node sm _other -> sm -getStackLoc :: Area -> ByteOff -> LabelMap StackMap -> StackLoc +getStackLoc :: Area -> ByteOff -> NonDet.LabelMap StackMap -> StackLoc getStackLoc Old n _ = n getStackLoc (Young l) n stackmaps = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Nothing -> pprPanic "getStackLoc" (ppr l) Just sm -> sm_sp sm - sm_args sm + n @@ -432,8 +440,8 @@ getStackLoc (Young l) n stackmaps = -- extra code that goes *after* the Sp adjustment. handleLastNode - :: CmmConfig -> ProcPointSet -> LabelMap CmmLocalLive -> LabelMap ByteOff - -> LabelMap StackMap -> StackMap -> CmmTickScope + :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> LabelMap ByteOff + -> NonDet.LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C -> UniqDSM @@ -441,7 +449,7 @@ handleLastNode , ByteOff -- amount to adjust Sp , CmmNode O C -- new last node , [CmmBlock] -- new blocks - , LabelMap StackMap -- stackmaps for the continuations + , NonDet.LabelMap StackMap -- stackmaps for the continuations ) handleLastNode cfg procpoints liveness cont_info stackmaps @@ -452,7 +460,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- is cml_args, after popping any other junk from the stack. CmmCall{ cml_cont = Nothing, .. } -> do let sp_off = sp0 - cml_args - return ([], sp_off, last, [], mapEmpty) + return ([], sp_off, last, [], NonDet.mapEmpty) -- At each CmmCall with a continuation: CmmCall{ cml_cont = Just cont_lbl, .. } -> @@ -473,20 +481,20 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap + , NonDet.LabelMap StackMap ) lastCall lbl cml_args cml_ret_args cml_ret_off = ( assignments , spOffsetForCall sp0 cont_stack cml_args , last , [] -- no new blocks - , mapSingleton lbl cont_stack ) + , NonDet.mapSingleton lbl cont_stack ) where (assignments, cont_stack) = prepareStack lbl cml_ret_args cml_ret_off prepareStack lbl cml_ret_args cml_ret_off - | Just cont_stack <- mapLookup lbl stackmaps + | Just cont_stack <- NonDet.mapLookup lbl stackmaps -- If we have already seen this continuation before, then -- we just have to make the stack look the same: = (fixupStack stack0 cont_stack, cont_stack) @@ -506,7 +514,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap ) + , NonDet.LabelMap StackMap ) handleBranches -- See Note [diamond proc point] @@ -515,8 +523,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps = do let cont_args = mapFindWithDefault 0 l cont_info (assigs, cont_stack) = prepareStack l cont_args (sm_ret_off stack0) - out = mapFromList [ (l', cont_stack) - | l' <- successors last ] + out = NonDet.mapFromList + [ (l', cont_stack) + | l' <- successors last ] return ( assigs , spOffsetForCall sp0 cont_stack (platformWordSizeInBytes platform) , last @@ -532,7 +541,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , 0 , mapSuccessors fix_lbl last , concat [ blk | (_,_,_,blk) <- pps ] - , mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) + , NonDet.mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) -- For each successor of this block handleBranch :: BlockId -> UniqDSM (BlockId, BlockId, StackMap, [CmmBlock]) @@ -540,7 +549,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- (a) if the successor already has a stackmap, we need to -- shuffle the current stack to make it look the same. -- We have to insert a new block to make this happen. - | Just stack2 <- mapLookup l stackmaps + | Just stack2 <- NonDet.mapLookup l stackmaps = do let assigs = fixupStack stack0 stack2 (tmp_lbl, block) <- makeFixupBlock cfg sp0 l stack2 tscp assigs @@ -563,7 +572,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- the destination, because this StackMap might be used -- by fixupStack if this is a join point. | otherwise = return (l, l, stack1, []) - where live = mapFindWithDefault (panic "handleBranch") l liveness + where live = NonDet.mapFindWithDefault (panic "handleBranch") l liveness stack1 = stack0 { sm_regs = filterUFM is_live (sm_regs stack0) } is_live (r,_) = r `elemRegSet` live @@ -612,7 +621,7 @@ fixupStack old_stack new_stack = concatMap move new_locs setupStackFrame :: Platform -> BlockId -- label of continuation - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> ByteOff -- updfr -> ByteOff -- bytes of return values on stack -> StackMap -- current StackMap @@ -622,7 +631,7 @@ setupStackFrame platform lbl liveness updfr_off ret_args stack0 = (cont_stack, assignments) where -- get the set of LocalRegs live in the continuation - live = mapFindWithDefault Set.empty lbl liveness + live = NonDet.mapFindWithDefault Set.empty lbl liveness -- the stack from the base to updfr_off is off-limits. -- our new stack frame contains: @@ -824,7 +833,7 @@ allocate platform ret_off live stackmap at StackMap{ sm_sp = sp0 -- manifestSp :: CmmConfig - -> LabelMap StackMap -- StackMaps for other blocks + -> NonDet.LabelMap StackMap -- StackMaps for other blocks -> StackMap -- StackMap for this block -> ByteOff -- Sp on entry to the block -> ByteOff -- SpHigh @@ -857,10 +866,10 @@ manifestSp cfg stackmaps stack0 sp0 sp_high fixup_blocks' = map (mapBlock3' (id, adj_post_sp, id)) fixup_blocks -getAreaOff :: LabelMap StackMap -> (Area -> StackLoc) +getAreaOff :: NonDet.LabelMap StackMap -> (Area -> StackLoc) getAreaOff _ Old = 0 getAreaOff stackmaps (Young l) = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Just sm -> sm_sp sm - sm_args sm Nothing -> pprPanic "getAreaOff" (ppr l) @@ -987,7 +996,7 @@ optStackCheck n = -- Note [Always false stack check] -- StackMap will invalidate its mapping there. -- elimStackStores :: StackMap - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> (Area -> ByteOff) -> [CmmNode O O] -> [CmmNode O O] @@ -1009,7 +1018,7 @@ elimStackStores stackmap stackmaps area_off nodes -- Update info tables to include stack liveness -setInfoTableStackMap :: Platform -> LabelMap StackMap -> CmmDecl -> CmmDecl +setInfoTableStackMap :: Platform -> NonDet.LabelMap StackMap -> CmmDecl -> CmmDecl setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) = CmmProc top_info{ info_tbls = mapMapWithKey fix_info info_tbls } l v g where @@ -1019,7 +1028,7 @@ setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) get_liveness :: BlockId -> Liveness get_liveness lbl - = case mapLookup lbl stackmaps of + = case NonDet.mapLookup lbl stackmaps of Nothing -> pprPanic "setInfoTableStackMap" (ppr lbl <+> pdoc platform info_tbls) Just sm -> stackMapToLiveness platform sm @@ -1044,18 +1053,18 @@ stackMapToLiveness platform StackMap{..} = insertReloadsAsNeeded :: Platform -> ProcPointSet - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> BlockId -> [CmmBlock] -> UniqDSM [CmmBlock] insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = toBlockList . fst <$> - rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) mapEmpty + rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) NonDet.mapEmpty where rewriteCC :: RewriteFun CmmLocalLive rewriteCC (BlockCC e_node middle0 x_node) fact_base0 = do let entry_label = entryLabel e_node - stackmap = case mapLookup entry_label final_stackmaps of + stackmap = case NonDet.mapLookup entry_label final_stackmaps of Just sm -> sm Nothing -> panic "insertReloadsAsNeeded: rewriteCC: stackmap" @@ -1077,7 +1086,7 @@ insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = = (middle0, live_at_middle0) -- Final liveness for this block. - !fact_base2 = mapSingleton entry_label live_with_reloads + !fact_base2 = NonDet.mapSingleton entry_label live_with_reloads return (BlockCC e_node middle1 x_node, fact_base2) ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Platform import GHC.Platform.Regs (callerSaves) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm import GHC.Cmm.Liveness import GHC.Cmm.Switch (switchTargetsToList) ===================================== compiler/GHC/Cmm/Liveness.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.LRegSet import GHC.Data.Maybe @@ -57,7 +57,7 @@ cmmLocalLiveness platform graph = where entry = g_entry graph check facts = - noLiveOnEntry entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntry entry (expectJust "check" $ lookupFact entry facts) facts cmmGlobalLiveness :: Platform -> CmmGraph -> BlockEntryLiveness GlobalReg cmmGlobalLiveness platform graph = @@ -120,7 +120,7 @@ cmmLocalLivenessL platform graph = where entry = g_entry graph check facts = - noLiveOnEntryL entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntryL entry (expectJust "check" $ lookupFact entry facts) facts -- | On entry to the procedure, there had better not be any LocalReg's live-in. noLiveOnEntryL :: BlockId -> LRegSet -> a -> a ===================================== compiler/GHC/Cmm/Pipeline.hs ===================================== @@ -11,7 +11,7 @@ import GHC.Cmm import GHC.Cmm.Config import GHC.Cmm.ContFlowOpt import GHC.Cmm.CommonBlockElim -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Info.Build import GHC.Cmm.Lint import GHC.Cmm.LayoutStack ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -29,6 +29,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- Compute a minimal set of proc points for a control-flow graph. @@ -134,7 +135,7 @@ instance Outputable Status where -- Once you know what the proc-points are, figure out -- what proc-points each block is reachable from -- See Note [Proc-point analysis] -procPointAnalysis :: ProcPointSet -> CmmGraph -> LabelMap Status +procPointAnalysis :: ProcPointSet -> CmmGraph -> NonDet.LabelMap Status procPointAnalysis procPoints cmmGraph@(CmmGraph {g_graph = graph}) = analyzeCmmFwd procPointLattice procPointTransfer cmmGraph initProcPoints where @@ -196,14 +197,14 @@ extendPPSet extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block - in case mapLookup id env of + in case NonDet.mapLookup id env of Just ProcPoint -> setInsert id pps _ -> pps procPoints' = foldlGraphBlocks add setEmpty g newPoints = mapMaybe ppSuccessor blocks newPoint = listToMaybe newPoints ppSuccessor b = - let nreached id = case mapLookup id env `orElse` + let nreached id = case NonDet.mapLookup id env `orElse` pprPanic "no ppt" (ppr id <+> pdoc platform b) of ProcPoint -> 1 ReachedBy ps -> setSize ps @@ -235,7 +236,7 @@ extendPPSet platform g blocks procPoints = -- Input invariant: A block should only be reachable from a single ProcPoint. -- ToDo: use the _ret naming convention that the old code generator -- used. -- EZY -splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> LabelMap Status -> CmmDecl +splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> NonDet.LabelMap Status -> CmmDecl -> UniqDSM [CmmDecl] splitAtProcPoints _ _ _ _ _ t@(CmmData _ _) = return [t] splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do @@ -249,7 +250,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let add_block :: LabelMap (LabelMap CmmBlock) -> CmmBlock -> LabelMap (LabelMap CmmBlock) add_block graphEnv b = - case mapLookup bid procMap of + case NonDet.mapLookup bid procMap of Just ProcPoint -> add graphEnv bid bid b Just (ReachedBy set) -> case setElems set of @@ -263,7 +264,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let liveness = cmmGlobalLiveness platform g let ppLiveness pp = filter isArgReg $ regSetToList $ - expectJust "ppLiveness" $ mapLookup pp liveness + expectJust "ppLiveness" $ NonDet.mapLookup pp liveness graphEnv <- return $ foldlGraphBlocks add_block mapEmpty g -- Build a map from proc point BlockId to pairs of: ===================================== compiler/GHC/Cmm/Sink.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Cmm.Liveness import GHC.Cmm.LRegSet import GHC.Cmm.Utils import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Dataflow.Graph import GHC.Platform.Regs ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -40,7 +40,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapEmpty, mapLookup, mapInsert) import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -26,7 +26,8 @@ import GHC.CmmToAsm.Config import GHC.Cmm import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember, mapLookup, mapElems, mapKeys, mapEmpty, mapInsert, mapDelete, mapFromList, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setEmpty, setMember, setFromList, setInsert) import GHC.Types.Unique.FM ===================================== compiler/GHC/CmmToAsm/PIC.hs ===================================== @@ -60,7 +60,7 @@ import GHC.CmmToAsm.Config import GHC.CmmToAsm.Types -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapMember) import GHC.Cmm import GHC.Cmm.CLabel import GHC.Cmm.Utils (cmmLoadBWord) ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -15,7 +15,7 @@ import GHC.CmmToAsm.Instr import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapFoldlWithKey, mapLookup, mapInsert) import GHC.Utils.Monad import GHC.Utils.Monad.State.Strict ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import Data.List (nub, foldl1', find) import Data.Maybe ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Platform.Reg import GHC.Data.Graph.Base -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup, Label, LabelMap) import GHC.Cmm import GHC.Types.Unique.FM import GHC.Types.Unique.Set ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -122,7 +122,7 @@ import GHC.Platform.Reg import GHC.Platform.Reg.Class (RegClass(..)) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Cmm hiding (RegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs ===================================== @@ -23,7 +23,7 @@ import GHC.CmmToAsm.Types import GHC.Platform.Reg import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.Graph.Directed import GHC.Utils.Panic import GHC.Utils.Monad (concatMapM) ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -46,7 +46,8 @@ import GHC.CmmToAsm.Types import GHC.CmmToAsm.Utils import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapToList, LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setMember, setFromList) import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -34,7 +34,7 @@ import GHC.Cmm import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.InitFini import GHC.CmmToAsm.Wasm.Types import GHC.CmmToAsm.Wasm.Utils ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -66,7 +66,7 @@ import GHC.Cmm.Switch import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember) import GHC.Cmm.CLabel import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -54,7 +54,7 @@ import GHC.CmmToAsm.Reg.Target import GHC.CmmToAsm.Config import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Platform.Regs import GHC.Cmm import GHC.Utils.Outputable ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.FastString import GHC.Data.OrdList ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -22,7 +22,7 @@ import Control.Monad import Data.List (delete, union, insert, intersect) import Data.Semigroup -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.Graph.Inductive.Graph import GHC.Types.Unique.DSM import GHC.Utils.Panic hiding (assert) ===================================== compiler/GHC/StgToCmm/Heap.hs ===================================== @@ -33,7 +33,7 @@ import GHC.StgToCmm.Closure import GHC.Cmm.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Runtime.Heap.Layout import GHC.Cmm.BlockId import GHC.Cmm ===================================== compiler/GHC/StgToCmm/Monad.hs ===================================== @@ -76,7 +76,7 @@ import GHC.StgToCmm.Sequel import GHC.Cmm.Graph as CmmGraph import GHC.Cmm.BlockId import GHC.Cmm.CLabel -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapSingleton, mapEmpty) import GHC.Runtime.Heap.Layout import GHC.Unit import GHC.Types.Id ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -21,6 +21,7 @@ is not deterministic. {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -Wall #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Types.Unique.DFM ( -- * Unique-keyed deterministic mappings ===================================== compiler/ghc.cabal.in ===================================== @@ -237,6 +237,7 @@ Library GHC.Cmm.Dataflow.Block GHC.Cmm.Dataflow.Graph GHC.Cmm.Dataflow.Label + GHC.Cmm.Dataflow.Label.NonDet GHC.Cmm.DebugBlock GHC.Cmm.Expr GHC.Cmm.GenericOpt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1ccb91d2e33d86377ef988c0dd1c8f33b5cfcf50...8a2a3d808d66c8b57af35edd07886bfab9b0827e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1ccb91d2e33d86377ef988c0dd1c8f33b5cfcf50...8a2a3d808d66c8b57af35edd07886bfab9b0827e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 16:54:46 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 08 Jul 2024 12:54:46 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] Refactor dependency collection Message-ID: <668c19d6e833b_3c535f129335c1240a1@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: 7515bde8 by Torsten Schmits at 2024-07-08T18:51:55+02:00 Refactor dependency collection - - - - - 3 changed files: - compiler/GHC/Linker/Deps.hs - testsuite/tests/th/cross-package/Makefile - testsuite/tests/th/cross-package/all.T Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -47,7 +47,6 @@ import GHC.Utils.Misc import GHC.Unit.Home import GHC.Data.Maybe -import Control.Monad import Control.Applicative import qualified Data.Set as Set @@ -117,45 +116,56 @@ get_link_deps get_link_deps opts pls maybe_normal_osuf span mods = do -- 1. Find the dependent home-pkg-modules/packages from each iface -- (omitting modules from the interactive package, which is already linked) - (mods_s, pkgs_s) <- + deps <- -- Why two code paths here? There is a significant amount of repeated work -- performed calculating transitive dependencies -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) if ldOneShotMode opts - then follow_deps (filterOut isInteractiveModule mods) - emptyUniqDSet emptyUniqDSet; - else do - (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods - return (catMaybes mmods, unionManyUniqDSets (init_pkg_set : pkgs)) - - let - -- 2. Exclude ones already linked - -- Main reason: avoid findModule calls in get_linkable - (mods_needed, links_got) = partitionWith split_mods mods_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s `minusUDFM` pkgs_loaded pls - - split_mods mod = - let is_linked = lookupModuleEnv (objs_loaded pls) mod - <|> lookupModuleEnv (bcos_loaded pls) mod - in case is_linked of - Just linkable -> Right linkable - Nothing -> Left mod + then oneshot_deps opts (filterOut isInteractiveModule mods) + else make_deps + + -- TODO this used to avoid some lookups, maybe we can move that to + -- oneshot_deps now + -- (mods_needed, links_got) = partitionWith split_mods mods_s + -- + -- split_mods mod = + -- let is_linked = lookupModuleEnv (objs_loaded pls) mod + -- <|> lookupModuleEnv (bcos_loaded pls) mod + -- in case is_linked of + -- Just linkable -> Right linkable + -- Nothing -> Left mod -- 3. For each dependent module, find its linkable -- This will either be in the HPT or (in the case of one-shot -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM get_linkable mods_needed + (lnks, pkgs_s) <- partitionWithM dep_linkable deps + let + lnks_needed = concat lnks + pkgs_s' = mkUniqDSet pkgs_s + pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s' `minusUDFM` pkgs_loaded pls return $ LinkDeps { ldNeededLinkables = lnks_needed - , ldAllLinkables = links_got ++ lnks_needed + -- , ldAllLinkables = links_got ++ lnks_needed + , ldAllLinkables = lnks_needed , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s + , ldNeededUnits = pkgs_s' } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts + make_deps = do + (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods + let + link_mods = + listToUDFM [(moduleName (mi_module (hm_iface m)), m) | m <- mmods] + link_libs = + uniqDSetToList (unionManyUniqDSets (init_pkg_set : pkgs)) + pure $ + LinkModules (LinkHomeModule <$> link_mods) : + (LinkLibrary <$> link_libs) + -- This code is used in `--make` mode to calculate the home package and unit dependencies -- for a set of modules. -- @@ -187,94 +197,14 @@ get_link_deps opts pls maybe_normal_osuf span mods = do get_mod_info (ModNodeKeyWithUid gwib uid) = case lookupHug (ue_home_unit_graph unit_env) uid (gwib_mod gwib) of - Just hmi -> - let iface = (hm_iface hmi) - mmod = case mi_hsc_src iface of - HsBootFile -> link_boot_mod_error (mi_module iface) - _ -> return $ Just (mi_module iface) - - in (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface),) <$> mmod + Just hmi -> do + let iface = hm_iface hmi + case mi_hsc_src iface of + HsBootFile -> throwProgramError opts $ link_boot_mod_error (mi_module iface) + _ -> pure (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface), hmi) Nothing -> throwProgramError opts $ text "getLinkDeps: Home module not loaded" <+> ppr (gwib_mod gwib) <+> ppr uid - - -- This code is used in one-shot mode to traverse downwards through the HPT - -- to find all link dependencies. - -- The ModIface contains the transitive closure of the module dependencies - -- within the current package, *except* for boot modules: if we encounter - -- a boot module, we have to find its real interface and discover the - -- dependencies of that. Hence we need to traverse the dependency - -- tree recursively. See bug #936, testcase ghci/prog007. - follow_deps :: [Module] -- modules to follow - -> UniqDSet Module -- accum. module dependencies - -> UniqDSet UnitId -- accum. package dependencies - -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs = - pure (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod : mods) acc_mods acc_pkgs = do - ldLoadIface opts msg mod >>= \case - Failed err - | ldUseByteCode opts - -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs (moduleUnitId mod)) - | otherwise - -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> follow_deps_iface iface mod mods acc_mods acc_pkgs - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" - - follow_deps_iface iface mod mods acc_mods acc_pkgs = do - when (mi_boot iface == IsBoot) $ link_boot_mod_error mod - - let - pkg = moduleUnit mod - deps = mi_deps iface - - pkg_deps = dep_direct_pkgs deps - (boot_deps_home, mod_deps_home) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ - \case - (_, GWIB m IsBoot) -> Left (mkModule pkg m) - (_, GWIB m NotBoot) -> Right (mkModule pkg m) - - has_core_bindings = isJust (mi_extra_decls iface) - - acc_pkgs' - | ldUseByteCode opts - = if has_core_bindings - then acc_pkgs - else addOneToUniqDSet acc_pkgs (moduleUnitId mod) - | otherwise - = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) - - mod_deps_pkg - | ldUseByteCode opts - = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] - | otherwise - = [] - - mod_deps' = filterOut (`elementOfUniqDSet` acc_mods) (boot_deps_home ++ mod_deps_home ++ mod_deps_pkg) - - acc_mods' - | ldUseByteCode opts - = addOneToUniqDSet acc_mods mod - | otherwise - = addListToUniqDSet acc_mods (mod : mod_deps') - - case ue_homeUnit unit_env of - _ | ldUseByteCode opts && has_core_bindings -> - follow_deps (mod_deps' ++ mods) acc_mods' acc_pkgs' - Just home_unit | isHomeUnit home_unit pkg -> - follow_deps (mod_deps' ++ mods) acc_mods' acc_pkgs' - _ -> - follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - - link_boot_mod_error :: Module -> IO a - link_boot_mod_error mod = throwProgramError opts $ - text "module" <+> ppr mod <+> - text "cannot be linked; it is only available as a boot module" - no_obj :: Outputable a => a -> IO b no_obj mod = dieWith opts span $ text "cannot find object file for module " <> @@ -283,6 +213,24 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" + dep_linkable = \case + LinkModules mods -> Left <$> mapM get_linkable (eltsUDFM mods) + LinkLibrary uid -> pure (Right uid) + + get_linkable = \case + LinkHomeModule hmi -> + pure (expectJust "getLinkDeps" (homeModLinkable hmi)) + + LinkObjectModule iface loc -> do + let mod = mi_module iface + findObjectLinkableMaybe mod loc >>= \case + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + LinkByteCodeModule iface wcb -> do + details <- initModDetails (ldHscEnv opts) iface + t <- getCurrentTime + initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable @@ -291,72 +239,182 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable mod -- A home-package module - | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) - = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) - | otherwise - = do -- It's not in the HPT because we are in one shot mode, - -- so use the Finder to get a ModLocation... - case ue_homeUnit unit_env of - Nothing -> no_obj mod - Just home_unit -> do - - let fc = ldFinderCache opts - let fopts = ldFinderOpts opts - mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) - case mb_stuff of - Found loc mod -> found loc mod - _ | ldUseByteCode opts -> hydrate (no_obj mod) mod - | otherwise -> no_obj (moduleName mod) - where - found loc mod - | ldUseByteCode opts = hydrate (fallback_no_bytecode loc mod) mod - | otherwise = fallback_no_bytecode loc mod - - hydrate alt mod = do - Succeeded iface <- ldLoadIface opts (text "makima") mod - case mi_extra_decls iface of - Just extra_decls -> do - details <- initModDetails hsc_env iface - t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] - _ -> alt - - fallback_no_bytecode loc mod = do - mb_lnk <- findObjectLinkableMaybe mod loc - case mb_lnk of - Nothing -> no_obj mod - Just lnk -> adjust_linkable lnk - - hsc_env = ldHscEnv opts - - adjust_linkable lnk - | Just new_osuf <- maybe_normal_osuf = do - new_uls <- mapM (adjust_ul new_osuf) - (linkableUnlinked lnk) - return lnk{ linkableUnlinked=new_uls } - | otherwise = - return lnk - - adjust_ul new_osuf (DotO file) = do - -- file may already has new_osuf suffix. One example - -- is when we load bytecode from whole core bindings, - -- then the corresponding foreign stub objects are - -- compiled as shared objects and file may already has - -- .dyn_o suffix. And it's okay as long as the file to - -- load is already there. - let new_file = file -<.> new_osuf - ok <- doesFileExist new_file - if (not ok) - then dieWith opts span $ - text "cannot find object file " - <> quotes (text new_file) $$ while_linking_expr - else return (DotO new_file) - adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) - adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) - adjust_ul _ l@(BCOs {}) = return l - adjust_ul _ l at LoadedBCOs{} = return l - adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + adjust_linkable lnk + | Just new_osuf <- maybe_normal_osuf = do + new_uls <- mapM (adjust_ul new_osuf) + (linkableUnlinked lnk) + return lnk{ linkableUnlinked=new_uls } + | otherwise = + return lnk + + adjust_ul new_osuf (DotO file) = do + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf + ok <- doesFileExist new_file + if (not ok) + then dieWith opts span $ + text "cannot find object file " + <> quotes (text new_file) $$ while_linking_expr + else return (DotO new_file) + adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) + adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) + adjust_ul _ l@(BCOs {}) = return l + adjust_ul _ l at LoadedBCOs{} = return l + adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + +data LinkObjectModule = + LinkHomeModule HomeModInfo + | + LinkObjectModule ModIface ModLocation + | + LinkByteCodeModule ModIface WholeCoreBindings + +instance Outputable LinkObjectModule where + ppr = \case + LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") + LinkObjectModule iface _ -> ppr (mi_module iface) + LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") + +data LinkDep = + LinkModules (UniqDFM ModuleName LinkObjectModule) + | + LinkLibrary UnitId + +instance Outputable LinkDep where + ppr = \case + LinkModules mods -> text "link modules:" <+> ppr mods + LinkLibrary uid -> text "link library:" <+> ppr uid + +-- This code is used in one-shot mode to traverse downwards through the HPT +-- to find all link dependencies. +-- The ModIface contains the transitive closure of the module dependencies +-- within the current package, *except* for boot modules: if we encounter +-- a boot module, we have to find its real interface and discover the +-- dependencies of that. Hence we need to traverse the dependency +-- tree recursively. See bug #936, testcase ghci/prog007. +oneshot_deps :: + LinkDepsOpts -> + -- | Modules whose imports to follow + [Module] -> + IO [LinkDep] +oneshot_deps opts mods = + eltsUDFM <$> oneshot_deps_loop opts [GWIB m NotBoot | m <- mods] emptyUDFM + +oneshot_deps_loop :: + LinkDepsOpts -> + [ModuleWithIsBoot] -> + UniqDFM UnitId LinkDep -> + IO (UniqDFM UnitId LinkDep) +oneshot_deps_loop _ [] acc = + pure acc +oneshot_deps_loop opts (GWIB mod is_boot : mods) acc = do + (new_acc, new_mods) <- process_module + oneshot_deps_loop opts (new_mods ++ mods) new_acc + where + process_module + | already_seen + = pure (acc, []) + | is_home || oe_bytecode + = try_add_module + | otherwise + = add_library + + already_seen + | Just (LinkModules mods) <- mod_dep + = elemUDFM mod_name mods + | Just (LinkLibrary _) <- mod_dep + = True + | otherwise + = False + + try_add_module = do + -- TODO use finder as well here to get ModLocation right away + ldLoadIface opts load_reason mod >>= \case + Failed err + -- Interfaces can be missing, e.g. from ghc-prim + -- TODO ??? + | not is_home + , oe_bytecode + -> do + add_library + | otherwise + -> throwProgramError opts $ + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + Succeeded iface + | mi_boot iface == IsBoot + -> throwProgramError opts $ link_boot_mod_error mod + | oe_bytecode + , Just core_bindings <- mi_extra_decls iface + -> pure (add_bytecode iface (WholeCoreBindings core_bindings mod undefined)) + | is_home + , Just home <- oe_home + -> do + let fc = ldFinderCache opts + fopts = ldFinderOpts opts + findHomeModule fc fopts home (moduleName mod) >>= \case + Found loc _ -> do + pure (add_home_module iface loc) + _ -> + throwProgramError opts $ + text "No home module for matching unit in module" <+> ppr mod + | otherwise + -> add_library + + add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) + + add_bytecode iface core_bindings = add_module iface (LinkByteCodeModule iface core_bindings) + + add_home_module iface loc = add_module iface (LinkObjectModule iface loc) + + add_module iface lmod = (new_acc lmod, new_deps iface) + + new_acc iface + | IsBoot <- is_boot + = acc + | otherwise + = alterUDFM (add_package_module iface) acc mod_unit_id + + add_package_module lmod = \case + Just (LinkLibrary u) -> Just (LinkLibrary u) + Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) + Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + + new_deps iface + | oe_bytecode + = [GWIB usg_mod NotBoot | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | Just _ <- oe_home + = local + | otherwise + = [] + where + local = [GWIB (mkModule mod_unit n) b | (_, GWIB n b) <- Set.toList (dep_direct_mods (mi_deps iface))] + + is_home + | Just home <- oe_home + = homeUnitAsUnit home == mod_unit + | otherwise + = False + + mod_dep = lookupUDFM acc mod_unit_id + mod_name = moduleName mod + mod_unit_id = moduleUnitId mod + mod_unit = moduleUnit mod + load_reason = + text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + oe_bytecode = ldUseByteCode opts + oe_home = ue_homeUnit (ldUnitEnv opts) + +link_boot_mod_error :: Module -> SDoc +link_boot_mod_error mod = + text "module" <+> ppr mod <+> + text "cannot be linked; it is only available as a boot module" {- Note [Using Byte Code rather than Object Code for Template Haskell] ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -2,7 +2,8 @@ TOP=../../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -ARGS := $(TEST_HC_OPTS) -package-db db -fprefer-byte-code -fbyte-code-and-object-code -package dep -v0 +BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -v0 +ARGS := $(BASIC) -fprefer-byte-code -fbyte-code-and-object-code .PHONY: CrossPackageArchive CrossPackageArchive: @@ -18,3 +19,8 @@ CrossPackageEmptyArchive: CrossPackageNoArchive: ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageArchiveObjCode +CrossPackageArchiveObjCode: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(BASIC)" ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -13,6 +13,7 @@ def cross_test(suf): 'prep.bash', 'run.bash', ]), + use_specs({'stdout': 'CrossPackage.stdout'}), ], makefile_test, [name], @@ -21,3 +22,4 @@ def cross_test(suf): cross_test('Archive') cross_test('EmptyArchive') cross_test('NoArchive') +cross_test('ArchiveObjCode') View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7515bde803aeb90876904082b976d6cdae67a03e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7515bde803aeb90876904082b976d6cdae67a03e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 19:04:11 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 08 Jul 2024 15:04:11 -0400 Subject: [Git][ghc/ghc][master] 2 commits: AArch64: Simplify stmtToInstrs type Message-ID: <668c382bca5d1_3c535f26fac001347a3@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 1 changed file: - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -51,7 +51,6 @@ import GHC.Data.OrdList import GHC.Utils.Outputable import Control.Monad ( mapAndUnzipM, foldM ) -import Data.Maybe import GHC.Float import GHC.Types.Basic @@ -149,8 +148,8 @@ basicBlockCodeGen block = do let line = srcSpanStartLine span; col = srcSpanStartCol span return $ unitOL $ LOCATION fileId line col (unpackFS name) _ -> return nilOL - (mid_instrs,mid_bid) <- stmtsToInstrs id stmts - (!tail_instrs,_) <- stmtToInstrs mid_bid tail + mid_instrs <- stmtsToInstrs stmts + (!tail_instrs) <- stmtToInstrs tail let instrs = header_comment_instr `appOL` loc_instrs `appOL` mid_instrs `appOL` tail_instrs -- TODO: Then x86 backend run @verifyBasicBlock@ here and inserts -- unwinding info. See Ticket 19913 @@ -252,38 +251,27 @@ generateJumpTableForInstr _ _ = Nothing -- ----------------------------------------------------------------------------- -- Top-level of the instruction selector --- See Note [Keeping track of the current block] for why --- we pass the BlockId. -stmtsToInstrs :: BlockId -- ^ Basic block these statement will start to be placed in. - -> [CmmNode O O] -- ^ Cmm Statement - -> NatM (InstrBlock, BlockId) -- ^ Resulting instruction -stmtsToInstrs bid stmts = - go bid stmts nilOL +stmtsToInstrs :: [CmmNode O O] -- ^ Cmm Statements + -> NatM InstrBlock -- ^ Resulting instructions +stmtsToInstrs stmts = + go stmts nilOL where - go bid [] instrs = return (instrs,bid) - go bid (s:stmts) instrs = do - (instrs',bid') <- stmtToInstrs bid s - -- If the statement introduced a new block, we use that one - let !newBid = fromMaybe bid bid' - go newBid stmts (instrs `appOL` instrs') - --- | `bid` refers to the current block and is used to update the CFG --- if new blocks are inserted in the control flow. --- See Note [Keeping track of the current block] for more details. -stmtToInstrs :: BlockId -- ^ Basic block this statement will start to be placed in. - -> CmmNode e x - -> NatM (InstrBlock, Maybe BlockId) - -- ^ Instructions, and bid of new block if successive - -- statements are placed in a different basic block. -stmtToInstrs bid stmt = do + go [] instrs = return instrs + go (s:stmts) instrs = do + instrs' <- stmtToInstrs s + go stmts (instrs `appOL` instrs') + +stmtToInstrs :: CmmNode e x -- ^ Cmm Statement + -> NatM InstrBlock -- ^ Resulting Instructions +stmtToInstrs stmt = do -- traceM $ "-- -------------------------- stmtToInstrs -------------------------- --\n" -- ++ showSDocUnsafe (ppr stmt) platform <- getPlatform case stmt of CmmUnsafeForeignCall target result_regs args - -> genCCall target result_regs args bid + -> genCCall target result_regs args - _ -> (,Nothing) <$> case stmt of + _ -> case stmt of CmmComment s -> return (unitOL (COMMENT (ftext s))) CmmTick {} -> return nilOL @@ -304,7 +292,7 @@ stmtToInstrs bid stmt = do --We try to arrange blocks such that the likely branch is the fallthrough --in GHC.Cmm.ContFlowOpt. So we can assume the condition is likely false here. CmmCondBranch arg true false _prediction -> - genCondBranch bid true false arg + genCondBranch true false arg CmmSwitch arg ids -> genSwitch arg ids @@ -1456,14 +1444,12 @@ genCondFarJump cond far_target = do , B far_target , NEWBLOCK skip_lbl_id] -genCondBranch - :: BlockId -- the source of the jump - -> BlockId -- the true branch target +genCondBranch :: BlockId -- the true branch target -> BlockId -- the false branch target -> CmmExpr -- the condition on which to branch -> NatM InstrBlock -- Instructions -genCondBranch _ true false expr = do +genCondBranch true false expr = do b1 <- genCondJump true expr b2 <- genBranch false return (b1 `appOL` b2) @@ -1549,11 +1535,10 @@ genCCall :: ForeignTarget -- function to call -> [CmmFormal] -- where to put the result -> [CmmActual] -- arguments (of mixed type) - -> BlockId -- The block we are in - -> NatM (InstrBlock, Maybe BlockId) + -> NatM InstrBlock -- TODO: Specialize where we can. -- Generic impl -genCCall target dest_regs arg_regs bid = do +genCCall target dest_regs arg_regs = do -- we want to pass arg_regs into allArgRegs -- pprTraceM "genCCall target" (ppr target) -- pprTraceM "genCCall formal" (ppr dest_regs) @@ -1617,7 +1602,7 @@ genCCall target dest_regs arg_regs bid = do `appOL` (unitOL $ BL call_target passRegs) -- branch and link. `appOL` readResultsCode -- parse the results into registers `appOL` moveStackUp (stackSpace `div` 8) - return (code, Nothing) + return code PrimTarget MO_F32_Fabs | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> @@ -1642,7 +1627,7 @@ genCCall target dest_regs arg_regs bid = do let lo = getRegisterReg platform (CmmLocal dst_lo) hi = getRegisterReg platform (CmmLocal dst_hi) nd = getRegisterReg platform (CmmLocal dst_needed) - return ( + return $ code_x `appOL` code_y `snocOL` MUL (OpReg W64 lo) (OpReg W64 reg_a) (OpReg W64 reg_b) `snocOL` @@ -1651,7 +1636,6 @@ genCCall target dest_regs arg_regs bid = do -- nd = (hi == ASR(lo,width-1)) ? 1 : 0 CMP (OpReg W64 hi) (OpRegShift W64 lo SASR (widthInBits w - 1)) `snocOL` CSET (OpReg W64 nd) NE - , Nothing) -- For sizes < platform width, we can just perform a multiply and shift -- using the normal 64 bit multiply. Calculating the dst_needed value is -- complicated a little by the need to be careful when truncation happens. @@ -1674,7 +1658,7 @@ genCCall target dest_regs arg_regs bid = do (reg_a, code_a') <- signExtendReg w w' reg_a' (reg_b, code_b') <- signExtendReg w w' reg_b' - return ( + return $ code_a `appOL` code_b `appOL` code_a' `appOL` @@ -1704,7 +1688,6 @@ genCCall target dest_regs arg_regs bid = do CSET (OpReg w' nd) EQ `appOL` -- Finally truncate hi to drop any extraneous sign bits. truncateReg w' w hi - , Nothing) -- Can't handle > 64 bit operands | otherwise -> unsupported (MO_S_Mul2 w) PrimTarget (MO_U_Mul2 w) @@ -1724,7 +1707,7 @@ genCCall target dest_regs arg_regs bid = do code_y `snocOL` MUL (OpReg W64 lo) (OpReg W64 reg_a) (OpReg W64 reg_b) `snocOL` UMULH (OpReg W64 hi) (OpReg W64 reg_a) (OpReg W64 reg_b) - , Nothing) + ) -- For sizes < platform width, we can just perform a multiply and shift -- Need to be careful to truncate the low half, but the upper half should be -- be ok if the invariant in [Signed arithmetic on AArch64] is maintained. @@ -1755,7 +1738,7 @@ genCCall target dest_regs arg_regs bid = do (OpImm (ImmInt $ widthInBits w)) -- width to extract `appOL` truncateReg W64 w lo - , Nothing) + ) | otherwise -> unsupported (MO_U_Mul2 w) PrimTarget (MO_Clz w) | w == W64 || w == W32 @@ -1767,7 +1750,7 @@ genCCall target dest_regs arg_regs bid = do return ( code_x `snocOL` CLZ (OpReg w dst_reg) (OpReg w reg_a) - , Nothing) + ) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1783,7 +1766,7 @@ genCCall target dest_regs arg_regs bid = do , ORR (r dst') (r dst') (imm 0x00008000) , CLZ (r dst') (r dst') ] - , Nothing) + ) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1793,13 +1776,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(x << 24 | 0x0080_0000) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 24) , ORR (r dst') (r dst') (imm 0x00800000) , CLZ (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_Clz w) PrimTarget (MO_Ctz w) | w == W64 || w == W32 @@ -1808,11 +1790,10 @@ genCCall target dest_regs arg_regs bid = do -> do (reg_a, _format_x, code_x) <- getSomeReg src let dst_reg = getRegisterReg platform (CmmLocal dst) - return ( + return $ code_x `snocOL` RBIT (OpReg w dst_reg) (OpReg w reg_a) `snocOL` CLZ (OpReg w dst_reg) (OpReg w dst_reg) - , Nothing) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1822,13 +1803,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(reverseBits(x) | 0x0000_8000) -} - return ( + return $ code_x `appOL` toOL [ RBIT (r dst') (r reg_a) , ORR (r dst') (r dst') (imm 0x00008000) , CLZ (r dst') (r dst') ] - , Nothing) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1838,13 +1818,12 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = clz(reverseBits(x) | 0x0080_0000) -} - return ( + return $ code_x `appOL` toOL [ RBIT (r dst') (r reg_a) , ORR (r dst') (r dst') (imm 0x00800000) , CLZ (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_Ctz w) PrimTarget (MO_BRev w) | w == W64 || w == W32 @@ -1853,10 +1832,9 @@ genCCall target dest_regs arg_regs bid = do -> do (reg_a, _format_x, code_x) <- getSomeReg src let dst_reg = getRegisterReg platform (CmmLocal dst) - return ( + return $ code_x `snocOL` RBIT (OpReg w dst_reg) (OpReg w reg_a) - , Nothing) | w == W16 , [src] <- arg_regs , [dst] <- dest_regs @@ -1866,12 +1844,11 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = reverseBits32(x << 16) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 16) , RBIT (r dst') (r dst') ] - , Nothing) | w == W8 , [src] <- arg_regs , [dst] <- dest_regs @@ -1881,12 +1858,11 @@ genCCall target dest_regs arg_regs bid = do r n = OpReg W32 n imm n = OpImm (ImmInt n) {- dst = reverseBits32(x << 24) -} - return ( + return $ code_x `appOL` toOL [ LSL (r dst') (r reg_a) (imm 24) , RBIT (r dst') (r dst') ] - , Nothing) | otherwise -> unsupported (MO_BRev w) @@ -1989,12 +1965,12 @@ genCCall target dest_regs arg_regs bid = do MO_SubIntC _w -> unsupported mop -- Memory Ordering - MO_AcquireFence -> return (unitOL DMBISH, Nothing) - MO_ReleaseFence -> return (unitOL DMBISH, Nothing) - MO_SeqCstFence -> return (unitOL DMBISH, Nothing) - MO_Touch -> return (nilOL, Nothing) -- Keep variables live (when using interior pointers) + MO_AcquireFence -> return (unitOL DMBISH) + MO_ReleaseFence -> return (unitOL DMBISH) + MO_SeqCstFence -> return (unitOL DMBISH) + MO_Touch -> return nilOL -- Keep variables live (when using interior pointers) -- Prefetch - MO_Prefetch_Data _n -> return (nilOL, Nothing) -- Prefetch hint. + MO_Prefetch_Data _n -> return nilOL -- Prefetch hint. -- Memory copy/set/move/cmp, with alignment for optimization @@ -2029,7 +2005,7 @@ genCCall target dest_regs arg_regs bid = do code = code_p `snocOL` instr (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p) - return (code, Nothing) + return code | otherwise -> panic "mal-formed AtomicRead" MO_AtomicWrite w ord | [p_reg, val_reg] <- arg_regs -> do @@ -2042,7 +2018,7 @@ genCCall target dest_regs arg_regs bid = do code_p `appOL` code_val `snocOL` instr fmt_val (OpReg w val) (OpAddr $ AddrReg p) - return (code, Nothing) + return code | otherwise -> panic "mal-formed AtomicWrite" MO_AtomicRMW w amop -> mkCCall (atomicRMWLabel w amop) MO_Cmpxchg w -> mkCCall (cmpxchgLabel w) @@ -2055,13 +2031,13 @@ genCCall target dest_regs arg_regs bid = do unsupported :: Show a => a -> b unsupported mop = panic ("outOfLineCmmOp: " ++ show mop ++ " not supported here") - mkCCall :: FastString -> NatM (InstrBlock, Maybe BlockId) + mkCCall :: FastString -> NatM InstrBlock mkCCall name = do config <- getConfig target <- cmmMakeDynamicReference config CallReference $ mkForeignLabel name ForeignLabelInThisPackage IsFunction let cconv = ForeignConvention CCallConv [NoHint] [NoHint] CmmMayReturn - genCCall (ForeignTarget target cconv) dest_regs arg_regs bid + genCCall (ForeignTarget target cconv) dest_regs arg_regs -- TODO: Optimize using paired stores and loads (STP, LDP). It is -- automatically done by the allocator for us. However it's not optimal, @@ -2227,7 +2203,7 @@ genCCall target dest_regs arg_regs bid = do (reg_fx, _format_x, code_fx) <- getFloatReg arg_reg let dst = getRegisterReg platform (CmmLocal dest_reg) let code = code_fx `appOL` op (OpReg w dst) (OpReg w reg_fx) - return (code, Nothing) + return code {- Note [AArch64 far jumps] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5b1aefb70edbd54ac899896df39d8f3d6c579518...71a7fa8cc4327f7d220c5e006a2413e6648b9cd8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5b1aefb70edbd54ac899896df39d8f3d6c579518...71a7fa8cc4327f7d220c5e006a2413e6648b9cd8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 19:04:47 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 08 Jul 2024 15:04:47 -0400 Subject: [Git][ghc/ghc][master] Fix eta-expansion in Prep Message-ID: <668c384f4e4fa_3c535f29ec4e013814c@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 3 changed files: - compiler/GHC/CoreToStg/Prep.hs - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T Changes: ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -1611,7 +1611,7 @@ cpeArgArity env float_decision floats1 arg -- See wrinkle (EA2) in Note [Eta expansion of arguments in CorePrep] | Just ao <- cp_arityOpts (cpe_config env) -- Just <=> -O1 or -O2 - , not (has_join_in_tail_context arg) + , not (eta_would_wreck_join arg) -- See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] = case exprEtaExpandArity ao arg of Nothing -> 0 @@ -1620,15 +1620,15 @@ cpeArgArity env float_decision floats1 arg | otherwise = exprArity arg -- this is cheap enough for -O0 -has_join_in_tail_context :: CoreExpr -> Bool +eta_would_wreck_join :: CoreExpr -> Bool -- ^ Identify the cases where we'd generate invalid `CpeApp`s as described in -- Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] -has_join_in_tail_context (Let bs e) = isJoinBind bs || has_join_in_tail_context e -has_join_in_tail_context (Lam b e) | isTyVar b = has_join_in_tail_context e -has_join_in_tail_context (Cast e _) = has_join_in_tail_context e -has_join_in_tail_context (Tick _ e) = has_join_in_tail_context e -has_join_in_tail_context (Case _ _ _ alts) = any has_join_in_tail_context (rhssOfAlts alts) -has_join_in_tail_context _ = False +eta_would_wreck_join (Let bs e) = isJoinBind bs || eta_would_wreck_join e +eta_would_wreck_join (Lam _ e) = eta_would_wreck_join e +eta_would_wreck_join (Cast e _) = eta_would_wreck_join e +eta_would_wreck_join (Tick _ e) = eta_would_wreck_join e +eta_would_wreck_join (Case _ _ _ alts) = any eta_would_wreck_join (rhssOfAlts alts) +eta_would_wreck_join _ = False maybeSaturate :: Id -> CpeApp -> Int -> [CoreTickish] -> UniqSM CpeRhs maybeSaturate fn expr n_args unsat_ticks @@ -1761,7 +1761,8 @@ There is a nasty Wrinkle: (EA1) When eta expanding an argument headed by a join point, we might get "crap", as Note [Eta expansion for join points] in GHC.Core.Opt.Arity puts - it. + it. This crap means the output does not conform to the syntax in + Note [CorePrep invariants], which then makes later passes crash (#25033). Consider f (join j x = rhs in ...(j 1)...(j 2)...) @@ -1776,15 +1777,22 @@ There is a nasty Wrinkle: In our case, (join j x = rhs in ...(j 1)...(j 2)...) is not a valid `CpeApp` (see Note [CorePrep invariants]) and we'd get a crash in the App case of `coreToStgExpr`. - Hence we simply check for the cases where an intervening join point - binding in the tail context of the argument would lead to the introduction - of such crap via `has_join_in_tail_context`, in which case we abstain from - eta expansion. + + Hence, in `eta_would_wreck_join`, we check for the cases where an + intervening join point binding in the tail context of the argument would + make eta-expansion break Note [CorePrep invariants], in which + case we abstain from eta expansion. This scenario occurs rarely; hence it's OK to generate sub-optimal code. The alternative would be to fix Note [Eta expansion for join points], but that's quite challenging due to unfoldings of (recursive) join points. + `eta_would_wreck_join` sees if there are any join points, like `j` above + that would be messed up. It must look inside lambdas (#25033); consider + f (\x. join j y = ... in ...(j 1)...(j 3)...) + We can't eta expand that `\x` any more than we could if the join was at + the top. (And when there's a lambda, we don't have a thunk anyway.) + (EA2) In cpeArgArity, if float_decision=FloatNone the `arg` will look like let in rhs where is non-empty and can't be floated out of a lazy context (see ===================================== testsuite/tests/simplCore/should_compile/T25033.hs ===================================== @@ -0,0 +1,18 @@ +{-# OPTIONS_GHC -fno-do-lambda-eta-expansion #-} +-- It's hard to trigger #25033, because the Simplier eta-expands +-- lambdas. So I switched off that Simplifier ability, and thereby +-- triggered the bug on this nice small example. + +module T25033 where + +{-# NOINLINE woo #-} +woo x = x + +foo v = woo (\xs -> let + j ys = \ws -> xs ++ (reverse . reverse . reverse . reverse . + reverse . reverse . reverse . reverse) ws + in + case v of + "a" -> j "wim" + _ -> j "wam" + ) ===================================== testsuite/tests/simplCore/should_compile/all.T ===================================== @@ -527,3 +527,4 @@ test('T24808', [ grep_errmsg(r'myFunction') ], compile, ['-O -ddump-simpl']) test('T24944', [extra_files(['T24944a.hs'])], multimod_compile, ['T24944', '-v0 -O2']) test('T24725a', [ grep_errmsg(r'testedRule')], compile, ['-O -ddump-rule-firings']) +test('T25033', normal, compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8bf6fd68001bc1dabdd974506fc735e22e8257a9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8bf6fd68001bc1dabdd974506fc735e22e8257a9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 19:35:56 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 08 Jul 2024 15:35:56 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: AArch64: Simplify stmtToInstrs type Message-ID: <668c3f9c2ee44_3c535f2f0ee3c1396d9@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 9ce885d1 by Sjoerd Visscher at 2024-07-08T15:35:39-04:00 One-shot Haddock - - - - - c38c3775 by Sjoerd Visscher at 2024-07-08T15:35:39-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - 8ad0dceb by Rodrigo Mesquita at 2024-07-08T15:35:42-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 13fca62b by Matthew Pickering at 2024-07-08T15:35:49-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - 3fe85d8f by Andrea Bedini at 2024-07-08T15:35:49-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - a888e741 by Matthew Pickering at 2024-07-08T15:35:50-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - libraries/ghc-boot/ghc-boot.cabal.in - testsuite/config/ghc - testsuite/tests/haddock/haddock_testsuite/Makefile - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T - utils/haddock/.gitignore - utils/haddock/CHANGES.md - utils/haddock/doc/invoking.rst - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/Options.hs - utils/haddock/haddock-test/src/Test/Haddock.hs - utils/haddock/haddock-test/src/Test/Haddock/Config.hs - utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs - utils/haddock/hoogle-test/Main.hs - utils/haddock/html-test/Main.hs - utils/haddock/html-test/ref/Bug1004.html - utils/haddock/html-test/ref/Bug310.html - utils/haddock/html-test/ref/Bug548.html - utils/haddock/html-test/ref/BundledPatterns.html The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5cc08d8d280fea12e52c0cefd3cf2d93f6bfd6e1...a888e741336e68a8bf3231300ee9addeb71f8f6b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5cc08d8d280fea12e52c0cefd3cf2d93f6bfd6e1...a888e741336e68a8bf3231300ee9addeb71f8f6b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 19:50:26 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 08 Jul 2024 15:50:26 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 5 commits: AArch64: Simplify stmtToInstrs type Message-ID: <668c4301ebb7f_3c535f32111981478ba@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96628d99 by Apoorv Ingle at 2024-07-08T14:33:18-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 1d4ed0c9 by Apoorv Ingle at 2024-07-08T14:33:18-05:00 simplify splitHsApps - - - - - 30 changed files: - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4dbb7a0bd32852596acae8080ada5c8448d4c480...1d4ed0c9f2f3d3a53f2a7fc4b61f4b51ecdffa25 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4dbb7a0bd32852596acae8080ada5c8448d4c480...1d4ed0c9f2f3d3a53f2a7fc4b61f4b51ecdffa25 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 21:30:32 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 08 Jul 2024 17:30:32 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] more refactoring Message-ID: <668c5a7848cfb_3c535f3fc95881640a8@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: f5b6dfcb by Torsten Schmits at 2024-07-08T23:29:37+02:00 more refactoring - - - - - 11 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/th/cross-package/Cross.hs - testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - testsuite/tests/th/cross-package/Makefile - testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/obj.conf - testsuite/tests/th/cross-package/prep.bash - testsuite/tests/th/cross-package/run.bash Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -57,6 +57,8 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) data LinkDepsOpts = LinkDepsOpts @@ -67,6 +69,7 @@ data LinkDepsOpts = LinkDepsOpts , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldFinderCache :: !FinderCache -- ^ Finder cache , ldFinderOpts :: !FinderOpts -- ^ Finder options + , ldHugFinderOpts :: !(UnitEnvGraph FinderOpts) , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects , ldMsgOpts :: !(DiagnosticOpts IfaceMessage) -- ^ Options for diagnostics , ldWays :: !Ways -- ^ Enabled ways @@ -287,8 +290,15 @@ data LinkDep = instance Outputable LinkDep where ppr = \case - LinkModules mods -> text "link modules:" <+> ppr mods - LinkLibrary uid -> text "link library:" <+> ppr uid + LinkModules mods -> text "modules:" <+> ppr (eltsUDFM mods) + LinkLibrary uid -> text "library:" <+> ppr uid + +data OneshotError = + NoLocation Module + | + NoInterface MissingInterfaceError + | + LinkBootModule Module -- This code is used in one-shot mode to traverse downwards through the HPT -- to find all link dependencies. @@ -303,26 +313,33 @@ oneshot_deps :: [Module] -> IO [LinkDep] oneshot_deps opts mods = - eltsUDFM <$> oneshot_deps_loop opts [GWIB m NotBoot | m <- mods] emptyUDFM + runExceptT (oneshot_deps_loop opts mods emptyUDFM) >>= \case + Right a -> pure (eltsUDFM a) + Left err -> throwProgramError opts (message err) + where + message = \case + NoLocation mod -> + pprPanic "found iface but no location" (ppr mod) + NoInterface err -> + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + LinkBootModule mod -> + link_boot_mod_error mod oneshot_deps_loop :: LinkDepsOpts -> - [ModuleWithIsBoot] -> + [Module] -> UniqDFM UnitId LinkDep -> - IO (UniqDFM UnitId LinkDep) + ExceptT OneshotError IO (UniqDFM UnitId LinkDep) oneshot_deps_loop _ [] acc = pure acc -oneshot_deps_loop opts (GWIB mod is_boot : mods) acc = do +oneshot_deps_loop opts (mod : mods) acc = do (new_acc, new_mods) <- process_module oneshot_deps_loop opts (new_mods ++ mods) new_acc where process_module - | already_seen - = pure (acc, []) - | is_home || oe_bytecode - = try_add_module - | otherwise - = add_library + | already_seen = pure (acc, []) + | is_home || bytecode = try_iface + | otherwise = add_library already_seen | Just (LinkModules mods) <- mod_dep @@ -332,52 +349,30 @@ oneshot_deps_loop opts (GWIB mod is_boot : mods) acc = do | otherwise = False - try_add_module = do - -- TODO use finder as well here to get ModLocation right away - ldLoadIface opts load_reason mod >>= \case - Failed err - -- Interfaces can be missing, e.g. from ghc-prim - -- TODO ??? - | not is_home - , oe_bytecode - -> do - add_library - | otherwise - -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface - | mi_boot iface == IsBoot - -> throwProgramError opts $ link_boot_mod_error mod - | oe_bytecode - , Just core_bindings <- mi_extra_decls iface - -> pure (add_bytecode iface (WholeCoreBindings core_bindings mod undefined)) - | is_home - , Just home <- oe_home - -> do - let fc = ldFinderCache opts - fopts = ldFinderOpts opts - findHomeModule fc fopts home (moduleName mod) >>= \case - Found loc _ -> do - pure (add_home_module iface loc) - _ -> - throwProgramError opts $ - text "No home module for matching unit in module" <+> ppr mod - | otherwise - -> add_library + try_iface = + liftIO (ldLoadIface opts load_reason mod) >>= \case + Failed err -> throwE (NoInterface err) + Succeeded iface -> + location >>= \case + InstalledFound loc _ -> with_iface loc iface + _ -> throwE (NoLocation mod) + + with_iface loc iface + | mi_boot iface == IsBoot + = throwE (LinkBootModule mod) + | bytecode + , Just core_bindings <- mi_extra_decls iface + , let wcb = WholeCoreBindings core_bindings mod loc + = pure (add_module iface (LinkByteCodeModule iface wcb)) + | is_home + = pure (add_module iface (LinkObjectModule iface loc)) + | otherwise + = add_library add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) - add_bytecode iface core_bindings = add_module iface (LinkByteCodeModule iface core_bindings) - - add_home_module iface loc = add_module iface (LinkObjectModule iface loc) - - add_module iface lmod = (new_acc lmod, new_deps iface) - - new_acc iface - | IsBoot <- is_boot - = acc - | otherwise - = alterUDFM (add_package_module iface) acc mod_unit_id + add_module iface lmod = + (alterUDFM (add_package_module lmod) acc mod_unit_id, new_deps iface) add_package_module lmod = \case Just (LinkLibrary u) -> Just (LinkLibrary u) @@ -385,21 +380,34 @@ oneshot_deps_loop opts (GWIB mod is_boot : mods) acc = do Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) new_deps iface - | oe_bytecode - = [GWIB usg_mod NotBoot | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local - | Just _ <- oe_home + | bytecode + -- TODO How can we better determine the external deps? + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | Just _ <- mb_home = local | otherwise = [] where - local = [GWIB (mkModule mod_unit n) b | (_, GWIB n b) <- Set.toList (dep_direct_mods (mi_deps iface))] + local = + [ + mkModule mod_unit m + -- TODO Somehow this just works, no idea what the deal was in the + -- old code with boot modules. + | (_, GWIB m _) <- Set.toList (dep_direct_mods (mi_deps iface)) + ] is_home - | Just home <- oe_home + | Just home <- mb_home = homeUnitAsUnit home == mod_unit | otherwise = False + location = + liftIO $ + findExactModule (ldFinderCache opts) (ldFinderOpts opts) + (ldHugFinderOpts opts) (hsc_units (ldHscEnv opts)) mb_home + (toUnitId <$> mod) + mod_dep = lookupUDFM acc mod_unit_id mod_name = moduleName mod mod_unit_id = moduleUnitId mod @@ -408,8 +416,8 @@ oneshot_deps_loop opts (GWIB mod is_boot : mods) acc = do text "need to link module" <+> ppr mod <+> text "due to use of Template Haskell" - oe_bytecode = ldUseByteCode opts - oe_home = ue_homeUnit (ldUnitEnv opts) + bytecode = ldUseByteCode opts + mb_home = ue_homeUnit (ldUnitEnv opts) link_boot_mod_error :: Module -> SDoc link_boot_mod_error mod = ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -645,6 +645,7 @@ initLinkDepsOpts hsc_env = opts , ldPprOpts = initSDocContext dflags defaultUserStyle , ldFinderCache = hsc_FC hsc_env , ldFinderOpts = initFinderOpts dflags + , ldHugFinderOpts = initFinderOpts . homeUnitEnv_dflags <$> hsc_HUG hsc_env , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -2,6 +2,7 @@ module Main where +import GHC.Prim import CrossLocal (splc) a :: Int ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -2,13 +2,15 @@ module CrossLocal where +import GHC.Prim import Language.Haskell.TH (ExpQ) import Language.Haskell.TH.Syntax (lift) -- just to be sure that the file isn't accidentally picked up locally import "dep" CrossDepApi (dep, A (A)) -import CrossNum (num) +import {-# source #-} CrossNum (num) +import CrossObj (numo) splc :: ExpQ -splc = lift @_ @Int (num + d) +splc = lift @_ @Int (num + d + numo) where A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs-boot ===================================== @@ -0,0 +1,3 @@ +module CrossNum where + +num :: Int ===================================== testsuite/tests/th/cross-package/CrossObj.hs ===================================== @@ -0,0 +1,4 @@ +module CrossObj where + +numo :: Int +numo = 0 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -2,7 +2,8 @@ TOP=../../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -v0 +# TODO check error without -package obj (especially for ObjCode, it appears to fail at link time) +BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -package obj -v0 ARGS := $(BASIC) -fprefer-byte-code -fbyte-code-and-object-code .PHONY: CrossPackageArchive ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -9,7 +9,10 @@ def cross_test(suf): 'CrossDep.hs', 'CrossDepApi.hs', 'CrossNum.hs', + 'CrossNum.hs-boot', + 'CrossObj.hs', 'dep.conf', + 'obj.conf', 'prep.bash', 'run.bash', ]), ===================================== testsuite/tests/th/cross-package/obj.conf ===================================== @@ -0,0 +1,8 @@ +name: obj +version: 1.0 +id: obj-1.0 +key: obj-1.0 +exposed: True +exposed-modules: CrossObj +import-dirs: ${pkgroot}/obj +library-dirs: ${pkgroot}/obj ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -8,10 +8,11 @@ ghc_pkg_cmd="$3" archive="$4" base="$PWD" -lib="$base/dep" -# TODO see if this can just be stored in pwd. $lib as well db="$base/db" -conf="${lib}/dep.conf" +dep="$base/dep" +conf_dep="${dep}/dep.conf" +obj="$base/obj" +conf_obj="${obj}/obj.conf" ghc_pkg() { @@ -23,22 +24,29 @@ ghc() eval "${ghc_cmd at Q} $ghc_opts $@" } -mkdir -p "$lib" "$db" -mv CrossDep.hs CrossDepApi.hs "$lib/" -cp dep.conf "$lib/" +mkdir -p "$dep" "$obj" "$db" +mv CrossDep.hs CrossDepApi.hs "$dep/" +cp dep.conf "$dep/" +mv CrossObj.hs "$obj/" +cp obj.conf "$obj/" ghc_pkg recache -ghc "-package-db ${db at Q} -hidir ${lib at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${lib at Q}/CrossDep.hs ${lib at Q}/CrossDepApi.hs" +ghc "-package-db ${db at Q} -hidir ${dep at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${dep at Q}/CrossDep.hs ${dep at Q}/CrossDepApi.hs" + +ghc "-package-db ${db at Q} -hidir ${obj at Q} -O0 -this-unit-id obj-1.0 -c ${obj at Q}/CrossObj.hs" +$AR cqs "${obj}/libHSobj-1.0.a" "${obj}/CrossObj.o" +echo 'hs-libraries: HSobj-1.0' >> "$conf_obj" if [[ "$archive" == 1 ]] then - $AR cqs "${lib}/libHSdep-1.0.a" "${lib}/CrossDep.o" "${lib}/CrossDepApi.o" - echo 'hs-libraries: HSdep-1.0' >> "$conf" + $AR cqs "${dep}/libHSdep-1.0.a" "${dep}/CrossDep.o" "${dep}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" elif [[ "$archive" == 2 ]] then - $AR cqs "${lib}/libHSdep-1.0.a" - echo 'hs-libraries: HSdep-1.0' >> "$conf" + $AR cqs "${dep}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" fi -ghc_pkg -v0 register "${conf at Q}" +ghc_pkg -v0 register "${conf_dep at Q}" +ghc_pkg -v0 register "${conf_obj at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -10,7 +10,7 @@ ghc() eval "${ghc_cmd at Q} $ghc_opts $@" } -ghc -c CrossNum.hs CrossLocal.hs +ghc -c CrossNum.hs-boot CrossNum.hs CrossLocal.hs ghc -c Cross.hs ghc Cross.o -o Cross ./Cross View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f5b6dfcb0d18e7331aa09c10700f4e1709eb3551 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f5b6dfcb0d18e7331aa09c10700f4e1709eb3551 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 8 21:51:59 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 08 Jul 2024 17:51:59 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] add direct package deps when not using bytecode Message-ID: <668c5f7fb4379_3c535f42bfee0165864@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: e0f55a78 by Torsten Schmits at 2024-07-08T23:51:43+02:00 add direct package deps when not using bytecode - - - - - 2 changed files: - compiler/GHC/Linker/Deps.hs - testsuite/tests/th/cross-package/Makefile Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -48,6 +48,9 @@ import GHC.Unit.Home import GHC.Data.Maybe import Control.Applicative +import Control.Monad +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) import qualified Data.Set as Set import qualified Data.Map as M @@ -57,8 +60,6 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock -import Control.Monad.IO.Class (MonadIO (liftIO)) -import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) data LinkDepsOpts = LinkDepsOpts @@ -372,13 +373,21 @@ oneshot_deps_loop opts (mod : mods) acc = do add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) add_module iface lmod = - (alterUDFM (add_package_module lmod) acc mod_unit_id, new_deps iface) + (addListToUDFM with_mod (direct_pkgs iface), new_deps iface) + where + with_mod = alterUDFM (add_package_module lmod) acc mod_unit_id add_package_module lmod = \case Just (LinkLibrary u) -> Just (LinkLibrary u) Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + direct_pkgs iface + | bytecode + = [] + | otherwise + = [(u, LinkLibrary u) | u <- Set.toList (dep_direct_pkgs (mi_deps iface))] + new_deps iface | bytecode -- TODO How can we better determine the external deps? ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -2,8 +2,8 @@ TOP=../../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -# TODO check error without -package obj (especially for ObjCode, it appears to fail at link time) -BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -package obj -v0 +# TODO it works even without -package obj, but it should complain about the package not being exposed +BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -v0 ARGS := $(BASIC) -fprefer-byte-code -fbyte-code-and-object-code .PHONY: CrossPackageArchive View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e0f55a7830f35d6fcd32c1612c28241bb231c4f0 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e0f55a7830f35d6fcd32c1612c28241bb231c4f0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 01:00:36 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 08 Jul 2024 21:00:36 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] simplify splitHsApps Message-ID: <668c8bb45008b_3c535f5ca4c8416729f@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 3e71d399 by Apoorv Ingle at 2024-07-08T19:46:43-05:00 simplify splitHsApps - - - - - 6 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -473,15 +473,13 @@ type instance XXExpr GhcTc = XXExprGhcTc * * ********************************************************************* -} --- | Hint to the typechecker how to typecheck the expanded expression -data TCFunInfo = TcApp -- use tcApp to typecheck - | TcExpr -- use tcExpr to typecheck - -- | The different source constructs that we use to instantiate the "original" field --- in an `XXExprGhcRn original expansion` +-- in an `XXExprGhcRn original expansion` (See below) data HsThingRn = OrigExpr (HsExpr GhcRn) | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from - | OrigPat (LPat GhcRn) HsDoFlavour (Maybe (ExprLStmt GhcRn)) + | OrigPat (LPat GhcRn) + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ the statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -494,11 +492,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing - , xrn_TCFunInfo :: TCFunInfo } -- A Hint to the type checker of how to proceed - -- TcApp <=> use GHC.Tc.Gen.Expr.tcApp - -- TcExpr <=> use GHC.Tc.Gen.Expr.tcExpr + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp + -- False <=> use GHC.Tc.Gen.Expr.tcExpr | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -524,30 +522,30 @@ mkExpandedExpr -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr , xrn_expanded = eExpr - , xrn_TCFunInfo = TcExpr }) + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement - -> HsDoFlavour - -> TCFunInfo + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt flav tc_fun eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav , xrn_expanded = eExpr - , xrn_TCFunInfo = tc_fun}) + , xrn_doTcApp = doTcApp}) mkExpandedPatRn :: LPat GhcRn -- ^ source pattern - -> HsDoFlavour + -> HsDoFlavour -- ^ source statement do flavour -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt , xrn_expanded = eExpr - , xrn_TCFunInfo = TcExpr}) + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and @@ -557,14 +555,14 @@ mkExpandedStmtAt -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ the flavour of the statement - -> TCFunInfo -- ^ should type check with tcApp or tcExpr + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt addPop loc oStmt flav tcFun eExpr +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr | addPop - = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav tcFun eExpr) + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) | otherwise - = L loc $ mkExpandedStmt oStmt flav tcFun eExpr + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -858,7 +856,7 @@ instance Outputable HsThingRn where = case thing of OrigExpr x -> ppr_builder ":" x OrigStmt x _ -> ppr_builder ":" x - OrigPat x _ _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -569,7 +569,6 @@ deriving instance Eq (IE GhcTc) -- --------------------------------------------------------------------- deriving instance Data HsThingRn -deriving instance Data TCFunInfo deriving instance Data XXExprGhcRn deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -898,9 +898,6 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of - VACall{} - | XExpr (PopErrCtxt{}) <- arg - -> thing_inside VACall{} | XExpr (ExpandedThingRn o _ _) <- arg , isHsThingRnStmt o || isHsThingRnPat o ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -80,7 +80,7 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = return $ mkExpandedStmtAt addPop loc stmt flav TcExpr body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- @@ -88,7 +88,7 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- return e ~~> return e -- to make T18324 work = do let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtAt addPop loc stmt flav TcExpr expansion + return $ mkExpandedStmtAt addPop loc stmt flav False expansion expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below @@ -97,7 +97,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtAt addPop loc stmt doFlavour TcExpr expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn @@ -113,7 +113,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour TcApp expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) @@ -128,7 +128,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_o let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour TcApp expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts @@ -196,7 +196,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) -- add blocks for failable patterns ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) - -- builds (body <$> e1 <*> e2 ...) + -- builds (((body <$> e1) <*> e2) ...) ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) -- wrap the expanded expression with a `join` if needed @@ -219,7 +219,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) , arg_expr = (L rhs_loc rhs) , is_body_stmt = is_body_stmt }) = - do let xx_expr = mkExpandedStmtAt addPop rhs_loc stmt doFlavour TcExpr rhs + do let xx_expr = mkExpandedStmtAt addPop rhs_loc stmt doFlavour False rhs traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) return ((pat, mb_fail_op) , xx_expr) @@ -269,7 +269,7 @@ mk_failable_expr doFlav mb_stmt lpat@(L loc pat) expr fail_op = (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr _ -> return $ case mb_stmt of Nothing -> genHsLamDoExp doFlav [lpat] expr - Just s -> wrapGenSpan (mkExpandedStmt s doFlav TcExpr + Just s -> wrapGenSpan (mkExpandedStmt s doFlav False (unLoc $ (genHsLamDoExp doFlav [lpat] $ wrapGenSpan (mkPopErrCtxtExpr expr)))) else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,7 +714,7 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e' tc_info) res_ty +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty | OrigStmt ls@(L loc s at LetStmt{}) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ @@ -726,16 +726,21 @@ tcXExpr xe@(ExpandedThingRn o e' tc_info) res_ty } | OrigStmt ls@(L loc s) flav <- o - , TcExpr <- tc_info + , not doTcApp = setSrcSpanA loc $ addStmtCtxt s flav $ mkExpandedStmtTc ls flav <$> tcExpr e' res_ty | OrigStmt ls@(L loc _) flav <- o - , TcApp <- tc_info + , doTcApp = setSrcSpanA loc $ mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 + = setSrcSpanA loc $ + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty + tcXExpr xe res_ty = tcApp (XExpr xe) res_ty {- ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _ _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -326,24 +326,6 @@ splitHsApps e = go e (top_ctxt 0 e) [] -- See Note [Looking through ExpandedThingRn] go (XExpr (ExpandedThingRn o e _)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) _ <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) _ _ <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -1285,6 +1267,7 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L l e)) -> popErrCtxt $ setSrcSpanA l $ addExprCtxt e $ thing_inside XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e71d39916efb633c4a5e5822ce731e8784d3789 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e71d39916efb633c4a5e5822ce731e8784d3789 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 08:06:21 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 09 Jul 2024 04:06:21 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 41 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668cef7dadd5_17a7d633d310c43352@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - c5ca422b by Matthew Pickering at 2024-07-08T18:07:57+01:00 Run on test-abi label - - - - - a4c1d155 by Rodrigo Mesquita at 2024-07-08T18:07:57+01:00 Write a test for object determinism Extend abi_test with object determinism check Standalone run abi test Disable local test on CI - - - - - 8b3a2e02 by Rodrigo Mesquita at 2024-07-08T18:07:57+01:00 Remame uniques straight off stgtocmm, before cmm pipeline WIP Progress Work around LLVM assembler bug! In a really stupid way) Fix ordering of CLabels for IdLabels Local test script tweaks Do uniq renaming before SRTs Revert "Do uniq renaming before SRTs" This reverts commit db38b635d626106e40b3ab18091e0a24046c30c5. Do on CmmGroup Do uniq-renaming pass right at `codeGen` not better Revert "Do uniq-renaming pass right at `codeGen`" This reverts commit 74e9068aaaf736bf815a36bf74a0dde19a074a7a. Reapply "Do uniq renaming before SRTs" This reverts commit 682f89732fc2a95fa011f530c0c6922bf576d229. Try ALSO after SRT Revert "Try ALSO after SRT" This reverts commit c5dd7b426cde768126402aac3f39617ccb99f5c5. Renaming before and after SRTs bc of procs and srts and ... Wait no that was way too slow... cleaner approach, same idea Revert "Reapply "Do uniq renaming before SRTs"" This reverts commit 70ff49b7efc8c1fca46cba6eff630c5d39a99213. Finfixes Add traces Fix bug triggered by static data generated during SRT Wait, that was still there?! StableNmCmp is invalid for internal names... also, rename all Id uniques This fixes a really awful bug. Tweaks - - - - - 07ed3049 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 cmm: Back LabelMap with UDFM Use a deterministic unique map to back the implementation of `LabelMap`. This is necessary towards the goal of object code determinism in #12935. Our intended solution requires renaming uniques in a deterministic order (which will be the order in which they were created), but storing them label map makes us lose this order. Backing it with a UDFM fixes this issue. - - - - - b0cdbd1f by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - 1aba6fe5 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 UniqDSM det uniques + use in Cmm.Info Now for SRTs SRT generation using deterministic uniq supply Back LabelMap with deterministic UDFM TSAN uniq rename hard Revert "TSAN uniq rename hard" This reverts commit 7ca5ab3036c15f38c6d4cbcb616d415958c6bcda. improvements to uniqdsm UniqDSM ProcPoint CmmLayoutStack UniqDet 90% of cpsTop UniqDSM Major progress in using UniqDSM in CmmToAsm and Ncg backends Fix imports Un-back label map with udfm Revert "Un-back label map with udfm" This reverts commit f5d2e4257214a3f7b7d845651e6662c5babfd6a3. - - - - - 66c3ed80 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 Tweaks - - - - - 142be466 by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 Make UDSM oneshot deriving via state - - - - - b4f2203b by Rodrigo Mesquita at 2024-07-08T18:07:58+01:00 Put deterministic renaming behind a flag - - - - - d734bd30 by Rodrigo Mesquita at 2024-07-08T18:07:59+01:00 Introduce back LabelMap non deterministic - - - - - 54981338 by Rodrigo Mesquita at 2024-07-08T18:07:59+01:00 Use NonDeterministic Label map in multiple passes (TODO: More could be available. Look through Det LabelMap uses again) - - - - - 4ee04e81 by Rodrigo Mesquita at 2024-07-09T09:04:37+01:00 Drop dumps - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - + compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Switch.hs - compiler/GHC/Cmm/Switch/Implement.hs - + compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/Dwarf.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a2a3d808d66c8b57af35edd07886bfab9b0827e...4ee04e81629ef950d7b9a315fa68119f7ce89024 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8a2a3d808d66c8b57af35edd07886bfab9b0827e...4ee04e81629ef950d7b9a315fa68119f7ce89024 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 09:04:17 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 09 Jul 2024 05:04:17 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] testsuite: Make find_so regex more precise Message-ID: <668cfd1127e3_17a7d63c095ec63279@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: 625f5118 by Matthew Pickering at 2024-07-09T10:02:48+01:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 1 changed file: - testsuite/driver/testlib.py Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -727,7 +727,7 @@ def _find_so(lib, directory, in_place): # "\w+" matches the hash on release builds or "inplace", such as 765d in the example # "ghc\S+" matches the ghc build name: ghc9.11.20240508 if in_place: - to_match = r'libHS{}-\d+(\.\d+)+-\w+-ghc\S+\.' + suffix + to_match = r'libHS{}-\d+(\.\d+)+-[a-z0-9]+-ghc\S+\.' + suffix else: to_match = r'libHS{}-\d+(\.\d+)+-ghc\S+\.' + suffix View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/625f5118725aa22d104235ffef696d92e62411e5 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/625f5118725aa22d104235ffef696d92e62411e5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 09:35:28 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 09 Jul 2024 05:35:28 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 5 commits: Put deterministic renaming behind a flag Message-ID: <668d0460c1cb5_17a7d641486fc70767@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 4be44d3f by Rodrigo Mesquita at 2024-07-09T10:35:12+01:00 Put deterministic renaming behind a flag - - - - - 708f7546 by Rodrigo Mesquita at 2024-07-09T10:35:12+01:00 Introduce back LabelMap non deterministic - - - - - 227b5f4f by Rodrigo Mesquita at 2024-07-09T10:35:12+01:00 Use NonDeterministic Label map in multiple passes (TODO: More could be available. Look through Det LabelMap uses again) - - - - - 02f380c0 by Rodrigo Mesquita at 2024-07-09T10:35:12+01:00 Drop dumps - - - - - 315f05c0 by Rodrigo Mesquita at 2024-07-09T10:35:12+01:00 Make FactBase deterministic again - - - - - 30 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - + compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/Driver/Config/StgToCmm.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Config.hs - compiler/GHC/StgToCmm/Heap.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ee04e81629ef950d7b9a315fa68119f7ce89024...315f05c001f41cf27b75870aa60d55f15a725421 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4ee04e81629ef950d7b9a315fa68119f7ce89024...315f05c001f41cf27b75870aa60d55f15a725421 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 09:47:20 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 09 Jul 2024 05:47:20 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Undo a bit more NonDet LblMap Message-ID: <668d07285cb8f_17a7d64357e70733d0@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: f526e1ae by Rodrigo Mesquita at 2024-07-09T10:47:09+01:00 Undo a bit more NonDet LblMap - - - - - 2 changed files: - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Info/Build.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -73,7 +73,6 @@ module GHC.Cmm.Dataflow.Label.NonDet , nonDetMapFoldMapWithKey , nonDetMapKeys , nonDetMapToList - , fromDetMap ) where import GHC.Prelude @@ -92,7 +91,6 @@ import qualified GHC.Data.Word64Map.Strict as M import Data.List (foldl1') import GHC.Cmm.Dataflow.Label (Label(..), mkHooplLabel) -import qualified GHC.Cmm.Dataflow.Label as Det ----------------------------------------------------------------------------- -- LabelSet @@ -268,9 +266,6 @@ nonDetMapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) nonDetMapToList :: LabelMap b -> [(Label, b)] nonDetMapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] -fromDetMap :: Det.LabelMap a -> LabelMap a -fromDetMap = mapFromList . Det.mapToList - ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -27,7 +27,6 @@ import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label -import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module import GHC.Data.Graph.Directed @@ -537,7 +536,7 @@ newtype CAFfyLabel = CAFfyLabel CLabel deriving newtype instance OutputableP env CLabel => OutputableP env CAFfyLabel type CAFSet = Set CAFfyLabel -type CAFEnv = NonDet.LabelMap CAFSet +type CAFEnv = LabelMap CAFSet -- | Records the CAFfy references of a set of static data decls. type DataCAFEnv = Map CLabel CAFSet @@ -603,10 +602,8 @@ cafAnal -> CmmGraph -> CAFEnv cafAnal platform contLbls topLbl cmmGraph = - -- ToDo: Is this worth it, or does it shadow the cost of deterministic mapUnion? - NonDet.fromDetMap $ - analyzeCmmBwd cafLattice - (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty + analyzeCmmBwd cafLattice + (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty cafLattice :: DataflowLattice CAFSet @@ -782,7 +779,7 @@ depAnalSRTs platform cafEnv cafEnv_static decls = | (l, lbl) <- labelledBlocks , Just (cafs :: Set CAFfyLabel) <- [case l of - BlockLabel l -> NonDet.mapLookup l cafEnv + BlockLabel l -> mapLookup l cafEnv DeclLabel cl -> Map.lookup cl cafEnv_static] , let cafs' = Set.delete lbl cafs ] @@ -817,7 +814,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep - , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv + , Just cafs <- mapLookup (g_entry g) cafEnv = Just (Just (g_entry g), mkCAFfyLabel platform top_lbl, cafs) | otherwise @@ -910,7 +907,7 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do CmmStaticsRaw lbl _ -> (lbl, set) (proc_envs, procss) = unzip procs - cafEnv = NonDet.mapUnions proc_envs + cafEnv = mapUnions proc_envs -- ToDo: May be more expensive now with LabelMap decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss staticFuns = mapFromList (getStaticFuns decls) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f526e1aee078712a5ae611d73fe90afa5e5095cb -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f526e1aee078712a5ae611d73fe90afa5e5095cb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:16:53 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 06:16:53 -0400 Subject: [Git][ghc/ghc][master] 2 commits: One-shot Haddock Message-ID: <668d0e153f3c4_12557741e54c4243d@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - 25 changed files: - testsuite/tests/haddock/haddock_testsuite/Makefile - utils/haddock/.gitignore - utils/haddock/CHANGES.md - utils/haddock/doc/invoking.rst - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/Options.hs - utils/haddock/haddock-test/src/Test/Haddock.hs - utils/haddock/haddock-test/src/Test/Haddock/Config.hs - utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs - utils/haddock/hoogle-test/Main.hs - utils/haddock/html-test/Main.hs - utils/haddock/html-test/ref/Bug1004.html - utils/haddock/html-test/ref/Bug310.html - utils/haddock/html-test/ref/Bug548.html - utils/haddock/html-test/ref/BundledPatterns.html - utils/haddock/html-test/ref/BundledPatterns2.html - utils/haddock/html-test/src/Bug310.hs - utils/haddock/hypsrc-test/Main.hs - utils/haddock/latex-test/Main.hs Changes: ===================================== testsuite/tests/haddock/haddock_testsuite/Makefile ===================================== @@ -27,7 +27,6 @@ htmlTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ - --haddock-stdout=haddock-out.log # Corresponds to the `latex-test` testsuite .PHONY: latexTest @@ -43,7 +42,6 @@ latexTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ - --haddock-stdout=haddock-out.log # Corresponds to the `hoogle-test` testsuite .PHONY: hoogleTest @@ -59,7 +57,6 @@ hoogleTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ - --haddock-stdout=haddock-out.log # Corresponds to the `hypsrc-test` testsuite .PHONY: hypsrcTest @@ -75,4 +72,3 @@ hypsrcTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ - --haddock-stdout=haddock-out.log ===================================== utils/haddock/.gitignore ===================================== @@ -7,6 +7,10 @@ /hypsrc-test/out/ /latex-test/out/ /hoogle-test/out/ +/html-test/one-shot-out/ +/hypsrc-test/one-shot-out/ +/latex-test/one-shot-out/ +/hoogle-test/one-shot-out/ *.o *.hi ===================================== utils/haddock/CHANGES.md ===================================== @@ -1,5 +1,7 @@ ## Changes in 2.32.0 - * add highlighting for inline-code-blocks (sections enclosed in @'s) + * Add highlighting for inline-code-blocks (sections enclosed in @'s) + + * Add incremental mode to support rendering documentation one module at a time. ## Changes in 2.28.0 * `hi-haddock` is integrated, which means docstrings are no longer extracted ===================================== utils/haddock/doc/invoking.rst ===================================== @@ -542,6 +542,11 @@ The following options are available: ``cabal`` uses temporary `response files `_ to pass arguments to Haddock. +.. option:: --incremental= + + Use Haddock in :ref:`incremental mode`. Haddock will generate + documentation for the given module only. + Using literate or pre-processed source -------------------------------------- @@ -604,3 +609,28 @@ files. Following the steps above will allow you to take full advantage of "hi-haddock" and generate Haddock documentation from existing build results without requiring any further compilation. + +.. _incremental-mode: + +Incremental mode +---------------- + +In incremental mode Haddock generates documentation for only one module, making it +possible to generate documentation incrementally. It is useful when working on +the documentation, and especially in big packages, since your changes get +rendered quickly. Incremental mode takes full advantage of "hi-haddock": the +compiler is never invoked so it's guaranteed that no recompilation will occur. + +There are two major downsides to this method: + +#. The procedure to get links between modules in incremental mode is the same as + for links between packages in normal mode, using :option:`--dump-interface` + and :option:`--read-interface`. So for each dependency you will have to + pass the location of the ``.haddock`` file with :option:`--read-interface`. + It is therefore recommended to use incremental mode in conjunction with a + build system like Bazel or Buck to track build dependencies at file level. +#. Class instances from other modules than where the class is defined are not + available in incremental mode. This is because the module where the class is + defined has to be rendered before the module with the instance, since that + module depends on the former. So it is recommended to do a final pass in + normal mode before publishing the documentation to f.e. Hackage. ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -166,12 +166,14 @@ haddockWithGhc ghc args = handleTopExceptions $ do qual <- rightOrThrowE (qualification flags) sinceQual <- rightOrThrowE (sinceQualification flags) + let isOneShotMode = isJust (optOneShot flags) + -- Inject dynamic-too into ghc options if the ghc we are using was built with - -- dynamic linking + -- dynamic linking (except when in one-shot mode) flags'' <- ghc flags $ do df <- getDynFlags case lookup "GHC Dynamic" (compilerInfo df) of - Just "YES" -> return $ Flag_OptGhc "-dynamic-too" : flags + Just "YES" | not isOneShotMode -> return $ Flag_OptGhc "-dynamic-too" : flags _ -> return flags -- Inject `-j` into ghc options, if given to Haddock @@ -190,6 +192,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do -- to compute output file names that are stored in the 'DynFlags' of the -- resulting 'ModSummary's. let withDir | Flag_NoTmpCompDir `elem` flags = id + | isOneShotMode = id | otherwise = withTempOutputDir -- Output warnings about potential misuse of some flags @@ -218,7 +221,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do putMsg logger $ renderJson (jsonInterfaceFile ifaceFile) -- If we were given source files to generate documentation from, do it - if not (null files) then do + if not (null files) || isJust (optOneShot flags) then do (packages, ifaces, homeLinks) <- readPackagesAndProcessModules flags files let packageInfo = PackageInfo { piPackageName = fromMaybe (PackageName mempty) (optPackageName flags) @@ -514,7 +517,7 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages opt_contents_url opt_index_url unicode sincePkg packageInfo qual pretty withQuickjump return () - unless withBaseURL $ do + unless (withBaseURL || isJust (optOneShot flags)) $ do copyHtmlBits odir libDir themes withQuickjump writeHaddockMeta odir withQuickjump @@ -551,7 +554,7 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} - ppHyperlinkedSource (verbosity flags) odir libDir opt_source_css pretty srcMap ifaces + ppHyperlinkedSource (verbosity flags) (isJust (optOneShot flags)) odir libDir opt_source_css pretty srcMap ifaces return () ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs ===================================== @@ -8,6 +8,7 @@ module Haddock.Backends.Hyperlinker , module Haddock.Backends.Hyperlinker.Utils ) where +import Control.Monad (unless) import Data.Map as M import Data.Maybe import GHC.Data.FastString (mkFastString) @@ -40,6 +41,8 @@ import Haddock.Utils (Verbosity, out, verbose, writeUtf8File) -- produced source. ppHyperlinkedSource :: Verbosity + -> Bool + -- ^ In one-shot mode -> FilePath -- ^ Output directory -> FilePath @@ -53,12 +56,13 @@ ppHyperlinkedSource -> [Interface] -- ^ Interfaces for which we create source -> IO () -ppHyperlinkedSource verbosity outdir libdir mstyle pretty srcs' ifaces = do +ppHyperlinkedSource verbosity isOneShot outdir libdir mstyle pretty srcs' ifaces = do createDirectoryIfMissing True srcdir - let cssFile = fromMaybe (defaultCssFile libdir) mstyle - copyFile cssFile $ srcdir srcCssFile - copyFile (libdir "html" highlightScript) $ - srcdir highlightScript + unless isOneShot $ do + let cssFile = fromMaybe (defaultCssFile libdir) mstyle + copyFile cssFile $ srcdir srcCssFile + copyFile (libdir "html" highlightScript) $ + srcdir highlightScript mapM_ (ppHyperlinkedModuleSource verbosity srcdir pretty srcs) ifaces where srcdir = outdir hypSrcDir ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs ===================================== @@ -425,7 +425,7 @@ ppHtmlContents , not (instIsSig iface) ] ) - | pinfo <- packages + | pinfo <- mergedPackages ] sig_trees = [ ( piPackageInfo pinfo @@ -437,7 +437,7 @@ ppHtmlContents , instIsSig iface ] ) - | pinfo <- packages + | pinfo <- mergedPackages ] html = headHtml doctitle themes mathjax_url Nothing @@ -459,6 +459,10 @@ ppHtmlContents toInstalledDescription :: InstalledInterface -> Maybe (MDoc Name) toInstalledDescription = fmap mkMeta . hmi_description . instInfo + -- Merge package interfaces from the same package (f.e. like those generated by --incremental) + mergedPackages = Map.elems $ Map.fromListWith merge $ map (\p -> ((ppPackageInfo (piPackageInfo p), piVisibility p), p)) packages + merge p1 p2 = p1{piInstalledInterfaces = piInstalledInterfaces p1 ++ piInstalledInterfaces p2} + ppPrologue :: Maybe Package -> Qualification -> String -> Maybe (MDoc GHC.RdrName) -> Html ppPrologue _ _ _ Nothing = noHtml ppPrologue pkg qual title (Just doc) = ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs ===================================== @@ -193,8 +193,7 @@ subTableSrc pkg qual lnks splice decls = Just $ table << aboves (concatMap subRo : map (cell . (td <<)) subs linkHtml :: SrcSpan -> Maybe Module -> DocName -> Html - linkHtml loc@(RealSrcSpan _ _) mdl dn = links lnks loc splice mdl dn - linkHtml _ _ _ = noHtml + linkHtml loc mdl dn = links lnks loc splice mdl dn subBlock :: [Html] -> Maybe Html subBlock [] = Nothing ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -37,6 +37,7 @@ module Haddock.Interface ( import Control.Monad import Data.List (isPrefixOf) +import qualified Data.List as List import Data.Traversable (for) import qualified Data.Map.Strict as Map import qualified Data.Set as Set @@ -44,6 +45,8 @@ import Debug.Trace (traceMarkerIO) import System.Exit (exitFailure ) -- TODO use Haddock's die import Text.Printf import GHC hiding (verbosity, SuccessFlag(..)) +import GHC.Builtin.Names (mkMainModule_) +import qualified GHC.Data.EnumSet as EnumSet import GHC.Data.FastString (unpackFS) import GHC.Data.Graph.Directed import GHC.Data.Maybe @@ -56,16 +59,20 @@ import qualified GHC.Driver.DynFlags as DynFlags import qualified GHC.Utils.Outputable as Outputable import GHC.Driver.Session hiding (verbosity) import GHC.HsToCore.Docs (getMainDeclBinder) +import GHC.Iface.Load (loadSysInterface) +import GHC.IfaceToCore (tcIfaceInst, tcIfaceFamInst) +import GHC.Tc.Utils.Monad (initIfaceLoad, initIfaceLcl) +import GHC.Tc.Utils.Env (lookupGlobal_maybe) import GHC.Types.Error (mkUnknownDiagnostic) import GHC.Types.Name.Occurrence (emptyOccEnv) +import GHC.Unit.Finder (findImportedModule, FindResult(Found)) +import GHC.Unit.Home.ModInfo import GHC.Unit.Module.Graph (ModuleGraphNode (..)) import GHC.Unit.Module.ModDetails +import GHC.Unit.Module.ModIface (mi_semantic_module, mi_boot) import GHC.Unit.Module.ModSummary (isBootSummary) -import GHC.Utils.Outputable (Outputable, (<+>), pprModuleName) +import GHC.Utils.Outputable (Outputable, (<+>), pprModuleName, text) import GHC.Utils.Error (withTiming) -import GHC.Unit.Home.ModInfo -import GHC.Tc.Utils.Env (lookupGlobal_maybe) -import qualified Data.List as List #if defined(mingw32_HOST_OS) import System.IO @@ -75,7 +82,7 @@ import GHC.IO.Encoding.Failure (CodingFailureMode(TransliterateCodingFailure)) import Haddock.GhcUtils (moduleString, pretty) import Haddock.Interface.AttachInstances (attachInstances) -import Haddock.Interface.Create (createInterface1) +import Haddock.Interface.Create (createInterface1, createInterface1') import Haddock.Interface.Rename (renameInterface) import Haddock.InterfaceFile (InterfaceFile, ifInstalledIfaces, ifLinkEnv) import Haddock.Options hiding (verbosity) @@ -108,8 +115,12 @@ processModules verbosity modules flags extIfaces = do | ext <- extIfaces , iface <- ifInstalledIfaces ext ] + oneShotHiFile = optOneShot flags - interfaces <- createIfaces verbosity modules flags instIfaceMap + interfaces <- maybe + (createIfaces verbosity modules flags instIfaceMap) + (createOneShotIface verbosity flags instIfaceMap) + oneShotHiFile let exportedNames = Set.unions $ map (Set.fromList . ifaceExports) $ @@ -118,7 +129,7 @@ processModules verbosity modules flags extIfaces = do interfaces' <- {-# SCC attachInstances #-} withTimingM "attachInstances" (const ()) $ do - attachInstances (exportedNames, mods) interfaces instIfaceMap + attachInstances (exportedNames, mods) interfaces instIfaceMap (isJust oneShotHiFile) -- Combine the link envs of the external packages into one let extLinks = Map.unions (map ifLinkEnv extIfaces) @@ -313,6 +324,67 @@ processModule verbosity modSummary flags ifaceMap instIfaceMap = do return (Just interface) +-- | Create a single interface from a single module in one-shot mode. +createOneShotIface + :: Verbosity + -- ^ Verbosity requested by the caller + -> [Flag] + -- ^ Command line flags which Hadddock was invoked with + -> InstIfaceMap + -- ^ Map from module to corresponding installed interface file + -> String + -- ^ Name of the module + -> Ghc [Interface] + -- ^ Resulting interfaces +createOneShotIface verbosity flags instIfaceMap moduleNameStr = do + + let moduleNm = mkModuleName moduleNameStr + doc = text "createOneShotIface" + + out verbosity verbose $ "Checking interface " ++ moduleNameStr ++ "..." + + -- Turn on GHC's one-shot mode + dflags <- (\df -> df{ ghcMode = OneShot }) <$> getDynFlags + modifySession $ hscSetFlags dflags + hsc_env <- getSession + + (iface, insts) <- liftIO $ initIfaceLoad hsc_env $ do + + iface <- loadSysInterface doc $ mkMainModule_ moduleNm + + insts <- initIfaceLcl (mi_semantic_module iface) doc (mi_boot iface) $ do + + new_eps_insts <- mapM tcIfaceInst (mi_insts iface) + new_eps_fam_insts <- mapM tcIfaceFamInst (mi_fam_insts iface) + + pure (new_eps_insts, new_eps_fam_insts) + + pure (iface, insts) + + -- Update the DynFlags with the extensions from the source file (as stored in the interface file) + -- This is instead of ms_hspp_opts from ModSummary, which is not available in one-shot mode. + let dflags' = case mi_docs iface of + Just docs -> setExtensions $ setLanguage dflags + where + setLanguage df = lang_set df (docs_language docs) + setExtensions df = List.foldl' xopt_set df $ EnumSet.toList (docs_extensions docs) + Nothing -> dflags + + -- We should find the module here, otherwise there would have been an error earlier. + res <- liftIO $ findImportedModule hsc_env moduleNm NoPkgQual + let hieFilePath = case res of + Found ml _ -> ml_hie_file ml + _ -> throwE "createOneShotIface: module not found" + + !interface <- do + logger <- getLogger + {-# SCC createInterface #-} + withTiming logger "createInterface" (const ()) $ + runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ + createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts + + pure [interface] + -------------------------------------------------------------------------------- -- * Building of cross-linking environment -------------------------------------------------------------------------------- ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -24,6 +24,7 @@ module Haddock.Interface.AttachInstances (attachInstances, instHead) where import Control.Applicative ((<|>)) import Control.Arrow hiding ((<+>)) import Control.DeepSeq (force) +import Control.Monad (unless) import Data.Foldable (toList) import qualified Data.List as List import qualified Data.Map.Strict as Map @@ -69,8 +70,8 @@ type Modules = Set.Set Module type ExportInfo = (ExportedNames, Modules) -- Also attaches fixities -attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> Ghc [Interface] -attachInstances expInfo ifaces instIfaceMap = do +attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> Bool -> Ghc [Interface] +attachInstances expInfo ifaces instIfaceMap isOneShot = do -- We need to keep load modules in which we will look for instances. We've -- somewhat arbitrarily decided to load all modules which are available - -- either directly or from a re-export. @@ -97,8 +98,10 @@ attachInstances expInfo ifaces instIfaceMap = do (_msgs, mb_index) <- do hsc_env <- getSession liftIO $ runTcInteractive hsc_env $ do - let doc = text "Need interface for haddock" - initIfaceTcRn $ mapM_ (loadSysInterface doc) mods_to_load + -- In one shot mode we don't want to load anything more than is already loaded + unless isOneShot $ do + let doc = text "Need interface for haddock" + initIfaceTcRn $ mapM_ (loadSysInterface doc) mods_to_load cls_env at InstEnvs{ie_global, ie_local} <- tcGetInstEnvs fam_env@(pkg_fie, home_fie) <- tcGetFamInstEnvs -- We use Data.Sequence.Seq because we are creating left associated ===================================== utils/haddock/haddock-api/src/Haddock/Interface/Create.hs ===================================== @@ -29,7 +29,7 @@ -- This module provides a single function 'createInterface', -- which creates a Haddock 'Interface' from the typechecking -- results 'TypecheckedModule' from GHC. -module Haddock.Interface.Create (IfM, runIfM, createInterface1) where +module Haddock.Interface.Create (IfM, runIfM, createInterface1, createInterface1') where import Control.Arrow (first, (&&&)) import Control.DeepSeq @@ -84,7 +84,7 @@ createInterface1 -> InstIfaceMap -> ([ClsInst], [FamInst]) -> IfM m Interface -createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = do +createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = let ModSummary { -- Cached flags from OPTIONS, INCLUDE and LANGUAGE @@ -93,9 +93,23 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance ms_hspp_opts , ms_location = modl } = mod_sum + in + createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) +createInterface1' + :: MonadIO m + => [Flag] + -> UnitState + -> DynFlags + -> FilePath + -> ModIface + -> IfaceMap + -> InstIfaceMap + -> ([ClsInst], [FamInst]) + -> IfM m Interface +createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) = do + let sDocContext = DynFlags.initSDocContext dflags Outputable.defaultUserStyle - dflags = ms_hspp_opts mLanguage = language dflags parserOpts = Parser.initParserOpts dflags mdl = mi_module mod_iface @@ -230,7 +244,7 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance Interface { ifaceMod = mdl , ifaceIsSig = is_sig - , ifaceHieFile = ml_hie_file modl + , ifaceHieFile = hie_file , ifaceInfo = info , ifaceDoc = Documentation header_doc mod_warning , ifaceRnDoc = Documentation Nothing Nothing ===================================== utils/haddock/haddock-api/src/Haddock/Options.hs ===================================== @@ -33,6 +33,7 @@ module Haddock.Options , optShowInterfaceFile , optLaTeXStyle , optMathjax + , optOneShot , qualification , sinceQualification , verbosity @@ -122,6 +123,7 @@ data Flag | Flag_IgnoreLinkSymbol String | Flag_ParCount (Maybe Int) | Flag_TraceArgs + | Flag_OneShot String deriving (Eq, Show) options :: Bool -> [OptDescr Flag] @@ -156,6 +158,11 @@ options backwardsCompat = ["show-interface"] (ReqArg Flag_ShowInterface "FILE") "print the interface in a human readable form" + , Option + [] + ["incremental"] + (ReqArg Flag_OneShot "MODULE") + "generate documentation for a single module only, given its module name" , -- Option ['S'] ["docbook"] (NoArg Flag_DocBook) -- "output in DocBook XML", Option @@ -473,6 +480,9 @@ optDumpInterfaceFile flags = optLast [str | Flag_DumpInterface str <- flags] optShowInterfaceFile :: [Flag] -> Maybe FilePath optShowInterfaceFile flags = optLast [str | Flag_ShowInterface str <- flags] +optOneShot :: [Flag] -> Maybe String +optOneShot flags = optLast [str | Flag_OneShot str <- flags] + optLaTeXStyle :: [Flag] -> Maybe String optLaTeXStyle flags = optLast [str | Flag_LaTeXStyle str <- flags] @@ -551,7 +561,7 @@ reexportFlags :: [Flag] -> [String] reexportFlags flags = [option | Flag_Reexport option <- flags] data Visibility = Visible | Hidden - deriving (Eq, Show) + deriving (Eq, Ord, Show) readIfaceArgs :: [Flag] -> [(DocPaths, Visibility, FilePath)] readIfaceArgs flags = [parseIfaceOption s | Flag_ReadInterface s <- flags] ===================================== utils/haddock/haddock-test/src/Test/Haddock.hs ===================================== @@ -8,10 +8,10 @@ module Test.Haddock ) where import Control.Monad - -import Data.Maybe - import qualified Data.ByteString.Char8 as BS +import qualified Data.Map.Strict as Map +import Data.Maybe +import GHC.ResponseFile import System.Directory import System.Exit import System.FilePath @@ -74,10 +74,10 @@ maybeDiff cfg@(Config{cfgDiffTool = (Just diff)}) files = do runHaddock :: Config c -> IO Bool runHaddock cfg@(Config{..}) = do createEmptyDirectory $ cfgOutDir cfg + createEmptyDirectory $ cfgOneShotOutDir cfg putStrLn "Generating documentation..." successes <- forM cfgPackages $ \tpkg -> do - haddockStdOut <- openFile cfgHaddockStdOut WriteMode let pc = processConfig { pcArgs = @@ -87,24 +87,83 @@ runHaddock cfg@(Config{..}) = do , tpkgFiles tpkg ] , pcEnv = Just cfgEnv - , pcStdOut = Just haddockStdOut - , pcStdErr = Just haddockStdOut } let msg = "Failed to run Haddock on test package '" ++ tpkgName tpkg ++ "'" succeeded <- waitForSuccess msg stdout =<< runProcess' cfgHaddockPath pc unless succeeded $ removeDirectoryRecursive (outDir cfgDirConfig tpkg) - pure succeeded + if cfgSkipOneShot then pure succeeded else do + let oneShotDir = oneshotOutDir cfgDirConfig tpkg + hiDir = oneShotDir "hi" + hieDir = oneShotDir "hie" + responseFile = hiDir "response-file" + createEmptyDirectory oneShotDir + createEmptyDirectory hiDir + createEmptyDirectory hieDir + writeFile responseFile $ escapeArgs + [ "--odir=" ++ oneShotDir + , "--optghc=-hidir=" ++ hiDir + , "--optghc=-hiedir=" ++ hieDir + ] + + -- Build .hi files + let pc' = + processConfig + { pcArgs = + concat + [ + [ "--make" + , "-haddock" + , "-fwrite-interface" + , "-fwrite-ide-info" + , "-no-keep-o-files" + , "-hidir=" ++ hiDir + , "-hiedir=" ++ hieDir + ] + , tpkgFiles tpkg + ] + , pcEnv = Just cfgEnv + } + let msg = "Failed to run GHC on test package '" ++ tpkgName tpkg ++ "'" + _ <- waitForSuccess msg stdout =<< runProcess' cfgGhcPath pc' + + files <- filter ((== ".hi") . takeExtension) <$> listDirectory hiDir + -- Use the output order of GHC as a simple dependency order + filesSorted <- Map.elems . Map.fromList <$> traverse (\file -> (,file) <$> getModificationTime (hiDir file)) files + let srcRef = if "--hyperlinked-source" `elem` cfgHaddockArgs then ",src,visible," else "" + loop [] = pure True + loop (file : files) = do + let hiFile = hiDir file + haddockFile = hiFile ++ ".haddock" + pc = + processConfig + { pcArgs = + concat + [ cfgHaddockArgs + , [ "@" ++ responseFile + , "--incremental=" ++ takeBaseName hiFile + , "--dump-interface=" ++ haddockFile + ] + ] + , pcEnv = Just cfgEnv + } + let msg = "Failed to run Haddock in one-shot mode on file '" ++ hiFile ++ "'" + succeeded <- waitForSuccess msg stdout =<< runProcess' cfgHaddockPath pc + if succeeded + -- Allow subsequent files to depend on this file + then do + appendFile responseFile $ + escapeArgs [ "--read-interface=" ++ srcRef ++ haddockFile ] + loop files + else pure False + succeeded2 <- loop filesSorted + when succeeded2 $ do + removeDirectoryRecursive hiDir + removeDirectoryRecursive hieDir + pure succeeded2 let somethingFailed = any not successes - when somethingFailed $ - putStrLn - ( "Haddock output is at '" - ++ cfgHaddockStdOut - ++ "'. " - ++ "This file can be set with `--haddock-stdout`." - ) pure somethingFailed checkFile :: Config c -> FilePath -> IO CheckResult @@ -114,11 +173,20 @@ checkFile cfg file = do then do mout <- readOut cfg file mref <- readRef cfg file - return $ case (mout, mref) of + case (mout, mref) of (Just out, Just ref) - | ccfgEqual ccfg out ref -> Pass - | otherwise -> Fail - _ -> Error "Failed to parse input files" + | ccfgEqual ccfg out ref -> + if cfgSkipOneShot cfg || dcfgCheckIgnoreOneShot (cfgDirConfig cfg) file + then return Pass + else do + mOneShotOut <- readOneShotOut cfg file + return $ case mOneShotOut of + Just oneShotOut + | ccfgEqual ccfg oneShotOut out -> Pass + | otherwise -> Fail + Nothing -> Error "Failed to parse one-shot input file" + | otherwise -> return Fail + _ -> return $ Error "Failed to parse input files" else return NoRef where ccfg = cfgCheckConfig cfg @@ -147,11 +215,21 @@ readOut cfg file = ccfg = cfgCheckConfig cfg dcfg = cfgDirConfig cfg +readOneShotOut :: Config c -> FilePath -> IO (Maybe c) +readOneShotOut cfg file = + fmap (ccfgClean ccfg file) . ccfgRead ccfg . BS.unpack + <$> BS.readFile (oneShotOutFile dcfg file) + where + ccfg = cfgCheckConfig cfg + dcfg = cfgDirConfig cfg + diffFile :: Config c -> FilePath -> FilePath -> IO () diffFile cfg diff file = do Just out <- readOut cfg file + Just oneShotOut <- readOneShotOut cfg file Just ref <- readRef cfg file writeFile outFile' $ ccfgDump ccfg out + writeFile oneShotOutFile' $ ccfgDump ccfg oneShotOut writeFile refFile' $ ccfgDump ccfg ref putStrLn $ "Diff for file \"" ++ file ++ "\":" @@ -162,11 +240,20 @@ diffFile cfg diff file = do { pcArgs = [outFile', refFile'] , pcStdOut = Just stdout } - waitForProcess handle >> return () + void $ waitForProcess handle + handle' <- + runProcess' diff $ + processConfig + { pcArgs = [oneShotOutFile', outFile'] + , pcStdOut = Just stdout + } + void $ waitForProcess handle' + return () where dcfg = cfgDirConfig cfg ccfg = cfgCheckConfig cfg outFile' = outFile dcfg file <.> "dump" + oneShotOutFile' = oneShotOutFile dcfg file <.> "dump" refFile' = outFile dcfg file <.> "ref" <.> "dump" maybeAcceptFile :: Config c -> FilePath -> CheckResult -> IO CheckResult @@ -185,8 +272,14 @@ maybeAcceptFile _ _ result = pure result outDir :: DirConfig -> TestPackage -> FilePath outDir dcfg tpkg = dcfgOutDir dcfg tpkgName tpkg +oneshotOutDir :: DirConfig -> TestPackage -> FilePath +oneshotOutDir dcfg tpkg = dcfgOneShotOutDir dcfg tpkgName tpkg + outFile :: DirConfig -> FilePath -> FilePath outFile dcfg file = dcfgOutDir dcfg file +oneShotOutFile :: DirConfig -> FilePath -> FilePath +oneShotOutFile dcfg file = dcfgOneShotOutDir dcfg file + refFile :: DirConfig -> FilePath -> FilePath refFile dcfg file = dcfgRefDir dcfg file ===================================== utils/haddock/haddock-test/src/Test/Haddock/Config.hs ===================================== @@ -4,7 +4,7 @@ module Test.Haddock.Config ( TestPackage(..), CheckConfig(..), DirConfig(..), Config(..) , defaultDirConfig - , cfgSrcDir, cfgRefDir, cfgOutDir, cfgResDir + , cfgSrcDir, cfgRefDir, cfgOutDir, cfgResDir, cfgOneShotOutDir , parseArgs, checkOpt, loadConfig ) where @@ -57,8 +57,10 @@ data DirConfig = DirConfig { dcfgSrcDir :: FilePath , dcfgRefDir :: FilePath , dcfgOutDir :: FilePath + , dcfgOneShotOutDir :: FilePath , dcfgResDir :: FilePath , dcfgCheckIgnore :: FilePath -> Bool + , dcfgCheckIgnoreOneShot :: FilePath -> Bool } @@ -67,8 +69,10 @@ defaultDirConfig baseDir = DirConfig { dcfgSrcDir = baseDir "src" , dcfgRefDir = baseDir "ref" , dcfgOutDir = baseDir "out" + , dcfgOneShotOutDir = baseDir "one-shot-out" , dcfgResDir = rootDir "resources" , dcfgCheckIgnore = const False + , dcfgCheckIgnoreOneShot = const False } where rootDir = baseDir ".." @@ -76,29 +80,30 @@ defaultDirConfig baseDir = DirConfig data Config c = Config { cfgHaddockPath :: FilePath + , cfgGhcPath :: FilePath , cfgPackages :: [TestPackage] , cfgHaddockArgs :: [String] - , cfgHaddockStdOut :: FilePath , cfgDiffTool :: Maybe FilePath , cfgEnv :: Environment , cfgAccept :: Bool , cfgCheckConfig :: CheckConfig c , cfgDirConfig :: DirConfig + , cfgSkipOneShot :: Bool } -cfgSrcDir, cfgRefDir, cfgOutDir, cfgResDir :: Config c -> FilePath +cfgSrcDir, cfgRefDir, cfgOutDir, cfgResDir, cfgOneShotOutDir :: Config c -> FilePath cfgSrcDir = dcfgSrcDir . cfgDirConfig cfgRefDir = dcfgRefDir . cfgDirConfig cfgOutDir = dcfgOutDir . cfgDirConfig cfgResDir = dcfgResDir . cfgDirConfig +cfgOneShotOutDir = dcfgOneShotOutDir . cfgDirConfig data Flag = FlagHaddockPath FilePath | FlagHaddockOptions String - | FlagHaddockStdOut FilePath | FlagGhcPath FilePath | FlagDiffTool FilePath | FlagNoDiff @@ -118,10 +123,6 @@ flagsHaddockOptions flags = concat [ words opts | FlagHaddockOptions opts <- flags ] -flagsHaddockStdOut :: [Flag] -> Maybe FilePath -flagsHaddockStdOut flags = mlast [ path | FlagHaddockStdOut path <- flags ] - - flagsDiffTool :: [Flag] -> Maybe FilePath flagsDiffTool flags = mlast [ path | FlagDiffTool path <- flags ] @@ -132,8 +133,6 @@ options = "path to Haddock executable to exectue tests with" , Option [] ["haddock-options"] (ReqArg FlagHaddockOptions "OPTS") "additional options to run Haddock with" - , Option [] ["haddock-stdout"] (ReqArg FlagHaddockStdOut "FILE") - "where to redirect Haddock output" , Option [] ["ghc-path"] (ReqArg FlagGhcPath "FILE") "path ghc executable" , Option [] ["diff-tool"] (ReqArg FlagDiffTool "PATH") @@ -196,7 +195,7 @@ loadConfig ccfg dcfg flags files = do , queriedGhcPath ] - ghcPath <- case ghc_path of + cfgGhcPath <- case ghc_path of Just path -> pure path Nothing -> do hPutStrLn stderr "GHC executable not found; consider using the `--ghc-path` flag." @@ -213,11 +212,9 @@ loadConfig ccfg dcfg flags files = do , pure ["--optghc=-w"] , pure ["--optghc=-hide-all-packages"] , pure $ flagsHaddockOptions flags - , baseDependencies ghcPath + , baseDependencies cfgGhcPath ] - let cfgHaddockStdOut = fromMaybe defaultStdOut (flagsHaddockStdOut flags) - cfgDiffTool <- if FlagNoDiff `elem` flags then pure Nothing else (<|>) <$> pure (flagsDiffTool flags) <*> defaultDiffTool @@ -226,6 +223,7 @@ loadConfig ccfg dcfg flags files = do let cfgCheckConfig = ccfg let cfgDirConfig = dcfg + let cfgSkipOneShot = False return $ Config { .. } @@ -307,7 +305,7 @@ baseDependencies ghcPath = do htmlDirOpt = listToMaybe (haddockHTMLs pkg) pure (unitId, ifaceOpt, htmlDirOpt) - + defaultDiffTool :: IO (Maybe FilePath) defaultDiffTool = ===================================== utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs ===================================== @@ -7,6 +7,7 @@ module Test.Haddock.Xhtml , stripAnchorsWhen , stripIdsWhen , stripFooter + , fixAttrValueWhen ) where {- @@ -48,19 +49,19 @@ type Value = String -- -- * match an attribute key -- * check something about the value --- * if the check succeeded, replace the value with a dummy value -stripAttrValueWhen +-- * if the check succeeded, apply a function to the value +fixAttrValueWhen :: Attr -- ^ attribute key - -> Value - -- ^ dummy attribute value + -> (Value -> Value) + -- ^ update attribute value function -> (Value -> Bool) -- ^ determine whether we should modify the attribute -> Xml -- ^ input XML -> Xml -- ^ output XML -stripAttrValueWhen key fallback p (Xml body) = Xml (filterAttrs body) +fixAttrValueWhen key f p (Xml body) = Xml (filterAttrs body) where keyEq = key ++ "=\"" @@ -69,11 +70,24 @@ stripAttrValueWhen key fallback p (Xml body) = Xml (filterAttrs body) | Just valRest <- stripPrefix keyEq b , Just (val, rest) <- spanToEndOfString valRest = if p val - then keyEq ++ fallback ++ "\"" ++ filterAttrs rest + then keyEq ++ f val ++ "\"" ++ filterAttrs rest else keyEq ++ val ++ "\"" ++ filterAttrs rest | otherwise = c : filterAttrs cs +stripAttrValueWhen + :: Attr + -- ^ attribute key + -> Value + -- ^ dummy attribute value + -> (Value -> Bool) + -- ^ determine whether we should modify the attribute + -> Xml + -- ^ input XML + -> Xml + -- ^ output XML +stripAttrValueWhen key fallback = fixAttrValueWhen key (const fallback) + -- | Spans to the next (unescaped) @\"@ character. -- -- >>> spanToEndOfString "no closing quotation" ===================================== utils/haddock/hoogle-test/Main.hs ===================================== @@ -17,9 +17,14 @@ checkConfig = CheckConfig , ccfgEqual = (==) `on` crlfToLf } +multiModuleTests :: [String] +multiModuleTests = ["modules", "type-sigs"] dirConfig :: DirConfig -dirConfig = defaultDirConfig $ takeDirectory __FILE__ +dirConfig = (defaultDirConfig $ takeDirectory __FILE__) + -- Multi-module hoogle tests don't make sense for one-shot mode + { dcfgCheckIgnoreOneShot = (`elem` (fmap ( "test.txt") multiModuleTests)) + } main :: IO () ===================================== utils/haddock/html-test/Main.hs ===================================== @@ -23,6 +23,7 @@ checkConfig = CheckConfig dirConfig :: DirConfig dirConfig = (defaultDirConfig $ takeDirectory __FILE__) { dcfgCheckIgnore = checkIgnore + , dcfgCheckIgnoreOneShot = (`elem` ignoredOneShotTests) . takeBaseName } @@ -31,6 +32,11 @@ main = do cfg <- parseArgs checkConfig dirConfig =<< getArgs runAndCheck $ cfg { cfgHaddockArgs = cfgHaddockArgs cfg ++ ["--pretty-html", "--html"] +#ifdef mingw32_HOST_OS + , cfgSkipOneShot = False -- Current test setup makes the argument list too long on Windows +#else + , cfgSkipOneShot = False +#endif } @@ -47,7 +53,7 @@ stripIfRequired mdl = preserveLinksModules :: [String] preserveLinksModules = ["Bug253.html", "NamespacedIdentifiers.html"] -ingoredTests :: [FilePath] +ingoredTests :: [String] ingoredTests = [ -- Currently some declarations are exported twice @@ -56,6 +62,19 @@ ingoredTests = "B" ] +ignoredOneShotTests :: [String] +ignoredOneShotTests = + [ + -- Class instances don't travel up the dependency chain in one-shot mode + "Bug1004" + , "OrphanInstancesClass" + , "OrphanInstancesType" + , "TypeFamilies2" + -- Warnings are not stored in .haddock files https://github.com/haskell/haddock/issues/223 + , "DeprecatedReExport" + , "HiddenInstancesB" + ] + checkIgnore :: FilePath -> Bool checkIgnore file | takeBaseName file `elem` ingoredTests = True checkIgnore file@(c:_) | takeExtension file == ".html" && isUpper c = False ===================================== utils/haddock/html-test/ref/Bug1004.html ===================================== @@ -147,6 +147,8 @@ > f g :: k -> Type) #  (Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #  (Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g) #

(Product f g a) #

(Product f g a) #

(Product f g a) #

(Product f g a) #  (Product f g a) #

(Product f g a) #

(Product f g a) #

(Product f g a) #

f g :: k -> Type) #

(Product f g a) #

type family (a :: Natural) +) - (b :: Natural) :: -> Type) #  (WrappedArrow a b) #

(WrappedArrow a b) #

(WrappedArrow a b) #

(WrappedArrow a b c) #

(WrappedArrow a b c) #  -> Type) #

(WrappedArrow a b c) #

Vec n a -> Vec (n (n + 1) aRTree d a -> RTree (d (d + 1) aVec n a -> Vec (n (n + 1) a infixr 5RTree d a -> RTree (d (d + 1) aVec n a -> Vec (n (n + 1) a

  • RTree d a -> RTree (d (d + 1) a
  • Vec n a -> Vec (n (n + 1) a infixr 5RTree d a -> RTree (d (d + 1) a "#local-" `isPrefixOf` href stripAnchors' = stripAnchorsWhen $ \name -> "local-" `isPrefixOf` name stripIds' = stripIdsWhen $ \name -> "local-" `isPrefixOf` name + -- One-shot hyperlinked source links to other modules as if they are in another package + fixPaths = fixAttrValueWhen "href" (drop 7) ("../src/" `isPrefixOf`) dirConfig :: DirConfig ===================================== utils/haddock/latex-test/Main.hs ===================================== @@ -21,6 +21,8 @@ checkConfig = CheckConfig dirConfig :: DirConfig dirConfig = (defaultDirConfig $ takeDirectory __FILE__) { dcfgCheckIgnore = (`elem` ["haddock.sty", "main.tex"]) . takeFileName + -- Just a discrepancy in output order + , dcfgCheckIgnoreOneShot = (`elem` ["ConstructorArgs.tex"]) . takeFileName } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8bf6fd68001bc1dabdd974506fc735e22e8257a9...74ec4c0640e96feb8930b96e9ec64dd0aa03f2bf -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8bf6fd68001bc1dabdd974506fc735e22e8257a9...74ec4c0640e96feb8930b96e9ec64dd0aa03f2bf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:17:30 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 06:17:30 -0400 Subject: [Git][ghc/ghc][master] ghc-boot: Relax Cabal bound Message-ID: <668d0e3ac5b9d_1255775acf6c47357@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 1 changed file: - libraries/ghc-boot/ghc-boot.cabal.in Changes: ===================================== libraries/ghc-boot/ghc-boot.cabal.in ===================================== @@ -28,7 +28,7 @@ build-type: Custom extra-source-files: changelog.md custom-setup - setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.10, directory, filepath + setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.14, directory, filepath source-repository head type: git View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed8a8f0bf0cc866ca309ca07f996d85522c9c20e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed8a8f0bf0cc866ca309ca07f996d85522c9c20e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:18:08 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 06:18:08 -0400 Subject: [Git][ghc/ghc][master] 2 commits: ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Message-ID: <668d0e60de711_12557779114852943@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 3 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -708,7 +708,10 @@ test-bootstrap: - .gitlab/ci.sh setup # Bootstrapping should not depend on HAPPY or ALEX so set them to false # so the build fails if they are invoked. - - export HAPPY=/bin/false; export ALEX=/bin/false + - unset HAPPY; unset ALEX + # Check the commands are not available, parens are crucial to start a subshell + - (! command -v alex --version) + - (! command -v happy --version) - .gitlab/ci.sh configure - .gitlab/ci.sh build_hadrian - .gitlab/ci.sh test_hadrian ===================================== .gitlab/ci.sh ===================================== @@ -403,6 +403,12 @@ function configure() { else args+=("--disable-numa") fi + if [[ -n ${HAPPY:-} ]]; then + args+=("HAPPY=$HAPPY") + fi + if [[ -n ${ALEX:-} ]]; then + args+=("ALEX=$ALEX") + fi start_section "configuring" # See https://stackoverflow.com/questions/7577052 for a rationale for the @@ -411,8 +417,6 @@ function configure() { --enable-tarballs-autodownload \ "${args[@]+"${args[@]}"}" \ GHC="$GHC" \ - HAPPY="$HAPPY" \ - ALEX="$ALEX" \ || ( cat config.log; fail "configure failed" ) end_section "configuring" } ===================================== hadrian/src/Hadrian/Haskell/Cabal/Parse.hs ===================================== @@ -19,6 +19,7 @@ import Data.Bifunctor import Data.List.Extra import Development.Shake import qualified Distribution.Compat.Graph as Graph +import qualified Distribution.Compat.Lens as CL import qualified Distribution.ModuleName as C import qualified Distribution.Package as C import qualified Distribution.PackageDescription as C @@ -37,6 +38,7 @@ import qualified Distribution.Simple.Utils as C import qualified Distribution.Simple.Program.Types as C import qualified Distribution.Simple.Configure as C (getPersistBuildConfig) import qualified Distribution.Simple.Build as C +import qualified Distribution.Types.BuildInfo.Lens as CL (HasBuildInfo(..), traverseBuildInfos) import qualified Distribution.Types.ComponentLocalBuildInfo as C import qualified Distribution.InstalledPackageInfo as Installed import qualified Distribution.Simple.PackageIndex as C @@ -193,10 +195,21 @@ configurePackage context at Context {..} = do verbosity <- getVerbosity let v = shakeVerbosityToCabalFlag verbosity argList' = argList ++ ["--flags=" ++ unwords flagList, v] + when (verbosity >= Verbose) $ putProgressInfo $ "| Package " ++ quote (pkgName package) ++ " configuration flags: " ++ unwords argList' + + -- See #24826 for why this workaround exists + -- In future `Cabal` versions we should pass the `--ignore-build-tools` flag when + -- calling configure. + -- See https://github.com/haskell/cabal/pull/10128 + let gpdWithoutBuildTools = + CL.set (CL.traverseBuildInfos . CL.buildToolDepends) [] + . CL.set (CL.traverseBuildInfos . CL.buildTools) [] + $ gpd + traced "cabal-configure" $ - C.defaultMainWithHooksNoReadArgs hooks gpd argList' + C.defaultMainWithHooksNoReadArgs hooks gpdWithoutBuildTools argList' dir <- Context.buildPath context files <- liftIO $ getDirectoryFilesIO "." [ dir -/- "include" -/- "**" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed8a8f0bf0cc866ca309ca07f996d85522c9c20e...aba2c9d4728262cd9a2d711eded9050ac131c6c1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed8a8f0bf0cc866ca309ca07f996d85522c9c20e...aba2c9d4728262cd9a2d711eded9050ac131c6c1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:18:50 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 06:18:50 -0400 Subject: [Git][ghc/ghc][master] testsuite: Don't attempt to link when checking whether a way is supported Message-ID: <668d0e8aa0ccd_1255779114285595f@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 1 changed file: - testsuite/config/ghc Changes: ===================================== testsuite/config/ghc ===================================== @@ -236,7 +236,7 @@ def get_compiler_info(): if test_src is None: test_src = ''' - module Main where + module A where main = putStrLn "Hello World!" ''' @@ -245,7 +245,7 @@ def get_compiler_info(): src.write_text(textwrap.dedent(test_src)) try: p = subprocess.run( - '{} -v0 {} -o test '.format(config.compiler, src) + ' '.join(flags), + '{} -v0 {} '.format(config.compiler, src) + ' '.join(flags), shell=True, cwd=d, stderr=None if config.verbose >= 3 else subprocess.DEVNULL View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12bb9e7b2aab1b4f9fe56d9b674fdc8a8e7cfb32 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12bb9e7b2aab1b4f9fe56d9b674fdc8a8e7cfb32 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:25:26 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 09 Jul 2024 06:25:26 -0400 Subject: [Git][ghc/ghc][wip/haddock-iface-fixes] 40 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668d1016a8185_125577afb748562fb@gitlab.mail> Zubin pushed to branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 87dd36d2 by Zubin Duggal at 2024-07-09T15:55:06+05:30 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - 8980f4b5 by Zubin Duggal at 2024-07-09T15:55:08+05:30 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c49a84ba439b5079936ff2eec0160c425a3671ac...8980f4b5667fb549de4151c386d7f5784df3cfc9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c49a84ba439b5079936ff2eec0160c425a3671ac...8980f4b5667fb549de4151c386d7f5784df3cfc9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:44:53 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 06:44:53 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 45 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668d14a511f00_125577e3f1c0626e1@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 2ff70ba0 by sheaf at 2024-07-09T12:43:32+02:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 61fc81ac by sheaf at 2024-07-09T12:44:05+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - de5a3e48 by sheaf at 2024-07-09T12:44:08+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - c218d2ff by sheaf at 2024-07-09T12:44:09+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - cbfd1bb8 by sheaf at 2024-07-09T12:44:09+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - d2080986 by sheaf at 2024-07-09T12:44:09+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 87939b37 by sheaf at 2024-07-09T12:44:09+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f47ef2d5f999e43af1dcc333142368d91ee5d3af...87939b374863c9c4cb0222521b59b63f622a62de -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f47ef2d5f999e43af1dcc333142368d91ee5d3af...87939b374863c9c4cb0222521b59b63f622a62de You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:49:47 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 06:49:47 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: One-shot Haddock Message-ID: <668d15cb203a4_1255771054898646d2@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 4a64a9d8 by Simon Peyton Jones at 2024-07-09T06:49:30-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 4f79017f by Matthew Pickering at 2024-07-09T06:49:30-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - d7ce01ca by Adam Sandberg Ericsson at 2024-07-09T06:49:31-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - libraries/ghc-boot/ghc-boot.cabal.in - rts/Linker.c - rts/RtsStartup.c - rts/linker/MMap.c - rts/linker/MMap.h - testsuite/config/ghc - testsuite/tests/haddock/haddock_testsuite/Makefile - testsuite/tests/rts/Makefile - testsuite/tests/rts/linker/Makefile - testsuite/tests/rts/linker/T11223/Makefile - utils/haddock/.gitignore - utils/haddock/CHANGES.md - utils/haddock/doc/invoking.rst - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a888e741336e68a8bf3231300ee9addeb71f8f6b...d7ce01cac32b227b09ea160c5eacaa0549c63497 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a888e741336e68a8bf3231300ee9addeb71f8f6b...d7ce01cac32b227b09ea160c5eacaa0549c63497 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 10:50:44 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 06:50:44 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Use xmm registers in genapply Message-ID: <668d1604e0e9e_12557710ad38071462@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: e2ffd631 by sheaf at 2024-07-09T12:50:23+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 7 changed files: - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - rts/include/Cmm.h - utils/deriveConstants/Main.hs - utils/genapply/Main.hs Changes: ===================================== compiler/GHC/Cmm/Lexer.x ===================================== @@ -104,11 +104,14 @@ $white_no_nl+ ; "False" { kw CmmT_False } "likely" { kw CmmT_likely} - P at decimal { global_regN VanillaReg gcWord } - R at decimal { global_regN VanillaReg bWord } - F at decimal { global_regN FloatReg (const $ cmmFloat W32) } - D at decimal { global_regN DoubleReg (const $ cmmFloat W64) } - L at decimal { global_regN LongReg (const $ cmmBits W64) } + P at decimal { global_regN 1 VanillaReg gcWord } + R at decimal { global_regN 1 VanillaReg bWord } + F at decimal { global_regN 1 FloatReg (const $ cmmFloat W32) } + D at decimal { global_regN 1 DoubleReg (const $ cmmFloat W64) } + L at decimal { global_regN 1 LongReg (const $ cmmBits W64) } + XMM at decimal { global_regN 3 XmmReg (const $ cmmVec 2 (cmmFloat W64)) } + YMM at decimal { global_regN 3 YmmReg (const $ cmmVec 4 (cmmFloat W64)) } + ZMM at decimal { global_regN 3 ZmmReg (const $ cmmVec 8 (cmmFloat W64)) } Sp { global_reg Sp bWord } SpLim { global_reg SpLim bWord } Hp { global_reg Hp gcWord } @@ -173,9 +176,9 @@ data CmmToken | CmmT_bits16 | CmmT_bits32 | CmmT_bits64 - | CmmT_bits128 - | CmmT_bits256 - | CmmT_bits512 + | CmmT_vec128 + | CmmT_vec256 + | CmmT_vec512 | CmmT_float32 | CmmT_float64 | CmmT_gcptr @@ -211,14 +214,16 @@ special_char span buf _len = return (L span (CmmT_SpecChar (currentChar buf))) kw :: CmmToken -> Action kw tok span _buf _len = return (L span tok) -global_regN :: (Int -> GlobalReg) -> (Platform -> CmmType) -> Action -global_regN con ty_fn span buf len +global_regN :: Int -> (Int -> GlobalReg) -> (Platform -> CmmType) -> Action +global_regN ident_nb_chars con ty_fn span buf len = do { platform <- getPlatform ; let reg = con (fromIntegral n) ty = ty_fn platform ; return (L span (CmmT_GlobalReg (GlobalRegUse reg ty))) } - where buf' = stepOn buf - n = parseUnsignedInteger buf' (len-1) 10 octDecDigit + where buf' = go ident_nb_chars buf + where go 0 b = b + go i b = go (i-1) (stepOn b) + n = parseUnsignedInteger buf' (len-ident_nb_chars) 10 octDecDigit global_reg :: GlobalReg -> (Platform -> CmmType) -> Action global_reg reg ty_fn span _buf _len @@ -269,9 +274,9 @@ reservedWordsFM = listToUFM $ ( "bits16", CmmT_bits16 ), ( "bits32", CmmT_bits32 ), ( "bits64", CmmT_bits64 ), - ( "bits128", CmmT_bits128 ), - ( "bits256", CmmT_bits256 ), - ( "bits512", CmmT_bits512 ), + ( "vec128", CmmT_vec128 ), + ( "vec256", CmmT_vec256 ), + ( "vec512", CmmT_vec512 ), ( "float32", CmmT_float32 ), ( "float64", CmmT_float64 ), -- New forms @@ -279,9 +284,6 @@ reservedWordsFM = listToUFM $ ( "b16", CmmT_bits16 ), ( "b32", CmmT_bits32 ), ( "b64", CmmT_bits64 ), - ( "b128", CmmT_bits128 ), - ( "b256", CmmT_bits256 ), - ( "b512", CmmT_bits512 ), ( "f32", CmmT_float32 ), ( "f64", CmmT_float64 ), ( "gcptr", CmmT_gcptr ), ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -171,7 +171,7 @@ lintCmmMiddle node = case node of CmmAssign reg expr -> do erep <- lintCmmExpr expr let reg_ty = cmmRegType reg - unless (erep `cmmEqType_ignoring_ptrhood` reg_ty) $ + unless (erep `cmmCompatType` reg_ty) $ cmmLintAssignErr (CmmAssign reg expr) erep reg_ty CmmStore l r _alignment -> do ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -381,9 +381,9 @@ import qualified Data.ByteString.Char8 as BS8 'bits16' { L _ (CmmT_bits16) } 'bits32' { L _ (CmmT_bits32) } 'bits64' { L _ (CmmT_bits64) } - 'bits128' { L _ (CmmT_bits128) } - 'bits256' { L _ (CmmT_bits256) } - 'bits512' { L _ (CmmT_bits512) } + 'vec128' { L _ (CmmT_vec128) } + 'vec256' { L _ (CmmT_vec256) } + 'vec512' { L _ (CmmT_vec512) } 'float32' { L _ (CmmT_float32) } 'float64' { L _ (CmmT_float64) } 'gcptr' { L _ (CmmT_gcptr) } @@ -942,9 +942,9 @@ typenot8 :: { CmmType } : 'bits16' { b16 } | 'bits32' { b32 } | 'bits64' { b64 } - | 'bits128' { b128 } - | 'bits256' { b256 } - | 'bits512' { b512 } + | 'vec128' { cmmVec 2 f64 } + | 'vec256' { cmmVec 4 f64 } + | 'vec512' { cmmVec 8 f64 } | 'float32' { f32 } | 'float64' { f64 } | 'gcptr' {% do platform <- PD.getPlatform; return $ gcWord platform } ===================================== compiler/GHC/Cmm/Type.hs ===================================== @@ -4,7 +4,7 @@ module GHC.Cmm.Type , cInt , cmmBits, cmmFloat , typeWidth, setCmmTypeWidth - , cmmEqType, cmmEqType_ignoring_ptrhood + , cmmEqType, cmmCompatType , isFloatType, isGcPtrType, isBitsType , isWordAny, isWord32, isWord64 , isFloat64, isFloat32 @@ -87,21 +87,27 @@ instance Outputable CmmCat where cmmEqType :: CmmType -> CmmType -> Bool -- Exact equality cmmEqType (CmmType c1 w1) (CmmType c2 w2) = c1==c2 && w1==w2 -cmmEqType_ignoring_ptrhood :: CmmType -> CmmType -> Bool - -- This equality is temporary; used in CmmLint - -- but the RTS files are not yet well-typed wrt pointers -cmmEqType_ignoring_ptrhood (CmmType c1 w1) (CmmType c2 w2) - = c1 `weak_eq` c2 && w1==w2 +-- | A weaker notion of equality of 'CmmType's than 'cmmEqType', +-- used (only) in Cmm Lint. +-- +-- Why "weaker"? Because: +-- +-- - we don't distinguish GcPtr vs NonGcPtr, because the the RTS files +-- are not yet well-typed wrt pointers, +-- - for vectors, we only compare the widths, because in practice things like +-- X86 xmm registers support different types of data (e.g. 4xf32, 2xf64, 2xu64 etc). +cmmCompatType :: CmmType -> CmmType -> Bool +cmmCompatType (CmmType c1 w1) (CmmType c2 w2) + = c1 `weak_eq` c2 && w1 == w2 where weak_eq :: CmmCat -> CmmCat -> Bool - FloatCat `weak_eq` FloatCat = True - FloatCat `weak_eq` _other = False - _other `weak_eq` FloatCat = False - (VecCat l1 cat1) `weak_eq` (VecCat l2 cat2) = l1 == l2 - && cat1 `weak_eq` cat2 - (VecCat {}) `weak_eq` _other = False - _other `weak_eq` (VecCat {}) = False - _word1 `weak_eq` _word2 = True -- Ignores GcPtr + FloatCat `weak_eq` FloatCat = True + FloatCat `weak_eq` _other = False + _other `weak_eq` FloatCat = False + (VecCat {}) `weak_eq` (VecCat {}) = True -- only compare overall width + (VecCat {}) `weak_eq` _other = False + _other `weak_eq` (VecCat {}) = False + _word1 `weak_eq` _word2 = True -- Ignores GcPtr --- Simple operations on CmmType ----- typeWidth :: CmmType -> Width ===================================== rts/include/Cmm.h ===================================== @@ -101,9 +101,9 @@ #define F_ float32 #define D_ float64 #define L_ bits64 -#define V16_ bits128 -#define V32_ bits256 -#define V64_ bits512 +#define V16_ vec128 +#define V32_ vec256 +#define V64_ vec512 #define SIZEOF_StgDouble 8 #define SIZEOF_StgWord64 8 ===================================== utils/deriveConstants/Main.hs ===================================== @@ -1048,7 +1048,8 @@ writeHeader fn rs = atomicWriteFile fn xs genapplyBits = mconcat ["// " ++ _name ++ " " ++ show v ++ "\n" | (_name, v) <- genapplyData] genapplyData = [(_name, v) | (_, GetWord _name (Snd v)) <- rs, _name `elem` genapplyFields ] genapplyFields = [ - "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", "MAX_Real_Long_REG", + "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", + "MAX_Real_Long_REG", "MAX_Real_XMM_REG", "WORD_SIZE", "TAG_BITS", "BITMAP_BITS_SHIFT" ] haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs ===================================== utils/genapply/Main.hs ===================================== @@ -67,6 +67,7 @@ data TargetInfo = TargetInfo maxRealFloatReg, maxRealDoubleReg, maxRealLongReg, + maxRealXmmReg, wordSize, tagBits, tagBitsMax, @@ -86,6 +87,7 @@ parseTargetInfo path = do maxRealFloatReg = tups_get "MAX_Real_Float_REG", maxRealDoubleReg = tups_get "MAX_Real_Double_REG", maxRealLongReg = tups_get "MAX_Real_Long_REG", + maxRealXmmReg = tups_get "MAX_Real_XMM_REG", wordSize = tups_get "WORD_SIZE", tagBits = tag_bits, tagBitsMax = 1 `shiftL` tag_bits, @@ -105,6 +107,7 @@ data ArgRep | V16 -- 16-byte (128-bit) vectors | V32 -- 32-byte (256-bit) vectors | V64 -- 64-byte (512-bit) vectors + deriving (Eq, Show) -- size of a value in *words* argSize :: TargetInfo -> ArgRep -> Int @@ -138,13 +141,15 @@ isPtr _ = False -- Registers type Reg = String +type AvailRegs = ([Reg],[Reg],[Reg],[Reg],[Int]) -availableRegs :: TargetInfo -> ([Reg],[Reg],[Reg],[Reg]) +availableRegs :: TargetInfo -> AvailRegs availableRegs TargetInfo {..} = ( vanillaRegs maxRealVanillaReg, floatRegs maxRealFloatReg, doubleRegs maxRealDoubleReg, - longRegs maxRealLongReg + longRegs maxRealLongReg, + xmmRegNos maxRealXmmReg ) vanillaRegs, floatRegs, doubleRegs, longRegs :: Int -> [Reg] @@ -153,6 +158,9 @@ floatRegs n = [ "F" ++ show m | m <- [1..n] ] doubleRegs n = [ "D" ++ show m | m <- [1..n] ] longRegs n = [ "L" ++ show m | m <- [1..n] ] +xmmRegNos :: Int -> [Int] +xmmRegNos n = [1..n] + -- ----------------------------------------------------------------------------- -- Loading/saving register arguments to the stack @@ -176,6 +184,7 @@ assignRegs Int) -- Sp of left-over args assignRegs targetInfo sp args = assign targetInfo sp args (availableRegs targetInfo) [] +assign :: TargetInfo -> Int -> [ArgRep] -> AvailRegs -> [(Reg, Int)] -> ([(Reg, Int)], [ArgRep], Int) assign _ sp [] _regs doc = (doc, [], sp) assign targetInfo sp (V : args) regs doc = assign targetInfo sp args regs doc assign targetInfo sp (arg : args) regs doc @@ -184,28 +193,44 @@ assign targetInfo sp (arg : args) regs doc ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp) -findAvailableReg N (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg F (vregs, freg:fregs, dregs, lregs) = - Just (freg, (vregs,fregs,dregs,lregs)) -findAvailableReg D (vregs, fregs, dreg:dregs, lregs) = - Just (dreg, (vregs,fregs,dregs,lregs)) -findAvailableReg L (vregs, fregs, dregs, lreg:lregs) = - Just (lreg, (vregs,fregs,dregs,lregs)) +findAvailableReg :: ArgRep -> AvailRegs -> Maybe (Reg, AvailRegs) +findAvailableReg N (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg P (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg F (vregs, freg:fregs, dregs, lregs, xmmregNos) = + Just (freg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg D (vregs, fregs, dreg:dregs, lregs, xmmregNos) = + Just (dreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg L (vregs, fregs, dregs, lreg:lregs, xmmregNos) = + Just (lreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg v (vregs, fregs, dregs, lregs, xmmregNo:xmmregNos) + | Just vecRegNm <- + case v of + V16 -> Just "XMM" + V32 -> Just "YMM" + V64 -> Just "ZMM" + _ -> Nothing + -- NB: here we assume xmm/ymm/zmm registers overlap. + = Just (vecRegNm ++ show xmmregNo, (vregs,fregs,dregs,lregs,xmmregNos)) findAvailableReg _ _ = Nothing +assign_reg_to_stk :: String -> Int -> Doc assign_reg_to_stk reg sp = loadSpWordOff (regRep reg) sp <> text " = " <> text reg <> semi +assign_stk_to_reg :: String -> Int -> Doc assign_stk_to_reg reg sp = text reg <> text " = " <> loadSpWordOff (regRep reg) sp <> semi +regRep :: String -> String regRep ('F':_) = "F_" regRep ('D':_) = "D_" regRep ('L':_) = "L_" -regRep _ = "W_" +regRep ('X':'M':'M':_) = "V16_" +regRep ('Y':'M':'M':_) = "V32_" +regRep ('Z':'M':'M':_) = "V64_" +regRep _ = "W_" loadSpWordOff :: String -> Int -> Doc loadSpWordOff rep off = text rep <> text "[Sp+WDS(" <> int off <> text ")]" @@ -649,6 +674,7 @@ formalParam arg n = text "arg" <> int n <> text ", " formalParamType arg = argRep arg +argRep :: ArgRep -> Doc argRep F = text "F_" argRep D = text "D_" argRep L = text "L_" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2ffd631e8041cc51f61041cac88a732b77665ed -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e2ffd631e8041cc51f61041cac88a732b77665ed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 11:01:35 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 07:01:35 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 7 commits: Testsuite: use py-cpuinfo to compute CPU features Message-ID: <668d188f2cda5_1255771434d287218b@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 91bc5a7d by sheaf at 2024-07-09T13:01:16+02:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 599e32eb by sheaf at 2024-07-09T13:01:16+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 2ef6bfaa by sheaf at 2024-07-09T13:01:16+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 621d5644 by sheaf at 2024-07-09T13:01:17+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - f0ad6090 by sheaf at 2024-07-09T13:01:17+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 1020faf6 by sheaf at 2024-07-09T13:01:17+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - f5b8a3a6 by sheaf at 2024-07-09T13:01:17+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2ffd631e8041cc51f61041cac88a732b77665ed...f5b8a3a6330e4cc2ebf1d6f97d45f05b0ae1fd50 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2ffd631e8041cc51f61041cac88a732b77665ed...f5b8a3a6330e4cc2ebf1d6f97d45f05b0ae1fd50 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 11:03:17 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 09 Jul 2024 07:03:17 -0400 Subject: [Git][ghc/ghc][wip/hadddock-libraries] 39 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668d18f5ef19_12557715d1500727ae@gitlab.mail> Zubin pushed to branch wip/hadddock-libraries at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 079e159a by Zubin Duggal at 2024-07-09T16:31:03+05:30 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 This causes a metric decrease under non-release flavours because under these flavours libraries are compiled with optimisation but executables are not. Since we move the bulk of the code from the haddock executable to the haddock-api library, we see a metric decrease on the validate flavours. Metric Decrease: haddock.Cabal haddock.base haddock.compiler - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Env.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3a2a553b6e0057bb70046d5d04fab8a26b7dbf0...079e159a85faebceaa793ecfe19d0056eb539b27 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3a2a553b6e0057bb70046d5d04fab8a26b7dbf0...079e159a85faebceaa793ecfe19d0056eb539b27 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 11:24:20 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 09 Jul 2024 07:24:20 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/doc-fix-nondecreasing] 4638 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <668d1de45feb2_1255771b2abf08084a@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/doc-fix-nondecreasing at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00 Drop dependence on `touch` This drops GHC's dependence on the `touch` program, instead implementing it within GHC. This eliminates an external dependency and means that we have one fewer program to keep track of in the `configure` script - - - - - 0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00 Parser, renamer, type checker for @a-binders (#17594) GHC Proposal 448 introduces binders for invisible type arguments (@a-binders) in various contexts. This patch implements @-binders in lambda patterns and function equations: {-# LANGUAGE TypeAbstractions #-} id1 :: a -> a id1 @t x = x :: t -- @t-binder on the LHS of a function equation higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16) higherRank f = (f 42, f 42) ex :: (Int8, Int16) ex = higherRank (\ @a x -> maxBound @a - x ) -- @a-binder in a lambda pattern in an argument -- to a higher-order function Syntax ------ To represent those @-binders in the AST, the list of patterns in Match now uses ArgPat instead of Pat: data Match p body = Match { ... - m_pats :: [LPat p], + m_pats :: [LArgPat p], ... } + data ArgPat pass + = VisPat (XVisPat pass) (LPat pass) + | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass)) + | XArgPat !(XXArgPat pass) The VisPat constructor represents patterns for visible arguments, which include ordinary value-level arguments and required type arguments (neither is prefixed with a @), while InvisPat represents invisible type arguments (prefixed with a @). Parser ------ In the grammar (Parser.y), the lambda and lambda-cases productions of aexp non-terminal were updated to accept argpats instead of apats: aexp : ... - | '\\' apats '->' exp + | '\\' argpats '->' exp ... - | '\\' 'lcases' altslist(apats) + | '\\' 'lcases' altslist(argpats) ... + argpat : apat + | PREFIX_AT atype Function left-hand sides did not require any changes to the grammar, as they were already parsed with productions capable of parsing @-binders. Those binders were being rejected in post-processing (isFunLhs), and now we accept them. In Parser.PostProcess, patterns are constructed with the help of PatBuilder, which is used as an intermediate data structure when disambiguating between FunBind and PatBind. In this patch we define ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived data structure produced in isFunLhs and consumed in checkFunBind. Renamer ------- Renaming of @-binders builds upon prior work on type patterns, implemented in 2afbddb0f24, which guarantees proper scoping and shadowing behavior of bound type variables. This patch merely defines rnLArgPatsAndThen to process a mix of visible and invisible patterns: + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn] + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where + rnArgPatAndThen (VisPat x p) = ... rnLPatAndThen ... + rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ... Common logic between rnArgPats and rnPats is factored out into the rn_pats_general helper. Type checker ------------ Type-checking of @-binders builds upon prior work on lazy skolemisation, implemented in f5d3e03c56f. This patch extends tcMatchPats to handle @-binders. Now it takes and returns a list of LArgPat rather than LPat: tcMatchPats :: ... - -> [LPat GhcRn] + -> [LArgPat GhcRn] ... - -> TcM ([LPat GhcTc], a) + -> TcM ([LArgPat GhcTc], a) Invisible binders in the Match are matched up with invisible (Specified) foralls in the type. This is done with a new clause in the `loop` worker of tcMatchPats: loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a) loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys) ... -- NEW CLAUSE: | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis = ... In addition to that, tcMatchPats no longer discards type patterns. This is done by filterOutErasedPats in the desugarer instead. x86_64-linux-deb10-validate+debug_info Metric Increase: MultiLayerModulesTH_OneShot - - - - - 486979b0 by Jade at 2024-02-19T07:12:13-05:00 Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246 Fixes: #24346 - - - - - 17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00 Fix reST in users guide It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax. - - - - - 35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00 Fix searching for errors in sphinx build - - - - - 4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00 hadrian: fix wasm backend post linker script permissions The post-link.mjs script was incorrectly copied and installed as a regular data file without executable permission, this commit fixes it. - - - - - a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00 testsuite: mark T23540 as fragile on i386 See #24449 for details. - - - - - 249caf0d by Matthew Craven at 2024-02-19T20:36:09-05:00 Add @since annotation to Data.Data.mkConstrTag - - - - - cdd939e7 by Jade at 2024-02-19T20:36:46-05:00 Enhance documentation of Data.Complex - - - - - d04f384f by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian/bindist: Ensure that phony rules are marked as such Otherwise make may not run the rule if file with the same name as the rule happens to exist. - - - - - efcbad2d by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian: Generate HSC2HS_EXTRAS variable in bindist installation We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. - - - - - c540559c by Matthew Pickering at 2024-02-21T04:59:23-05:00 ci: Show --info for installed compiler - - - - - ab9281a2 by Matthew Pickering at 2024-02-21T04:59:23-05:00 configure: Correctly set --target flag for linker opts Previously we were trying to use the FP_CC_SUPPORTS_TARGET with 4 arguments, when it only takes 3 arguments. Instead we need to use the `FP_PROG_CC_LINKER_TARGET` function in order to set the linker flags. Actually fixes #24414 - - - - - 9460d504 by Rodrigo Mesquita at 2024-02-21T04:59:59-05:00 configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS - - - - - 77629e76 by Andrei Borzenkov at 2024-02-21T05:00:35-05:00 Namespacing for fixity signatures (#14032) Namespace specifiers were added to syntax of fixity signatures: - sigdecl ::= infix prec ops | ... + sigdecl ::= infix prec namespace_spec ops | ... To preserve namespace during renaming MiniFixityEnv type now has separate FastStringEnv fields for names that should be on the term level and for name that should be on the type level. makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way: - signatures without namespace specifiers fill both fields - signatures with 'data' specifier fill data field only - signatures with 'type' specifier fill type field only Was added helper function lookupMiniFixityEnv that takes care about looking for a name in an appropriate namespace. Updates haddock submodule. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 84357d11 by Teo Camarasu at 2024-02-21T05:01:11-05:00 rts: only collect live words in nonmoving census when non-concurrent This avoids segfaults when the mutator modifies closures as we examine them. Resolves #24393 - - - - - 9ca56dd3 by Ian-Woo Kim at 2024-02-21T05:01:53-05:00 mutex wrap in refreshProfilingCCSs - - - - - 1387966a by Cheng Shao at 2024-02-21T05:02:32-05:00 rts: remove unused HAVE_C11_ATOMICS macro This commit removes the unused HAVE_C11_ATOMICS macro. We used to have a few places that have fallback paths when HAVE_C11_ATOMICS is not defined, but that is completely redundant, since the FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler doesn't support C11 style atomics. There are also many places (e.g. in unreg backend, SMP.h, library cbits, etc) where we unconditionally use C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the oldest distro we test in our CI, so there's no value in keeping HAVE_C11_ATOMICS. - - - - - 0f40d68f by Andreas Klebinger at 2024-02-21T05:03:09-05:00 RTS: -Ds - make sure incall is non-zero before dereferencing it. Fixes #24445 - - - - - e5886de5 by Ben Gamari at 2024-02-21T05:03:44-05:00 rts/AdjustorPool: Use ExecPage abstraction This is just a minor cleanup I found while reviewing the implementation. - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 09941666 by Adam Gundry at 2024-02-21T13:53:12+00:00 Define GHC2024 language edition (#24320) See https://github.com/ghc-proposals/ghc-proposals/pull/613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail at joachim-breitner.de> - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 5121a4ed by Ben Gamari at 2024-02-23T06:40:55-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. Bumps haddock submodule. - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 0eb2265d by Hécate Moonlight at 2024-02-24T16:02:16-05:00 Improve the synopsis and description of base - - - - - 2e36f5d2 by Jade at 2024-02-24T16:02:51-05:00 Error Messages: Properly align cyclic module error Fixes: #24476 - - - - - bbfb051c by Ben Gamari at 2024-02-24T19:10:23-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. - - - - - d8d6ad8c by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Move modules into GHC.Internal.* namespace Bumps haddock submodule due to testsuite output changes. - - - - - a82af7cd by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Rewrite `@since ` to `@since base-` These will be incrementally moved to the export sites in `base` where possible. - - - - - ca3836e1 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Migrate Haddock `not-home` pragmas from `ghc-internal` This ensures that we do not use `base` stub modules as declarations' homes when not appropriate. - - - - - c8cf3e26 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Partially freeze exports of GHC.Base Sadly there are still a few module reexports. However, at least we have decoupled from the exports of `GHC.Internal.Base`. - - - - - 272573c6 by Ben Gamari at 2024-02-24T19:10:23-05:00 Move Haddock named chunks - - - - - 2d8a881d by Ben Gamari at 2024-02-24T19:10:23-05:00 Drop GHC.Internal.Data.Int - - - - - 55c4c385 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler: Fix mention to `GHC....` modules in wasm desugaring Really, these references should be via known-key names anyways. I have fixed the proximate issue here but have opened #24472 to track the additional needed refactoring. - - - - - 64150911 by Ben Gamari at 2024-02-24T19:10:23-05:00 Accept performance shifts from ghc-internal restructure As expected, Haddock now does more work. Less expected is that some other testcases actually get faster, presumably due to less interface file loading. As well, the size_hello_artifact test regressed a bit when debug information is enabled due to debug information for the new stub symbols. Metric Decrease: T12227 T13056 Metric Increase: haddock.Cabal haddock.base MultiLayerModulesTH_OneShot size_hello_artifact - - - - - 317a915b by Ben Gamari at 2024-02-24T19:10:23-05:00 Expose GHC.Wasm.Prim from ghc-experimental Previously this was only exposed from `ghc-internal` which violates our agreement that users shall not rely on things exposed from that package. Fixes #24479. - - - - - 3bbd2bf2 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Small optimisation of evCallStack Don't lookupIds unless we actually need them. - - - - - 3e5c9e3c by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Use toException instead of SomeException - - - - - 125714a6 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Factor out errorBelch This was useful when debugging - - - - - 3d6aae7c by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Clean up imports of GHC.Stack.CloneStack - - - - - 6900306e by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move PrimMVar to GHC.Internal.MVar - - - - - 28f8a148 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move prettyCallStack to GHC.Internal.Stack - - - - - 4892de47 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Explicit dependency to workaround #24436 Currently `ghc -M` fails to account for `.hs-boot` files correctly, leading to issues with cross-package one-shot builds failing. This currently manifests in `GHC.Exception` due to the boot file for `GHC.Internal.Stack`. Work around this by adding an explicit `import`, ensuring that `GHC.Internal.Stack` is built before `GHC.Exception`. See #24436. - - - - - 294c93a5 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Use displayException in top-level exception handler Happily this also allows us to eliminate a special case for Deadlock exceptions. Implements [CLC #198](https://github.com/haskell/core-libraries-committee/issues/198). - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - cf756a25 by Ben Gamari at 2024-02-24T22:11:53-05:00 rts: Fix symbol references in Wasm RTS - - - - - 4e4d47a0 by Jade at 2024-02-26T15:17:20-05:00 GHCi: Improve response to unloading, loading and reloading modules Fixes #13869 - - - - - f3de8a3c by Zubin Duggal at 2024-02-26T15:17:57-05:00 rel-eng/fetch-gitlab.py: Fix name of aarch64 alpine 3_18 release job - - - - - c71bfdff by Cheng Shao at 2024-02-26T15:18:35-05:00 hadrian/hie-bios: pass -j to hadrian This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. - - - - - 50bfdb46 by Cheng Shao at 2024-02-26T15:18:35-05:00 ci: enable parallelism in hadrian/ghci scripts This commit enables parallelism when the hadrian/ghci scripts are called in CI. The time bottleneck is in the hadrian build step, but previously the build step wasn't parallelized. - - - - - 61a78231 by Felix Yan at 2024-02-26T15:19:14-05:00 m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension This implements Proposal 0475, introducing the `ListTuplePuns` extension which is enabled by default. Disabling this extension makes it invalid to refer to list, tuple and sum type constructors by using built-in syntax like `[Int]`, `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`. Instead, this syntax exclusively denotes data constructors for use with `DataKinds`. The conventional way of referring to these data constructors by prefixing them with a single quote (`'(Int, Int)`) is now a parser error. Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo` data constructor has been renamed to `MkSolo` (in a previous commit). Unboxed tuples and sums now have real source declarations in `GHC.Types`. Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo` and `Solo#`. Constraint tuples now have the unambiguous type constructors `CTuple<n>` as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before. A new parser construct has been added for the unboxed sum data constructor declarations. The type families `Tuple`, `Sum#` etc. that were intended to provide nicer syntax have been omitted from this change set due to inference problems, to be implemented at a later time. See the MR discussion for more info. Updates the submodule utils/haddock. Updates the cabal submodule due to new language extension. Metric Increase: haddock.base Metric Decrease: MultiLayerModulesTH_OneShot size_hello_artifact Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst Merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns This enriched the `CtOrigin` for non-linear patterns to include data of the pattern that created the constraint (which can be quite useful if it occurs nested in a pattern) as well as an explanation why the pattern is non-restricted in (at least in some cases). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * Main change: make the error message generated by mkFunTysMsg more accurate by changing "value arguments" to "visible arguments". * Refactor: define a new type synonym VisArity and use it instead of Arity in a few places. It might be the case that there other places in the compiler that should talk about visible arguments rather than value arguments, but I haven't tried to find them all, focusing only on the error message reported in the ticket. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 1289c2c1 by Torsten Schmits at 2024-07-09T13:23:11+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - 21 changed files: - .ghcid - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/default.nix - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/README.mkd - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitlab/rel_eng/upload_ghc_libs.py - .gitmodules - CODEOWNERS - compiler/GHC.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6258540659dd5d98b519052f777fc1e49620ce66...1289c2c1601ad8599e0cf9849ae2aacb4eeea8db -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6258540659dd5d98b519052f777fc1e49620ce66...1289c2c1601ad8599e0cf9849ae2aacb4eeea8db You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 11:37:15 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 09 Jul 2024 07:37:15 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/doc-fix-nondecreasing] Improve docs for NondecreasingIndentation Message-ID: <668d20ebab76a_1255771df9e1c812c6@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/doc-fix-nondecreasing at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - 1 changed file: - docs/users_guide/bugs.rst Changes: ===================================== docs/users_guide/bugs.rst ===================================== @@ -129,14 +129,21 @@ Context-free syntax expressions. Specifically, the restriction that "a nested context must be indented further to the right than the enclosing context" is relaxed to allow the nested context to be at the same level as the - enclosing context, if the enclosing context is a ``do`` expression. + enclosing context, if the nested context is a ``do`` expression. - For example, the following code is accepted by GHC: :: + For example, the following code, in which a ``do`` context is nested + within a case context, and the statement `feed animal` is indented by + the same amount as the case alt, is accepted by GHC: :: - main = do args <- getArgs - if null args then return [] else do - ps <- mapM process args - mapM print ps + main = case animal of + Wombat -> do + feed animal + + But this code, with the inverse nesting, is not: :: + + main = do + case animal of + Wombat -> feed animal This behaviour is controlled by the :extension:`NondecreasingIndentation` extension. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46ec0a8e11dea77254843ef8017dd19402374c75 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46ec0a8e11dea77254843ef8017dd19402374c75 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 11:58:26 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 09 Jul 2024 07:58:26 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/haddock-object-files Message-ID: <668d25e25e6e4_125577223d58c86915@gitlab.mail> Zubin pushed new branch wip/haddock-object-files at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/haddock-object-files You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 12:00:41 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 09 Jul 2024 08:00:41 -0400 Subject: [Git][ghc/ghc][wip/haddock-object-files] haddock: Handle non-hs files, so that haddock can generate documentation for modules with Message-ID: <668d2668ec3fe_12557722f7464888c2@gitlab.mail> Zubin pushed to branch wip/haddock-object-files at Glasgow Haskell Compiler / GHC Commits: 04236fbd by Zubin Duggal at 2024-07-09T17:30:26+05:30 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 7 changed files: - testsuite/tests/haddock/haddock_testsuite/Makefile - testsuite/tests/haddock/haddock_testsuite/all.T - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/A.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/B.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/F.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/arith.c - utils/haddock/haddock-api/src/Haddock/Interface.hs Changes: ===================================== testsuite/tests/haddock/haddock_testsuite/Makefile ===================================== @@ -72,3 +72,7 @@ hypsrcTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ + +.PHONY: haddockForeignTest +haddockForeignTest: + '$(HADDOCK)' A.hs B.hs F.hs arith.c ===================================== testsuite/tests/haddock/haddock_testsuite/all.T ===================================== @@ -19,3 +19,8 @@ test('haddockHypsrcTest', [ignore_stdout, ignore_stderr, req_haddock], makefile_test, ['hypsrcTest ' + accept]) + +test('haddockForeignTest', + [ignore_stdout, ignore_stderr, req_haddock, extra_files(['./haddock-th-foreign-repro/A.hs', './haddock-th-foreign-repro/B.hs', './haddock-th-foreign-repro/F.hs', './haddock-th-foreign-repro/arith.c'])], + makefile_test, + ['haddockForeignTest']) ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/A.hs ===================================== @@ -0,0 +1,8 @@ +module A where + +import Language.Haskell.TH +import F + + +foo :: Exp +foo = LitE (StringL "foo") ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/B.hs ===================================== @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +module B where + +import A + +$([d| bar = $(return foo) |]) ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/F.hs ===================================== @@ -0,0 +1,4 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +module F where + +foreign import ccall "some_c_function" c_some_c_function :: IO () ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/arith.c ===================================== @@ -0,0 +1 @@ +void some_c_function(void) {} ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE TupleSections #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface @@ -58,6 +59,8 @@ import GHC.Core.InstEnv import qualified GHC.Driver.DynFlags as DynFlags import qualified GHC.Utils.Outputable as Outputable import GHC.Driver.Session hiding (verbosity) +import GHC.Driver.Phases +import GHC.Driver.Pipeline (compileFile) import GHC.HsToCore.Docs (getMainDeclBinder) import GHC.Iface.Load (loadSysInterface) import GHC.IfaceToCore (tcIfaceInst, tcIfaceFamInst) @@ -73,6 +76,7 @@ import GHC.Unit.Module.ModIface (mi_semantic_module, mi_boot) import GHC.Unit.Module.ModSummary (isBootSummary) import GHC.Utils.Outputable (Outputable, (<+>), pprModuleName, text) import GHC.Utils.Error (withTiming) +import GHC.Utils.Monad (mapMaybeM) #if defined(mingw32_HOST_OS) import System.IO @@ -165,7 +169,15 @@ createIfaces -> Ghc [Interface] -- ^ Resulting interfaces createIfaces verbosity modules flags instIfaceMap = do - targets <- mapM (\filePath -> guessTarget filePath Nothing Nothing) modules + let (hs_srcs, non_hs_srcs) = List.partition isHaskellishTarget $ map (,Nothing) modules + hsc_env <- getSession + o_files <- mapMaybeM (\x -> liftIO $ compileFile hsc_env NoStop x) + non_hs_srcs + dflags <- getSessionDynFlags + let dflags' = dflags { ldInputs = map (FileOption "") o_files + ++ ldInputs dflags } + _ <- setSessionDynFlags dflags' + targets <- mapM (\(filePath, _) -> guessTarget filePath Nothing Nothing) hs_srcs setTargets targets (_errs, modGraph) <- depanalE [] False View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04236fbdb3b78b3e03f862427b7b145b7642a928 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/04236fbdb3b78b3e03f862427b7b145b7642a928 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 12:49:32 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 08:49:32 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 7 commits: Testsuite: use py-cpuinfo to compute CPU features Message-ID: <668d31dcafa9b_1255772a6d37498267@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: f31ee921 by sheaf at 2024-07-09T14:49:13+02:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - d1d261fb by sheaf at 2024-07-09T14:49:15+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 0ebcd237 by sheaf at 2024-07-09T14:49:16+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - ec789f5b by sheaf at 2024-07-09T14:49:17+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 95b124d1 by sheaf at 2024-07-09T14:49:17+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 691ae5aa by sheaf at 2024-07-09T14:49:18+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - f2a89ddc by sheaf at 2024-07-09T14:49:18+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f5b8a3a6330e4cc2ebf1d6f97d45f05b0ae1fd50...f2a89ddcc10ea8dc312ab0942fd61aaf781cdca8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f5b8a3a6330e4cc2ebf1d6f97d45f05b0ae1fd50...f2a89ddcc10ea8dc312ab0942fd61aaf781cdca8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 13:29:58 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 09 Jul 2024 09:29:58 -0400 Subject: [Git][ghc/ghc][wip/haddock-iface-fixes] 2 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <668d3b5696665_12557732580d41159d4@gitlab.mail> Zubin pushed to branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC Commits: 0ceea859 by Zubin Duggal at 2024-07-09T18:59:45+05:30 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - 07405521 by Zubin Duggal at 2024-07-09T18:59:45+05:30 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 7 changed files: - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -433,16 +433,17 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap + pkgSrcLMap = Map.map (hypSrcModuleUrlToLineFormat . hypSrcPkgUrlToModuleFormat) + $ Map.mapKeys moduleUnit extSrcMap -- These urls have a template for the module %M and the line %L - -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey - = Map.singleton k hypSrcModuleLineUrlFormat + = Map.insert k hypSrcModuleLineUrlFormat pkgSrcLMap | Just path <- srcLEntity , Just k <- pkgKey - = Map.singleton k path - | otherwise = Map.empty + = Map.insert k path pkgSrcLMap + | otherwise = pkgSrcLMap sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs ===================================== @@ -14,6 +14,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleNameUrlFormat , hypSrcModuleLineUrlFormat , hypSrcModuleUrlToNameFormat + , hypSrcModuleUrlToLineFormat , hypSrcPkgUrlToModuleFormat , spliceURL , spliceURL' @@ -86,6 +87,9 @@ hypSrcModuleLineUrlFormat = hypSrcModuleUrlFormat ++ "#" ++ lineFormat hypSrcModuleUrlToNameFormat :: String -> String hypSrcModuleUrlToNameFormat url = url ++ "#" ++ nameFormat +hypSrcModuleUrlToLineFormat :: String -> String +hypSrcModuleUrlToLineFormat url = url ++ "#" ++ lineFormat + hypSrcPkgUrlToModuleFormat :: String -> String hypSrcPkgUrlToModuleFormat url = url moduleFormat ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -228,25 +228,28 @@ createIfaces verbosity modules flags instIfaceMap = do -- Visit modules in that order sortedMods = concatMap go $ topSortModuleGraph False modGraph Nothing out verbosity normal "Haddock coverage:" - (ifaces, _) <- foldM f ([], Map.empty) sortedMods + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) + (ifaces, _, _) <- foldM f ([], Map.empty, inst_warning_map) sortedMods return (reverse ifaces) where - f (ifaces, ifaceMap) modSummary = do + f (ifaces, ifaceMap, warningMap) modSummary = do x <- {-# SCC processModule #-} withTimingM "processModule" (const ()) $ do - processModule verbosity modSummary flags ifaceMap instIfaceMap + processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap return $ case x of Just iface -> ( iface:ifaces - , Map.insert (ifaceMod iface) iface ifaceMap ) + , Map.insert (ifaceMod iface) iface ifaceMap + , Map.union (ifaceWarningMap iface) warningMap) Nothing -> ( ifaces - , ifaceMap ) -- Boot modules don't generate ifaces. + , ifaceMap + , warningMap ) -- Boot modules don't generate ifaces. dropErr :: MaybeErr e a -> Maybe a dropErr (Succeeded a) = Just a dropErr (Failed _) = Nothing -processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface) -processModule verbosity modSummary flags ifaceMap instIfaceMap = do +processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> WarningMap -> Ghc (Maybe Interface) +processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modSummary) ++ "..." hsc_env <- getSession @@ -269,7 +272,7 @@ processModule verbosity modSummary flags ifaceMap instIfaceMap = do {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts + createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts warningMap let (haddockable, haddocked) = @@ -375,13 +378,13 @@ createOneShotIface verbosity flags instIfaceMap moduleNameStr = do let hieFilePath = case res of Found ml _ -> ml_hie_file ml _ -> throwE "createOneShotIface: module not found" - + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) !interface <- do logger <- getLogger {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts + createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts inst_warning_map pure [interface] ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -143,10 +143,11 @@ attachInstances expInfo ifaces instIfaceMap isOneShot = do attach (cls_insts, fam_insts, inst_map) iface = do let getInstDoc = findInstDoc iface ifaceMap instIfaceMap getFixity = findFixity iface ifaceMap instIfaceMap + getInstLocIface name = Map.lookup name . instInstanceLocMap =<< Map.lookup (nameModule name) instIfaceMap newItems <- mapM - (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity) + (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity getInstLocIface) (ifaceExportItems iface) let orphanInstances = attachOrphanInstances expInfo getInstDoc (ifaceInstances iface) fam_insts return $ @@ -184,9 +185,11 @@ attachToExportItem -- ^ how to lookup the doc of an instance -> (Name -> Maybe Fixity) -- ^ how to lookup a fixity + -> (Name -> Maybe RealSrcSpan) + -- ^ how to lookup definition spans for instances -> ExportItem GhcRn -> Ghc (ExportItem GhcRn) -attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export = +attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity getInstLocIface export = case attachFixities export of ExportDecl e@(ExportD{expDDecl = L eSpan (TyClD _ d)}) -> do insts <- @@ -267,12 +270,17 @@ attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export -- spanName: attach the location to the name that is the same file as the instance location spanName s (InstHead{ihdClsName = clsn}) (L instL instn) = - let s1 = getSrcSpan s + let s1 = let orig_span = getSrcSpan s + in if isGoodSrcSpan orig_span + then orig_span + else case getInstLocIface s of + Nothing -> orig_span + Just rs -> RealSrcSpan rs mempty sn = if srcSpanFileName_maybe s1 == srcSpanFileName_maybe instL then instn else clsn - in L (getSrcSpan s) sn + in L s1 sn -- spanName on Either spanNameE s (Left e) _ = L (getSrcSpan s) (Left e) spanNameE s (Right ok) linst = ===================================== utils/haddock/haddock-api/src/Haddock/Interface/Create.hs ===================================== @@ -83,8 +83,9 @@ createInterface1 -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = +createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = let ModSummary { -- Cached flags from OPTIONS, INCLUDE and LANGUAGE @@ -94,7 +95,7 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance , ms_location = modl } = mod_sum in - createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) + createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings createInterface1' :: MonadIO m @@ -106,8 +107,9 @@ createInterface1' -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) = do +createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = do let sDocContext = DynFlags.initSDocContext dflags Outputable.defaultUserStyle mLanguage = language dflags @@ -205,7 +207,7 @@ createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces let -- Warnings in this module and transitive warnings from dependent modules transitiveWarnings :: Map Name (Doc Name) - transitiveWarnings = Map.unions (warningMap : map ifaceWarningMap (Map.elems ifaces)) + transitiveWarnings = Map.union warningMap depWarnings export_items <- mkExportItems ===================================== utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs ===================================== @@ -49,6 +49,7 @@ import GHC.Iface.Binary (getWithUserData, putSymbolTable) import GHC.Iface.Type (IfaceType, putIfaceType) import GHC.Types.Name.Cache import GHC.Types.Unique +import GHC.Types.SrcLoc import GHC.Types.Unique.FM import GHC.Unit.State import GHC.Utils.Binary @@ -366,6 +367,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) = do put_ bh modu put_ bh is_sig @@ -376,6 +379,8 @@ instance Binary InstalledInterface where put_ bh visExps put_ bh opts put_ bh fixMap + put_ bh warnMap + put_ bh locMap get bh = do modu <- get bh @@ -387,6 +392,8 @@ instance Binary InstalledInterface where visExps <- get bh opts <- get bh fixMap <- get bh + warnMap <- get bh + locMap <- get bh return ( InstalledInterface modu @@ -399,6 +406,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) instance Binary DocOption where @@ -758,3 +767,19 @@ instance Binary n => Binary (Wrap n) where name <- get bh return (Backticked name) _ -> error "get Wrap: Bad h" + +instance Binary RealSrcSpan where + put_ bh sp = do + put_ bh (srcSpanFile sp) + put_ bh (srcSpanStartLine sp) + put_ bh (srcSpanStartCol sp) + put_ bh (srcSpanEndLine sp) + put_ bh (srcSpanEndCol sp) + + get bh = do + fs <- get bh + sl <- get bh + sc <- get bh + el <- get bh + ec <- get bh + pure $ mkRealSrcSpan (mkRealSrcLoc fs sl sc) (mkRealSrcLoc fs el ec) ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -48,16 +48,18 @@ import Control.Monad.Catch import Control.Monad.State.Strict import Data.Data (Data) import Data.Map (Map) +import qualified Data.Map as Map import qualified Data.Set as Set import GHC import qualified GHC.Data.Strict as Strict import GHC.Driver.Session (Language) import qualified GHC.LanguageExtensions as LangExt +import GHC.Core.InstEnv (is_dfun_name) import GHC.Types.Fixity (Fixity (..)) import GHC.Types.Name (stableNameCmp) import GHC.Types.Name.Occurrence import GHC.Types.Name.Reader (RdrName (..)) -import GHC.Types.SrcLoc (BufPos (..), BufSpan (..)) +import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan) import GHC.Types.Var (Specificity) import GHC.Utils.Outputable @@ -166,6 +168,8 @@ data InstalledInterface = InstalledInterface , instOptions :: [DocOption] -- ^ Haddock options for this module (prune, ignore-exports, etc). , instFixMap :: Map Name Fixity + , instWarningMap :: WarningMap + , instInstanceLocMap :: Map Name RealSrcSpan } -- | Convert an 'Interface' to an 'InstalledInterface' @@ -182,6 +186,8 @@ toInstalledIface interface = , instOptions = interface.ifaceOptions , instFixMap = interface.ifaceFixMap , instDefMeths = interface.ifaceDefMeths + , instWarningMap = interface.ifaceWarningMap + , instInstanceLocMap = Map.fromList [(inst_name, loc) | i <- interface.ifaceInstances, let inst_name = is_dfun_name i, Just loc <- [srcSpanToRealSrcSpan (nameSrcSpan inst_name)]] } -- | A monad in which we create Haddock interfaces. Not to be confused with View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8980f4b5667fb549de4151c386d7f5784df3cfc9...0740552187f7e11b7af1d9e1d5f60bd9c042a875 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8980f4b5667fb549de4151c386d7f5784df3cfc9...0740552187f7e11b7af1d9e1d5f60bd9c042a875 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 13:38:36 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 09 Jul 2024 09:38:36 -0400 Subject: [Git][ghc/ghc][wip/prof-dyn] 15 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <668d3d5c194db_12557733e52941171cf@gitlab.mail> Matthew Pickering pushed to branch wip/prof-dyn at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - f2b8bf06 by Matthew Pickering at 2024-07-09T14:37:12+01:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 43c77202 by Matthew Pickering at 2024-07-09T14:37:14+01:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - configure.ac - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/625f5118725aa22d104235ffef696d92e62411e5...43c77202d8757fd60c9233c144eb37bb3ade587b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/625f5118725aa22d104235ffef696d92e62411e5...43c77202d8757fd60c9233c144eb37bb3ade587b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 13:47:59 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 09 Jul 2024 09:47:59 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 2 commits: Revert "Undo a bit more NonDet LblMap" Message-ID: <668d3f8fd73c_1255773698dd81286dc@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 15bd7255 by Rodrigo Mesquita at 2024-07-09T11:13:32+01:00 Revert "Undo a bit more NonDet LblMap" This reverts commit f526e1aee078712a5ae611d73fe90afa5e5095cb. - - - - - dba04972 by Rodrigo Mesquita at 2024-07-09T11:13:37+01:00 Revert "Make FactBase deterministic again" This reverts commit 315f05c001f41cf27b75870aa60d55f15a725421. - - - - - 8 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Sink.hs Changes: ===================================== compiler/GHC/Cmm/Dataflow.hs ===================================== @@ -43,8 +43,9 @@ import Data.Kind (Type) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap) import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label.NonDet hiding (LabelMap) type family Fact (x :: Extensibility) f :: Type type instance Fact C f = FactBase f @@ -157,7 +158,7 @@ fixpointAnalysis direction lattice do_block entry blockmap = loop start -- information in fbase1 and (if something changed) we update it -- and add the affected blocks to the worklist. (todo2, fbase2) = {-# SCC "mapFoldWithKey" #-} - Det.mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts in loop todo2 fbase2 loop _ !fbase1 = fbase1 @@ -230,7 +231,7 @@ fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap do_block block fbase1 let blocks2 = Det.mapInsert (entryLabel new_block) new_block blocks1 (todo2, fbase2) = {-# SCC "mapFoldWithKey_rewrite" #-} - Det.mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts loop todo2 blocks2 fbase2 loop _ !blocks1 !fbase1 = return (blocks1, fbase1) ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -11,8 +11,6 @@ module GHC.Cmm.Dataflow.Label , LabelMap , LabelSet , mkHooplLabel - , FactBase - , lookupFact -- * Set , setEmpty , setNull @@ -296,10 +294,3 @@ instance TrieMap LabelMap where foldTM k m z = mapFoldr k z m filterTM f m = mapFilter f m ------------------------------------------------------------------------------ --- FactBase - -type FactBase f = LabelMap f - -lookupFact :: Label -> FactBase f -> Maybe f -lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -22,6 +22,8 @@ module GHC.Cmm.Dataflow.Label.NonDet ( Label , LabelMap , LabelSet + , FactBase + , lookupFact , mkHooplLabel -- * Set , setEmpty @@ -286,3 +288,10 @@ instance OutputableP env a => OutputableP env (LabelMap a) where -- foldTM k m z = mapFoldr k z m -- TODO:ERROR? -- filterTM f m = mapFilter f m +----------------------------------------------------------------------------- +-- FactBase + +type FactBase f = LabelMap f + +lookupFact :: Label -> FactBase f -> Maybe f +lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -27,6 +27,8 @@ import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet (lookupFact) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module import GHC.Data.Graph.Directed @@ -536,7 +538,7 @@ newtype CAFfyLabel = CAFfyLabel CLabel deriving newtype instance OutputableP env CLabel => OutputableP env CAFfyLabel type CAFSet = Set CAFfyLabel -type CAFEnv = LabelMap CAFSet +type CAFEnv = NonDet.LabelMap CAFSet -- | Records the CAFfy references of a set of static data decls. type DataCAFEnv = Map CLabel CAFSet @@ -603,7 +605,7 @@ cafAnal -> CAFEnv cafAnal platform contLbls topLbl cmmGraph = analyzeCmmBwd cafLattice - (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty + (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph NonDet.mapEmpty cafLattice :: DataflowLattice CAFSet @@ -663,7 +665,7 @@ cafTransfers platform contLbls entry topLbl text "topLbl:" <+> pdoc platform topLbl $$ text "cafs in exit:" <+> pdoc platform joined $$ text "result:" <+> pdoc platform result) $ - mapSingleton (entryLabel eNode) result + NonDet.mapSingleton (entryLabel eNode) result -- ----------------------------------------------------------------------------- @@ -779,7 +781,7 @@ depAnalSRTs platform cafEnv cafEnv_static decls = | (l, lbl) <- labelledBlocks , Just (cafs :: Set CAFfyLabel) <- [case l of - BlockLabel l -> mapLookup l cafEnv + BlockLabel l -> NonDet.mapLookup l cafEnv DeclLabel cl -> Map.lookup cl cafEnv_static] , let cafs' = Set.delete lbl cafs ] @@ -814,7 +816,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep - , Just cafs <- mapLookup (g_entry g) cafEnv + , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv = Just (Just (g_entry g), mkCAFfyLabel platform top_lbl, cafs) | otherwise @@ -907,7 +909,7 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do CmmStaticsRaw lbl _ -> (lbl, set) (proc_envs, procss) = unzip procs - cafEnv = mapUnions proc_envs -- ToDo: May be more expensive now with LabelMap + cafEnv = NonDet.mapUnions proc_envs decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss staticFuns = mapFromList (getStaticFuns decls) ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -263,7 +263,7 @@ cmmLayoutStack cfg procpoints entry_args layout :: CmmConfig -> LabelSet -- proc points - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> BlockId -- entry -> ByteOff -- stack args on entry @@ -439,7 +439,7 @@ getStackLoc (Young l) n stackmaps = -- extra code that goes *after* the Sp adjustment. handleLastNode - :: CmmConfig -> ProcPointSet -> LabelMap CmmLocalLive -> LabelMap ByteOff + :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> LabelMap ByteOff -> NonDet.LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C @@ -571,7 +571,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- the destination, because this StackMap might be used -- by fixupStack if this is a join point. | otherwise = return (l, l, stack1, []) - where live = mapFindWithDefault (panic "handleBranch") l liveness + where live = NonDet.mapFindWithDefault (panic "handleBranch") l liveness stack1 = stack0 { sm_regs = filterUFM is_live (sm_regs stack0) } is_live (r,_) = r `elemRegSet` live @@ -620,7 +620,7 @@ fixupStack old_stack new_stack = concatMap move new_locs setupStackFrame :: Platform -> BlockId -- label of continuation - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> ByteOff -- updfr -> ByteOff -- bytes of return values on stack -> StackMap -- current StackMap @@ -630,7 +630,7 @@ setupStackFrame platform lbl liveness updfr_off ret_args stack0 = (cont_stack, assignments) where -- get the set of LocalRegs live in the continuation - live = mapFindWithDefault Set.empty lbl liveness + live = NonDet.mapFindWithDefault Set.empty lbl liveness -- the stack from the base to updfr_off is off-limits. -- our new stack frame contains: @@ -1058,7 +1058,7 @@ insertReloadsAsNeeded -> UniqDSM [CmmBlock] insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = toBlockList . fst <$> - rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) mapEmpty + rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) NonDet.mapEmpty where rewriteCC :: RewriteFun CmmLocalLive rewriteCC (BlockCC e_node middle0 x_node) fact_base0 = do @@ -1085,7 +1085,7 @@ insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = = (middle0, live_at_middle0) -- Final liveness for this block. - !fact_base2 = mapSingleton entry_label live_with_reloads + !fact_base2 = NonDet.mapSingleton entry_label live_with_reloads return (BlockCC e_node middle1 x_node, fact_base2) ===================================== compiler/GHC/Cmm/Liveness.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.LRegSet import GHC.Data.Maybe ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -29,6 +29,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- Compute a minimal set of proc points for a control-flow graph. @@ -134,7 +135,7 @@ instance Outputable Status where -- Once you know what the proc-points are, figure out -- what proc-points each block is reachable from -- See Note [Proc-point analysis] -procPointAnalysis :: ProcPointSet -> CmmGraph -> LabelMap Status +procPointAnalysis :: ProcPointSet -> CmmGraph -> NonDet.LabelMap Status procPointAnalysis procPoints cmmGraph@(CmmGraph {g_graph = graph}) = analyzeCmmFwd procPointLattice procPointTransfer cmmGraph initProcPoints where @@ -196,14 +197,14 @@ extendPPSet extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block - in case mapLookup id env of + in case NonDet.mapLookup id env of Just ProcPoint -> setInsert id pps _ -> pps procPoints' = foldlGraphBlocks add setEmpty g newPoints = mapMaybe ppSuccessor blocks newPoint = listToMaybe newPoints ppSuccessor b = - let nreached id = case mapLookup id env `orElse` + let nreached id = case NonDet.mapLookup id env `orElse` pprPanic "no ppt" (ppr id <+> pdoc platform b) of ProcPoint -> 1 ReachedBy ps -> setSize ps @@ -235,7 +236,7 @@ extendPPSet platform g blocks procPoints = -- Input invariant: A block should only be reachable from a single ProcPoint. -- ToDo: use the _ret naming convention that the old code generator -- used. -- EZY -splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> LabelMap Status -> CmmDecl +splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> NonDet.LabelMap Status -> CmmDecl -> UniqDSM [CmmDecl] splitAtProcPoints _ _ _ _ _ t@(CmmData _ _) = return [t] splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do @@ -249,7 +250,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let add_block :: LabelMap (LabelMap CmmBlock) -> CmmBlock -> LabelMap (LabelMap CmmBlock) add_block graphEnv b = - case mapLookup bid procMap of + case NonDet.mapLookup bid procMap of Just ProcPoint -> add graphEnv bid bid b Just (ReachedBy set) -> case setElems set of @@ -263,7 +264,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let liveness = cmmGlobalLiveness platform g let ppLiveness pp = filter isArgReg $ regSetToList $ - expectJust "ppLiveness" $ mapLookup pp liveness + expectJust "ppLiveness" $ NonDet.mapLookup pp liveness graphEnv <- return $ foldlGraphBlocks add_block mapEmpty g -- Build a map from proc point BlockId to pairs of: ===================================== compiler/GHC/Cmm/Sink.hs ===================================== @@ -14,8 +14,7 @@ import GHC.Cmm.Liveness import GHC.Cmm.LRegSet import GHC.Cmm.Utils import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label (mapFindWithDefault) -import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Dataflow.Graph import GHC.Platform.Regs @@ -154,7 +153,7 @@ type Assignments = [Assignment] -- x = e1 cmmSink :: CmmConfig -> CmmGraph -> UniqDSM CmmGraph -cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink NonDet.mapEmpty blocks +cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink mapEmpty blocks where platform = cmmPlatform cfg liveness = cmmLocalLivenessL platform graph @@ -164,13 +163,13 @@ cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink NonDet.mapEmpty blocks join_pts = findJoinPoints blocks - sink :: NonDet.LabelMap Assignments -> [CmmBlock] -> UniqDSM [CmmBlock] + sink :: LabelMap Assignments -> [CmmBlock] -> UniqDSM [CmmBlock] sink _ [] = pure [] sink sunk (b:bs) = do -- Now sink and inline in this block (prepend, last_fold) <- runOpt cfg $ constantFoldNode last - (middle', assigs) <- walk cfg (ann_middles ++ annotate platform live_middle prepend) (NonDet.mapFindWithDefault [] lbl sunk) + (middle', assigs) <- walk cfg (ann_middles ++ annotate platform live_middle prepend) (mapFindWithDefault [] lbl sunk) let (final_last, assigs') = tryToInline platform live last_fold assigs -- Now, drop any assignments that we will not sink any further. @@ -193,10 +192,9 @@ cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink NonDet.mapEmpty blocks final_middle = foldl' blockSnoc middle' dropped_last - sunk' = NonDet.mapUnion sunk $ - NonDet.mapFromList - [ (l, filterAssignments platform (getLive l) assigs'') - | l <- succs ] + sunk' = mapUnion sunk $ + mapFromList [ (l, filterAssignments platform (getLive l) assigs'') + | l <- succs ] (blockJoin first final_middle final_last :) <$> sink sunk' bs @@ -216,7 +214,7 @@ cmmSink cfg graph = ofBlockList (g_entry graph) <$> sink NonDet.mapEmpty blocks -- We cannot sink into join points (successors with more than -- one predecessor), so identify the join points and the set -- of registers live in them. - (joins, nonjoins) = partition (`NonDet.mapMember` join_pts) succs + (joins, nonjoins) = partition (`mapMember` join_pts) succs live_in_joins = unionsLRegSet (map getLive joins) -- We do not want to sink an assignment into multiple branches, @@ -266,13 +264,13 @@ annotate platform live nodes = snd $ foldr ann (live,[]) nodes -- -- Find the blocks that have multiple successors (join points) -- -findJoinPoints :: [CmmBlock] -> NonDet.LabelMap Int -findJoinPoints blocks = NonDet.mapFilter (>1) succ_counts +findJoinPoints :: [CmmBlock] -> LabelMap Int +findJoinPoints blocks = mapFilter (>1) succ_counts where all_succs = concatMap successors blocks - succ_counts :: NonDet.LabelMap Int - succ_counts = foldl' (\acc l -> NonDet.mapInsertWith (+) l 1 acc) NonDet.mapEmpty all_succs + succ_counts :: LabelMap Int + succ_counts = foldl' (\acc l -> mapInsertWith (+) l 1 acc) mapEmpty all_succs -- -- filter the list of assignments to remove any assignments that View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f526e1aee078712a5ae611d73fe90afa5e5095cb...dba049723168ab1ec9e3d865bfa55ba67731cbdc -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f526e1aee078712a5ae611d73fe90afa5e5095cb...dba049723168ab1ec9e3d865bfa55ba67731cbdc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 15:40:42 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 11:40:42 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: Make type-equality on synonyms a bit faster Message-ID: <668d59fae24f_22ebb44ff308567f6@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 81b3b2c2 by Simon Peyton Jones at 2024-07-09T11:40:10-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - e5578c13 by Matthew Pickering at 2024-07-09T11:40:10-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 79108ebb by Adam Sandberg Ericsson at 2024-07-09T11:40:11-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 14 changed files: - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - rts/Linker.c - rts/RtsStartup.c - rts/linker/MMap.c - rts/linker/MMap.h - testsuite/tests/rts/Makefile - testsuite/tests/rts/linker/Makefile - testsuite/tests/rts/linker/T11223/Makefile Changes: ===================================== compiler/GHC/Core/Map/Type.hs ===================================== @@ -38,6 +38,7 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.TyCo.Rep +import GHC.Core.TyCon( isForgetfulSynTyCon ) import GHC.Core.TyCo.Compare( eqForAllVis ) import GHC.Data.TrieMap @@ -228,10 +229,11 @@ eqDeBruijnType env_t1@(D env1 t1) env_t2@(D env2 t2) = andEq TEQX e = hasCast e andEq TEQ e = e - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare - go (D _ (TyConApp tc1 [])) (D _ (TyConApp tc2 [])) - | tc1 == tc2 - = TEQ + -- See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare + go (D env1 (TyConApp tc1 tys1)) (D env2 (TyConApp tc2 tys2)) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) + = gos env1 env2 tys1 tys2 + go env_t@(D env t) env_t'@(D env' t') | Just new_t <- coreView t = go (D env new_t) env_t' | Just new_t' <- coreView t' = go env_t (D env' new_t') ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -138,35 +138,52 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing nullary type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form - TyConApp tc [] + TyConApp tc tys1 = TyConApp tc tys2 -where @tc@ is a type synonym. A naive way to perform this comparison these +where `tc` is a type synonym. A naive way to perform this comparison these would first expand the synonym and then compare the resulting expansions. -However, this is obviously wasteful and the RHS of @tc@ may be large; it is -much better to rather compare the TyCons directly. Consequently, before -expanding type synonyms in type comparisons we first look for a nullary -TyConApp and simply compare the TyCons if we find one. Of course, if we find -that the TyCons are *not* equal then we still need to perform the expansion as -their RHSs may still be equal. +However, this is obviously wasteful and the RHS of `tc` may be large. We'd +prefer to compare `tys1 = tys2`. When is that sound? Precisely when the +synonym is not /forgetful/; that is, all its type variables appear in its +RHS -- see `GHC.Core.TyCon.isForgetfulSynTyCon`. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be equal. + +This works fine for /equality/, but not for /comparison/. Consider + type S a b = (b, a) +Now consider + S Int Bool `compare` S Char Char +The ordering may depend on whether we expand the synonym or not, and we +don't want the result to depend on that. So for comparison we stick to +/nullary/ synonyms only, which is still useful. We perform this optimisation in a number of places: - * GHC.Core.Types.eqType - * GHC.Core.Types.nonDetCmpType - * GHC.Core.Unify.unify_ty - * GHC.Tc.Solver.Equality.can_eq_nc' - * TcUnify.uType + * GHC.Core.TyCo.Compare.eqType (works for non-nullary synonyms) + * GHC.Core.Map.TYpe.eqDeBruijnType (works for non-nullary synonyms) + * GHC.Core.Types.nonDetCmpType (nullary only) This optimisation is especially helpful for the ubiquitous GHC.Types.Type, since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. +Currently-missed opportunity (#25009): +* In the case of forgetful synonyms, we could still compare the args, pairwise, + and then compare the RHS's with a suitably extended RnEnv2. That would avoid + comparing the same arg repeatedly. e.g. + type S a b = (a,a) + Compare S y ~ S y + If we expand, we end up compare with itself twice. + + But since forgetful synonyms are rare, we have not tried this. + Note [Type comparisons using object pointer comparisons] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Quite often we substitute the type from a definition site into @@ -341,16 +358,26 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env = \ t1 t2 -> t1 `seq` t2 `seq` let go = generic_eq_type_x syn_flag mult_flag mb_env -- Abbreviation for recursive calls + + gos [] [] = True + gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 + gos _ _ = False + in case (t1,t2) of _ | 1# <- reallyUnsafePtrEquality# t1 t2 -> True -- See Note [Type comparisons using object pointer comparisons] - (TyConApp tc1 [], TyConApp tc2 []) | tc1 == tc2 -> True - -- See Note [Comparing nullary type synonyms] + (TyConApp tc1 tys1, TyConApp tc2 tys2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + -> gos tys1 tys2 _ | ExpandSynonyms <- syn_flag, Just t1' <- coreView t1 -> go t1' t2 | ExpandSynonyms <- syn_flag, Just t2' <- coreView t2 -> go t1 t2' + (TyConApp tc1 ts1, TyConApp tc2 ts2) + | tc1 == tc2 -> gos ts1 ts2 + | otherwise -> False + (TyVarTy tv1, TyVarTy tv2) -> case mb_env of Nothing -> tv1 == tv2 @@ -381,14 +408,6 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env | Just (s1, t1') <- tcSplitAppTyNoView_maybe t1 -> go s1 s2 && go t1' t2' - (TyConApp tc1 ts1, TyConApp tc2 ts2) - | tc1 == tc2 -> gos ts1 ts2 - | otherwise -> False - where - gos [] [] = True - gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 - gos _ _ = False - (ForAllTy (Bndr tv1 vis1) body1, ForAllTy (Bndr tv2 vis2) body2) -> case mb_env of Nothing -> generic_eq_type_x syn_flag mult_flag @@ -666,10 +685,11 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - -- See Note [Comparing nullary type synonyms] + go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 - = TEQ + = TEQ -- See Note [Comparing type synonyms] + go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -758,8 +778,10 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] - go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + + go env (TyConApp tc1 ts1) (TyConApp tc2 ts2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + = gos env (tyConBinders tc1) ts1 ts2 go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -841,7 +841,8 @@ data TyConDetails = -- are fine), again after expanding any -- nested synonyms - synIsForgetful :: Bool, -- True <= at least one argument is not mentioned + synIsForgetful :: Bool, -- See Note [Forgetful type synonyms] + -- True <= at least one argument is not mentioned -- in the RHS (or is mentioned only under -- forgetful synonyms) -- Test is conservative, so True does not guarantee @@ -2121,11 +2122,43 @@ isFamFreeTyCon (TyCon { tyConDetails = details }) -- True. Thus, False means that all bound variables appear on the RHS; -- True may not mean anything, as the test to set this flag is -- conservative. +-- +-- See Note [Forgetful type synonyms] isForgetfulSynTyCon :: TyCon -> Bool isForgetfulSynTyCon (TyCon { tyConDetails = details }) | SynonymTyCon { synIsForgetful = forget } <- details = forget | otherwise = False +{- Note [Forgetful type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A type synonyms is /forgetful/ if its RHS fails to mention one (or more) of its bound variables. + +Forgetfulness is conservative: + * A non-forgetful synonym /guarantees/ to mention all its bound variables in its RHS. + * It is always safe to classify a synonym as forgetful. + +Examples: + type R = Int -- Not forgetful + type S a = Int -- Forgetful + type T1 a = Int -> S a -- Forgetful + type T2 a = a -> S a -- Not forgetful + type T3 a = Int -> F a -- Not forgetful + where type family F a + +* R shows that nullary synonyms are not forgetful. + +* T2 shows that forgetfulness needs to account for uses of forgetful + synonyms. `a` appears on the RHS, but only under a forgetful S + +* T3 shows that non-forgetfulness is not the same as injectivity. T3 mentions its + bound variable on its RHS, but under a type family. So it is entirely possible + that T3 Int ~ T3 Bool + +* Since type synonyms are non-recursive, we don't need a fixpoint analysis to + determine forgetfulness. It's rather easy -- see `GHC.Core.Type.buildSynTyCon`, + which is a bit over-conservative for over-saturated synonyms. +-} + -- As for newtypes, it is in some contexts important to distinguish between -- closed synonyms and synonym families, as synonym families have no unique -- right hand side to which a synonym family application can expand. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon + -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,8 +3275,9 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing -nullary type synonyms] in "GHC.Core.Type". +applications (e.g. things like @TyConApp typeTyCon []@). See +* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" +* Note [Unifying type synonyms] in "GHC.Core.Unify" To accomplish these we use a number of tricks, implemented by mkTyConApp. ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1089,6 +1089,47 @@ of arity n: If we couldn't decompose in the previous step, we return SurelyApart. Afterwards, the rest of the code doesn't have to worry about type families. + +Note [Unifying type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the task of unifying two 'Type's of the form + + TyConApp tc [] ~ TyConApp tc [] + +where `tc` is a type synonym. A naive way to perform this comparison these +would first expand the synonym and then compare the resulting expansions. + +However, this is obviously wasteful and the RHS of `tc` may be large; it is +much better to rather compare the TyCons directly. Consequently, before +expanding type synonyms in type comparisons we first look for a nullary +TyConApp and simply compare the TyCons if we find one. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be unifiable. E.g + type T = S (a->a) + type S a = [a] +and consider + T Int ~ S (Int -> Int) + +We can't decompose non-nullary synonyms. E.g. + type R a = F a -- Where F is a type family +and consider + R (a->a) ~ R Int +We can't conclude that (a->) ~ Int. (There is a currently-missed opportunity +here; if we knew that R was /injective/, perhaps we could decompose.) + +We perform the nullary-type-synonym optimisation in a number of places: + + * GHC.Core.Unify.unify_ty + * GHC.Tc.Solver.Equality.can_eq_nc' + * GHC.Tc.Utils.Unify.uType + +This optimisation is especially helpful for the ubiquitous GHC.Types.Type, +since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications +whenever possible. See Note [Using synonyms to compress types] in +GHC.Core.Type for details. + +c.f. Note [Comparing type synonyms] in GHC.Core.TyCo.Compare -} -------------- unify_ty: the main workhorse ----------- @@ -1107,7 +1148,7 @@ unify_ty :: UMEnv -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare + -- See Note [Unifying type synonyms] | tc1 == tc2 = return () ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,7 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare +-- See Note [Unifying type synonyms] in GHC.Core.Unify can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2187,11 +2187,12 @@ uType env@(UE { u_role = role }) orig_ty1 orig_ty2 ; uType env orig_ty1 ty2 } Nothing -> uUnfilledVar env IsSwapped tv2 ty1 } - -- See Note [Expanding synonyms during unification] + -- See Note [Unifying type synonyms] in GHC.Core.Unify go ty1@(TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = return $ mkReflCo role ty1 + -- Now expand synonyms -- See Note [Expanding synonyms during unification] -- -- Also NB that we recurse to 'go' so that we don't push a @@ -2349,7 +2350,7 @@ We expand synonyms during unification, but: * The problem case immediately above can happen only with arguments to the tycon. So we check for nullary tycons *before* expanding. This is particularly helpful when checking (* ~ *), because * is - now a type synonym. + now a type synonym. See Note [Unifying type synonyms] in GHC.Core.Unify. Note [Deferred unification] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== rts/Linker.c ===================================== @@ -501,11 +501,6 @@ initLinker_ (int retain_cafs) } # endif - if (RtsFlags.MiscFlags.linkerMemBase != 0) { - // User-override for mmap_32bit_base - mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; - } - #if defined(OBJFORMAT_PEi386) initLinker_PEi386(); #endif ===================================== rts/RtsStartup.c ===================================== @@ -11,6 +11,7 @@ #include "HsFFI.h" #include "sm/Storage.h" +#include "linker/MMap.h" #include "RtsFlags.h" #include "RtsUtils.h" #include "Prelude.h" @@ -342,6 +343,9 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config) /* Initialise the adjustors subsystem */ initAdjustors(); + /* Initialise mmapForLinker */ + initLinkerMMap(); + /* Initialise the stats department, phase 1 */ initStats1(); ===================================== rts/linker/MMap.c ===================================== @@ -40,6 +40,13 @@ void *mmap_32bit_base = LINKER_LOAD_BASE; +void initLinkerMMap(void) { + if (RtsFlags.MiscFlags.linkerMemBase != 0) { + // User-override for mmap_32bit_base + mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; + } +} + static const char *memoryAccessDescription(MemoryAccess mode) { switch (mode) { ===================================== rts/linker/MMap.h ===================================== @@ -49,6 +49,8 @@ #define LINKER_LOAD_BASE ((void *) 0x40000000) #endif +void initLinkerMMap(void); + /** Access modes for mprotectForLinker */ typedef enum { MEM_NO_ACCESS, ===================================== testsuite/tests/rts/Makefile ===================================== @@ -23,8 +23,8 @@ T4059: ./T4059 exec_signals-prep: - $(CC) -o exec_signals_child exec_signals_child.c - $(CC) -o exec_signals_prepare exec_signals_prepare.c + $(TEST_CC) -o exec_signals_child exec_signals_child.c + $(TEST_CC) -o exec_signals_prepare exec_signals_prepare.c .PHONY: T4850 T4850: ===================================== testsuite/tests/rts/linker/Makefile ===================================== @@ -69,7 +69,7 @@ linker_unload_native: $(RM) Test.o Test.hi Test.a Test.so Test2.so "$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 -dynamic -fPIC -o Test.a # only libraries without DT_NEEDED are supported - "$(CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ + "$(TEST_CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ -Wl,--whole-archive Test.a cp Test.so Test2.so ===================================== testsuite/tests/rts/linker/T11223/Makefile ===================================== @@ -11,44 +11,44 @@ CC=$(TEST_CC) .PHONY: t_11223_simple_link t_11223_simple_link: $(RM) -f foo_simple.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_simple.o + "$(TEST_CC)" -c foo.c -o foo_simple.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs .PHONY: t_11223_simple_link_lib t_11223_simple_link_lib: $(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a - "$(CC)" -c foo.c -o foo_lib.o + "$(TEST_CC)" -c foo.c -o foo_lib.o "$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)" .PHONY: t_11223_simple_duplicate t_11223_simple_duplicate: $(RM) -f foo_dup.o bar_dup.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_dup.o - "$(CC)" -c bar.c -o bar_dup.o + "$(TEST_CC)" -c foo.c -o foo_dup.o + "$(TEST_CC)" -c bar.c -o bar_dup.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs .PHONY: t_11223_simple_duplicate_lib t_11223_simple_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libfoo_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)" .PHONY: t_11223_simple_unused_duplicate_lib t_11223_simple_unused_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libbar_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)" .PHONY: t_11223_link_order_a_b_succeed t_11223_link_order_a_b_succeed: $(RM) -f foo_link_lib_1.o bar_link_lib_1.o foo.hi foo.o libbar_link_lib_1.a libfoo_link_lib_1.a - "$(CC)" -c foo.c -o foo_link_lib_1.o - "$(CC)" -c bar.c -o bar_link_lib_1.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_1.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_1.o "$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null "$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)" @@ -56,8 +56,8 @@ t_11223_link_order_a_b_succeed: .PHONY: t_11223_link_order_b_a_succeed t_11223_link_order_b_a_succeed: $(RM) -f foo_link_lib_2.o bar_link_lib_2.o foo.hi foo.o libbar_link_lib_2.a libfoo_link_lib_2.a - "$(CC)" -c foo.c -o foo_link_lib_2.o - "$(CC)" -c bar.c -o bar_link_lib_2.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_2.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_2.o "$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null "$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)" @@ -65,8 +65,8 @@ t_11223_link_order_b_a_succeed: .PHONY: t_11223_link_order_a_b_2_fail t_11223_link_order_a_b_2_fail: $(RM) -f foo_link_lib_3.o bar_link_lib_3.o foo.hi foo.o libbar_link_lib_3.a libfoo_link_lib_3.a - "$(CC)" -c foo.c -o foo_link_lib_3.o - "$(CC)" -c bar.c -o bar_link_lib_3.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_3.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_3.o "$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null "$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)" @@ -74,8 +74,8 @@ t_11223_link_order_a_b_2_fail: .PHONY: t_11223_link_order_b_a_2_succeed t_11223_link_order_b_a_2_succeed: $(RM) -f foo_link_lib_4.o bar_link_lib_4.o foo.hi foo.o libbar_link_lib_4.a libfoo_link_lib_4.a - "$(CC)" -c foo.c -o foo_link_lib_4.o - "$(CC)" -c bar.c -o bar_link_lib_4.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_4.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_4.o "$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null "$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)" @@ -87,40 +87,40 @@ t_11223_link_order_b_a_2_succeed: .PHONY: t_11223_weak_only_link_fail t_11223_weak_only_link_fail: $(RM) -f power_w1.o power.hi power.o - "$(CC)" -c power.c -DWEAK -o power_w1.o + "$(TEST_CC)" -c power.c -DWEAK -o power_w1.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o .PHONY: t_11223_weak_only_link_succeed t_11223_weak_only_link_succeed: $(RM) -f power_w2.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o power_w2.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o power_w2.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o .PHONY: t_11223_weak_both_link_order_a_b_succeed t_11223_weak_both_link_order_a_b_succeed: $(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o - "$(CC)" -c power.c -DWEAK -o fast_power_w3.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w3.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w3.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o .PHONY: t_11223_weak_both_link_order_b_a_succeed t_11223_weak_both_link_order_b_a_succeed: $(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o - "$(CC)" -c power.c -DWEAK -o fast_power_w4.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w4.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w4.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o .PHONY: t_11223_weak_single_link_order_a_b_succeed t_11223_weak_single_link_order_a_b_succeed: $(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o - "$(CC)" -c power_slow.c -o slow_power_w5.o - "$(CC)" -c power.c -DWEAK -o fast_power_w5.o + "$(TEST_CC)" -c power_slow.c -o slow_power_w5.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w5.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o .PHONY: t_11223_weak_single_link_order_b_a_succeed t_11223_weak_single_link_order_b_a_succeed: $(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o - "$(CC)" -c power.c -o fast_power_w6.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w6.o + "$(TEST_CC)" -c power.c -o fast_power_w6.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d7ce01cac32b227b09ea160c5eacaa0549c63497...79108ebbd673999e579f5ba7919cb2e067ffa80b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d7ce01cac32b227b09ea160c5eacaa0549c63497...79108ebbd673999e579f5ba7919cb2e067ffa80b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 16:39:14 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 09 Jul 2024 12:39:14 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] test multi-unit build Message-ID: <668d67b281074_22ebb4e84b0873027@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: bf627100 by Torsten Schmits at 2024-07-09T18:39:08+02:00 test multi-unit build - - - - - 5 changed files: - compiler/GHC/Linker/Deps.hs - testsuite/tests/th/cross-package/Makefile - testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/unit1 - + testsuite/tests/th/cross-package/unit2 Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -392,7 +392,7 @@ oneshot_deps_loop opts (mod : mods) acc = do | bytecode -- TODO How can we better determine the external deps? = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local - | Just _ <- mb_home + | is_home = local | otherwise = [] ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -3,8 +3,10 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk # TODO it works even without -package obj, but it should complain about the package not being exposed -BASIC := $(TEST_HC_OPTS) -this-unit-id=cross -package-db db -package dep -v0 -ARGS := $(BASIC) -fprefer-byte-code -fbyte-code-and-object-code +DB := -package-db db -package dep +BASIC := $(TEST_HC_OPTS) $(DB) -this-unit-id=cross -v0 +BC := -fprefer-byte-code -fbyte-code-and-object-code +ARGS := $(BASIC) $(BC) .PHONY: CrossPackageArchive CrossPackageArchive: @@ -25,3 +27,11 @@ CrossPackageNoArchive: CrossPackageArchiveObjCode: ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 ./run.bash "$(TEST_HC)" "$(BASIC)" + +.PHONY: CrossPackageMultiUnit +CrossPackageMultiUnit: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + mkdir -p unit2-src/ + mv CrossLocal.hs CrossNum.hs CrossNum.hs-boot unit2-src/ + "$(TEST_HC)" $(TEST_HC_OPTS) $(ARGS) -unit @unit1 -unit @unit2 + ./Cross ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -1,4 +1,4 @@ -def cross_test(suf): +def cross_test(suf, files = []): name = f'CrossPackage{suf}' test( name, @@ -15,7 +15,7 @@ def cross_test(suf): 'obj.conf', 'prep.bash', 'run.bash', - ]), + ] + files), use_specs({'stdout': 'CrossPackage.stdout'}), ], makefile_test, @@ -26,3 +26,4 @@ cross_test('Archive') cross_test('EmptyArchive') cross_test('NoArchive') cross_test('ArchiveObjCode') +cross_test('MultiUnit', ['unit1', 'unit2']) ===================================== testsuite/tests/th/cross-package/unit1 ===================================== @@ -0,0 +1 @@ +-i -i. Cross -this-unit-id unit1 -package-id unit2 ===================================== testsuite/tests/th/cross-package/unit2 ===================================== @@ -0,0 +1 @@ +-i -i./unit2-src CrossLocal CrossNum -this-unit-id unit2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bf627100bb5075d6db0483cb0dd695741ba4c126 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bf627100bb5075d6db0483cb0dd695741ba4c126 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 16:56:20 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 12:56:20 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Use xmm registers in genapply Message-ID: <668d6bb42f208_22ebb4107dea0734bc@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: c4464914 by sheaf at 2024-07-09T18:56:06+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 7 changed files: - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - rts/include/Cmm.h - utils/deriveConstants/Main.hs - utils/genapply/Main.hs Changes: ===================================== compiler/GHC/Cmm/Lexer.x ===================================== @@ -104,11 +104,14 @@ $white_no_nl+ ; "False" { kw CmmT_False } "likely" { kw CmmT_likely} - P at decimal { global_regN VanillaReg gcWord } - R at decimal { global_regN VanillaReg bWord } - F at decimal { global_regN FloatReg (const $ cmmFloat W32) } - D at decimal { global_regN DoubleReg (const $ cmmFloat W64) } - L at decimal { global_regN LongReg (const $ cmmBits W64) } + P at decimal { global_regN 1 VanillaReg gcWord } + R at decimal { global_regN 1 VanillaReg bWord } + F at decimal { global_regN 1 FloatReg (const $ cmmFloat W32) } + D at decimal { global_regN 1 DoubleReg (const $ cmmFloat W64) } + L at decimal { global_regN 1 LongReg (const $ cmmBits W64) } + XMM at decimal { global_regN 3 XmmReg (const $ cmmVec 2 (cmmFloat W64)) } + YMM at decimal { global_regN 3 YmmReg (const $ cmmVec 4 (cmmFloat W64)) } + ZMM at decimal { global_regN 3 ZmmReg (const $ cmmVec 8 (cmmFloat W64)) } Sp { global_reg Sp bWord } SpLim { global_reg SpLim bWord } Hp { global_reg Hp gcWord } @@ -173,9 +176,9 @@ data CmmToken | CmmT_bits16 | CmmT_bits32 | CmmT_bits64 - | CmmT_bits128 - | CmmT_bits256 - | CmmT_bits512 + | CmmT_vec128 + | CmmT_vec256 + | CmmT_vec512 | CmmT_float32 | CmmT_float64 | CmmT_gcptr @@ -211,14 +214,16 @@ special_char span buf _len = return (L span (CmmT_SpecChar (currentChar buf))) kw :: CmmToken -> Action kw tok span _buf _len = return (L span tok) -global_regN :: (Int -> GlobalReg) -> (Platform -> CmmType) -> Action -global_regN con ty_fn span buf len +global_regN :: Int -> (Int -> GlobalReg) -> (Platform -> CmmType) -> Action +global_regN ident_nb_chars con ty_fn span buf len = do { platform <- getPlatform ; let reg = con (fromIntegral n) ty = ty_fn platform ; return (L span (CmmT_GlobalReg (GlobalRegUse reg ty))) } - where buf' = stepOn buf - n = parseUnsignedInteger buf' (len-1) 10 octDecDigit + where buf' = go ident_nb_chars buf + where go 0 b = b + go i b = go (i-1) (stepOn b) + n = parseUnsignedInteger buf' (len-ident_nb_chars) 10 octDecDigit global_reg :: GlobalReg -> (Platform -> CmmType) -> Action global_reg reg ty_fn span _buf _len @@ -269,9 +274,9 @@ reservedWordsFM = listToUFM $ ( "bits16", CmmT_bits16 ), ( "bits32", CmmT_bits32 ), ( "bits64", CmmT_bits64 ), - ( "bits128", CmmT_bits128 ), - ( "bits256", CmmT_bits256 ), - ( "bits512", CmmT_bits512 ), + ( "vec128", CmmT_vec128 ), + ( "vec256", CmmT_vec256 ), + ( "vec512", CmmT_vec512 ), ( "float32", CmmT_float32 ), ( "float64", CmmT_float64 ), -- New forms @@ -279,9 +284,6 @@ reservedWordsFM = listToUFM $ ( "b16", CmmT_bits16 ), ( "b32", CmmT_bits32 ), ( "b64", CmmT_bits64 ), - ( "b128", CmmT_bits128 ), - ( "b256", CmmT_bits256 ), - ( "b512", CmmT_bits512 ), ( "f32", CmmT_float32 ), ( "f64", CmmT_float64 ), ( "gcptr", CmmT_gcptr ), ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -171,7 +171,7 @@ lintCmmMiddle node = case node of CmmAssign reg expr -> do erep <- lintCmmExpr expr let reg_ty = cmmRegType reg - unless (erep `cmmEqType_ignoring_ptrhood` reg_ty) $ + unless (erep `cmmCompatType` reg_ty) $ cmmLintAssignErr (CmmAssign reg expr) erep reg_ty CmmStore l r _alignment -> do ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -381,9 +381,9 @@ import qualified Data.ByteString.Char8 as BS8 'bits16' { L _ (CmmT_bits16) } 'bits32' { L _ (CmmT_bits32) } 'bits64' { L _ (CmmT_bits64) } - 'bits128' { L _ (CmmT_bits128) } - 'bits256' { L _ (CmmT_bits256) } - 'bits512' { L _ (CmmT_bits512) } + 'vec128' { L _ (CmmT_vec128) } + 'vec256' { L _ (CmmT_vec256) } + 'vec512' { L _ (CmmT_vec512) } 'float32' { L _ (CmmT_float32) } 'float64' { L _ (CmmT_float64) } 'gcptr' { L _ (CmmT_gcptr) } @@ -942,9 +942,9 @@ typenot8 :: { CmmType } : 'bits16' { b16 } | 'bits32' { b32 } | 'bits64' { b64 } - | 'bits128' { b128 } - | 'bits256' { b256 } - | 'bits512' { b512 } + | 'vec128' { cmmVec 2 f64 } + | 'vec256' { cmmVec 4 f64 } + | 'vec512' { cmmVec 8 f64 } | 'float32' { f32 } | 'float64' { f64 } | 'gcptr' {% do platform <- PD.getPlatform; return $ gcWord platform } ===================================== compiler/GHC/Cmm/Type.hs ===================================== @@ -4,7 +4,7 @@ module GHC.Cmm.Type , cInt , cmmBits, cmmFloat , typeWidth, setCmmTypeWidth - , cmmEqType, cmmEqType_ignoring_ptrhood + , cmmEqType, cmmCompatType , isFloatType, isGcPtrType, isBitsType , isWordAny, isWord32, isWord64 , isFloat64, isFloat32 @@ -87,21 +87,27 @@ instance Outputable CmmCat where cmmEqType :: CmmType -> CmmType -> Bool -- Exact equality cmmEqType (CmmType c1 w1) (CmmType c2 w2) = c1==c2 && w1==w2 -cmmEqType_ignoring_ptrhood :: CmmType -> CmmType -> Bool - -- This equality is temporary; used in CmmLint - -- but the RTS files are not yet well-typed wrt pointers -cmmEqType_ignoring_ptrhood (CmmType c1 w1) (CmmType c2 w2) - = c1 `weak_eq` c2 && w1==w2 +-- | A weaker notion of equality of 'CmmType's than 'cmmEqType', +-- used (only) in Cmm Lint. +-- +-- Why "weaker"? Because: +-- +-- - we don't distinguish GcPtr vs NonGcPtr, because the the RTS files +-- are not yet well-typed wrt pointers, +-- - for vectors, we only compare the widths, because in practice things like +-- X86 xmm registers support different types of data (e.g. 4xf32, 2xf64, 2xu64 etc). +cmmCompatType :: CmmType -> CmmType -> Bool +cmmCompatType (CmmType c1 w1) (CmmType c2 w2) + = c1 `weak_eq` c2 && w1 == w2 where weak_eq :: CmmCat -> CmmCat -> Bool - FloatCat `weak_eq` FloatCat = True - FloatCat `weak_eq` _other = False - _other `weak_eq` FloatCat = False - (VecCat l1 cat1) `weak_eq` (VecCat l2 cat2) = l1 == l2 - && cat1 `weak_eq` cat2 - (VecCat {}) `weak_eq` _other = False - _other `weak_eq` (VecCat {}) = False - _word1 `weak_eq` _word2 = True -- Ignores GcPtr + FloatCat `weak_eq` FloatCat = True + FloatCat `weak_eq` _other = False + _other `weak_eq` FloatCat = False + (VecCat {}) `weak_eq` (VecCat {}) = True -- only compare overall width + (VecCat {}) `weak_eq` _other = False + _other `weak_eq` (VecCat {}) = False + _word1 `weak_eq` _word2 = True -- Ignores GcPtr --- Simple operations on CmmType ----- typeWidth :: CmmType -> Width ===================================== rts/include/Cmm.h ===================================== @@ -101,9 +101,9 @@ #define F_ float32 #define D_ float64 #define L_ bits64 -#define V16_ bits128 -#define V32_ bits256 -#define V64_ bits512 +#define V16_ vec128 +#define V32_ vec256 +#define V64_ vec512 #define SIZEOF_StgDouble 8 #define SIZEOF_StgWord64 8 ===================================== utils/deriveConstants/Main.hs ===================================== @@ -1048,7 +1048,8 @@ writeHeader fn rs = atomicWriteFile fn xs genapplyBits = mconcat ["// " ++ _name ++ " " ++ show v ++ "\n" | (_name, v) <- genapplyData] genapplyData = [(_name, v) | (_, GetWord _name (Snd v)) <- rs, _name `elem` genapplyFields ] genapplyFields = [ - "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", "MAX_Real_Long_REG", + "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", + "MAX_Real_Long_REG", "MAX_Real_XMM_REG", "WORD_SIZE", "TAG_BITS", "BITMAP_BITS_SHIFT" ] haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs ===================================== utils/genapply/Main.hs ===================================== @@ -15,6 +15,7 @@ import Text.PrettyPrint import Data.Word import Data.Bits import Data.List ( intersperse, nub, sort ) +import Data.Maybe ( mapMaybe ) import System.Environment import Control.Arrow ((***)) @@ -67,6 +68,7 @@ data TargetInfo = TargetInfo maxRealFloatReg, maxRealDoubleReg, maxRealLongReg, + maxRealXmmReg, wordSize, tagBits, tagBitsMax, @@ -86,6 +88,7 @@ parseTargetInfo path = do maxRealFloatReg = tups_get "MAX_Real_Float_REG", maxRealDoubleReg = tups_get "MAX_Real_Double_REG", maxRealLongReg = tups_get "MAX_Real_Long_REG", + maxRealXmmReg = tups_get "MAX_Real_XMM_REG", wordSize = tups_get "WORD_SIZE", tagBits = tag_bits, tagBitsMax = 1 `shiftL` tag_bits, @@ -105,6 +108,7 @@ data ArgRep | V16 -- 16-byte (128-bit) vectors | V32 -- 32-byte (256-bit) vectors | V64 -- 64-byte (512-bit) vectors + deriving (Eq, Show) -- size of a value in *words* argSize :: TargetInfo -> ArgRep -> Int @@ -138,13 +142,15 @@ isPtr _ = False -- Registers type Reg = String +type AvailRegs = ([Reg],[Reg],[Reg],[Reg],[Int]) -availableRegs :: TargetInfo -> ([Reg],[Reg],[Reg],[Reg]) +availableRegs :: TargetInfo -> AvailRegs availableRegs TargetInfo {..} = ( vanillaRegs maxRealVanillaReg, floatRegs maxRealFloatReg, doubleRegs maxRealDoubleReg, - longRegs maxRealLongReg + longRegs maxRealLongReg, + xmmRegNos maxRealXmmReg ) vanillaRegs, floatRegs, doubleRegs, longRegs :: Int -> [Reg] @@ -153,6 +159,9 @@ floatRegs n = [ "F" ++ show m | m <- [1..n] ] doubleRegs n = [ "D" ++ show m | m <- [1..n] ] longRegs n = [ "L" ++ show m | m <- [1..n] ] +xmmRegNos :: Int -> [Int] +xmmRegNos n = [1..n] + -- ----------------------------------------------------------------------------- -- Loading/saving register arguments to the stack @@ -176,6 +185,7 @@ assignRegs Int) -- Sp of left-over args assignRegs targetInfo sp args = assign targetInfo sp args (availableRegs targetInfo) [] +assign :: TargetInfo -> Int -> [ArgRep] -> AvailRegs -> [(Reg, Int)] -> ([(Reg, Int)], [ArgRep], Int) assign _ sp [] _regs doc = (doc, [], sp) assign targetInfo sp (V : args) regs doc = assign targetInfo sp args regs doc assign targetInfo sp (arg : args) regs doc @@ -184,28 +194,49 @@ assign targetInfo sp (arg : args) regs doc ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp) -findAvailableReg N (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg F (vregs, freg:fregs, dregs, lregs) = - Just (freg, (vregs,fregs,dregs,lregs)) -findAvailableReg D (vregs, fregs, dreg:dregs, lregs) = - Just (dreg, (vregs,fregs,dregs,lregs)) -findAvailableReg L (vregs, fregs, dregs, lreg:lregs) = - Just (lreg, (vregs,fregs,dregs,lregs)) +findAvailableReg :: ArgRep -> AvailRegs -> Maybe (Reg, AvailRegs) +-- NB: this will go wrong if we try to generate stg_apply code with overlapping +-- registers (e.g. stg_ap_df_fast). +-- +-- This function should instead compute non-overlapping registers, +-- depending on the platform. +findAvailableReg N (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg P (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg F (vregs, freg:fregs, dregs, lregs, xmmregNos) = + Just (freg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg D (vregs, fregs, dreg:dregs, lregs, xmmregNos) = + Just (dreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg L (vregs, fregs, dregs, lreg:lregs, xmmregNos) = + Just (lreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg v (vregs, fregs, dregs, lregs, xmmregNo:xmmregNos) + | Just vecRegNm <- + case v of + V16 -> Just "XMM" + V32 -> Just "YMM" + V64 -> Just "ZMM" + _ -> Nothing + -- NB: here we assume xmm/ymm/zmm registers overlap. + = Just (vecRegNm ++ show xmmregNo, (vregs,fregs,dregs,lregs,xmmregNos)) findAvailableReg _ _ = Nothing +assign_reg_to_stk :: String -> Int -> Doc assign_reg_to_stk reg sp = loadSpWordOff (regRep reg) sp <> text " = " <> text reg <> semi +assign_stk_to_reg :: String -> Int -> Doc assign_stk_to_reg reg sp = text reg <> text " = " <> loadSpWordOff (regRep reg) sp <> semi +regRep :: String -> String regRep ('F':_) = "F_" regRep ('D':_) = "D_" regRep ('L':_) = "L_" -regRep _ = "W_" +regRep ('X':'M':'M':_) = "V16_" +regRep ('Y':'M':'M':_) = "V32_" +regRep ('Z':'M':'M':_) = "V64_" +regRep _ = "W_" loadSpWordOff :: String -> Int -> Doc loadSpWordOff rep off = text rep <> text "[Sp+WDS(" <> int off <> text ")]" @@ -649,6 +680,7 @@ formalParam arg n = text "arg" <> int n <> text ", " formalParamType arg = argRep arg +argRep :: ArgRep -> Doc argRep F = text "F_" argRep D = text "D_" argRep L = text "L_" @@ -878,9 +910,18 @@ genApplyFast targetInfo args = (reg_locs, _leftovers, sp_offset) = assignRegs targetInfo 1 args stack_usage = maxStack [fun_stack, (sp_offset,sp_offset)] + + vecs :: [Reg] + vecs = mapMaybe (\ (r,_) -> case r of { xyz:'M':'M':_ | xyz `elem` ['X','Y','Z'] -> Just r; _ -> Nothing}) reg_locs + vecs_cond :: Doc + vecs_cond = case vecs of + [] -> empty + _ -> text "#if" <+> text (unwords [ "defined(REG_" ++ r ++ ")" | r <- vecs ]) + in - vcat [ + vcat $ [ fun_fast_label, + vecs_cond, char '{', nest 4 (vcat [ text "W_ info;", @@ -926,7 +967,15 @@ genApplyFast targetInfo args = char '}' ]), char '}' - ] + ] ++ + if null vecs + then [] + else [ text "#else" + , char '{' + , nest 4 $ text "foreign \"C\" barf(\"" <> mkApplyName args <> text ": unsupported register\", NULL) never returns;" + , char '}' + , text "#endif" + ] -- ----------------------------------------------------------------------------- -- Making a stack apply View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c44649141a44bd8d9b0fae173a4f7fce716f5a76 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c44649141a44bd8d9b0fae173a4f7fce716f5a76 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 16:56:36 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Tue, 09 Jul 2024 12:56:36 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 7 commits: One-shot Haddock Message-ID: <668d6bc46320a_22ebb4112183474046@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 65d08ae5 by Apoorv Ingle at 2024-07-09T11:56:08-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - libraries/ghc-boot/ghc-boot.cabal.in - testsuite/config/ghc - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3e71d39916efb633c4a5e5822ce731e8784d3789...65d08ae5badb849c5e9774e9045dbc34a472534c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3e71d39916efb633c4a5e5822ce731e8784d3789...65d08ae5badb849c5e9774e9045dbc34a472534c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 16:58:37 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 12:58:37 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Use xmm registers in genapply Message-ID: <668d6c3dbe9a5_22ebb4125b1787462c@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 717042b7 by sheaf at 2024-07-09T18:58:14+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 7 changed files: - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - rts/include/Cmm.h - utils/deriveConstants/Main.hs - utils/genapply/Main.hs Changes: ===================================== compiler/GHC/Cmm/Lexer.x ===================================== @@ -104,11 +104,14 @@ $white_no_nl+ ; "False" { kw CmmT_False } "likely" { kw CmmT_likely} - P at decimal { global_regN VanillaReg gcWord } - R at decimal { global_regN VanillaReg bWord } - F at decimal { global_regN FloatReg (const $ cmmFloat W32) } - D at decimal { global_regN DoubleReg (const $ cmmFloat W64) } - L at decimal { global_regN LongReg (const $ cmmBits W64) } + P at decimal { global_regN 1 VanillaReg gcWord } + R at decimal { global_regN 1 VanillaReg bWord } + F at decimal { global_regN 1 FloatReg (const $ cmmFloat W32) } + D at decimal { global_regN 1 DoubleReg (const $ cmmFloat W64) } + L at decimal { global_regN 1 LongReg (const $ cmmBits W64) } + XMM at decimal { global_regN 3 XmmReg (const $ cmmVec 2 (cmmFloat W64)) } + YMM at decimal { global_regN 3 YmmReg (const $ cmmVec 4 (cmmFloat W64)) } + ZMM at decimal { global_regN 3 ZmmReg (const $ cmmVec 8 (cmmFloat W64)) } Sp { global_reg Sp bWord } SpLim { global_reg SpLim bWord } Hp { global_reg Hp gcWord } @@ -173,9 +176,9 @@ data CmmToken | CmmT_bits16 | CmmT_bits32 | CmmT_bits64 - | CmmT_bits128 - | CmmT_bits256 - | CmmT_bits512 + | CmmT_vec128 + | CmmT_vec256 + | CmmT_vec512 | CmmT_float32 | CmmT_float64 | CmmT_gcptr @@ -211,14 +214,16 @@ special_char span buf _len = return (L span (CmmT_SpecChar (currentChar buf))) kw :: CmmToken -> Action kw tok span _buf _len = return (L span tok) -global_regN :: (Int -> GlobalReg) -> (Platform -> CmmType) -> Action -global_regN con ty_fn span buf len +global_regN :: Int -> (Int -> GlobalReg) -> (Platform -> CmmType) -> Action +global_regN ident_nb_chars con ty_fn span buf len = do { platform <- getPlatform ; let reg = con (fromIntegral n) ty = ty_fn platform ; return (L span (CmmT_GlobalReg (GlobalRegUse reg ty))) } - where buf' = stepOn buf - n = parseUnsignedInteger buf' (len-1) 10 octDecDigit + where buf' = go ident_nb_chars buf + where go 0 b = b + go i b = go (i-1) (stepOn b) + n = parseUnsignedInteger buf' (len-ident_nb_chars) 10 octDecDigit global_reg :: GlobalReg -> (Platform -> CmmType) -> Action global_reg reg ty_fn span _buf _len @@ -269,9 +274,9 @@ reservedWordsFM = listToUFM $ ( "bits16", CmmT_bits16 ), ( "bits32", CmmT_bits32 ), ( "bits64", CmmT_bits64 ), - ( "bits128", CmmT_bits128 ), - ( "bits256", CmmT_bits256 ), - ( "bits512", CmmT_bits512 ), + ( "vec128", CmmT_vec128 ), + ( "vec256", CmmT_vec256 ), + ( "vec512", CmmT_vec512 ), ( "float32", CmmT_float32 ), ( "float64", CmmT_float64 ), -- New forms @@ -279,9 +284,6 @@ reservedWordsFM = listToUFM $ ( "b16", CmmT_bits16 ), ( "b32", CmmT_bits32 ), ( "b64", CmmT_bits64 ), - ( "b128", CmmT_bits128 ), - ( "b256", CmmT_bits256 ), - ( "b512", CmmT_bits512 ), ( "f32", CmmT_float32 ), ( "f64", CmmT_float64 ), ( "gcptr", CmmT_gcptr ), ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -171,7 +171,7 @@ lintCmmMiddle node = case node of CmmAssign reg expr -> do erep <- lintCmmExpr expr let reg_ty = cmmRegType reg - unless (erep `cmmEqType_ignoring_ptrhood` reg_ty) $ + unless (erep `cmmCompatType` reg_ty) $ cmmLintAssignErr (CmmAssign reg expr) erep reg_ty CmmStore l r _alignment -> do ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -381,9 +381,9 @@ import qualified Data.ByteString.Char8 as BS8 'bits16' { L _ (CmmT_bits16) } 'bits32' { L _ (CmmT_bits32) } 'bits64' { L _ (CmmT_bits64) } - 'bits128' { L _ (CmmT_bits128) } - 'bits256' { L _ (CmmT_bits256) } - 'bits512' { L _ (CmmT_bits512) } + 'vec128' { L _ (CmmT_vec128) } + 'vec256' { L _ (CmmT_vec256) } + 'vec512' { L _ (CmmT_vec512) } 'float32' { L _ (CmmT_float32) } 'float64' { L _ (CmmT_float64) } 'gcptr' { L _ (CmmT_gcptr) } @@ -942,9 +942,9 @@ typenot8 :: { CmmType } : 'bits16' { b16 } | 'bits32' { b32 } | 'bits64' { b64 } - | 'bits128' { b128 } - | 'bits256' { b256 } - | 'bits512' { b512 } + | 'vec128' { cmmVec 2 f64 } + | 'vec256' { cmmVec 4 f64 } + | 'vec512' { cmmVec 8 f64 } | 'float32' { f32 } | 'float64' { f64 } | 'gcptr' {% do platform <- PD.getPlatform; return $ gcWord platform } ===================================== compiler/GHC/Cmm/Type.hs ===================================== @@ -4,7 +4,7 @@ module GHC.Cmm.Type , cInt , cmmBits, cmmFloat , typeWidth, setCmmTypeWidth - , cmmEqType, cmmEqType_ignoring_ptrhood + , cmmEqType, cmmCompatType , isFloatType, isGcPtrType, isBitsType , isWordAny, isWord32, isWord64 , isFloat64, isFloat32 @@ -87,21 +87,27 @@ instance Outputable CmmCat where cmmEqType :: CmmType -> CmmType -> Bool -- Exact equality cmmEqType (CmmType c1 w1) (CmmType c2 w2) = c1==c2 && w1==w2 -cmmEqType_ignoring_ptrhood :: CmmType -> CmmType -> Bool - -- This equality is temporary; used in CmmLint - -- but the RTS files are not yet well-typed wrt pointers -cmmEqType_ignoring_ptrhood (CmmType c1 w1) (CmmType c2 w2) - = c1 `weak_eq` c2 && w1==w2 +-- | A weaker notion of equality of 'CmmType's than 'cmmEqType', +-- used (only) in Cmm Lint. +-- +-- Why "weaker"? Because: +-- +-- - we don't distinguish GcPtr vs NonGcPtr, because the the RTS files +-- are not yet well-typed wrt pointers, +-- - for vectors, we only compare the widths, because in practice things like +-- X86 xmm registers support different types of data (e.g. 4xf32, 2xf64, 2xu64 etc). +cmmCompatType :: CmmType -> CmmType -> Bool +cmmCompatType (CmmType c1 w1) (CmmType c2 w2) + = c1 `weak_eq` c2 && w1 == w2 where weak_eq :: CmmCat -> CmmCat -> Bool - FloatCat `weak_eq` FloatCat = True - FloatCat `weak_eq` _other = False - _other `weak_eq` FloatCat = False - (VecCat l1 cat1) `weak_eq` (VecCat l2 cat2) = l1 == l2 - && cat1 `weak_eq` cat2 - (VecCat {}) `weak_eq` _other = False - _other `weak_eq` (VecCat {}) = False - _word1 `weak_eq` _word2 = True -- Ignores GcPtr + FloatCat `weak_eq` FloatCat = True + FloatCat `weak_eq` _other = False + _other `weak_eq` FloatCat = False + (VecCat {}) `weak_eq` (VecCat {}) = True -- only compare overall width + (VecCat {}) `weak_eq` _other = False + _other `weak_eq` (VecCat {}) = False + _word1 `weak_eq` _word2 = True -- Ignores GcPtr --- Simple operations on CmmType ----- typeWidth :: CmmType -> Width ===================================== rts/include/Cmm.h ===================================== @@ -101,9 +101,9 @@ #define F_ float32 #define D_ float64 #define L_ bits64 -#define V16_ bits128 -#define V32_ bits256 -#define V64_ bits512 +#define V16_ vec128 +#define V32_ vec256 +#define V64_ vec512 #define SIZEOF_StgDouble 8 #define SIZEOF_StgWord64 8 ===================================== utils/deriveConstants/Main.hs ===================================== @@ -1048,7 +1048,8 @@ writeHeader fn rs = atomicWriteFile fn xs genapplyBits = mconcat ["// " ++ _name ++ " " ++ show v ++ "\n" | (_name, v) <- genapplyData] genapplyData = [(_name, v) | (_, GetWord _name (Snd v)) <- rs, _name `elem` genapplyFields ] genapplyFields = [ - "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", "MAX_Real_Long_REG", + "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", + "MAX_Real_Long_REG", "MAX_Real_XMM_REG", "WORD_SIZE", "TAG_BITS", "BITMAP_BITS_SHIFT" ] haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs ===================================== utils/genapply/Main.hs ===================================== @@ -14,7 +14,8 @@ import Prelude hiding ((<>)) import Text.PrettyPrint import Data.Word import Data.Bits -import Data.List ( intersperse, nub, sort ) +import Data.List ( intercalate, intersperse, nub, sort ) +import Data.Maybe ( mapMaybe ) import System.Environment import Control.Arrow ((***)) @@ -67,6 +68,7 @@ data TargetInfo = TargetInfo maxRealFloatReg, maxRealDoubleReg, maxRealLongReg, + maxRealXmmReg, wordSize, tagBits, tagBitsMax, @@ -86,6 +88,7 @@ parseTargetInfo path = do maxRealFloatReg = tups_get "MAX_Real_Float_REG", maxRealDoubleReg = tups_get "MAX_Real_Double_REG", maxRealLongReg = tups_get "MAX_Real_Long_REG", + maxRealXmmReg = tups_get "MAX_Real_XMM_REG", wordSize = tups_get "WORD_SIZE", tagBits = tag_bits, tagBitsMax = 1 `shiftL` tag_bits, @@ -105,6 +108,7 @@ data ArgRep | V16 -- 16-byte (128-bit) vectors | V32 -- 32-byte (256-bit) vectors | V64 -- 64-byte (512-bit) vectors + deriving (Eq, Show) -- size of a value in *words* argSize :: TargetInfo -> ArgRep -> Int @@ -138,13 +142,15 @@ isPtr _ = False -- Registers type Reg = String +type AvailRegs = ([Reg],[Reg],[Reg],[Reg],[Int]) -availableRegs :: TargetInfo -> ([Reg],[Reg],[Reg],[Reg]) +availableRegs :: TargetInfo -> AvailRegs availableRegs TargetInfo {..} = ( vanillaRegs maxRealVanillaReg, floatRegs maxRealFloatReg, doubleRegs maxRealDoubleReg, - longRegs maxRealLongReg + longRegs maxRealLongReg, + xmmRegNos maxRealXmmReg ) vanillaRegs, floatRegs, doubleRegs, longRegs :: Int -> [Reg] @@ -153,6 +159,9 @@ floatRegs n = [ "F" ++ show m | m <- [1..n] ] doubleRegs n = [ "D" ++ show m | m <- [1..n] ] longRegs n = [ "L" ++ show m | m <- [1..n] ] +xmmRegNos :: Int -> [Int] +xmmRegNos n = [1..n] + -- ----------------------------------------------------------------------------- -- Loading/saving register arguments to the stack @@ -176,6 +185,7 @@ assignRegs Int) -- Sp of left-over args assignRegs targetInfo sp args = assign targetInfo sp args (availableRegs targetInfo) [] +assign :: TargetInfo -> Int -> [ArgRep] -> AvailRegs -> [(Reg, Int)] -> ([(Reg, Int)], [ArgRep], Int) assign _ sp [] _regs doc = (doc, [], sp) assign targetInfo sp (V : args) regs doc = assign targetInfo sp args regs doc assign targetInfo sp (arg : args) regs doc @@ -184,28 +194,49 @@ assign targetInfo sp (arg : args) regs doc ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp) -findAvailableReg N (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg F (vregs, freg:fregs, dregs, lregs) = - Just (freg, (vregs,fregs,dregs,lregs)) -findAvailableReg D (vregs, fregs, dreg:dregs, lregs) = - Just (dreg, (vregs,fregs,dregs,lregs)) -findAvailableReg L (vregs, fregs, dregs, lreg:lregs) = - Just (lreg, (vregs,fregs,dregs,lregs)) +findAvailableReg :: ArgRep -> AvailRegs -> Maybe (Reg, AvailRegs) +-- NB: this will go wrong if we try to generate stg_apply code with overlapping +-- registers (e.g. stg_ap_df_fast). +-- +-- This function should instead compute non-overlapping registers, +-- depending on the platform. +findAvailableReg N (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg P (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg F (vregs, freg:fregs, dregs, lregs, xmmregNos) = + Just (freg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg D (vregs, fregs, dreg:dregs, lregs, xmmregNos) = + Just (dreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg L (vregs, fregs, dregs, lreg:lregs, xmmregNos) = + Just (lreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg v (vregs, fregs, dregs, lregs, xmmregNo:xmmregNos) + | Just vecRegNm <- + case v of + V16 -> Just "XMM" + V32 -> Just "YMM" + V64 -> Just "ZMM" + _ -> Nothing + -- NB: here we assume xmm/ymm/zmm registers overlap. + = Just (vecRegNm ++ show xmmregNo, (vregs,fregs,dregs,lregs,xmmregNos)) findAvailableReg _ _ = Nothing +assign_reg_to_stk :: String -> Int -> Doc assign_reg_to_stk reg sp = loadSpWordOff (regRep reg) sp <> text " = " <> text reg <> semi +assign_stk_to_reg :: String -> Int -> Doc assign_stk_to_reg reg sp = text reg <> text " = " <> loadSpWordOff (regRep reg) sp <> semi +regRep :: String -> String regRep ('F':_) = "F_" regRep ('D':_) = "D_" regRep ('L':_) = "L_" -regRep _ = "W_" +regRep ('X':'M':'M':_) = "V16_" +regRep ('Y':'M':'M':_) = "V32_" +regRep ('Z':'M':'M':_) = "V64_" +regRep _ = "W_" loadSpWordOff :: String -> Int -> Doc loadSpWordOff rep off = text rep <> text "[Sp+WDS(" <> int off <> text ")]" @@ -649,6 +680,7 @@ formalParam arg n = text "arg" <> int n <> text ", " formalParamType arg = argRep arg +argRep :: ArgRep -> Doc argRep F = text "F_" argRep D = text "D_" argRep L = text "L_" @@ -878,9 +910,18 @@ genApplyFast targetInfo args = (reg_locs, _leftovers, sp_offset) = assignRegs targetInfo 1 args stack_usage = maxStack [fun_stack, (sp_offset,sp_offset)] + + vecs :: [Reg] + vecs = mapMaybe (\ (r,_) -> case r of { xyz:'M':'M':_ | xyz `elem` ['X','Y','Z'] -> Just r; _ -> Nothing}) reg_locs + vecs_cond :: Doc + vecs_cond = case vecs of + [] -> empty + _ -> text "#if" <+> text (intercalate " && " [ "defined(REG_" ++ r ++ ")" | r <- vecs ]) + in - vcat [ + vcat $ [ fun_fast_label, + vecs_cond, char '{', nest 4 (vcat [ text "W_ info;", @@ -926,7 +967,15 @@ genApplyFast targetInfo args = char '}' ]), char '}' - ] + ] ++ + if null vecs + then [] + else [ text "#else" + , char '{' + , nest 4 $ text "foreign \"C\" barf(\"" <> mkApplyName args <> text ": unsupported register\", NULL) never returns;" + , char '}' + , text "#endif" + ] -- ----------------------------------------------------------------------------- -- Making a stack apply View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/717042b734aba2d2395558377fe897306de19c1b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/717042b734aba2d2395558377fe897306de19c1b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 17:01:39 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 09 Jul 2024 13:01:39 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Use xmm registers in genapply Message-ID: <668d6cf393444_22ebb413d5ea47525f@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 227ab64d by sheaf at 2024-07-09T19:01:29+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 7 changed files: - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - rts/include/Cmm.h - utils/deriveConstants/Main.hs - utils/genapply/Main.hs Changes: ===================================== compiler/GHC/Cmm/Lexer.x ===================================== @@ -104,11 +104,14 @@ $white_no_nl+ ; "False" { kw CmmT_False } "likely" { kw CmmT_likely} - P at decimal { global_regN VanillaReg gcWord } - R at decimal { global_regN VanillaReg bWord } - F at decimal { global_regN FloatReg (const $ cmmFloat W32) } - D at decimal { global_regN DoubleReg (const $ cmmFloat W64) } - L at decimal { global_regN LongReg (const $ cmmBits W64) } + P at decimal { global_regN 1 VanillaReg gcWord } + R at decimal { global_regN 1 VanillaReg bWord } + F at decimal { global_regN 1 FloatReg (const $ cmmFloat W32) } + D at decimal { global_regN 1 DoubleReg (const $ cmmFloat W64) } + L at decimal { global_regN 1 LongReg (const $ cmmBits W64) } + XMM at decimal { global_regN 3 XmmReg (const $ cmmVec 2 (cmmFloat W64)) } + YMM at decimal { global_regN 3 YmmReg (const $ cmmVec 4 (cmmFloat W64)) } + ZMM at decimal { global_regN 3 ZmmReg (const $ cmmVec 8 (cmmFloat W64)) } Sp { global_reg Sp bWord } SpLim { global_reg SpLim bWord } Hp { global_reg Hp gcWord } @@ -173,9 +176,9 @@ data CmmToken | CmmT_bits16 | CmmT_bits32 | CmmT_bits64 - | CmmT_bits128 - | CmmT_bits256 - | CmmT_bits512 + | CmmT_vec128 + | CmmT_vec256 + | CmmT_vec512 | CmmT_float32 | CmmT_float64 | CmmT_gcptr @@ -211,14 +214,16 @@ special_char span buf _len = return (L span (CmmT_SpecChar (currentChar buf))) kw :: CmmToken -> Action kw tok span _buf _len = return (L span tok) -global_regN :: (Int -> GlobalReg) -> (Platform -> CmmType) -> Action -global_regN con ty_fn span buf len +global_regN :: Int -> (Int -> GlobalReg) -> (Platform -> CmmType) -> Action +global_regN ident_nb_chars con ty_fn span buf len = do { platform <- getPlatform ; let reg = con (fromIntegral n) ty = ty_fn platform ; return (L span (CmmT_GlobalReg (GlobalRegUse reg ty))) } - where buf' = stepOn buf - n = parseUnsignedInteger buf' (len-1) 10 octDecDigit + where buf' = go ident_nb_chars buf + where go 0 b = b + go i b = go (i-1) (stepOn b) + n = parseUnsignedInteger buf' (len-ident_nb_chars) 10 octDecDigit global_reg :: GlobalReg -> (Platform -> CmmType) -> Action global_reg reg ty_fn span _buf _len @@ -269,9 +274,9 @@ reservedWordsFM = listToUFM $ ( "bits16", CmmT_bits16 ), ( "bits32", CmmT_bits32 ), ( "bits64", CmmT_bits64 ), - ( "bits128", CmmT_bits128 ), - ( "bits256", CmmT_bits256 ), - ( "bits512", CmmT_bits512 ), + ( "vec128", CmmT_vec128 ), + ( "vec256", CmmT_vec256 ), + ( "vec512", CmmT_vec512 ), ( "float32", CmmT_float32 ), ( "float64", CmmT_float64 ), -- New forms @@ -279,9 +284,6 @@ reservedWordsFM = listToUFM $ ( "b16", CmmT_bits16 ), ( "b32", CmmT_bits32 ), ( "b64", CmmT_bits64 ), - ( "b128", CmmT_bits128 ), - ( "b256", CmmT_bits256 ), - ( "b512", CmmT_bits512 ), ( "f32", CmmT_float32 ), ( "f64", CmmT_float64 ), ( "gcptr", CmmT_gcptr ), ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -171,7 +171,7 @@ lintCmmMiddle node = case node of CmmAssign reg expr -> do erep <- lintCmmExpr expr let reg_ty = cmmRegType reg - unless (erep `cmmEqType_ignoring_ptrhood` reg_ty) $ + unless (erep `cmmCompatType` reg_ty) $ cmmLintAssignErr (CmmAssign reg expr) erep reg_ty CmmStore l r _alignment -> do ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -381,9 +381,9 @@ import qualified Data.ByteString.Char8 as BS8 'bits16' { L _ (CmmT_bits16) } 'bits32' { L _ (CmmT_bits32) } 'bits64' { L _ (CmmT_bits64) } - 'bits128' { L _ (CmmT_bits128) } - 'bits256' { L _ (CmmT_bits256) } - 'bits512' { L _ (CmmT_bits512) } + 'vec128' { L _ (CmmT_vec128) } + 'vec256' { L _ (CmmT_vec256) } + 'vec512' { L _ (CmmT_vec512) } 'float32' { L _ (CmmT_float32) } 'float64' { L _ (CmmT_float64) } 'gcptr' { L _ (CmmT_gcptr) } @@ -942,9 +942,9 @@ typenot8 :: { CmmType } : 'bits16' { b16 } | 'bits32' { b32 } | 'bits64' { b64 } - | 'bits128' { b128 } - | 'bits256' { b256 } - | 'bits512' { b512 } + | 'vec128' { cmmVec 2 f64 } + | 'vec256' { cmmVec 4 f64 } + | 'vec512' { cmmVec 8 f64 } | 'float32' { f32 } | 'float64' { f64 } | 'gcptr' {% do platform <- PD.getPlatform; return $ gcWord platform } ===================================== compiler/GHC/Cmm/Type.hs ===================================== @@ -4,7 +4,7 @@ module GHC.Cmm.Type , cInt , cmmBits, cmmFloat , typeWidth, setCmmTypeWidth - , cmmEqType, cmmEqType_ignoring_ptrhood + , cmmEqType, cmmCompatType , isFloatType, isGcPtrType, isBitsType , isWordAny, isWord32, isWord64 , isFloat64, isFloat32 @@ -87,21 +87,27 @@ instance Outputable CmmCat where cmmEqType :: CmmType -> CmmType -> Bool -- Exact equality cmmEqType (CmmType c1 w1) (CmmType c2 w2) = c1==c2 && w1==w2 -cmmEqType_ignoring_ptrhood :: CmmType -> CmmType -> Bool - -- This equality is temporary; used in CmmLint - -- but the RTS files are not yet well-typed wrt pointers -cmmEqType_ignoring_ptrhood (CmmType c1 w1) (CmmType c2 w2) - = c1 `weak_eq` c2 && w1==w2 +-- | A weaker notion of equality of 'CmmType's than 'cmmEqType', +-- used (only) in Cmm Lint. +-- +-- Why "weaker"? Because: +-- +-- - we don't distinguish GcPtr vs NonGcPtr, because the the RTS files +-- are not yet well-typed wrt pointers, +-- - for vectors, we only compare the widths, because in practice things like +-- X86 xmm registers support different types of data (e.g. 4xf32, 2xf64, 2xu64 etc). +cmmCompatType :: CmmType -> CmmType -> Bool +cmmCompatType (CmmType c1 w1) (CmmType c2 w2) + = c1 `weak_eq` c2 && w1 == w2 where weak_eq :: CmmCat -> CmmCat -> Bool - FloatCat `weak_eq` FloatCat = True - FloatCat `weak_eq` _other = False - _other `weak_eq` FloatCat = False - (VecCat l1 cat1) `weak_eq` (VecCat l2 cat2) = l1 == l2 - && cat1 `weak_eq` cat2 - (VecCat {}) `weak_eq` _other = False - _other `weak_eq` (VecCat {}) = False - _word1 `weak_eq` _word2 = True -- Ignores GcPtr + FloatCat `weak_eq` FloatCat = True + FloatCat `weak_eq` _other = False + _other `weak_eq` FloatCat = False + (VecCat {}) `weak_eq` (VecCat {}) = True -- only compare overall width + (VecCat {}) `weak_eq` _other = False + _other `weak_eq` (VecCat {}) = False + _word1 `weak_eq` _word2 = True -- Ignores GcPtr --- Simple operations on CmmType ----- typeWidth :: CmmType -> Width ===================================== rts/include/Cmm.h ===================================== @@ -101,9 +101,9 @@ #define F_ float32 #define D_ float64 #define L_ bits64 -#define V16_ bits128 -#define V32_ bits256 -#define V64_ bits512 +#define V16_ vec128 +#define V32_ vec256 +#define V64_ vec512 #define SIZEOF_StgDouble 8 #define SIZEOF_StgWord64 8 ===================================== utils/deriveConstants/Main.hs ===================================== @@ -1048,7 +1048,8 @@ writeHeader fn rs = atomicWriteFile fn xs genapplyBits = mconcat ["// " ++ _name ++ " " ++ show v ++ "\n" | (_name, v) <- genapplyData] genapplyData = [(_name, v) | (_, GetWord _name (Snd v)) <- rs, _name `elem` genapplyFields ] genapplyFields = [ - "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", "MAX_Real_Long_REG", + "MAX_Real_Vanilla_REG", "MAX_Real_Float_REG", "MAX_Real_Double_REG", + "MAX_Real_Long_REG", "MAX_Real_XMM_REG", "WORD_SIZE", "TAG_BITS", "BITMAP_BITS_SHIFT" ] haskellRs = fmap snd $ filter (\r -> fst r `elem` [Haskell,Both]) rs ===================================== utils/genapply/Main.hs ===================================== @@ -14,7 +14,8 @@ import Prelude hiding ((<>)) import Text.PrettyPrint import Data.Word import Data.Bits -import Data.List ( intersperse, nub, sort ) +import Data.List ( intercalate, intersperse, nub, sort ) +import Data.Maybe ( mapMaybe ) import System.Environment import Control.Arrow ((***)) @@ -67,6 +68,7 @@ data TargetInfo = TargetInfo maxRealFloatReg, maxRealDoubleReg, maxRealLongReg, + maxRealXmmReg, wordSize, tagBits, tagBitsMax, @@ -86,6 +88,7 @@ parseTargetInfo path = do maxRealFloatReg = tups_get "MAX_Real_Float_REG", maxRealDoubleReg = tups_get "MAX_Real_Double_REG", maxRealLongReg = tups_get "MAX_Real_Long_REG", + maxRealXmmReg = tups_get "MAX_Real_XMM_REG", wordSize = tups_get "WORD_SIZE", tagBits = tag_bits, tagBitsMax = 1 `shiftL` tag_bits, @@ -105,6 +108,7 @@ data ArgRep | V16 -- 16-byte (128-bit) vectors | V32 -- 32-byte (256-bit) vectors | V64 -- 64-byte (512-bit) vectors + deriving (Eq, Show) -- size of a value in *words* argSize :: TargetInfo -> ArgRep -> Int @@ -138,13 +142,15 @@ isPtr _ = False -- Registers type Reg = String +type AvailRegs = ([Reg],[Reg],[Reg],[Reg],[Int]) -availableRegs :: TargetInfo -> ([Reg],[Reg],[Reg],[Reg]) +availableRegs :: TargetInfo -> AvailRegs availableRegs TargetInfo {..} = ( vanillaRegs maxRealVanillaReg, floatRegs maxRealFloatReg, doubleRegs maxRealDoubleReg, - longRegs maxRealLongReg + longRegs maxRealLongReg, + xmmRegNos maxRealXmmReg ) vanillaRegs, floatRegs, doubleRegs, longRegs :: Int -> [Reg] @@ -153,6 +159,9 @@ floatRegs n = [ "F" ++ show m | m <- [1..n] ] doubleRegs n = [ "D" ++ show m | m <- [1..n] ] longRegs n = [ "L" ++ show m | m <- [1..n] ] +xmmRegNos :: Int -> [Int] +xmmRegNos n = [1..n] + -- ----------------------------------------------------------------------------- -- Loading/saving register arguments to the stack @@ -176,6 +185,7 @@ assignRegs Int) -- Sp of left-over args assignRegs targetInfo sp args = assign targetInfo sp args (availableRegs targetInfo) [] +assign :: TargetInfo -> Int -> [ArgRep] -> AvailRegs -> [(Reg, Int)] -> ([(Reg, Int)], [ArgRep], Int) assign _ sp [] _regs doc = (doc, [], sp) assign targetInfo sp (V : args) regs doc = assign targetInfo sp args regs doc assign targetInfo sp (arg : args) regs doc @@ -184,28 +194,49 @@ assign targetInfo sp (arg : args) regs doc ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp) -findAvailableReg N (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = - Just (vreg, (vregs,fregs,dregs,lregs)) -findAvailableReg F (vregs, freg:fregs, dregs, lregs) = - Just (freg, (vregs,fregs,dregs,lregs)) -findAvailableReg D (vregs, fregs, dreg:dregs, lregs) = - Just (dreg, (vregs,fregs,dregs,lregs)) -findAvailableReg L (vregs, fregs, dregs, lreg:lregs) = - Just (lreg, (vregs,fregs,dregs,lregs)) +findAvailableReg :: ArgRep -> AvailRegs -> Maybe (Reg, AvailRegs) +-- NB: this will go wrong if we try to generate stg_apply code with overlapping +-- registers (e.g. stg_ap_df_fast). +-- +-- This function should instead compute non-overlapping registers, +-- depending on the platform. +findAvailableReg N (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg P (vreg:vregs, fregs, dregs, lregs, xmmregNos) = + Just (vreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg F (vregs, freg:fregs, dregs, lregs, xmmregNos) = + Just (freg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg D (vregs, fregs, dreg:dregs, lregs, xmmregNos) = + Just (dreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg L (vregs, fregs, dregs, lreg:lregs, xmmregNos) = + Just (lreg, (vregs,fregs,dregs,lregs,xmmregNos)) +findAvailableReg v (vregs, fregs, dregs, lregs, xmmregNo:xmmregNos) + | Just vecRegNm <- + case v of + V16 -> Just "XMM" + V32 -> Just "YMM" + V64 -> Just "ZMM" + _ -> Nothing + -- NB: here we assume xmm/ymm/zmm registers overlap. + = Just (vecRegNm ++ show xmmregNo, (vregs,fregs,dregs,lregs,xmmregNos)) findAvailableReg _ _ = Nothing +assign_reg_to_stk :: String -> Int -> Doc assign_reg_to_stk reg sp = loadSpWordOff (regRep reg) sp <> text " = " <> text reg <> semi +assign_stk_to_reg :: String -> Int -> Doc assign_stk_to_reg reg sp = text reg <> text " = " <> loadSpWordOff (regRep reg) sp <> semi +regRep :: String -> String regRep ('F':_) = "F_" regRep ('D':_) = "D_" regRep ('L':_) = "L_" -regRep _ = "W_" +regRep ('X':'M':'M':_) = "V16_" +regRep ('Y':'M':'M':_) = "V32_" +regRep ('Z':'M':'M':_) = "V64_" +regRep _ = "W_" loadSpWordOff :: String -> Int -> Doc loadSpWordOff rep off = text rep <> text "[Sp+WDS(" <> int off <> text ")]" @@ -649,6 +680,7 @@ formalParam arg n = text "arg" <> int n <> text ", " formalParamType arg = argRep arg +argRep :: ArgRep -> Doc argRep F = text "F_" argRep D = text "D_" argRep L = text "L_" @@ -878,9 +910,19 @@ genApplyFast targetInfo args = (reg_locs, _leftovers, sp_offset) = assignRegs targetInfo 1 args stack_usage = maxStack [fun_stack, (sp_offset,sp_offset)] + + vecs :: [Reg] + vecs = mapMaybe (\ (r,_) -> case r of { xyz:'M':'M':_ | xyz `elem` ['X','Y','Z'] -> Just r; _ -> Nothing}) reg_locs + vecs_cond :: Doc + vecs_cond = case vecs of + [] -> empty + _ -> text "#if" <+> text (intercalate " && " [ "defined(REG_" ++ r ++ ")" | r <- vecs ]) + in - vcat [ + vcat $ [ fun_fast_label, + vecs_cond, -- If we use e.g. ZMM1, wrap the definition in "#if defined(REG_ZMM1)" + -- to prevent attempting to compile this code on unsupported architectures. char '{', nest 4 (vcat [ text "W_ info;", @@ -926,7 +968,15 @@ genApplyFast targetInfo args = char '}' ]), char '}' - ] + ] ++ + if null vecs + then [] + else [ text "#else" + , char '{' + , nest 4 $ text "foreign \"C\" barf(\"" <> mkApplyName args <> text ": unsupported register\", NULL) never returns;" + , char '}' + , text "#endif" + ] -- ----------------------------------------------------------------------------- -- Making a stack apply View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/227ab64d3a04af4473e5822d8abc83f17fe0fea9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/227ab64d3a04af4473e5822d8abc83f17fe0fea9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 20:12:49 2024 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Tue, 09 Jul 2024 16:12:49 -0400 Subject: [Git][ghc/ghc][wip/az/epa-span-in-delta] 14 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <668d99c1d9634_22ebb42d0d3908391f@gitlab.mail> Alan Zimmerman pushed to branch wip/az/epa-span-in-delta at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 039bcfda by Alan Zimmerman at 2024-07-09T20:25:43+01:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Types/SrcLoc.hs - configure.ac - hadrian/doc/flavours.md - hadrian/src/Flavour.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - hadrian/src/Settings/Flavours/GhcInGhci.hs - libraries/ghc-boot/ghc-boot.cabal.in - testsuite/config/ghc - testsuite/tests/haddock/haddock_testsuite/Makefile - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/T14189.stderr - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/.gitignore - utils/haddock/CHANGES.md - utils/haddock/doc/invoking.rst - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/99612d1871995bf34b8ee53d0afc52aa15eabd1b...039bcfda9850879cb8ead3f457609af092aca700 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/99612d1871995bf34b8ee53d0afc52aa15eabd1b...039bcfda9850879cb8ead3f457609af092aca700 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 21:09:36 2024 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Tue, 09 Jul 2024 17:09:36 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] 94 commits: ttg: Use List instead of Bag in AST for LHsBindsLR Message-ID: <668da7105215a_22ebb434b0c8c90619@gitlab.mail> Alan Zimmerman pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 1dcc481c by romes at 2024-07-09T21:34:49+01:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Multiplicity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04578d903c7769038e43f501adb7dae1b49ae489...1dcc481c13b343ac36ea3f1296f0743ded93c8db -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04578d903c7769038e43f501adb7dae1b49ae489...1dcc481c13b343ac36ea3f1296f0743ded93c8db You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 9 21:28:03 2024 From: gitlab at gitlab.haskell.org (Alan Zimmerman (@alanz)) Date: Tue, 09 Jul 2024 17:28:03 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] TTG HsCmdArrForm: use Fixity via extension point Message-ID: <668dab63b32df_22ebb437e6c8094664@gitlab.mail> Alan Zimmerman pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: 6911177c by romes at 2024-07-09T22:27:44+01:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 20 changed files: - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - utils/check-exact/ExactPrint.hs Changes: ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,58 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary, Eq +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + +instance Eq Fixity where -- Used to determine if two fixities conflict + (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving Data ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3469,7 +3469,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3483,7 +3483,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6911177ca7be9943f84e23735c3613b27ea5158c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6911177ca7be9943f84e23735c3613b27ea5158c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 00:22:59 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Tue, 09 Jul 2024 20:22:59 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/andreask/rule-ty-match Message-ID: <668dd46395d53_22ebb4508568810881c@gitlab.mail> Andreas Klebinger pushed new branch wip/andreask/rule-ty-match at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/andreask/rule-ty-match You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 01:11:47 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 21:11:47 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Improve docs for NondecreasingIndentation Message-ID: <668ddfd3c7230_22ebb45798538117346@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - 788c10a5 by Matthew Pickering at 2024-07-09T21:11:06-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - ebb3569b by Matthew Pickering at 2024-07-09T21:11:06-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - a4f3a034 by Alex Mason at 2024-07-09T21:11:12-04:00 ncg(aarch64): Add fsqrt instruction Implements the FSQRT machop using native assembly rather than a C call. - - - - - d41ed4da by Alex Mason at 2024-07-09T21:11:12-04:00 ncg(aarch64): Add REV instr for byteSwap primops Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 04895515 by Sylvain Henry at 2024-07-09T21:11:27-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - fcd60b3a by Sylvain Henry at 2024-07-09T21:11:27-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - 57e4bab4 by Sylvain Henry at 2024-07-09T21:11:27-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 6f9fcf6f by Simon Peyton Jones at 2024-07-09T21:11:27-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - d36c9a06 by sheaf at 2024-07-09T21:11:34-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 2dc55217 by Matthew Pickering at 2024-07-09T21:11:35-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - d120e124 by Adam Sandberg Ericsson at 2024-07-09T21:11:35-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - docs/users_guide/bugs.rst - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/79108ebbd673999e579f5ba7919cb2e067ffa80b...d120e124fb5717f5ae20c72ad5c5be6516b96d27 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/79108ebbd673999e579f5ba7919cb2e067ffa80b...d120e124fb5717f5ae20c72ad5c5be6516b96d27 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 03:42:29 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 09 Jul 2024 23:42:29 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: Add support for building profiled dynamic way Message-ID: <668e03256c827_e809d1a4c08305c3@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: a458bdc7 by Matthew Pickering at 2024-07-09T23:42:01-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - c8ee5391 by Matthew Pickering at 2024-07-09T23:42:01-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - c592a4f2 by Alex Mason at 2024-07-09T23:42:04-04:00 ncg(aarch64): Add fsqrt instruction Implements the FSQRT machop using native assembly rather than a C call. - - - - - 1c1e813b by Alex Mason at 2024-07-09T23:42:04-04:00 ncg(aarch64): Add REV instr for byteSwap primops Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - dcaa44ef by Sylvain Henry at 2024-07-09T23:42:11-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 45327a25 by Sylvain Henry at 2024-07-09T23:42:11-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - d7bae16d by Sylvain Henry at 2024-07-09T23:42:11-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 1c7c6651 by Simon Peyton Jones at 2024-07-09T23:42:11-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - f8557c5f by sheaf at 2024-07-09T23:42:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 2bd6b16d by Matthew Pickering at 2024-07-09T23:42:14-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - a3c9f531 by Adam Sandberg Ericsson at 2024-07-09T23:42:15-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d120e124fb5717f5ae20c72ad5c5be6516b96d27...a3c9f53164396101b97f8802a5199f37b87a90b1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d120e124fb5717f5ae20c72ad5c5be6516b96d27...a3c9f53164396101b97f8802a5199f37b87a90b1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 06:13:45 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 10 Jul 2024 02:13:45 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: Add support for building profiled dynamic way Message-ID: <668e269941219_e809d15a1684620d5@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 2eefdb10 by Matthew Pickering at 2024-07-10T02:13:17-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 78065b0f by Matthew Pickering at 2024-07-10T02:13:17-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 7fdc4e91 by Alex Mason at 2024-07-10T02:13:20-04:00 ncg(aarch64): Add fsqrt instruction Implements the FSQRT machop using native assembly rather than a C call. - - - - - ee1ed465 by Alex Mason at 2024-07-10T02:13:20-04:00 ncg(aarch64): Add REV instr for byteSwap primops Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 07cf83a4 by Sylvain Henry at 2024-07-10T02:13:26-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 2171c271 by Sylvain Henry at 2024-07-10T02:13:26-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - e572d2bd by Sylvain Henry at 2024-07-10T02:13:26-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - aedb0a37 by Simon Peyton Jones at 2024-07-10T02:13:26-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 98117172 by sheaf at 2024-07-10T02:13:29-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 5748e9c7 by Matthew Pickering at 2024-07-10T02:13:29-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 80c69cec by Adam Sandberg Ericsson at 2024-07-10T02:13:30-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3c9f53164396101b97f8802a5199f37b87a90b1...80c69cec7a9e4d5ba044077c9797f3b5fe27beb5 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3c9f53164396101b97f8802a5199f37b87a90b1...80c69cec7a9e4d5ba044077c9797f3b5fe27beb5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 07:28:04 2024 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Wed, 10 Jul 2024 03:28:04 -0400 Subject: [Git][ghc/ghc][wip/T25046_impl] 10 commits: AArch64: Simplify stmtToInstrs type Message-ID: <668e3804dadd7_e809d218af40901a1@gitlab.mail> Serge S. Gulin pushed to branch wip/T25046_impl at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - f504ffc4 by Serge S. Gulin at 2024-07-10T11:27:07+04:00 testsuite: extend size performance tests with gzip (fixes #25046) The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric. Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case. 2 groups of tests are added: 1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler). 2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CoreToStg/Prep.hs - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - libraries/ghc-boot/ghc-boot.cabal.in - testsuite/config/ghc - testsuite/driver/testlib.py - testsuite/mk/test.mk - testsuite/tests/haddock/haddock_testsuite/Makefile - + testsuite/tests/perf/size/Makefile - testsuite/tests/perf/size/all.T - testsuite/tests/perf/size/javascript/Makefile - − testsuite/tests/perf/size/javascript/T24602_perf_size.hs - testsuite/tests/perf/size/javascript/all.T - + testsuite/tests/simplCore/should_compile/T25033.hs - testsuite/tests/simplCore/should_compile/all.T - utils/haddock/.gitignore - utils/haddock/CHANGES.md - utils/haddock/doc/invoking.rst - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/Options.hs - utils/haddock/haddock-test/src/Test/Haddock.hs - utils/haddock/haddock-test/src/Test/Haddock/Config.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f2bf5cfa390361477b90923fa8d0be1e48c43fdb...f504ffc45e9565ec872b4bf17286208a858aca8e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f2bf5cfa390361477b90923fa8d0be1e48c43fdb...f504ffc45e9565ec872b4bf17286208a858aca8e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 08:44:17 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 10 Jul 2024 04:44:17 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: Add support for building profiled dynamic way Message-ID: <668e49e14459d_e809d2e502d4124770@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d89ec2a7 by Matthew Pickering at 2024-07-10T04:43:57-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 6fc28ee5 by Matthew Pickering at 2024-07-10T04:43:57-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - e641e16a by Sylvain Henry at 2024-07-10T04:44:02-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 8fb7c0a1 by Sylvain Henry at 2024-07-10T04:44:02-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - f4ca0ffa by Sylvain Henry at 2024-07-10T04:44:02-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 7a208db4 by Simon Peyton Jones at 2024-07-10T04:44:02-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - c197856c by sheaf at 2024-07-10T04:44:05-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 3ac9e346 by Matthew Pickering at 2024-07-10T04:44:05-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - b9199675 by Adam Sandberg Ericsson at 2024-07-10T04:44:06-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/80c69cec7a9e4d5ba044077c9797f3b5fe27beb5...b919967595a1c3dc87a0a9e4adccd086883d3965 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/80c69cec7a9e4d5ba044077c9797f3b5fe27beb5...b919967595a1c3dc87a0a9e4adccd086883d3965 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 10:26:14 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 06:26:14 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] ncg perf: WIP SPECIALISE Line SDoc #25060 Message-ID: <668e61c616792_e809d3c92dec147973@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC Commits: 7babce16 by Rodrigo Mesquita at 2024-07-10T11:25:54+01:00 ncg perf: WIP SPECIALISE Line SDoc #25060 - - - - - 21 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Dwarf/Constants.hs - compiler/GHC/CmmToAsm/Dwarf/Types.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Ppr.hs - compiler/GHC/Llvm/MetaData.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/Types/CostCentre.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Types/Name/Occurrence.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Unit/Types.hs - compiler/GHC/Utils/Outputable.hs Changes: ===================================== compiler/GHC/Builtin/PrimOps.hs ===================================== @@ -905,6 +905,7 @@ compare_fun_ty ty = mkVisFunTysMany [ty, ty] intPrimTy pprPrimOp :: IsLine doc => PrimOp -> doc pprPrimOp other_op = pprOccName (primOpOcc other_op) {-# SPECIALIZE pprPrimOp :: PrimOp -> SDoc #-} +{-# SPECIALIZE pprPrimOp :: PrimOp -> Line SDoc #-} {-# SPECIALIZE pprPrimOp :: PrimOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -307,6 +307,7 @@ pprModuleLabelKind MLK_FinalizerArray = text "fini_arr" pprModuleLabelKind (MLK_Finalizer (LexicalFastString s)) = text "fini__" <> ftext s pprModuleLabelKind MLK_IPEBuffer = text "ipe_buf" {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> SDoc #-} +{-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> Line SDoc #-} {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable isIdLabel :: CLabel -> Bool @@ -1428,11 +1429,13 @@ data LabelStyle pprAsmLabel :: IsLine doc => Platform -> CLabel -> doc pprAsmLabel platform lbl = pprCLabelStyle platform AsmStyle lbl {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprCLabel :: IsLine doc => Platform -> CLabel -> doc pprCLabel platform lbl = pprCLabelStyle platform CStyle lbl {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance OutputableP Platform CLabel where @@ -1583,8 +1586,8 @@ pprCLabelStyle !platform !sty lbl = -- see Note [Bangs in CLabel] CmmLabel _ _ fs CmmRetInfo -> maybe_underscore $ ftext fs <> text "_info" CmmLabel _ _ fs CmmRet -> maybe_underscore $ ftext fs <> text "_ret" CmmLabel _ _ fs CmmClosure -> maybe_underscore $ ftext fs <> text "_closure" -{-# INLINABLE pprCLabelStyle #-} -- Workaround a bug which prevented pprCLabelStyle from specialising (see #25060). {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [Internal proc labels] @@ -1621,6 +1624,7 @@ ppInternalProcLabel this_mod (IdLabel nm _ flavour) <> ppIdFlavor flavour ppInternalProcLabel _ _ = Nothing {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe SDoc #-} +{-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe Line SDoc #-} {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppIdFlavor :: IsLine doc => IdLabelInfo -> doc ===================================== compiler/GHC/Cmm/DebugBlock.hs ===================================== @@ -542,6 +542,7 @@ pprUnwindExpr p env = \case | p <= 1 -> pprUnwindExpr 2 env e0 <> char '*' <> pprUnwindExpr 2 env e1 other -> parens (pprUnwindExpr 0 env other) {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> SDoc #-} +{-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> Line SDoc #-} {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Conversion of Cmm expressions to unwind expressions. We check for ===================================== compiler/GHC/Cmm/Reg.hs ===================================== @@ -284,6 +284,7 @@ pprGlobalReg gr BaseReg -> text "BaseReg" PicBaseReg -> text "PicBaseReg" {-# SPECIALIZE pprGlobalReg :: GlobalReg -> SDoc #-} +{-# SPECIALIZE pprGlobalReg :: GlobalReg -> Line SDoc #-} {-# SPECIALIZE pprGlobalReg :: GlobalReg -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -68,6 +68,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprLabel :: IsDoc doc => Platform -> CLabel -> doc ===================================== compiler/GHC/CmmToAsm/Dwarf/Constants.hs ===================================== @@ -152,16 +152,22 @@ dwarfFrameSection platform = dwarfSection platform "frame" dwarfGhcSection platform = dwarfSection platform "ghc" dwarfARangesSection platform = dwarfSection platform "aranges" {-# SPECIALIZE dwarfInfoSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfInfoSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfInfoSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfAbbrevSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfAbbrevSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfLineSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfLineSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfFrameSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfFrameSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfGhcSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfGhcSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfGhcSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfARangesSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfARangesSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfARangesSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable dwarfSection :: IsDoc doc => Platform -> String -> doc @@ -175,6 +181,7 @@ dwarfSection platform name = | otherwise -> text "\t.section .debug_" <> text name <> text ",\"dr\"" {-# SPECIALIZE dwarfSection :: Platform -> String -> SDoc #-} +{-# SPECIALIZE dwarfSection :: Platform -> String -> Line SDoc #-} {-# SPECIALIZE dwarfSection :: Platform -> String -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -185,12 +192,16 @@ dwarfAbbrevLabel = text ".Lsection_abbrev" dwarfLineLabel = text ".Lsection_line" dwarfFrameLabel = text ".Lsection_frame" {-# SPECIALIZE dwarfInfoLabel :: SDoc #-} +{-# SPECIALIZE dwarfInfoLabel :: Line SDoc #-} {-# SPECIALIZE dwarfInfoLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevLabel :: SDoc #-} +{-# SPECIALIZE dwarfAbbrevLabel :: Line SDoc #-} {-# SPECIALIZE dwarfAbbrevLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineLabel :: SDoc #-} +{-# SPECIALIZE dwarfLineLabel :: Line SDoc #-} {-# SPECIALIZE dwarfLineLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameLabel :: SDoc #-} +{-# SPECIALIZE dwarfFrameLabel :: Line SDoc #-} {-# SPECIALIZE dwarfFrameLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mapping of registers to DWARF register numbers ===================================== compiler/GHC/CmmToAsm/Dwarf/Types.hs ===================================== @@ -144,6 +144,7 @@ pprAbbrevDecls platform haveDebugLine = ] $$ pprByte 0 {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> SDoc #-} +{-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> Line SDoc #-} {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generate assembly for DWARF data @@ -161,6 +162,7 @@ pprDwarfInfo platform haveSrc d pprDwarfInfoClose noChildren = pprDwarfInfoOpen platform haveSrc d {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> SDoc #-} +{-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> Line SDoc #-} {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a CLabel name in a ".stringz \"LABEL\"" @@ -258,6 +260,7 @@ pprDwarfARanges platform arngs unitU = $$ pprWord platform (char '0') $$ pprWord platform (char '0') {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> SDoc #-} +{-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> Line SDoc #-} {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDwarfARange :: IsDoc doc => Platform -> DwarfARange -> doc @@ -355,6 +358,7 @@ pprDwarfFrame platform DwarfFrame{dwCieLabel=cieLabel,dwCieInit=cieInit,dwCiePro -- Procedure unwind tables vcat (map (pprFrameProc platform cieLabel cieInit) procs) {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> SDoc #-} +{-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> Line SDoc #-} {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Writes a "Frame Description Entry" for a procedure. This consists @@ -548,18 +552,21 @@ wordAlign plat = PW4 -> char '2' _other -> int (platformWordSizeInBytes plat) {-# SPECIALIZE wordAlign :: Platform -> SDoc #-} +{-# SPECIALIZE wordAlign :: Platform -> Line SDoc #-} {-# SPECIALIZE wordAlign :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a single byte of constant DWARF data pprByte :: IsDoc doc => Word8 -> doc pprByte x = line $ text "\t.byte " <> integer (fromIntegral x) {-# SPECIALIZE pprByte :: Word8 -> SDoc #-} +{-# SPECIALIZE pprByte :: Word8 -> Line SDoc #-} {-# SPECIALIZE pprByte :: Word8 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a two-byte constant integer pprHalf :: IsDoc doc => Word16 -> doc pprHalf x = line $ text "\t.short" <+> integer (fromIntegral x) {-# SPECIALIZE pprHalf :: Word16 -> SDoc #-} +{-# SPECIALIZE pprHalf :: Word16 -> Line SDoc #-} {-# SPECIALIZE pprHalf :: Word16 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a constant DWARF flag @@ -570,6 +577,7 @@ pprFlag f = pprByte (if f then 0xff else 0x00) pprData4' :: IsDoc doc => Line doc -> doc pprData4' x = line (text "\t.long " <> x) {-# SPECIALIZE pprData4' :: SDoc -> SDoc #-} +{-# SPECIALIZE pprData4' :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprData4' :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for 4 bytes of constant DWARF data @@ -581,6 +589,7 @@ pprData4 = pprData4' . integer . fromIntegral pprDwWord :: IsDoc doc => Line doc -> doc pprDwWord = pprData4' {-# SPECIALIZE pprDwWord :: SDoc -> SDoc #-} +{-# SPECIALIZE pprDwWord :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprDwWord :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a machine word of dynamic data. Depends on the @@ -591,6 +600,7 @@ pprWord plat s = PW4 -> text "\t.long " <> s PW8 -> text "\t.quad " <> s {-# SPECIALIZE pprWord :: Platform -> SDoc -> SDoc #-} +{-# SPECIALIZE pprWord :: Platform -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprWord :: Platform -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Prints a number in "little endian base 128" format. The idea is @@ -602,6 +612,7 @@ pprLEBWord x | x < 128 = pprByte (fromIntegral x) | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBWord (x `shiftR` 7) {-# SPECIALIZE pprLEBWord :: Word -> SDoc #-} +{-# SPECIALIZE pprLEBWord :: Word -> Line SDoc #-} {-# SPECIALIZE pprLEBWord :: Word -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Same as @pprLEBWord@, but for a signed number @@ -611,6 +622,7 @@ pprLEBInt x | x >= -64 && x < 64 | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBInt (x `shiftR` 7) {-# SPECIALIZE pprLEBInt :: Int -> SDoc #-} +{-# SPECIALIZE pprLEBInt :: Int -> Line SDoc #-} {-# SPECIALIZE pprLEBInt :: Int -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generates a dynamic null-terminated string. If required the @@ -653,4 +665,5 @@ sectionOffset plat target section = OSMinGW32 -> line (text "\t.secrel32 " <> target) _other -> pprDwWord target {-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE sectionOffset :: Platform -> HLine -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -85,6 +85,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output the ELF .size directive. ===================================== compiler/GHC/CmmToAsm/Ppr.hs ===================================== @@ -122,12 +122,14 @@ pprASCII str chr' :: Word8 -> Char chr' (W8# w#) = C# (chr# (word2Int# (word8ToWord# w#))) {-# SPECIALIZE pprASCII :: ByteString -> SDoc #-} +{-# SPECIALIZE pprASCII :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprASCII :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".string" directive pprString :: IsLine doc => ByteString -> doc pprString bs = text "\t.string " <> doubleQuotes (pprASCII bs) {-# SPECIALIZE pprString :: ByteString -> SDoc #-} +{-# SPECIALIZE pprString :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprString :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".incbin" directive @@ -139,6 +141,7 @@ pprFileEmbed path <> pprFilePathString path -- proper escape (see #16389) <> text "\n\t.byte 0" {-# SPECIALIZE pprFileEmbed :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFileEmbed :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFileEmbed :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- @@ -204,6 +207,7 @@ pprSectionHeader config (Section t suffix) = OSDarwin -> pprDarwinSectionHeader t _ -> pprGNUSectionHeader config t suffix {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> SDoc #-} +{-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> Line SDoc #-} {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprGNUSectionHeader :: IsLine doc => NCGConfig -> SectionType -> CLabel -> doc @@ -256,6 +260,7 @@ pprGNUSectionHeader config t suffix = | otherwise -> text ",\"aMS\"," <> sectionType platform "progbits" <> text ",1" _ -> empty {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> SDoc #-} +{-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- XCOFF doesn't support relocating label-differences, so we place all @@ -270,6 +275,7 @@ pprXcoffSectionHeader t = case t of UninitialisedData -> text ".csect .data[BS]" _ -> panic "pprXcoffSectionHeader: unknown section type" {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDarwinSectionHeader :: IsLine doc => SectionType -> doc @@ -284,4 +290,5 @@ pprDarwinSectionHeader t = case t of CString -> text ".section\t__TEXT,__cstring,cstring_literals" OtherSection _ -> panic "pprDarwinSectionHeader: unknown section type" {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -134,6 +134,7 @@ pprNatCmmDecl config proc@(CmmProc top_info entry_lbl _ (ListGraph blocks)) = , pprSizeDecl platform proc_lbl ] {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output an internal proc label. See Note [Internal proc labels] in CLabel. ===================================== compiler/GHC/CmmToLlvm.hs ===================================== @@ -126,6 +126,7 @@ llvmHeader cfg = hang (text "Available targets:") 4 (vcat $ map (text . fst) $ llvmTargets config) {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> SDoc #-} +{-# SPECIALIZE llvmHeader :: LlvmCgConfig -> Line SDoc #-} {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable llvmGroupLlvmGens :: RawCmmGroup -> LlvmM () ===================================== compiler/GHC/CmmToLlvm/Ppr.hs ===================================== @@ -36,6 +36,7 @@ pprLlvmData cfg (globals, types) = globals' = ppLlvmGlobals cfg globals in types' $$ globals' {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> SDoc #-} +{-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> Line SDoc #-} {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Llvm/MetaData.hs ===================================== @@ -79,6 +79,7 @@ instance Outputable MetaId where ppMetaId :: IsLine doc => MetaId -> doc ppMetaId (MetaId n) = char '!' <> int n {-# SPECIALIZE ppMetaId :: MetaId -> SDoc #-} +{-# SPECIALIZE ppMetaId :: MetaId -> Line SDoc #-} {-# SPECIALIZE ppMetaId :: MetaId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | LLVM metadata expressions ===================================== compiler/GHC/Llvm/Ppr.hs ===================================== @@ -58,6 +58,7 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) $$ ppLlvmFunctionDecls decls $$ newLine $$ ppLlvmFunctions opts funcs {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> SDoc #-} +{-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> Line SDoc #-} {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -65,12 +66,14 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) ppLlvmComments :: IsDoc doc => [LMString] -> doc ppLlvmComments comments = lines_ $ map ppLlvmComment comments {-# SPECIALIZE ppLlvmComments :: [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmComments :: [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmComments :: [LMString] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a comment, can be inside a function or on its own ppLlvmComment :: IsLine doc => LMString -> doc ppLlvmComment com = semi <+> ftext com {-# SPECIALIZE ppLlvmComment :: LMString -> SDoc #-} +{-# SPECIALIZE ppLlvmComment :: LMString -> Line SDoc #-} {-# SPECIALIZE ppLlvmComment :: LMString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -78,6 +81,7 @@ ppLlvmComment com = semi <+> ftext com ppLlvmGlobals :: IsDoc doc => LlvmCgConfig -> [LMGlobal] -> doc ppLlvmGlobals opts ls = lines_ $ map (ppLlvmGlobal opts) ls {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a global mutable variable definition @@ -106,6 +110,7 @@ ppLlvmGlobal opts (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) = ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ text "Non Global var ppr as global! " <> ppVar opts var <> text "=" <> ppr (fmap (ppStatic @SDoc opts) val) {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -113,6 +118,7 @@ ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ ppLlvmAliases :: IsDoc doc => [LlvmAlias] -> doc ppLlvmAliases tys = lines_ $ map ppLlvmAlias tys {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> SDoc #-} +{-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> Line SDoc #-} {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM type alias. @@ -120,6 +126,7 @@ ppLlvmAlias :: IsLine doc => LlvmAlias -> doc ppLlvmAlias (name, ty) = char '%' <> ftext name <+> equals <+> text "type" <+> ppLlvmType ty {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> SDoc #-} +{-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> Line SDoc #-} {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -127,6 +134,7 @@ ppLlvmAlias (name, ty) ppLlvmMetas :: IsDoc doc => LlvmCgConfig -> [MetaDecl] -> doc ppLlvmMetas opts metas = lines_ $ map (ppLlvmMeta opts) metas {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> SDoc #-} +{-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> Line SDoc #-} {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM metadata definition. @@ -139,6 +147,7 @@ ppLlvmMeta _opts (MetaNamed n m) where nodes = hcat $ intersperse comma $ map ppMetaId m {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -146,6 +155,7 @@ ppLlvmMeta _opts (MetaNamed n m) ppLlvmFunctions :: IsDoc doc => LlvmCgConfig -> LlvmFunctions -> doc ppLlvmFunctions opts funcs = vcat $ map (ppLlvmFunction opts) funcs {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition. @@ -167,6 +177,7 @@ ppLlvmFunction opts fun = , newLine , newLine] {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> SDoc #-} +{-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition header. @@ -186,12 +197,14 @@ ppLlvmFunctionHeader (LlvmFunctionDecl n l c r varg p a) args in ppLlvmLinkageType l <+> ppLlvmCallConvention c <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> hsep (punctuate comma args') <> varg' <> rparen <> align {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a list of function declaration. ppLlvmFunctionDecls :: IsDoc doc => LlvmFunctionDecls -> doc ppLlvmFunctionDecls decs = vcat $ map ppLlvmFunctionDecl decs {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function declaration. @@ -213,6 +226,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> args <> varg' <> rparen <> align , empty] {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -220,6 +234,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) ppLlvmBlocks :: IsDoc doc => LlvmCgConfig -> LlvmBlocks -> doc ppLlvmBlocks opts blocks = vcat $ map (ppLlvmBlock opts) blocks {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> SDoc #-} +{-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block. @@ -237,12 +252,14 @@ ppLlvmBlock opts (LlvmBlock blockId stmts) = : map (ppLlvmStatement opts) block ++ [ empty , ppRest ] {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> SDoc #-} +{-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block label. ppLlvmBlockLabel :: IsLine doc => LlvmBlockId -> doc ppLlvmBlockLabel id = pprUniqueAlways id <> colon {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> SDoc #-} +{-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -266,6 +283,7 @@ ppLlvmStatement opts stmt = Nop -> line empty {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> SDoc #-} +{-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> Line SDoc #-} {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM expression. @@ -291,6 +309,7 @@ ppLlvmExpression opts expr Asm asm c ty v se sk -> ppAsm opts asm c ty v se sk MExpr meta expr -> ppMetaAnnotExpr opts meta expr {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaExpr :: IsLine doc => LlvmCgConfig -> MetaExpr -> doc @@ -302,6 +321,7 @@ ppMetaExpr opts = \case MetaVar v -> ppVar opts v MetaStruct es -> char '!' <> braces (ppCommaJoin (ppMetaExpr opts) es) {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> SDoc #-} +{-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> Line SDoc #-} {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -348,6 +368,7 @@ ppCall opts ct fptr args attrs = case fptr of ppCallMetaExpr attrs (MetaVar v) = ppVar' attrs opts v ppCallMetaExpr _ v = text "metadata" <+> ppMetaExpr opts v {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> SDoc #-} +{-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> Line SDoc #-} {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -356,6 +377,7 @@ ppMachOp opts op left right = ppLlvmMachOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -373,11 +395,13 @@ ppCmpOp opts op left right = in cmpOp <+> ppLlvmCmpOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAssignment :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc -> doc ppAssignment opts var expr = ppName opts var <+> equals <+> expr {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> SDoc #-} +{-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> Line SDoc #-} {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> HLine -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppFence :: IsLine doc => Bool -> LlvmSyncOrdering -> doc @@ -386,6 +410,7 @@ ppFence st ord = False -> empty in text "fence" <+> singleThread <+> ppSyncOrdering ord {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSyncOrdering :: IsLine doc => LlvmSyncOrdering -> doc @@ -396,6 +421,7 @@ ppSyncOrdering SyncRelease = text "release" ppSyncOrdering SyncAcqRel = text "acq_rel" ppSyncOrdering SyncSeqCst = text "seq_cst" {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicOp :: IsLine doc => LlvmAtomicOp -> doc @@ -411,6 +437,7 @@ ppAtomicOp LAO_Min = text "min" ppAtomicOp LAO_Umax = text "umax" ppAtomicOp LAO_Umin = text "umin" {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> SDoc #-} +{-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> Line SDoc #-} {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicRMW :: IsLine doc => LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> doc @@ -418,6 +445,7 @@ ppAtomicRMW opts aop tgt src ordering = text "atomicrmw" <+> ppAtomicOp aop <+> ppVar opts tgt <> comma <+> ppVar opts src <+> ppSyncOrdering ordering {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppCmpXChg :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar @@ -426,6 +454,7 @@ ppCmpXChg opts addr old new s_ord f_ord = text "cmpxchg" <+> ppVar opts addr <> comma <+> ppVar opts old <> comma <+> ppVar opts new <+> ppSyncOrdering s_ord <+> ppSyncOrdering f_ord {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -439,6 +468,7 @@ ppLoad opts var alignment = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> SDoc #-} +{-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> Line SDoc #-} {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppALoad :: IsLine doc => LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> doc @@ -451,6 +481,7 @@ ppALoad opts ord st var = in text "load atomic" <+> ppLlvmType derefType <> comma <+> ppVar opts var <> sThreaded <+> ppSyncOrdering ord <> align {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStore :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> doc @@ -462,6 +493,7 @@ ppStore opts val dst alignment metas = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -472,6 +504,7 @@ ppCast opts op from to <+> text "to" <+> ppLlvmType to {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> SDoc #-} +{-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> Line SDoc #-} {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -480,6 +513,7 @@ ppMalloc opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "malloc" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAlloca :: IsLine doc => LlvmCgConfig -> LlvmType -> Int -> doc @@ -487,6 +521,7 @@ ppAlloca opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "alloca" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppGetElementPtr :: IsLine doc => LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> doc @@ -497,6 +532,7 @@ ppGetElementPtr opts inb ptr idx = in text "getelementptr" <+> inbound <+> ppLlvmType derefType <> comma <+> ppVar opts ptr <> indexes {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> SDoc #-} +{-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> Line SDoc #-} {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -504,11 +540,13 @@ ppReturn :: IsLine doc => LlvmCgConfig -> Maybe LlvmVar -> doc ppReturn opts (Just var) = text "ret" <+> ppVar opts var ppReturn _ Nothing = text "ret" <+> ppLlvmType LMVoid {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> SDoc #-} +{-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppBranch :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppBranch opts var = text "br" <+> ppVar opts var {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -516,6 +554,7 @@ ppBranchIf :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc ppBranchIf opts cond trueT falseT = text "br" <+> ppVar opts cond <> comma <+> ppVar opts trueT <> comma <+> ppVar opts falseT {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -524,6 +563,7 @@ ppPhi opts tp preds = let ppPreds (val, label) = brackets $ ppName opts val <> comma <+> ppName opts label in text "phi" <+> ppLlvmType tp <+> hsep (punctuate comma $ map ppPreds preds) {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -536,6 +576,7 @@ ppSwitch opts scrut dflt targets = , [char ']'] ] {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -550,6 +591,7 @@ ppAsm opts asm constraints rty vars sideeffect alignstack = in text "call" <+> rty' <+> text "asm" <+> side <+> align <+> asm' <> comma <+> cons <> vars' {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> SDoc #-} +{-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> Line SDoc #-} {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtract :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> doc @@ -558,6 +600,7 @@ ppExtract opts vec idx = <+> ppLlvmType (getVarType vec) <+> ppName opts vec <> comma <+> ppVar opts idx {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtractV :: IsLine doc => LlvmCgConfig -> LlvmVar -> Int -> doc @@ -566,6 +609,7 @@ ppExtractV opts struct idx = <+> ppLlvmType (getVarType struct) <+> ppName opts struct <> comma <+> int idx {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> SDoc #-} +{-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> Line SDoc #-} {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppInsert :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc @@ -575,12 +619,14 @@ ppInsert opts vec elt idx = <+> ppLlvmType (getVarType elt) <+> ppName opts elt <> comma <+> ppVar opts idx {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnotExpr :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> doc ppMetaAnnotExpr opts meta expr = ppLlvmExpression opts expr <> ppMetaAnnots opts meta {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnots :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> doc @@ -593,6 +639,7 @@ ppMetaAnnots opts meta = hcat $ map ppMeta meta MetaStruct ms -> exclamation <> braces (ppCommaJoin (ppMetaExpr opts) ms) other -> exclamation <> braces (ppMetaExpr opts other) -- possible? {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -604,6 +651,7 @@ ppName opts v = case v of LMNLocalVar {} -> char '%' <> ppPlainName opts v LMLitVar {} -> ppPlainName opts v {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -616,6 +664,7 @@ ppPlainName opts v = case v of (LMNLocalVar x _ ) -> ftext x (LMLitVar x ) -> ppLit opts x {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a literal value. No type. @@ -639,11 +688,13 @@ ppLit opts l = case l of , Just lit <- garbageLit t -> ppLit opts lit | otherwise -> text "undef" {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppVar = ppVar' [] {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> doc @@ -651,11 +702,13 @@ ppVar' attrs opts v = case v of LMLitVar x -> ppTypeLit' attrs opts x x -> ppLlvmType (getVarType x) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppName opts x {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit :: IsLine doc => LlvmCgConfig -> LlvmLit -> doc ppTypeLit = ppTypeLit' [] {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> doc @@ -663,6 +716,7 @@ ppTypeLit' attrs opts l = case l of LMVectorLit {} -> ppLit opts l _ -> ppLlvmType (getLitType l) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppLit opts l {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStatic :: IsLine doc => LlvmCgConfig -> LlvmStatic -> doc @@ -681,6 +735,7 @@ ppStatic opts st = case st of LMAdd s1 s2 -> pprStaticArith opts s1 s2 (text "add") (text "fadd") (text "LMAdd") LMSub s1 s2 -> pprStaticArith opts s1 s2 (text "sub") (text "fsub") (text "LMSub") {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -694,6 +749,7 @@ pprSpecialStatic opts stat = case stat of <> comma <+> ppStatic opts stat _ -> ppStatic opts stat {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -707,6 +763,7 @@ pprStaticArith opts s1 s2 int_op float_op op_name = op_name <> text " with different types! s1: " <> ppStatic opts s1 <> text", s2: " <> ppStatic opts s2 {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> HLine -> HLine -> SDoc -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -718,10 +775,12 @@ pprStaticArith opts s1 s2 int_op float_op op_name = newLine :: IsDoc doc => doc newLine = empty {-# SPECIALIZE newLine :: SDoc #-} +{-# SPECIALIZE newLine :: Line SDoc #-} {-# SPECIALIZE newLine :: HDoc #-} -- | Exclamation point. exclamation :: IsLine doc => doc exclamation = char '!' {-# SPECIALIZE exclamation :: SDoc #-} +{-# SPECIALIZE exclamation :: Line SDoc #-} {-# SPECIALIZE exclamation :: HLine #-} ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -89,6 +89,7 @@ ppLlvmType t = case t of LMFunction (LlvmFunctionDecl _ _ _ r varg p _) -> ppLlvmType r <+> lparen <> ppParams varg p <> rparen {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} +{-# SPECIALIZE ppLlvmType :: LlvmType -> Line SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc @@ -101,6 +102,7 @@ ppParams varg p args = map fst p in ppCommaJoin ppLlvmType args <> varg' {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> SDoc #-} +{-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> Line SDoc #-} {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | An LLVM section definition. If Nothing then let LLVM decide the section @@ -400,6 +402,7 @@ ppLlvmParamAttr NoAlias = text "noalias" ppLlvmParamAttr NoCapture = text "nocapture" ppLlvmParamAttr Nest = text "nest" {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Llvm Function Attributes. @@ -498,6 +501,7 @@ ppLlvmFuncAttr NoRedZone = text "noredzone" ppLlvmFuncAttr NoImplicitFloat = text "noimplicitfloat" ppLlvmFuncAttr Naked = text "naked" {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -556,6 +560,7 @@ ppLlvmCallConvention CC_Ghc = text "ghccc" ppLlvmCallConvention (CC_Ncc i) = text "cc " <> int i ppLlvmCallConvention CC_X86_Stdcc = text "x86_stdcallcc" {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> SDoc #-} +{-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> Line SDoc #-} {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -630,6 +635,7 @@ ppLlvmLinkageType ExternallyVisible = empty ppLlvmLinkageType External = text "external" ppLlvmLinkageType Private = text "private" {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> SDoc #-} +{-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> Line SDoc #-} {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -690,6 +696,7 @@ ppLlvmMachOp LM_MO_And = text "and" ppLlvmMachOp LM_MO_Or = text "or" ppLlvmMachOp LM_MO_Xor = text "xor" {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> SDoc #-} +{-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -737,6 +744,7 @@ ppLlvmCmpOp LM_CMP_Fge = text "oge" ppLlvmCmpOp LM_CMP_Flt = text "olt" ppLlvmCmpOp LM_CMP_Fle = text "ole" {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -773,6 +781,7 @@ ppLlvmCastOp LM_Ptrtoint = text "ptrtoint" ppLlvmCastOp LM_Inttoptr = text "inttoptr" ppLlvmCastOp LM_Bitcast = text "bitcast" {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -799,6 +808,7 @@ ppDouble platform d str = map toUpper $ concat $ fixEndian $ map hex bs in text "0x" <> text str {-# SPECIALIZE ppDouble :: Platform -> Double -> SDoc #-} +{-# SPECIALIZE ppDouble :: Platform -> Double -> Line SDoc #-} {-# SPECIALIZE ppDouble :: Platform -> Double -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [LLVM Float Types] @@ -829,6 +839,7 @@ widenFp = float2Double ppFloat :: IsLine doc => Platform -> Float -> doc ppFloat platform = ppDouble platform . widenFp {-# SPECIALIZE ppFloat :: Platform -> Float -> SDoc #-} +{-# SPECIALIZE ppFloat :: Platform -> Float -> Line SDoc #-} {-# SPECIALIZE ppFloat :: Platform -> Float -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -839,9 +850,11 @@ ppFloat platform = ppDouble platform . widenFp ppCommaJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppCommaJoin ppr strs = hsep $ punctuate comma (map ppr strs) {-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppCommaJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSpaceJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppSpaceJoin ppr strs = hsep (map ppr strs) {-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppSpaceJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Types/CostCentre.hs ===================================== @@ -261,6 +261,7 @@ pprCostCentreStack CurrentCCS = text "CCCS" pprCostCentreStack DontCareCCS = text "CCS_DONT_CARE" pprCostCentreStack (SingletonCCS cc) = pprCostCentre cc <> text "_ccs" {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> SDoc #-} +{-# SPECIALISE pprCostCentreStack :: CostCentreStack -> Line SDoc #-} {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ----------------------------------------------------------------------------- @@ -284,6 +285,7 @@ pprCostCentre :: IsLine doc => CostCentre -> doc pprCostCentre cc = docWithStyle (ppCostCentreLbl cc) (\_ -> ftext (costCentreUserNameFS cc)) {-# SPECIALISE pprCostCentre :: CostCentre -> SDoc #-} +{-# SPECIALISE pprCostCentre :: CostCentre -> Line SDoc #-} {-# SPECIALISE pprCostCentre :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Printing in Core @@ -315,6 +317,7 @@ ppCostCentreLbl (NormalCC {cc_flavour = f, cc_name = n, cc_mod = m}) = pprModule m <> char '_' <> ztext (zEncodeFS n) <> char '_' <> ppFlavourLblComponent f <> text "_cc" {-# SPECIALISE ppCostCentreLbl :: CostCentre -> SDoc #-} +{-# SPECIALISE ppCostCentreLbl :: CostCentre -> Line SDoc #-} {-# SPECIALISE ppCostCentreLbl :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour component of a C label @@ -328,6 +331,7 @@ ppFlavourLblComponent (IndexedCC flav i) = LateCC -> text "LATECC" <> ppIdxLblComponent i CallerCC -> text "CALLERCC" <> ppIdxLblComponent i {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> SDoc #-} +{-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> Line SDoc #-} {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour index component of a C label @@ -337,6 +341,7 @@ ppIdxLblComponent n = 0 -> empty n -> int n {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> SDoc #-} +{-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> Line SDoc #-} {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- This is the name to go in the user-displayed string, ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -713,8 +713,8 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) handlePuns :: Bool -> Maybe FastString -> SDoc -> SDoc handlePuns True (Just pun) _ = ftext pun handlePuns _ _ r = r -{-# INLINABLE pprName #-} -- Workaround a bug which prevented pprName from specialising (see #25060). {-# SPECIALISE pprName :: Name -> SDoc #-} +{-# SPECIALISE pprName :: Name -> Line SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print fully qualified name (with unit-id, module and unique) ===================================== compiler/GHC/Types/Name/Occurrence.hs ===================================== @@ -403,6 +403,7 @@ pprOccName (OccName sp occ) = docWithStyle (ztext (zEncodeFS occ)) (\_ -> ftext occ <> whenPprDebug (braces (pprNameSpaceBrief sp))) {-# SPECIALIZE pprOccName :: OccName -> SDoc #-} +{-# SPECIALIZE pprOccName :: OccName -> Line SDoc #-} {-# SPECIALIZE pprOccName :: OccName -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mangle field names to avoid duplicate symbols. ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -305,6 +305,7 @@ pprUniqueAlways :: IsLine doc => Unique -> doc pprUniqueAlways u = text (showUnique u) {-# SPECIALIZE pprUniqueAlways :: Unique -> SDoc #-} +{-# SPECIALIZE pprUniqueAlways :: Unique -> Line SDoc #-} {-# SPECIALIZE pprUniqueAlways :: Unique -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance Outputable Unique where ===================================== compiler/GHC/Unit/Types.hs ===================================== @@ -217,6 +217,7 @@ pprModule mod@(Module p n) = docWithStyle code doc | otherwise = pprModuleName n {-# SPECIALIZE pprModule :: Module -> SDoc #-} +{-# SPECIALIZE pprModule :: Module -> Line SDoc #-} {-# SPECIALIZE pprModule :: Module -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprInstantiatedModule :: InstantiatedModule -> SDoc ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1080,6 +1080,7 @@ pprModuleName :: IsLine doc => ModuleName -> doc pprModuleName (ModuleName nm) = docWithStyle (ztext (zEncodeFS nm)) (\_ -> ftext nm) {-# SPECIALIZE pprModuleName :: ModuleName -> SDoc #-} +{-# SPECIALIZE pprModuleName :: ModuleName -> Line SDoc #-} {-# SPECIALIZE pprModuleName :: ModuleName -> HLine #-} -- see Note [SPECIALIZE to HDoc] ----------------------------------------------------------------------- @@ -1374,6 +1375,7 @@ pprFilePathString path = doubleQuotes $ text (escape (normalise path)) escape ('\\':xs) = '\\':'\\':escape xs escape (x:xs) = x:escape xs {-# SPECIALIZE pprFilePathString :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFilePathString :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFilePathString :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] {- @@ -1737,6 +1739,11 @@ pragma just to the entry point pprNatCmmDecl, to avoid cluttering the entire module. Because specialization is transitive, this makes sure that other functions in that module are specialized too. +NB: Specialising to SDoc also requires specialising to (Line SDoc) (which is a +type family that reduces to SDoc). This serves to workaround the fact that a +rule on @SDoc will not fire for @(Line SDoc) since the rule matching is blind +to type-family equations. See #25060 for a discussion. + Note [dualLine and dualDoc] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The IsLine and IsDoc classes provide the dualLine and dualDoc methods, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7babce16cce00444dbc417d3dd2e94fc5d21d816 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7babce16cce00444dbc417d3dd2e94fc5d21d816 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 10:27:27 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 06:27:27 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] 33 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <668e620fa99f3_e809d3dbecac14993a@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - a1a27312 by Rodrigo Mesquita at 2024-07-10T11:26:58+01:00 ngc: Workaround WW vs SPEC bug in pprinting Adds INLINABLE to `pprName` and `pprCLabelStyle` which turned up in a profile as unspecialised at types where it should have been specialised. The INLINABLE pragma works around a bug which causes specialisation to be missed due to Worker Wrapper (#25060). See also #25060 and #21851 Specialising these functions improves compile time allocations: geo. mean -0.5% minimum -3.2% maximum +0.2% ------------------------- Metric Decrease: ManyAlternatives ManyConstructors T12707 T13035 T13379 T1969 T9961 ------------------------- - - - - - 02c0738e by Rodrigo Mesquita at 2024-07-10T11:26:58+01:00 ncg: Don't execute dwarfGen for SDoc unnecessarily `dwarfGen @SDoc` is only needed if -ddump-asm is enabled (see emitNativeCode). Matching on the tuple forced unnecessary execution since the unique supply is threaded through -- use a lazy pattern instead. - - - - - 7bf06120 by Rodrigo Mesquita at 2024-07-10T11:26:58+01:00 ncg: INLINEABLE regAlloc regAlloc showed up in a time profile unspecialised, and making sure it is specialised is noticeable in the profile. Enabling it shaved off some 15ms compiling Cabal on my machine. - - - - - b444aec8 by Rodrigo Mesquita at 2024-07-10T11:26:58+01:00 ncg perf: WIP SPECIALISE Line SDoc #25060 - - - - - 30 changed files: - + .gitlab/README.md - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Dwarf/Constants.hs - compiler/GHC/CmmToAsm/Dwarf/Types.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Ppr.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Lit.hs - + compiler/GHC/Hs/Specificity.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7babce16cce00444dbc417d3dd2e94fc5d21d816...b444aec86bf87af66d36677cb5b86c40607c522c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7babce16cce00444dbc417d3dd2e94fc5d21d816...b444aec86bf87af66d36677cb5b86c40607c522c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 10:35:32 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 06:35:32 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] ncg perf: WIP SPECIALISE Line SDoc #25060 Message-ID: <668e63f414df0_e809d3f5436415446c@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC Commits: ad6e5be1 by Rodrigo Mesquita at 2024-07-10T11:34:52+01:00 ncg perf: WIP SPECIALISE Line SDoc #25060 - - - - - 21 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Dwarf/Constants.hs - compiler/GHC/CmmToAsm/Dwarf/Types.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Ppr.hs - compiler/GHC/Llvm/MetaData.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/Types/CostCentre.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Types/Name/Occurrence.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Unit/Types.hs - compiler/GHC/Utils/Outputable.hs Changes: ===================================== compiler/GHC/Builtin/PrimOps.hs ===================================== @@ -905,6 +905,7 @@ compare_fun_ty ty = mkVisFunTysMany [ty, ty] intPrimTy pprPrimOp :: IsLine doc => PrimOp -> doc pprPrimOp other_op = pprOccName (primOpOcc other_op) {-# SPECIALIZE pprPrimOp :: PrimOp -> SDoc #-} +{-# SPECIALIZE pprPrimOp :: PrimOp -> Line SDoc #-} {-# SPECIALIZE pprPrimOp :: PrimOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -307,6 +307,7 @@ pprModuleLabelKind MLK_FinalizerArray = text "fini_arr" pprModuleLabelKind (MLK_Finalizer (LexicalFastString s)) = text "fini__" <> ftext s pprModuleLabelKind MLK_IPEBuffer = text "ipe_buf" {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> SDoc #-} +{-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> Line SDoc #-} {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable isIdLabel :: CLabel -> Bool @@ -1428,11 +1429,13 @@ data LabelStyle pprAsmLabel :: IsLine doc => Platform -> CLabel -> doc pprAsmLabel platform lbl = pprCLabelStyle platform AsmStyle lbl {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprCLabel :: IsLine doc => Platform -> CLabel -> doc pprCLabel platform lbl = pprCLabelStyle platform CStyle lbl {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance OutputableP Platform CLabel where @@ -1583,8 +1586,8 @@ pprCLabelStyle !platform !sty lbl = -- see Note [Bangs in CLabel] CmmLabel _ _ fs CmmRetInfo -> maybe_underscore $ ftext fs <> text "_info" CmmLabel _ _ fs CmmRet -> maybe_underscore $ ftext fs <> text "_ret" CmmLabel _ _ fs CmmClosure -> maybe_underscore $ ftext fs <> text "_closure" -{-# INLINABLE pprCLabelStyle #-} -- Workaround a bug which prevented pprCLabelStyle from specialising (see #25060). {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [Internal proc labels] @@ -1621,6 +1624,7 @@ ppInternalProcLabel this_mod (IdLabel nm _ flavour) <> ppIdFlavor flavour ppInternalProcLabel _ _ = Nothing {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe SDoc #-} +{-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe (Line SDoc) #-} {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppIdFlavor :: IsLine doc => IdLabelInfo -> doc ===================================== compiler/GHC/Cmm/DebugBlock.hs ===================================== @@ -542,6 +542,7 @@ pprUnwindExpr p env = \case | p <= 1 -> pprUnwindExpr 2 env e0 <> char '*' <> pprUnwindExpr 2 env e1 other -> parens (pprUnwindExpr 0 env other) {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> SDoc #-} +{-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> Line SDoc #-} {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Conversion of Cmm expressions to unwind expressions. We check for ===================================== compiler/GHC/Cmm/Reg.hs ===================================== @@ -284,6 +284,7 @@ pprGlobalReg gr BaseReg -> text "BaseReg" PicBaseReg -> text "PicBaseReg" {-# SPECIALIZE pprGlobalReg :: GlobalReg -> SDoc #-} +{-# SPECIALIZE pprGlobalReg :: GlobalReg -> Line SDoc #-} {-# SPECIALIZE pprGlobalReg :: GlobalReg -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -68,6 +68,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprLabel :: IsDoc doc => Platform -> CLabel -> doc ===================================== compiler/GHC/CmmToAsm/Dwarf/Constants.hs ===================================== @@ -152,16 +152,22 @@ dwarfFrameSection platform = dwarfSection platform "frame" dwarfGhcSection platform = dwarfSection platform "ghc" dwarfARangesSection platform = dwarfSection platform "aranges" {-# SPECIALIZE dwarfInfoSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfInfoSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfInfoSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfAbbrevSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfAbbrevSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfLineSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfLineSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfFrameSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfFrameSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfGhcSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfGhcSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfGhcSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfARangesSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfARangesSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfARangesSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable dwarfSection :: IsDoc doc => Platform -> String -> doc @@ -175,6 +181,7 @@ dwarfSection platform name = | otherwise -> text "\t.section .debug_" <> text name <> text ",\"dr\"" {-# SPECIALIZE dwarfSection :: Platform -> String -> SDoc #-} +{-# SPECIALIZE dwarfSection :: Platform -> String -> Line SDoc #-} {-# SPECIALIZE dwarfSection :: Platform -> String -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -185,12 +192,16 @@ dwarfAbbrevLabel = text ".Lsection_abbrev" dwarfLineLabel = text ".Lsection_line" dwarfFrameLabel = text ".Lsection_frame" {-# SPECIALIZE dwarfInfoLabel :: SDoc #-} +{-# SPECIALIZE dwarfInfoLabel :: Line SDoc #-} {-# SPECIALIZE dwarfInfoLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevLabel :: SDoc #-} +{-# SPECIALIZE dwarfAbbrevLabel :: Line SDoc #-} {-# SPECIALIZE dwarfAbbrevLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineLabel :: SDoc #-} +{-# SPECIALIZE dwarfLineLabel :: Line SDoc #-} {-# SPECIALIZE dwarfLineLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameLabel :: SDoc #-} +{-# SPECIALIZE dwarfFrameLabel :: Line SDoc #-} {-# SPECIALIZE dwarfFrameLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mapping of registers to DWARF register numbers ===================================== compiler/GHC/CmmToAsm/Dwarf/Types.hs ===================================== @@ -144,6 +144,7 @@ pprAbbrevDecls platform haveDebugLine = ] $$ pprByte 0 {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> SDoc #-} +{-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> Line SDoc #-} {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generate assembly for DWARF data @@ -161,6 +162,7 @@ pprDwarfInfo platform haveSrc d pprDwarfInfoClose noChildren = pprDwarfInfoOpen platform haveSrc d {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> SDoc #-} +{-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> Line SDoc #-} {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a CLabel name in a ".stringz \"LABEL\"" @@ -258,6 +260,7 @@ pprDwarfARanges platform arngs unitU = $$ pprWord platform (char '0') $$ pprWord platform (char '0') {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> SDoc #-} +{-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> Line SDoc #-} {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDwarfARange :: IsDoc doc => Platform -> DwarfARange -> doc @@ -355,6 +358,7 @@ pprDwarfFrame platform DwarfFrame{dwCieLabel=cieLabel,dwCieInit=cieInit,dwCiePro -- Procedure unwind tables vcat (map (pprFrameProc platform cieLabel cieInit) procs) {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> SDoc #-} +{-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> Line SDoc #-} {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Writes a "Frame Description Entry" for a procedure. This consists @@ -548,18 +552,21 @@ wordAlign plat = PW4 -> char '2' _other -> int (platformWordSizeInBytes plat) {-# SPECIALIZE wordAlign :: Platform -> SDoc #-} +{-# SPECIALIZE wordAlign :: Platform -> Line SDoc #-} {-# SPECIALIZE wordAlign :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a single byte of constant DWARF data pprByte :: IsDoc doc => Word8 -> doc pprByte x = line $ text "\t.byte " <> integer (fromIntegral x) {-# SPECIALIZE pprByte :: Word8 -> SDoc #-} +{-# SPECIALIZE pprByte :: Word8 -> Line SDoc #-} {-# SPECIALIZE pprByte :: Word8 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a two-byte constant integer pprHalf :: IsDoc doc => Word16 -> doc pprHalf x = line $ text "\t.short" <+> integer (fromIntegral x) {-# SPECIALIZE pprHalf :: Word16 -> SDoc #-} +{-# SPECIALIZE pprHalf :: Word16 -> Line SDoc #-} {-# SPECIALIZE pprHalf :: Word16 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a constant DWARF flag @@ -570,6 +577,7 @@ pprFlag f = pprByte (if f then 0xff else 0x00) pprData4' :: IsDoc doc => Line doc -> doc pprData4' x = line (text "\t.long " <> x) {-# SPECIALIZE pprData4' :: SDoc -> SDoc #-} +{-# SPECIALIZE pprData4' :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprData4' :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for 4 bytes of constant DWARF data @@ -581,6 +589,7 @@ pprData4 = pprData4' . integer . fromIntegral pprDwWord :: IsDoc doc => Line doc -> doc pprDwWord = pprData4' {-# SPECIALIZE pprDwWord :: SDoc -> SDoc #-} +{-# SPECIALIZE pprDwWord :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprDwWord :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a machine word of dynamic data. Depends on the @@ -591,6 +600,7 @@ pprWord plat s = PW4 -> text "\t.long " <> s PW8 -> text "\t.quad " <> s {-# SPECIALIZE pprWord :: Platform -> SDoc -> SDoc #-} +{-# SPECIALIZE pprWord :: Platform -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprWord :: Platform -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Prints a number in "little endian base 128" format. The idea is @@ -602,6 +612,7 @@ pprLEBWord x | x < 128 = pprByte (fromIntegral x) | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBWord (x `shiftR` 7) {-# SPECIALIZE pprLEBWord :: Word -> SDoc #-} +{-# SPECIALIZE pprLEBWord :: Word -> Line SDoc #-} {-# SPECIALIZE pprLEBWord :: Word -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Same as @pprLEBWord@, but for a signed number @@ -611,6 +622,7 @@ pprLEBInt x | x >= -64 && x < 64 | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBInt (x `shiftR` 7) {-# SPECIALIZE pprLEBInt :: Int -> SDoc #-} +{-# SPECIALIZE pprLEBInt :: Int -> Line SDoc #-} {-# SPECIALIZE pprLEBInt :: Int -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generates a dynamic null-terminated string. If required the @@ -653,4 +665,5 @@ sectionOffset plat target section = OSMinGW32 -> line (text "\t.secrel32 " <> target) _other -> pprDwWord target {-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE sectionOffset :: Platform -> HLine -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -85,6 +85,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output the ELF .size directive. ===================================== compiler/GHC/CmmToAsm/Ppr.hs ===================================== @@ -122,12 +122,14 @@ pprASCII str chr' :: Word8 -> Char chr' (W8# w#) = C# (chr# (word2Int# (word8ToWord# w#))) {-# SPECIALIZE pprASCII :: ByteString -> SDoc #-} +{-# SPECIALIZE pprASCII :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprASCII :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".string" directive pprString :: IsLine doc => ByteString -> doc pprString bs = text "\t.string " <> doubleQuotes (pprASCII bs) {-# SPECIALIZE pprString :: ByteString -> SDoc #-} +{-# SPECIALIZE pprString :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprString :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".incbin" directive @@ -139,6 +141,7 @@ pprFileEmbed path <> pprFilePathString path -- proper escape (see #16389) <> text "\n\t.byte 0" {-# SPECIALIZE pprFileEmbed :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFileEmbed :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFileEmbed :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- @@ -204,6 +207,7 @@ pprSectionHeader config (Section t suffix) = OSDarwin -> pprDarwinSectionHeader t _ -> pprGNUSectionHeader config t suffix {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> SDoc #-} +{-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> Line SDoc #-} {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprGNUSectionHeader :: IsLine doc => NCGConfig -> SectionType -> CLabel -> doc @@ -256,6 +260,7 @@ pprGNUSectionHeader config t suffix = | otherwise -> text ",\"aMS\"," <> sectionType platform "progbits" <> text ",1" _ -> empty {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> SDoc #-} +{-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- XCOFF doesn't support relocating label-differences, so we place all @@ -270,6 +275,7 @@ pprXcoffSectionHeader t = case t of UninitialisedData -> text ".csect .data[BS]" _ -> panic "pprXcoffSectionHeader: unknown section type" {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDarwinSectionHeader :: IsLine doc => SectionType -> doc @@ -284,4 +290,5 @@ pprDarwinSectionHeader t = case t of CString -> text ".section\t__TEXT,__cstring,cstring_literals" OtherSection _ -> panic "pprDarwinSectionHeader: unknown section type" {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -134,6 +134,7 @@ pprNatCmmDecl config proc@(CmmProc top_info entry_lbl _ (ListGraph blocks)) = , pprSizeDecl platform proc_lbl ] {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output an internal proc label. See Note [Internal proc labels] in CLabel. ===================================== compiler/GHC/CmmToLlvm.hs ===================================== @@ -126,6 +126,7 @@ llvmHeader cfg = hang (text "Available targets:") 4 (vcat $ map (text . fst) $ llvmTargets config) {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> SDoc #-} +{-# SPECIALIZE llvmHeader :: LlvmCgConfig -> Line SDoc #-} {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable llvmGroupLlvmGens :: RawCmmGroup -> LlvmM () ===================================== compiler/GHC/CmmToLlvm/Ppr.hs ===================================== @@ -36,6 +36,7 @@ pprLlvmData cfg (globals, types) = globals' = ppLlvmGlobals cfg globals in types' $$ globals' {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> SDoc #-} +{-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> Line SDoc #-} {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Llvm/MetaData.hs ===================================== @@ -79,6 +79,7 @@ instance Outputable MetaId where ppMetaId :: IsLine doc => MetaId -> doc ppMetaId (MetaId n) = char '!' <> int n {-# SPECIALIZE ppMetaId :: MetaId -> SDoc #-} +{-# SPECIALIZE ppMetaId :: MetaId -> Line SDoc #-} {-# SPECIALIZE ppMetaId :: MetaId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | LLVM metadata expressions ===================================== compiler/GHC/Llvm/Ppr.hs ===================================== @@ -58,6 +58,7 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) $$ ppLlvmFunctionDecls decls $$ newLine $$ ppLlvmFunctions opts funcs {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> SDoc #-} +{-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> Line SDoc #-} {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -65,12 +66,14 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) ppLlvmComments :: IsDoc doc => [LMString] -> doc ppLlvmComments comments = lines_ $ map ppLlvmComment comments {-# SPECIALIZE ppLlvmComments :: [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmComments :: [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmComments :: [LMString] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a comment, can be inside a function or on its own ppLlvmComment :: IsLine doc => LMString -> doc ppLlvmComment com = semi <+> ftext com {-# SPECIALIZE ppLlvmComment :: LMString -> SDoc #-} +{-# SPECIALIZE ppLlvmComment :: LMString -> Line SDoc #-} {-# SPECIALIZE ppLlvmComment :: LMString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -78,6 +81,7 @@ ppLlvmComment com = semi <+> ftext com ppLlvmGlobals :: IsDoc doc => LlvmCgConfig -> [LMGlobal] -> doc ppLlvmGlobals opts ls = lines_ $ map (ppLlvmGlobal opts) ls {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a global mutable variable definition @@ -106,6 +110,7 @@ ppLlvmGlobal opts (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) = ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ text "Non Global var ppr as global! " <> ppVar opts var <> text "=" <> ppr (fmap (ppStatic @SDoc opts) val) {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -113,6 +118,7 @@ ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ ppLlvmAliases :: IsDoc doc => [LlvmAlias] -> doc ppLlvmAliases tys = lines_ $ map ppLlvmAlias tys {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> SDoc #-} +{-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> Line SDoc #-} {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM type alias. @@ -120,6 +126,7 @@ ppLlvmAlias :: IsLine doc => LlvmAlias -> doc ppLlvmAlias (name, ty) = char '%' <> ftext name <+> equals <+> text "type" <+> ppLlvmType ty {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> SDoc #-} +{-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> Line SDoc #-} {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -127,6 +134,7 @@ ppLlvmAlias (name, ty) ppLlvmMetas :: IsDoc doc => LlvmCgConfig -> [MetaDecl] -> doc ppLlvmMetas opts metas = lines_ $ map (ppLlvmMeta opts) metas {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> SDoc #-} +{-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> Line SDoc #-} {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM metadata definition. @@ -139,6 +147,7 @@ ppLlvmMeta _opts (MetaNamed n m) where nodes = hcat $ intersperse comma $ map ppMetaId m {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -146,6 +155,7 @@ ppLlvmMeta _opts (MetaNamed n m) ppLlvmFunctions :: IsDoc doc => LlvmCgConfig -> LlvmFunctions -> doc ppLlvmFunctions opts funcs = vcat $ map (ppLlvmFunction opts) funcs {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition. @@ -167,6 +177,7 @@ ppLlvmFunction opts fun = , newLine , newLine] {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> SDoc #-} +{-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition header. @@ -186,12 +197,14 @@ ppLlvmFunctionHeader (LlvmFunctionDecl n l c r varg p a) args in ppLlvmLinkageType l <+> ppLlvmCallConvention c <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> hsep (punctuate comma args') <> varg' <> rparen <> align {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a list of function declaration. ppLlvmFunctionDecls :: IsDoc doc => LlvmFunctionDecls -> doc ppLlvmFunctionDecls decs = vcat $ map ppLlvmFunctionDecl decs {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function declaration. @@ -213,6 +226,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> args <> varg' <> rparen <> align , empty] {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -220,6 +234,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) ppLlvmBlocks :: IsDoc doc => LlvmCgConfig -> LlvmBlocks -> doc ppLlvmBlocks opts blocks = vcat $ map (ppLlvmBlock opts) blocks {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> SDoc #-} +{-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block. @@ -237,12 +252,14 @@ ppLlvmBlock opts (LlvmBlock blockId stmts) = : map (ppLlvmStatement opts) block ++ [ empty , ppRest ] {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> SDoc #-} +{-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block label. ppLlvmBlockLabel :: IsLine doc => LlvmBlockId -> doc ppLlvmBlockLabel id = pprUniqueAlways id <> colon {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> SDoc #-} +{-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -266,6 +283,7 @@ ppLlvmStatement opts stmt = Nop -> line empty {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> SDoc #-} +{-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> Line SDoc #-} {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM expression. @@ -291,6 +309,7 @@ ppLlvmExpression opts expr Asm asm c ty v se sk -> ppAsm opts asm c ty v se sk MExpr meta expr -> ppMetaAnnotExpr opts meta expr {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaExpr :: IsLine doc => LlvmCgConfig -> MetaExpr -> doc @@ -302,6 +321,7 @@ ppMetaExpr opts = \case MetaVar v -> ppVar opts v MetaStruct es -> char '!' <> braces (ppCommaJoin (ppMetaExpr opts) es) {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> SDoc #-} +{-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> Line SDoc #-} {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -348,6 +368,7 @@ ppCall opts ct fptr args attrs = case fptr of ppCallMetaExpr attrs (MetaVar v) = ppVar' attrs opts v ppCallMetaExpr _ v = text "metadata" <+> ppMetaExpr opts v {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> SDoc #-} +{-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> Line SDoc #-} {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -356,6 +377,7 @@ ppMachOp opts op left right = ppLlvmMachOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -373,11 +395,13 @@ ppCmpOp opts op left right = in cmpOp <+> ppLlvmCmpOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAssignment :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc -> doc ppAssignment opts var expr = ppName opts var <+> equals <+> expr {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> SDoc #-} +{-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> Line SDoc #-} {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> HLine -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppFence :: IsLine doc => Bool -> LlvmSyncOrdering -> doc @@ -386,6 +410,7 @@ ppFence st ord = False -> empty in text "fence" <+> singleThread <+> ppSyncOrdering ord {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSyncOrdering :: IsLine doc => LlvmSyncOrdering -> doc @@ -396,6 +421,7 @@ ppSyncOrdering SyncRelease = text "release" ppSyncOrdering SyncAcqRel = text "acq_rel" ppSyncOrdering SyncSeqCst = text "seq_cst" {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicOp :: IsLine doc => LlvmAtomicOp -> doc @@ -411,6 +437,7 @@ ppAtomicOp LAO_Min = text "min" ppAtomicOp LAO_Umax = text "umax" ppAtomicOp LAO_Umin = text "umin" {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> SDoc #-} +{-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> Line SDoc #-} {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicRMW :: IsLine doc => LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> doc @@ -418,6 +445,7 @@ ppAtomicRMW opts aop tgt src ordering = text "atomicrmw" <+> ppAtomicOp aop <+> ppVar opts tgt <> comma <+> ppVar opts src <+> ppSyncOrdering ordering {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppCmpXChg :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar @@ -426,6 +454,7 @@ ppCmpXChg opts addr old new s_ord f_ord = text "cmpxchg" <+> ppVar opts addr <> comma <+> ppVar opts old <> comma <+> ppVar opts new <+> ppSyncOrdering s_ord <+> ppSyncOrdering f_ord {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -439,6 +468,7 @@ ppLoad opts var alignment = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> SDoc #-} +{-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> Line SDoc #-} {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppALoad :: IsLine doc => LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> doc @@ -451,6 +481,7 @@ ppALoad opts ord st var = in text "load atomic" <+> ppLlvmType derefType <> comma <+> ppVar opts var <> sThreaded <+> ppSyncOrdering ord <> align {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStore :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> doc @@ -462,6 +493,7 @@ ppStore opts val dst alignment metas = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -472,6 +504,7 @@ ppCast opts op from to <+> text "to" <+> ppLlvmType to {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> SDoc #-} +{-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> Line SDoc #-} {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -480,6 +513,7 @@ ppMalloc opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "malloc" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAlloca :: IsLine doc => LlvmCgConfig -> LlvmType -> Int -> doc @@ -487,6 +521,7 @@ ppAlloca opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "alloca" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppGetElementPtr :: IsLine doc => LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> doc @@ -497,6 +532,7 @@ ppGetElementPtr opts inb ptr idx = in text "getelementptr" <+> inbound <+> ppLlvmType derefType <> comma <+> ppVar opts ptr <> indexes {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> SDoc #-} +{-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> Line SDoc #-} {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -504,11 +540,13 @@ ppReturn :: IsLine doc => LlvmCgConfig -> Maybe LlvmVar -> doc ppReturn opts (Just var) = text "ret" <+> ppVar opts var ppReturn _ Nothing = text "ret" <+> ppLlvmType LMVoid {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> SDoc #-} +{-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppBranch :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppBranch opts var = text "br" <+> ppVar opts var {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -516,6 +554,7 @@ ppBranchIf :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc ppBranchIf opts cond trueT falseT = text "br" <+> ppVar opts cond <> comma <+> ppVar opts trueT <> comma <+> ppVar opts falseT {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -524,6 +563,7 @@ ppPhi opts tp preds = let ppPreds (val, label) = brackets $ ppName opts val <> comma <+> ppName opts label in text "phi" <+> ppLlvmType tp <+> hsep (punctuate comma $ map ppPreds preds) {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -536,6 +576,7 @@ ppSwitch opts scrut dflt targets = , [char ']'] ] {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -550,6 +591,7 @@ ppAsm opts asm constraints rty vars sideeffect alignstack = in text "call" <+> rty' <+> text "asm" <+> side <+> align <+> asm' <> comma <+> cons <> vars' {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> SDoc #-} +{-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> Line SDoc #-} {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtract :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> doc @@ -558,6 +600,7 @@ ppExtract opts vec idx = <+> ppLlvmType (getVarType vec) <+> ppName opts vec <> comma <+> ppVar opts idx {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtractV :: IsLine doc => LlvmCgConfig -> LlvmVar -> Int -> doc @@ -566,6 +609,7 @@ ppExtractV opts struct idx = <+> ppLlvmType (getVarType struct) <+> ppName opts struct <> comma <+> int idx {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> SDoc #-} +{-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> Line SDoc #-} {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppInsert :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc @@ -575,12 +619,14 @@ ppInsert opts vec elt idx = <+> ppLlvmType (getVarType elt) <+> ppName opts elt <> comma <+> ppVar opts idx {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnotExpr :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> doc ppMetaAnnotExpr opts meta expr = ppLlvmExpression opts expr <> ppMetaAnnots opts meta {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnots :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> doc @@ -593,6 +639,7 @@ ppMetaAnnots opts meta = hcat $ map ppMeta meta MetaStruct ms -> exclamation <> braces (ppCommaJoin (ppMetaExpr opts) ms) other -> exclamation <> braces (ppMetaExpr opts other) -- possible? {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -604,6 +651,7 @@ ppName opts v = case v of LMNLocalVar {} -> char '%' <> ppPlainName opts v LMLitVar {} -> ppPlainName opts v {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -616,6 +664,7 @@ ppPlainName opts v = case v of (LMNLocalVar x _ ) -> ftext x (LMLitVar x ) -> ppLit opts x {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a literal value. No type. @@ -639,11 +688,13 @@ ppLit opts l = case l of , Just lit <- garbageLit t -> ppLit opts lit | otherwise -> text "undef" {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppVar = ppVar' [] {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> doc @@ -651,11 +702,13 @@ ppVar' attrs opts v = case v of LMLitVar x -> ppTypeLit' attrs opts x x -> ppLlvmType (getVarType x) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppName opts x {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit :: IsLine doc => LlvmCgConfig -> LlvmLit -> doc ppTypeLit = ppTypeLit' [] {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> doc @@ -663,6 +716,7 @@ ppTypeLit' attrs opts l = case l of LMVectorLit {} -> ppLit opts l _ -> ppLlvmType (getLitType l) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppLit opts l {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStatic :: IsLine doc => LlvmCgConfig -> LlvmStatic -> doc @@ -681,6 +735,7 @@ ppStatic opts st = case st of LMAdd s1 s2 -> pprStaticArith opts s1 s2 (text "add") (text "fadd") (text "LMAdd") LMSub s1 s2 -> pprStaticArith opts s1 s2 (text "sub") (text "fsub") (text "LMSub") {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -694,6 +749,7 @@ pprSpecialStatic opts stat = case stat of <> comma <+> ppStatic opts stat _ -> ppStatic opts stat {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -707,6 +763,7 @@ pprStaticArith opts s1 s2 int_op float_op op_name = op_name <> text " with different types! s1: " <> ppStatic opts s1 <> text", s2: " <> ppStatic opts s2 {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> HLine -> HLine -> SDoc -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -718,10 +775,12 @@ pprStaticArith opts s1 s2 int_op float_op op_name = newLine :: IsDoc doc => doc newLine = empty {-# SPECIALIZE newLine :: SDoc #-} +{-# SPECIALIZE newLine :: Line SDoc #-} {-# SPECIALIZE newLine :: HDoc #-} -- | Exclamation point. exclamation :: IsLine doc => doc exclamation = char '!' {-# SPECIALIZE exclamation :: SDoc #-} +{-# SPECIALIZE exclamation :: Line SDoc #-} {-# SPECIALIZE exclamation :: HLine #-} ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -89,6 +89,7 @@ ppLlvmType t = case t of LMFunction (LlvmFunctionDecl _ _ _ r varg p _) -> ppLlvmType r <+> lparen <> ppParams varg p <> rparen {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} +{-# SPECIALIZE ppLlvmType :: LlvmType -> Line SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc @@ -101,6 +102,7 @@ ppParams varg p args = map fst p in ppCommaJoin ppLlvmType args <> varg' {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> SDoc #-} +{-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> Line SDoc #-} {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | An LLVM section definition. If Nothing then let LLVM decide the section @@ -400,6 +402,7 @@ ppLlvmParamAttr NoAlias = text "noalias" ppLlvmParamAttr NoCapture = text "nocapture" ppLlvmParamAttr Nest = text "nest" {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Llvm Function Attributes. @@ -498,6 +501,7 @@ ppLlvmFuncAttr NoRedZone = text "noredzone" ppLlvmFuncAttr NoImplicitFloat = text "noimplicitfloat" ppLlvmFuncAttr Naked = text "naked" {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -556,6 +560,7 @@ ppLlvmCallConvention CC_Ghc = text "ghccc" ppLlvmCallConvention (CC_Ncc i) = text "cc " <> int i ppLlvmCallConvention CC_X86_Stdcc = text "x86_stdcallcc" {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> SDoc #-} +{-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> Line SDoc #-} {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -630,6 +635,7 @@ ppLlvmLinkageType ExternallyVisible = empty ppLlvmLinkageType External = text "external" ppLlvmLinkageType Private = text "private" {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> SDoc #-} +{-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> Line SDoc #-} {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -690,6 +696,7 @@ ppLlvmMachOp LM_MO_And = text "and" ppLlvmMachOp LM_MO_Or = text "or" ppLlvmMachOp LM_MO_Xor = text "xor" {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> SDoc #-} +{-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -737,6 +744,7 @@ ppLlvmCmpOp LM_CMP_Fge = text "oge" ppLlvmCmpOp LM_CMP_Flt = text "olt" ppLlvmCmpOp LM_CMP_Fle = text "ole" {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -773,6 +781,7 @@ ppLlvmCastOp LM_Ptrtoint = text "ptrtoint" ppLlvmCastOp LM_Inttoptr = text "inttoptr" ppLlvmCastOp LM_Bitcast = text "bitcast" {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -799,6 +808,7 @@ ppDouble platform d str = map toUpper $ concat $ fixEndian $ map hex bs in text "0x" <> text str {-# SPECIALIZE ppDouble :: Platform -> Double -> SDoc #-} +{-# SPECIALIZE ppDouble :: Platform -> Double -> Line SDoc #-} {-# SPECIALIZE ppDouble :: Platform -> Double -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [LLVM Float Types] @@ -829,6 +839,7 @@ widenFp = float2Double ppFloat :: IsLine doc => Platform -> Float -> doc ppFloat platform = ppDouble platform . widenFp {-# SPECIALIZE ppFloat :: Platform -> Float -> SDoc #-} +{-# SPECIALIZE ppFloat :: Platform -> Float -> Line SDoc #-} {-# SPECIALIZE ppFloat :: Platform -> Float -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -839,9 +850,11 @@ ppFloat platform = ppDouble platform . widenFp ppCommaJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppCommaJoin ppr strs = hsep $ punctuate comma (map ppr strs) {-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppCommaJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSpaceJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppSpaceJoin ppr strs = hsep (map ppr strs) {-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppSpaceJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Types/CostCentre.hs ===================================== @@ -261,6 +261,7 @@ pprCostCentreStack CurrentCCS = text "CCCS" pprCostCentreStack DontCareCCS = text "CCS_DONT_CARE" pprCostCentreStack (SingletonCCS cc) = pprCostCentre cc <> text "_ccs" {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> SDoc #-} +{-# SPECIALISE pprCostCentreStack :: CostCentreStack -> Line SDoc #-} {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ----------------------------------------------------------------------------- @@ -284,6 +285,7 @@ pprCostCentre :: IsLine doc => CostCentre -> doc pprCostCentre cc = docWithStyle (ppCostCentreLbl cc) (\_ -> ftext (costCentreUserNameFS cc)) {-# SPECIALISE pprCostCentre :: CostCentre -> SDoc #-} +{-# SPECIALISE pprCostCentre :: CostCentre -> Line SDoc #-} {-# SPECIALISE pprCostCentre :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Printing in Core @@ -315,6 +317,7 @@ ppCostCentreLbl (NormalCC {cc_flavour = f, cc_name = n, cc_mod = m}) = pprModule m <> char '_' <> ztext (zEncodeFS n) <> char '_' <> ppFlavourLblComponent f <> text "_cc" {-# SPECIALISE ppCostCentreLbl :: CostCentre -> SDoc #-} +{-# SPECIALISE ppCostCentreLbl :: CostCentre -> Line SDoc #-} {-# SPECIALISE ppCostCentreLbl :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour component of a C label @@ -328,6 +331,7 @@ ppFlavourLblComponent (IndexedCC flav i) = LateCC -> text "LATECC" <> ppIdxLblComponent i CallerCC -> text "CALLERCC" <> ppIdxLblComponent i {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> SDoc #-} +{-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> Line SDoc #-} {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour index component of a C label @@ -337,6 +341,7 @@ ppIdxLblComponent n = 0 -> empty n -> int n {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> SDoc #-} +{-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> Line SDoc #-} {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- This is the name to go in the user-displayed string, ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -713,8 +713,8 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) handlePuns :: Bool -> Maybe FastString -> SDoc -> SDoc handlePuns True (Just pun) _ = ftext pun handlePuns _ _ r = r -{-# INLINABLE pprName #-} -- Workaround a bug which prevented pprName from specialising (see #25060). {-# SPECIALISE pprName :: Name -> SDoc #-} +{-# SPECIALISE pprName :: Name -> Line SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print fully qualified name (with unit-id, module and unique) ===================================== compiler/GHC/Types/Name/Occurrence.hs ===================================== @@ -403,6 +403,7 @@ pprOccName (OccName sp occ) = docWithStyle (ztext (zEncodeFS occ)) (\_ -> ftext occ <> whenPprDebug (braces (pprNameSpaceBrief sp))) {-# SPECIALIZE pprOccName :: OccName -> SDoc #-} +{-# SPECIALIZE pprOccName :: OccName -> Line SDoc #-} {-# SPECIALIZE pprOccName :: OccName -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mangle field names to avoid duplicate symbols. ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -305,6 +305,7 @@ pprUniqueAlways :: IsLine doc => Unique -> doc pprUniqueAlways u = text (showUnique u) {-# SPECIALIZE pprUniqueAlways :: Unique -> SDoc #-} +{-# SPECIALIZE pprUniqueAlways :: Unique -> Line SDoc #-} {-# SPECIALIZE pprUniqueAlways :: Unique -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance Outputable Unique where ===================================== compiler/GHC/Unit/Types.hs ===================================== @@ -223,6 +223,7 @@ pprModule mod@(Module p n) = docWithStyle code doc | otherwise = pprModuleName n {-# SPECIALIZE pprModule :: Module -> SDoc #-} +{-# SPECIALIZE pprModule :: Module -> Line SDoc #-} {-# SPECIALIZE pprModule :: Module -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprInstantiatedModule :: InstantiatedModule -> SDoc ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1080,6 +1080,7 @@ pprModuleName :: IsLine doc => ModuleName -> doc pprModuleName (ModuleName nm) = docWithStyle (ztext (zEncodeFS nm)) (\_ -> ftext nm) {-# SPECIALIZE pprModuleName :: ModuleName -> SDoc #-} +{-# SPECIALIZE pprModuleName :: ModuleName -> Line SDoc #-} {-# SPECIALIZE pprModuleName :: ModuleName -> HLine #-} -- see Note [SPECIALIZE to HDoc] ----------------------------------------------------------------------- @@ -1374,6 +1375,7 @@ pprFilePathString path = doubleQuotes $ text (escape (normalise path)) escape ('\\':xs) = '\\':'\\':escape xs escape (x:xs) = x:escape xs {-# SPECIALIZE pprFilePathString :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFilePathString :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFilePathString :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] {- @@ -1737,6 +1739,11 @@ pragma just to the entry point pprNatCmmDecl, to avoid cluttering the entire module. Because specialization is transitive, this makes sure that other functions in that module are specialized too. +NB: Specialising to SDoc also requires specialising to (Line SDoc) (which is a +type family that reduces to SDoc). This serves to workaround the fact that a +rule on @SDoc will not fire for @(Line SDoc) since the rule matching is blind +to type-family equations. See #25060 for a discussion. + Note [dualLine and dualDoc] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The IsLine and IsDoc classes provide the dualLine and dualDoc methods, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad6e5be1ed852574f716052dcaf1e2ed03b7cfa4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad6e5be1ed852574f716052dcaf1e2ed03b7cfa4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 11:55:09 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 07:55:09 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] Deleted 1 commit: ncg perf: WIP SPECIALISE Line SDoc #25060 Message-ID: <668e769d492cc_e809d4a012e416168@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: ad6e5be1 by Rodrigo Mesquita at 2024-07-10T11:34:52+01:00 ncg perf: WIP SPECIALISE Line SDoc #25060 - - - - - 21 changed files: - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Dwarf/Constants.hs - compiler/GHC/CmmToAsm/Dwarf/Types.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Ppr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Ppr.hs - compiler/GHC/Llvm/MetaData.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/Types/CostCentre.hs - compiler/GHC/Types/Name.hs - compiler/GHC/Types/Name/Occurrence.hs - compiler/GHC/Types/Unique.hs - compiler/GHC/Unit/Types.hs - compiler/GHC/Utils/Outputable.hs Changes: ===================================== compiler/GHC/Builtin/PrimOps.hs ===================================== @@ -905,6 +905,7 @@ compare_fun_ty ty = mkVisFunTysMany [ty, ty] intPrimTy pprPrimOp :: IsLine doc => PrimOp -> doc pprPrimOp other_op = pprOccName (primOpOcc other_op) {-# SPECIALIZE pprPrimOp :: PrimOp -> SDoc #-} +{-# SPECIALIZE pprPrimOp :: PrimOp -> Line SDoc #-} {-# SPECIALIZE pprPrimOp :: PrimOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -307,6 +307,7 @@ pprModuleLabelKind MLK_FinalizerArray = text "fini_arr" pprModuleLabelKind (MLK_Finalizer (LexicalFastString s)) = text "fini__" <> ftext s pprModuleLabelKind MLK_IPEBuffer = text "ipe_buf" {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> SDoc #-} +{-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> Line SDoc #-} {-# SPECIALIZE pprModuleLabelKind :: ModuleLabelKind -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable isIdLabel :: CLabel -> Bool @@ -1428,11 +1429,13 @@ data LabelStyle pprAsmLabel :: IsLine doc => Platform -> CLabel -> doc pprAsmLabel platform lbl = pprCLabelStyle platform AsmStyle lbl {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprAsmLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprCLabel :: IsLine doc => Platform -> CLabel -> doc pprCLabel platform lbl = pprCLabelStyle platform CStyle lbl {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabel :: Platform -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabel :: Platform -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance OutputableP Platform CLabel where @@ -1583,8 +1586,8 @@ pprCLabelStyle !platform !sty lbl = -- see Note [Bangs in CLabel] CmmLabel _ _ fs CmmRetInfo -> maybe_underscore $ ftext fs <> text "_info" CmmLabel _ _ fs CmmRet -> maybe_underscore $ ftext fs <> text "_ret" CmmLabel _ _ fs CmmClosure -> maybe_underscore $ ftext fs <> text "_closure" -{-# INLINABLE pprCLabelStyle #-} -- Workaround a bug which prevented pprCLabelStyle from specialising (see #25060). {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> SDoc #-} +{-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprCLabelStyle :: Platform -> LabelStyle -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [Internal proc labels] @@ -1621,6 +1624,7 @@ ppInternalProcLabel this_mod (IdLabel nm _ flavour) <> ppIdFlavor flavour ppInternalProcLabel _ _ = Nothing {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe SDoc #-} +{-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe (Line SDoc) #-} {-# SPECIALIZE ppInternalProcLabel :: Module -> CLabel -> Maybe HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppIdFlavor :: IsLine doc => IdLabelInfo -> doc ===================================== compiler/GHC/Cmm/DebugBlock.hs ===================================== @@ -542,6 +542,7 @@ pprUnwindExpr p env = \case | p <= 1 -> pprUnwindExpr 2 env e0 <> char '*' <> pprUnwindExpr 2 env e1 other -> parens (pprUnwindExpr 0 env other) {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> SDoc #-} +{-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> Line SDoc #-} {-# SPECIALIZE pprUnwindExpr :: Rational -> Platform -> UnwindExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Conversion of Cmm expressions to unwind expressions. We check for ===================================== compiler/GHC/Cmm/Reg.hs ===================================== @@ -284,6 +284,7 @@ pprGlobalReg gr BaseReg -> text "BaseReg" PicBaseReg -> text "PicBaseReg" {-# SPECIALIZE pprGlobalReg :: GlobalReg -> SDoc #-} +{-# SPECIALIZE pprGlobalReg :: GlobalReg -> Line SDoc #-} {-# SPECIALIZE pprGlobalReg :: GlobalReg -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -68,6 +68,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprLabel :: IsDoc doc => Platform -> CLabel -> doc ===================================== compiler/GHC/CmmToAsm/Dwarf/Constants.hs ===================================== @@ -152,16 +152,22 @@ dwarfFrameSection platform = dwarfSection platform "frame" dwarfGhcSection platform = dwarfSection platform "ghc" dwarfARangesSection platform = dwarfSection platform "aranges" {-# SPECIALIZE dwarfInfoSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfInfoSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfInfoSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfAbbrevSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfAbbrevSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfLineSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfLineSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfFrameSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfFrameSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfGhcSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfGhcSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfGhcSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfARangesSection :: Platform -> SDoc #-} +{-# SPECIALIZE dwarfARangesSection :: Platform -> Line SDoc #-} {-# SPECIALIZE dwarfARangesSection :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable dwarfSection :: IsDoc doc => Platform -> String -> doc @@ -175,6 +181,7 @@ dwarfSection platform name = | otherwise -> text "\t.section .debug_" <> text name <> text ",\"dr\"" {-# SPECIALIZE dwarfSection :: Platform -> String -> SDoc #-} +{-# SPECIALIZE dwarfSection :: Platform -> String -> Line SDoc #-} {-# SPECIALIZE dwarfSection :: Platform -> String -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -185,12 +192,16 @@ dwarfAbbrevLabel = text ".Lsection_abbrev" dwarfLineLabel = text ".Lsection_line" dwarfFrameLabel = text ".Lsection_frame" {-# SPECIALIZE dwarfInfoLabel :: SDoc #-} +{-# SPECIALIZE dwarfInfoLabel :: Line SDoc #-} {-# SPECIALIZE dwarfInfoLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfAbbrevLabel :: SDoc #-} +{-# SPECIALIZE dwarfAbbrevLabel :: Line SDoc #-} {-# SPECIALIZE dwarfAbbrevLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfLineLabel :: SDoc #-} +{-# SPECIALIZE dwarfLineLabel :: Line SDoc #-} {-# SPECIALIZE dwarfLineLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {-# SPECIALIZE dwarfFrameLabel :: SDoc #-} +{-# SPECIALIZE dwarfFrameLabel :: Line SDoc #-} {-# SPECIALIZE dwarfFrameLabel :: HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mapping of registers to DWARF register numbers ===================================== compiler/GHC/CmmToAsm/Dwarf/Types.hs ===================================== @@ -144,6 +144,7 @@ pprAbbrevDecls platform haveDebugLine = ] $$ pprByte 0 {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> SDoc #-} +{-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> Line SDoc #-} {-# SPECIALIZE pprAbbrevDecls :: Platform -> Bool -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generate assembly for DWARF data @@ -161,6 +162,7 @@ pprDwarfInfo platform haveSrc d pprDwarfInfoClose noChildren = pprDwarfInfoOpen platform haveSrc d {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> SDoc #-} +{-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> Line SDoc #-} {-# SPECIALIZE pprDwarfInfo :: Platform -> Bool -> DwarfInfo -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a CLabel name in a ".stringz \"LABEL\"" @@ -258,6 +260,7 @@ pprDwarfARanges platform arngs unitU = $$ pprWord platform (char '0') $$ pprWord platform (char '0') {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> SDoc #-} +{-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> Line SDoc #-} {-# SPECIALIZE pprDwarfARanges :: Platform -> [DwarfARange] -> Unique -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDwarfARange :: IsDoc doc => Platform -> DwarfARange -> doc @@ -355,6 +358,7 @@ pprDwarfFrame platform DwarfFrame{dwCieLabel=cieLabel,dwCieInit=cieInit,dwCiePro -- Procedure unwind tables vcat (map (pprFrameProc platform cieLabel cieInit) procs) {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> SDoc #-} +{-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> Line SDoc #-} {-# SPECIALIZE pprDwarfFrame :: Platform -> DwarfFrame -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Writes a "Frame Description Entry" for a procedure. This consists @@ -548,18 +552,21 @@ wordAlign plat = PW4 -> char '2' _other -> int (platformWordSizeInBytes plat) {-# SPECIALIZE wordAlign :: Platform -> SDoc #-} +{-# SPECIALIZE wordAlign :: Platform -> Line SDoc #-} {-# SPECIALIZE wordAlign :: Platform -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a single byte of constant DWARF data pprByte :: IsDoc doc => Word8 -> doc pprByte x = line $ text "\t.byte " <> integer (fromIntegral x) {-# SPECIALIZE pprByte :: Word8 -> SDoc #-} +{-# SPECIALIZE pprByte :: Word8 -> Line SDoc #-} {-# SPECIALIZE pprByte :: Word8 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a two-byte constant integer pprHalf :: IsDoc doc => Word16 -> doc pprHalf x = line $ text "\t.short" <+> integer (fromIntegral x) {-# SPECIALIZE pprHalf :: Word16 -> SDoc #-} +{-# SPECIALIZE pprHalf :: Word16 -> Line SDoc #-} {-# SPECIALIZE pprHalf :: Word16 -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a constant DWARF flag @@ -570,6 +577,7 @@ pprFlag f = pprByte (if f then 0xff else 0x00) pprData4' :: IsDoc doc => Line doc -> doc pprData4' x = line (text "\t.long " <> x) {-# SPECIALIZE pprData4' :: SDoc -> SDoc #-} +{-# SPECIALIZE pprData4' :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprData4' :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for 4 bytes of constant DWARF data @@ -581,6 +589,7 @@ pprData4 = pprData4' . integer . fromIntegral pprDwWord :: IsDoc doc => Line doc -> doc pprDwWord = pprData4' {-# SPECIALIZE pprDwWord :: SDoc -> SDoc #-} +{-# SPECIALIZE pprDwWord :: SDoc -> Line SDoc #-} {-# SPECIALIZE pprDwWord :: HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Assembly for a machine word of dynamic data. Depends on the @@ -591,6 +600,7 @@ pprWord plat s = PW4 -> text "\t.long " <> s PW8 -> text "\t.quad " <> s {-# SPECIALIZE pprWord :: Platform -> SDoc -> SDoc #-} +{-# SPECIALIZE pprWord :: Platform -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprWord :: Platform -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Prints a number in "little endian base 128" format. The idea is @@ -602,6 +612,7 @@ pprLEBWord x | x < 128 = pprByte (fromIntegral x) | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBWord (x `shiftR` 7) {-# SPECIALIZE pprLEBWord :: Word -> SDoc #-} +{-# SPECIALIZE pprLEBWord :: Word -> Line SDoc #-} {-# SPECIALIZE pprLEBWord :: Word -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Same as @pprLEBWord@, but for a signed number @@ -611,6 +622,7 @@ pprLEBInt x | x >= -64 && x < 64 | otherwise = pprByte (fromIntegral $ 128 .|. (x .&. 127)) $$ pprLEBInt (x `shiftR` 7) {-# SPECIALIZE pprLEBInt :: Int -> SDoc #-} +{-# SPECIALIZE pprLEBInt :: Int -> Line SDoc #-} {-# SPECIALIZE pprLEBInt :: Int -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Generates a dynamic null-terminated string. If required the @@ -653,4 +665,5 @@ sectionOffset plat target section = OSMinGW32 -> line (text "\t.secrel32 " <> target) _other -> pprDwWord target {-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE sectionOffset :: Platform -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE sectionOffset :: Platform -> HLine -> HLine -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -85,6 +85,7 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) = else empty) $$ pprSizeDecl platform info_lbl {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl RawCmmStatics Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output the ELF .size directive. ===================================== compiler/GHC/CmmToAsm/Ppr.hs ===================================== @@ -122,12 +122,14 @@ pprASCII str chr' :: Word8 -> Char chr' (W8# w#) = C# (chr# (word2Int# (word8ToWord# w#))) {-# SPECIALIZE pprASCII :: ByteString -> SDoc #-} +{-# SPECIALIZE pprASCII :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprASCII :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".string" directive pprString :: IsLine doc => ByteString -> doc pprString bs = text "\t.string " <> doubleQuotes (pprASCII bs) {-# SPECIALIZE pprString :: ByteString -> SDoc #-} +{-# SPECIALIZE pprString :: ByteString -> Line SDoc #-} {-# SPECIALIZE pprString :: ByteString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Emit a ".incbin" directive @@ -139,6 +141,7 @@ pprFileEmbed path <> pprFilePathString path -- proper escape (see #16389) <> text "\n\t.byte 0" {-# SPECIALIZE pprFileEmbed :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFileEmbed :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFileEmbed :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable {- @@ -204,6 +207,7 @@ pprSectionHeader config (Section t suffix) = OSDarwin -> pprDarwinSectionHeader t _ -> pprGNUSectionHeader config t suffix {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> SDoc #-} +{-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> Line SDoc #-} {-# SPECIALIZE pprSectionHeader :: NCGConfig -> Section -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprGNUSectionHeader :: IsLine doc => NCGConfig -> SectionType -> CLabel -> doc @@ -256,6 +260,7 @@ pprGNUSectionHeader config t suffix = | otherwise -> text ",\"aMS\"," <> sectionType platform "progbits" <> text ",1" _ -> empty {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> SDoc #-} +{-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> Line SDoc #-} {-# SPECIALIZE pprGNUSectionHeader :: NCGConfig -> SectionType -> CLabel -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- XCOFF doesn't support relocating label-differences, so we place all @@ -270,6 +275,7 @@ pprXcoffSectionHeader t = case t of UninitialisedData -> text ".csect .data[BS]" _ -> panic "pprXcoffSectionHeader: unknown section type" {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprXcoffSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprDarwinSectionHeader :: IsLine doc => SectionType -> doc @@ -284,4 +290,5 @@ pprDarwinSectionHeader t = case t of CString -> text ".section\t__TEXT,__cstring,cstring_literals" OtherSection _ -> panic "pprDarwinSectionHeader: unknown section type" {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> SDoc #-} +{-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> Line SDoc #-} {-# SPECIALIZE pprDarwinSectionHeader :: SectionType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -134,6 +134,7 @@ pprNatCmmDecl config proc@(CmmProc top_info entry_lbl _ (ListGraph blocks)) = , pprSizeDecl platform proc_lbl ] {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> SDoc #-} +{-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> Line SDoc #-} {-# SPECIALIZE pprNatCmmDecl :: NCGConfig -> NatCmmDecl (Alignment, RawCmmStatics) Instr -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Output an internal proc label. See Note [Internal proc labels] in CLabel. ===================================== compiler/GHC/CmmToLlvm.hs ===================================== @@ -126,6 +126,7 @@ llvmHeader cfg = hang (text "Available targets:") 4 (vcat $ map (text . fst) $ llvmTargets config) {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> SDoc #-} +{-# SPECIALIZE llvmHeader :: LlvmCgConfig -> Line SDoc #-} {-# SPECIALIZE llvmHeader :: LlvmCgConfig -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable llvmGroupLlvmGens :: RawCmmGroup -> LlvmM () ===================================== compiler/GHC/CmmToLlvm/Ppr.hs ===================================== @@ -36,6 +36,7 @@ pprLlvmData cfg (globals, types) = globals' = ppLlvmGlobals cfg globals in types' $$ globals' {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> SDoc #-} +{-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> Line SDoc #-} {-# SPECIALIZE pprLlvmData :: LlvmCgConfig -> LlvmData -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Llvm/MetaData.hs ===================================== @@ -79,6 +79,7 @@ instance Outputable MetaId where ppMetaId :: IsLine doc => MetaId -> doc ppMetaId (MetaId n) = char '!' <> int n {-# SPECIALIZE ppMetaId :: MetaId -> SDoc #-} +{-# SPECIALIZE ppMetaId :: MetaId -> Line SDoc #-} {-# SPECIALIZE ppMetaId :: MetaId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | LLVM metadata expressions ===================================== compiler/GHC/Llvm/Ppr.hs ===================================== @@ -58,6 +58,7 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) $$ ppLlvmFunctionDecls decls $$ newLine $$ ppLlvmFunctions opts funcs {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> SDoc #-} +{-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> Line SDoc #-} {-# SPECIALIZE ppLlvmModule :: LlvmCgConfig -> LlvmModule -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -65,12 +66,14 @@ ppLlvmModule opts (LlvmModule comments aliases meta globals decls funcs) ppLlvmComments :: IsDoc doc => [LMString] -> doc ppLlvmComments comments = lines_ $ map ppLlvmComment comments {-# SPECIALIZE ppLlvmComments :: [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmComments :: [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmComments :: [LMString] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a comment, can be inside a function or on its own ppLlvmComment :: IsLine doc => LMString -> doc ppLlvmComment com = semi <+> ftext com {-# SPECIALIZE ppLlvmComment :: LMString -> SDoc #-} +{-# SPECIALIZE ppLlvmComment :: LMString -> Line SDoc #-} {-# SPECIALIZE ppLlvmComment :: LMString -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -78,6 +81,7 @@ ppLlvmComment com = semi <+> ftext com ppLlvmGlobals :: IsDoc doc => LlvmCgConfig -> [LMGlobal] -> doc ppLlvmGlobals opts ls = lines_ $ map (ppLlvmGlobal opts) ls {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobals :: LlvmCgConfig -> [LMGlobal] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a global mutable variable definition @@ -106,6 +110,7 @@ ppLlvmGlobal opts (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) = ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ text "Non Global var ppr as global! " <> ppVar opts var <> text "=" <> ppr (fmap (ppStatic @SDoc opts) val) {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> SDoc #-} +{-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> Line SDoc #-} {-# SPECIALIZE ppLlvmGlobal :: LlvmCgConfig -> LMGlobal -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -113,6 +118,7 @@ ppLlvmGlobal opts (LMGlobal var val) = pprPanic "ppLlvmGlobal" $ ppLlvmAliases :: IsDoc doc => [LlvmAlias] -> doc ppLlvmAliases tys = lines_ $ map ppLlvmAlias tys {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> SDoc #-} +{-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> Line SDoc #-} {-# SPECIALIZE ppLlvmAliases :: [LlvmAlias] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM type alias. @@ -120,6 +126,7 @@ ppLlvmAlias :: IsLine doc => LlvmAlias -> doc ppLlvmAlias (name, ty) = char '%' <> ftext name <+> equals <+> text "type" <+> ppLlvmType ty {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> SDoc #-} +{-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> Line SDoc #-} {-# SPECIALIZE ppLlvmAlias :: LlvmAlias -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -127,6 +134,7 @@ ppLlvmAlias (name, ty) ppLlvmMetas :: IsDoc doc => LlvmCgConfig -> [MetaDecl] -> doc ppLlvmMetas opts metas = lines_ $ map (ppLlvmMeta opts) metas {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> SDoc #-} +{-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> Line SDoc #-} {-# SPECIALIZE ppLlvmMetas :: LlvmCgConfig -> [MetaDecl] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM metadata definition. @@ -139,6 +147,7 @@ ppLlvmMeta _opts (MetaNamed n m) where nodes = hcat $ intersperse comma $ map ppMetaId m {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmMeta :: LlvmCgConfig -> MetaDecl -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -146,6 +155,7 @@ ppLlvmMeta _opts (MetaNamed n m) ppLlvmFunctions :: IsDoc doc => LlvmCgConfig -> LlvmFunctions -> doc ppLlvmFunctions opts funcs = vcat $ map (ppLlvmFunction opts) funcs {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctions :: LlvmCgConfig -> LlvmFunctions -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition. @@ -167,6 +177,7 @@ ppLlvmFunction opts fun = , newLine , newLine] {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> SDoc #-} +{-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunction :: LlvmCgConfig -> LlvmFunction -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function definition header. @@ -186,12 +197,14 @@ ppLlvmFunctionHeader (LlvmFunctionDecl n l c r varg p a) args in ppLlvmLinkageType l <+> ppLlvmCallConvention c <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> hsep (punctuate comma args') <> varg' <> rparen <> align {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionHeader :: LlvmFunctionDecl -> [LMString] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a list of function declaration. ppLlvmFunctionDecls :: IsDoc doc => LlvmFunctionDecls -> doc ppLlvmFunctionDecls decs = vcat $ map ppLlvmFunctionDecl decs {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecls :: LlvmFunctionDecls -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out a function declaration. @@ -213,6 +226,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) <+> ppLlvmType r <+> char '@' <> ftext n <> lparen <> args <> varg' <> rparen <> align , empty] {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> SDoc #-} +{-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> Line SDoc #-} {-# SPECIALIZE ppLlvmFunctionDecl :: LlvmFunctionDecl -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -220,6 +234,7 @@ ppLlvmFunctionDecl (LlvmFunctionDecl n l c r varg p a) ppLlvmBlocks :: IsDoc doc => LlvmCgConfig -> LlvmBlocks -> doc ppLlvmBlocks opts blocks = vcat $ map (ppLlvmBlock opts) blocks {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> SDoc #-} +{-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlocks :: LlvmCgConfig -> LlvmBlocks -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block. @@ -237,12 +252,14 @@ ppLlvmBlock opts (LlvmBlock blockId stmts) = : map (ppLlvmStatement opts) block ++ [ empty , ppRest ] {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> SDoc #-} +{-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlock :: LlvmCgConfig -> LlvmBlock -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM block label. ppLlvmBlockLabel :: IsLine doc => LlvmBlockId -> doc ppLlvmBlockLabel id = pprUniqueAlways id <> colon {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> SDoc #-} +{-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> Line SDoc #-} {-# SPECIALIZE ppLlvmBlockLabel :: LlvmBlockId -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -266,6 +283,7 @@ ppLlvmStatement opts stmt = Nop -> line empty {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> SDoc #-} +{-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> Line SDoc #-} {-# SPECIALIZE ppLlvmStatement :: LlvmCgConfig -> LlvmStatement -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print out an LLVM expression. @@ -291,6 +309,7 @@ ppLlvmExpression opts expr Asm asm c ty v se sk -> ppAsm opts asm c ty v se sk MExpr meta expr -> ppMetaAnnotExpr opts meta expr {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppLlvmExpression :: LlvmCgConfig -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaExpr :: IsLine doc => LlvmCgConfig -> MetaExpr -> doc @@ -302,6 +321,7 @@ ppMetaExpr opts = \case MetaVar v -> ppVar opts v MetaStruct es -> char '!' <> braces (ppCommaJoin (ppMetaExpr opts) es) {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> SDoc #-} +{-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> Line SDoc #-} {-# SPECIALIZE ppMetaExpr :: LlvmCgConfig -> MetaExpr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -348,6 +368,7 @@ ppCall opts ct fptr args attrs = case fptr of ppCallMetaExpr attrs (MetaVar v) = ppVar' attrs opts v ppCallMetaExpr _ v = text "metadata" <+> ppMetaExpr opts v {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> SDoc #-} +{-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> Line SDoc #-} {-# SPECIALIZE ppCall :: LlvmCgConfig -> LlvmCallType -> LlvmVar -> [MetaExpr] -> [LlvmFuncAttr] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -356,6 +377,7 @@ ppMachOp opts op left right = ppLlvmMachOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppMachOp :: LlvmCgConfig -> LlvmMachOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -373,11 +395,13 @@ ppCmpOp opts op left right = in cmpOp <+> ppLlvmCmpOp op <+> ppLlvmType (getVarType left) <+> ppName opts left <> comma <+> ppName opts right {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppCmpOp :: LlvmCgConfig -> LlvmCmpOp -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAssignment :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc -> doc ppAssignment opts var expr = ppName opts var <+> equals <+> expr {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> SDoc #-} +{-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> SDoc -> Line SDoc #-} {-# SPECIALIZE ppAssignment :: LlvmCgConfig -> LlvmVar -> HLine -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppFence :: IsLine doc => Bool -> LlvmSyncOrdering -> doc @@ -386,6 +410,7 @@ ppFence st ord = False -> empty in text "fence" <+> singleThread <+> ppSyncOrdering ord {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppFence :: Bool -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSyncOrdering :: IsLine doc => LlvmSyncOrdering -> doc @@ -396,6 +421,7 @@ ppSyncOrdering SyncRelease = text "release" ppSyncOrdering SyncAcqRel = text "acq_rel" ppSyncOrdering SyncSeqCst = text "seq_cst" {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppSyncOrdering :: LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicOp :: IsLine doc => LlvmAtomicOp -> doc @@ -411,6 +437,7 @@ ppAtomicOp LAO_Min = text "min" ppAtomicOp LAO_Umax = text "umax" ppAtomicOp LAO_Umin = text "umin" {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> SDoc #-} +{-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> Line SDoc #-} {-# SPECIALIZE ppAtomicOp :: LlvmAtomicOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAtomicRMW :: IsLine doc => LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> doc @@ -418,6 +445,7 @@ ppAtomicRMW opts aop tgt src ordering = text "atomicrmw" <+> ppAtomicOp aop <+> ppVar opts tgt <> comma <+> ppVar opts src <+> ppSyncOrdering ordering {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppAtomicRMW :: LlvmCgConfig -> LlvmAtomicOp -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppCmpXChg :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar @@ -426,6 +454,7 @@ ppCmpXChg opts addr old new s_ord f_ord = text "cmpxchg" <+> ppVar opts addr <> comma <+> ppVar opts old <> comma <+> ppVar opts new <+> ppSyncOrdering s_ord <+> ppSyncOrdering f_ord {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> SDoc #-} +{-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> Line SDoc #-} {-# SPECIALIZE ppCmpXChg :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> LlvmSyncOrdering -> LlvmSyncOrdering -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -439,6 +468,7 @@ ppLoad opts var alignment = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> SDoc #-} +{-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> Line SDoc #-} {-# SPECIALIZE ppLoad :: LlvmCgConfig -> LlvmVar -> LMAlign -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppALoad :: IsLine doc => LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> doc @@ -451,6 +481,7 @@ ppALoad opts ord st var = in text "load atomic" <+> ppLlvmType derefType <> comma <+> ppVar opts var <> sThreaded <+> ppSyncOrdering ord <> align {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppALoad :: LlvmCgConfig -> LlvmSyncOrdering -> SingleThreaded -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStore :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> doc @@ -462,6 +493,7 @@ ppStore opts val dst alignment metas = Just n -> text ", align" <+> int n Nothing -> empty {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppStore :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LMAlign -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -472,6 +504,7 @@ ppCast opts op from to <+> text "to" <+> ppLlvmType to {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> SDoc #-} +{-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> Line SDoc #-} {-# SPECIALIZE ppCast :: LlvmCgConfig -> LlvmCastOp -> LlvmVar -> LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -480,6 +513,7 @@ ppMalloc opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "malloc" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppMalloc :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppAlloca :: IsLine doc => LlvmCgConfig -> LlvmType -> Int -> doc @@ -487,6 +521,7 @@ ppAlloca opts tp amount = let amount' = LMLitVar $ LMIntLit (toInteger amount) i32 in text "alloca" <+> ppLlvmType tp <> comma <+> ppVar opts amount' {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> SDoc #-} +{-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> Line SDoc #-} {-# SPECIALIZE ppAlloca :: LlvmCgConfig -> LlvmType -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppGetElementPtr :: IsLine doc => LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> doc @@ -497,6 +532,7 @@ ppGetElementPtr opts inb ptr idx = in text "getelementptr" <+> inbound <+> ppLlvmType derefType <> comma <+> ppVar opts ptr <> indexes {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> SDoc #-} +{-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> Line SDoc #-} {-# SPECIALIZE ppGetElementPtr :: LlvmCgConfig -> Bool -> LlvmVar -> [LlvmVar] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -504,11 +540,13 @@ ppReturn :: IsLine doc => LlvmCgConfig -> Maybe LlvmVar -> doc ppReturn opts (Just var) = text "ret" <+> ppVar opts var ppReturn _ Nothing = text "ret" <+> ppLlvmType LMVoid {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> SDoc #-} +{-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppReturn :: LlvmCgConfig -> Maybe LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppBranch :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppBranch opts var = text "br" <+> ppVar opts var {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranch :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -516,6 +554,7 @@ ppBranchIf :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc ppBranchIf opts cond trueT falseT = text "br" <+> ppVar opts cond <> comma <+> ppVar opts trueT <> comma <+> ppVar opts falseT {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppBranchIf :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -524,6 +563,7 @@ ppPhi opts tp preds = let ppPreds (val, label) = brackets $ ppName opts val <> comma <+> ppName opts label in text "phi" <+> ppLlvmType tp <+> hsep (punctuate comma $ map ppPreds preds) {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppPhi :: LlvmCgConfig -> LlvmType -> [(LlvmVar,LlvmVar)] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -536,6 +576,7 @@ ppSwitch opts scrut dflt targets = , [char ']'] ] {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> SDoc #-} +{-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> Line SDoc #-} {-# SPECIALIZE ppSwitch :: LlvmCgConfig -> LlvmVar -> LlvmVar -> [(LlvmVar,LlvmVar)] -> HDoc #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -550,6 +591,7 @@ ppAsm opts asm constraints rty vars sideeffect alignstack = in text "call" <+> rty' <+> text "asm" <+> side <+> align <+> asm' <> comma <+> cons <> vars' {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> SDoc #-} +{-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> Line SDoc #-} {-# SPECIALIZE ppAsm :: LlvmCgConfig -> LMString -> LMString -> LlvmType -> [LlvmVar] -> Bool -> Bool -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtract :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> doc @@ -558,6 +600,7 @@ ppExtract opts vec idx = <+> ppLlvmType (getVarType vec) <+> ppName opts vec <> comma <+> ppVar opts idx {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppExtract :: LlvmCgConfig -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppExtractV :: IsLine doc => LlvmCgConfig -> LlvmVar -> Int -> doc @@ -566,6 +609,7 @@ ppExtractV opts struct idx = <+> ppLlvmType (getVarType struct) <+> ppName opts struct <> comma <+> int idx {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> SDoc #-} +{-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> Line SDoc #-} {-# SPECIALIZE ppExtractV :: LlvmCgConfig -> LlvmVar -> Int -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppInsert :: IsLine doc => LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> doc @@ -575,12 +619,14 @@ ppInsert opts vec elt idx = <+> ppLlvmType (getVarType elt) <+> ppName opts elt <> comma <+> ppVar opts idx {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppInsert :: LlvmCgConfig -> LlvmVar -> LlvmVar -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnotExpr :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> doc ppMetaAnnotExpr opts meta expr = ppLlvmExpression opts expr <> ppMetaAnnots opts meta {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> SDoc #-} +{-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnotExpr :: LlvmCgConfig -> [MetaAnnot] -> LlvmExpression -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppMetaAnnots :: IsLine doc => LlvmCgConfig -> [MetaAnnot] -> doc @@ -593,6 +639,7 @@ ppMetaAnnots opts meta = hcat $ map ppMeta meta MetaStruct ms -> exclamation <> braces (ppCommaJoin (ppMetaExpr opts) ms) other -> exclamation <> braces (ppMetaExpr opts other) -- possible? {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> SDoc #-} +{-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> Line SDoc #-} {-# SPECIALIZE ppMetaAnnots :: LlvmCgConfig -> [MetaAnnot] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -604,6 +651,7 @@ ppName opts v = case v of LMNLocalVar {} -> char '%' <> ppPlainName opts v LMLitVar {} -> ppPlainName opts v {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Return the variable name or value of the 'LlvmVar' @@ -616,6 +664,7 @@ ppPlainName opts v = case v of (LMNLocalVar x _ ) -> ftext x (LMLitVar x ) -> ppLit opts x {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppPlainName :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print a literal value. No type. @@ -639,11 +688,13 @@ ppLit opts l = case l of , Just lit <- garbageLit t -> ppLit opts lit | otherwise -> text "undef" {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar :: IsLine doc => LlvmCgConfig -> LlvmVar -> doc ppVar = ppVar' [] {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar :: LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppVar' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> doc @@ -651,11 +702,13 @@ ppVar' attrs opts v = case v of LMLitVar x -> ppTypeLit' attrs opts x x -> ppLlvmType (getVarType x) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppName opts x {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> SDoc #-} +{-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> Line SDoc #-} {-# SPECIALIZE ppVar' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmVar -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit :: IsLine doc => LlvmCgConfig -> LlvmLit -> doc ppTypeLit = ppTypeLit' [] {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit :: LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppTypeLit' :: IsLine doc => [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> doc @@ -663,6 +716,7 @@ ppTypeLit' attrs opts l = case l of LMVectorLit {} -> ppLit opts l _ -> ppLlvmType (getLitType l) <+> ppSpaceJoin ppLlvmParamAttr attrs <+> ppLit opts l {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> SDoc #-} +{-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> Line SDoc #-} {-# SPECIALIZE ppTypeLit' :: [LlvmParamAttr] -> LlvmCgConfig -> LlvmLit -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppStatic :: IsLine doc => LlvmCgConfig -> LlvmStatic -> doc @@ -681,6 +735,7 @@ ppStatic opts st = case st of LMAdd s1 s2 -> pprStaticArith opts s1 s2 (text "add") (text "fadd") (text "LMAdd") LMSub s1 s2 -> pprStaticArith opts s1 s2 (text "sub") (text "fsub") (text "LMSub") {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE ppStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -694,6 +749,7 @@ pprSpecialStatic opts stat = case stat of <> comma <+> ppStatic opts stat _ -> ppStatic opts stat {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> SDoc #-} +{-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> Line SDoc #-} {-# SPECIALIZE pprSpecialStatic :: LlvmCgConfig -> LlvmStatic -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -707,6 +763,7 @@ pprStaticArith opts s1 s2 int_op float_op op_name = op_name <> text " with different types! s1: " <> ppStatic opts s1 <> text", s2: " <> ppStatic opts s2 {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> SDoc #-} +{-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> SDoc -> SDoc -> SDoc -> Line SDoc #-} {-# SPECIALIZE pprStaticArith :: LlvmCgConfig -> LlvmStatic -> LlvmStatic -> HLine -> HLine -> SDoc -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -718,10 +775,12 @@ pprStaticArith opts s1 s2 int_op float_op op_name = newLine :: IsDoc doc => doc newLine = empty {-# SPECIALIZE newLine :: SDoc #-} +{-# SPECIALIZE newLine :: Line SDoc #-} {-# SPECIALIZE newLine :: HDoc #-} -- | Exclamation point. exclamation :: IsLine doc => doc exclamation = char '!' {-# SPECIALIZE exclamation :: SDoc #-} +{-# SPECIALIZE exclamation :: Line SDoc #-} {-# SPECIALIZE exclamation :: HLine #-} ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -89,6 +89,7 @@ ppLlvmType t = case t of LMFunction (LlvmFunctionDecl _ _ _ r varg p _) -> ppLlvmType r <+> lparen <> ppParams varg p <> rparen {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} +{-# SPECIALIZE ppLlvmType :: LlvmType -> Line SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc @@ -101,6 +102,7 @@ ppParams varg p args = map fst p in ppCommaJoin ppLlvmType args <> varg' {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> SDoc #-} +{-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> Line SDoc #-} {-# SPECIALIZE ppParams :: LlvmParameterListType -> [LlvmParameter] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | An LLVM section definition. If Nothing then let LLVM decide the section @@ -400,6 +402,7 @@ ppLlvmParamAttr NoAlias = text "noalias" ppLlvmParamAttr NoCapture = text "nocapture" ppLlvmParamAttr Nest = text "nest" {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmParamAttr :: LlvmParamAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Llvm Function Attributes. @@ -498,6 +501,7 @@ ppLlvmFuncAttr NoRedZone = text "noredzone" ppLlvmFuncAttr NoImplicitFloat = text "noimplicitfloat" ppLlvmFuncAttr Naked = text "naked" {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> SDoc #-} +{-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> Line SDoc #-} {-# SPECIALIZE ppLlvmFuncAttr :: LlvmFuncAttr -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -556,6 +560,7 @@ ppLlvmCallConvention CC_Ghc = text "ghccc" ppLlvmCallConvention (CC_Ncc i) = text "cc " <> int i ppLlvmCallConvention CC_X86_Stdcc = text "x86_stdcallcc" {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> SDoc #-} +{-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> Line SDoc #-} {-# SPECIALIZE ppLlvmCallConvention :: LlvmCallConvention -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -630,6 +635,7 @@ ppLlvmLinkageType ExternallyVisible = empty ppLlvmLinkageType External = text "external" ppLlvmLinkageType Private = text "private" {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> SDoc #-} +{-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> Line SDoc #-} {-# SPECIALIZE ppLlvmLinkageType :: LlvmLinkageType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -690,6 +696,7 @@ ppLlvmMachOp LM_MO_And = text "and" ppLlvmMachOp LM_MO_Or = text "or" ppLlvmMachOp LM_MO_Xor = text "xor" {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> SDoc #-} +{-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmMachOp :: LlvmMachOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -737,6 +744,7 @@ ppLlvmCmpOp LM_CMP_Fge = text "oge" ppLlvmCmpOp LM_CMP_Flt = text "olt" ppLlvmCmpOp LM_CMP_Fle = text "ole" {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCmpOp :: LlvmCmpOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -773,6 +781,7 @@ ppLlvmCastOp LM_Ptrtoint = text "ptrtoint" ppLlvmCastOp LM_Inttoptr = text "inttoptr" ppLlvmCastOp LM_Bitcast = text "bitcast" {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> SDoc #-} +{-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> Line SDoc #-} {-# SPECIALIZE ppLlvmCastOp :: LlvmCastOp -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ----------------------------------------------------------------------------- @@ -799,6 +808,7 @@ ppDouble platform d str = map toUpper $ concat $ fixEndian $ map hex bs in text "0x" <> text str {-# SPECIALIZE ppDouble :: Platform -> Double -> SDoc #-} +{-# SPECIALIZE ppDouble :: Platform -> Double -> Line SDoc #-} {-# SPECIALIZE ppDouble :: Platform -> Double -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Note [LLVM Float Types] @@ -829,6 +839,7 @@ widenFp = float2Double ppFloat :: IsLine doc => Platform -> Float -> doc ppFloat platform = ppDouble platform . widenFp {-# SPECIALIZE ppFloat :: Platform -> Float -> SDoc #-} +{-# SPECIALIZE ppFloat :: Platform -> Float -> Line SDoc #-} {-# SPECIALIZE ppFloat :: Platform -> Float -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable @@ -839,9 +850,11 @@ ppFloat platform = ppDouble platform . widenFp ppCommaJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppCommaJoin ppr strs = hsep $ punctuate comma (map ppr strs) {-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppCommaJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppCommaJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ppSpaceJoin :: IsLine doc => (a -> doc) -> [a] -> doc ppSpaceJoin ppr strs = hsep (map ppr strs) {-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> SDoc #-} +{-# SPECIALIZE ppSpaceJoin :: (a -> SDoc) -> [a] -> Line SDoc #-} {-# SPECIALIZE ppSpaceJoin :: (a -> HLine) -> [a] -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ===================================== compiler/GHC/Types/CostCentre.hs ===================================== @@ -261,6 +261,7 @@ pprCostCentreStack CurrentCCS = text "CCCS" pprCostCentreStack DontCareCCS = text "CCS_DONT_CARE" pprCostCentreStack (SingletonCCS cc) = pprCostCentre cc <> text "_ccs" {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> SDoc #-} +{-# SPECIALISE pprCostCentreStack :: CostCentreStack -> Line SDoc #-} {-# SPECIALISE pprCostCentreStack :: CostCentreStack -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable ----------------------------------------------------------------------------- @@ -284,6 +285,7 @@ pprCostCentre :: IsLine doc => CostCentre -> doc pprCostCentre cc = docWithStyle (ppCostCentreLbl cc) (\_ -> ftext (costCentreUserNameFS cc)) {-# SPECIALISE pprCostCentre :: CostCentre -> SDoc #-} +{-# SPECIALISE pprCostCentre :: CostCentre -> Line SDoc #-} {-# SPECIALISE pprCostCentre :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- Printing in Core @@ -315,6 +317,7 @@ ppCostCentreLbl (NormalCC {cc_flavour = f, cc_name = n, cc_mod = m}) = pprModule m <> char '_' <> ztext (zEncodeFS n) <> char '_' <> ppFlavourLblComponent f <> text "_cc" {-# SPECIALISE ppCostCentreLbl :: CostCentre -> SDoc #-} +{-# SPECIALISE ppCostCentreLbl :: CostCentre -> Line SDoc #-} {-# SPECIALISE ppCostCentreLbl :: CostCentre -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour component of a C label @@ -328,6 +331,7 @@ ppFlavourLblComponent (IndexedCC flav i) = LateCC -> text "LATECC" <> ppIdxLblComponent i CallerCC -> text "CALLERCC" <> ppIdxLblComponent i {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> SDoc #-} +{-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> Line SDoc #-} {-# SPECIALISE ppFlavourLblComponent :: CCFlavour -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- ^ Print the flavour index component of a C label @@ -337,6 +341,7 @@ ppIdxLblComponent n = 0 -> empty n -> int n {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> SDoc #-} +{-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> Line SDoc #-} {-# SPECIALISE ppIdxLblComponent :: CostCentreIndex -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- This is the name to go in the user-displayed string, ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -713,8 +713,8 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) handlePuns :: Bool -> Maybe FastString -> SDoc -> SDoc handlePuns True (Just pun) _ = ftext pun handlePuns _ _ r = r -{-# INLINABLE pprName #-} -- Workaround a bug which prevented pprName from specialising (see #25060). {-# SPECIALISE pprName :: Name -> SDoc #-} +{-# SPECIALISE pprName :: Name -> Line SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Print fully qualified name (with unit-id, module and unique) ===================================== compiler/GHC/Types/Name/Occurrence.hs ===================================== @@ -403,6 +403,7 @@ pprOccName (OccName sp occ) = docWithStyle (ztext (zEncodeFS occ)) (\_ -> ftext occ <> whenPprDebug (braces (pprNameSpaceBrief sp))) {-# SPECIALIZE pprOccName :: OccName -> SDoc #-} +{-# SPECIALIZE pprOccName :: OccName -> Line SDoc #-} {-# SPECIALIZE pprOccName :: OccName -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable -- | Mangle field names to avoid duplicate symbols. ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -305,6 +305,7 @@ pprUniqueAlways :: IsLine doc => Unique -> doc pprUniqueAlways u = text (showUnique u) {-# SPECIALIZE pprUniqueAlways :: Unique -> SDoc #-} +{-# SPECIALIZE pprUniqueAlways :: Unique -> Line SDoc #-} {-# SPECIALIZE pprUniqueAlways :: Unique -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable instance Outputable Unique where ===================================== compiler/GHC/Unit/Types.hs ===================================== @@ -223,6 +223,7 @@ pprModule mod@(Module p n) = docWithStyle code doc | otherwise = pprModuleName n {-# SPECIALIZE pprModule :: Module -> SDoc #-} +{-# SPECIALIZE pprModule :: Module -> Line SDoc #-} {-# SPECIALIZE pprModule :: Module -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable pprInstantiatedModule :: InstantiatedModule -> SDoc ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1080,6 +1080,7 @@ pprModuleName :: IsLine doc => ModuleName -> doc pprModuleName (ModuleName nm) = docWithStyle (ztext (zEncodeFS nm)) (\_ -> ftext nm) {-# SPECIALIZE pprModuleName :: ModuleName -> SDoc #-} +{-# SPECIALIZE pprModuleName :: ModuleName -> Line SDoc #-} {-# SPECIALIZE pprModuleName :: ModuleName -> HLine #-} -- see Note [SPECIALIZE to HDoc] ----------------------------------------------------------------------- @@ -1374,6 +1375,7 @@ pprFilePathString path = doubleQuotes $ text (escape (normalise path)) escape ('\\':xs) = '\\':'\\':escape xs escape (x:xs) = x:escape xs {-# SPECIALIZE pprFilePathString :: FilePath -> SDoc #-} +{-# SPECIALIZE pprFilePathString :: FilePath -> Line SDoc #-} {-# SPECIALIZE pprFilePathString :: FilePath -> HLine #-} -- see Note [SPECIALIZE to HDoc] {- @@ -1737,6 +1739,11 @@ pragma just to the entry point pprNatCmmDecl, to avoid cluttering the entire module. Because specialization is transitive, this makes sure that other functions in that module are specialized too. +NB: Specialising to SDoc also requires specialising to (Line SDoc) (which is a +type family that reduces to SDoc). This serves to workaround the fact that a +rule on @SDoc will not fire for @(Line SDoc) since the rule matching is blind +to type-family equations. See #25060 for a discussion. + Note [dualLine and dualDoc] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ The IsLine and IsDoc classes provide the dualLine and dualDoc methods, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad6e5be1ed852574f716052dcaf1e2ed03b7cfa4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ad6e5be1ed852574f716052dcaf1e2ed03b7cfa4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 14:11:39 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 10:11:39 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] Deleted 1 commit: ncg: INLINEABLE regAlloc Message-ID: <668e969b9b159_2ecab9bac4305675@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: 7bf06120 by Rodrigo Mesquita at 2024-07-10T11:26:58+01:00 ncg: INLINEABLE regAlloc regAlloc showed up in a time profile unspecialised, and making sure it is specialised is noticeable in the profile. Enabling it shaved off some 15ms compiling Cabal on my machine. - - - - - 1 changed file: - compiler/GHC/CmmToAsm/Reg/Linear.hs Changes: ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -189,6 +189,9 @@ regAlloc config (CmmProc static lbl live sccs) -- bogus. to make non-exhaustive match warning go away. regAlloc _ (CmmProc _ _ _ _) = panic "RegAllocLinear.regAlloc: no match" +-- regAlloc showed up in a profile unspecialised. +-- Enabling it shaved off some 15ms compiling Cabal: +{-# INLINEABLE regAlloc #-} -- ----------------------------------------------------------------------------- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7bf06120705ac7fbffa5fd76c4809bf6f11d9cba -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7bf06120705ac7fbffa5fd76c4809bf6f11d9cba You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 14:31:31 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 10 Jul 2024 10:31:31 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] MP fixes, don't rename external names Message-ID: <668e9b438b44_2ecab9eb54d8590f8@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: c4afb742 by Matthew Pickering at 2024-07-10T15:31:22+01:00 MP fixes, don't rename external names - - - - - 3 changed files: - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/UniqueRenamer.hs - testsuite/tests/determinism/object/check.sh Changes: ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -343,6 +343,10 @@ newtype NeedExternDecl -- This is non-deterministic but we do not currently support deterministic -- code-generation. See Note [Unique Determinism and code generation] instance Ord CLabel where + compare (IdLabel a1 b1 c1) + (IdLabel a2 b2 c2) + | isExternalName a1, isExternalName a2 = stableNameCmp a1 a2 S.<> compare b1 b2 S.<> compare c1 c2 + compare (IdLabel a1 b1 c1) (IdLabel a2 b2 c2) = -- Comparing names here should deterministic because all unique should have been renamed deterministically ...... compare a1 a2 S.<> @@ -1874,8 +1878,10 @@ returns True. -- however, the input to layout must be deterministic to produce deterministic layout. -- Which means we could avoid renaming it here, as long as we guarantee the labels are produced deterministically (which we could, perhaps by using a det supply in fcode) mapInternalNonDetUniques :: Applicative m => (Unique -> m Unique) -> CLabel -> m CLabel -mapInternalNonDetUniques f = \case - IdLabel name cafInfo idLabelInfo -> IdLabel . setNameUnique name <$> f (nameUnique name) <*> pure cafInfo <*> pure idLabelInfo +mapInternalNonDetUniques f x = case x of + IdLabel name cafInfo idLabelInfo + | not (isExternalName name) -> IdLabel . setNameUnique name <$> f (nameUnique name) <*> pure cafInfo <*> pure idLabelInfo + | otherwise -> pure x cl at CmmLabel{} -> pure cl -- ROMES:TODO: what about `RtsApFast NonDetFastString`? RtsLabel rtsLblInfo -> pure $ RtsLabel rtsLblInfo ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -26,6 +26,9 @@ import GHC.Utils.Outputable as Outputable import Data.Tuple (swap) import GHC.Types.Id import GHC.Types.Unique.DSM +import GHC.Types.Name hiding (varName) +import GHC.Types.Var + {- -------------------------------------------------------------------------------- @@ -72,7 +75,7 @@ renameDetUniq uq = do Nothing -> do new_w <- gets supply -- New deterministic unique in this `DetRnM` let (tag, _) = unpkUnique uq - det_uniq = mkUnique tag new_w + det_uniq = mkUnique 'Q' new_w modify' (\DetUniqFM{mapping, supply} -> -- Update supply and mapping DetUniqFM @@ -94,7 +97,9 @@ detRenameCLabel = mapInternalNonDetUniques renameDetUniq -- | We want to rename uniques in Ids, but ONLY internal ones. detRenameId :: Id -> DetRnM Id -detRenameId i = setIdUnique i <$> renameDetUniq (getUnique i) +detRenameId i + | isExternalName (varName i) = return i + | otherwise = setIdUnique i <$> renameDetUniq (getUnique i) -------------------------------------------------------------------------------- -- Traversals ===================================== testsuite/tests/determinism/object/check.sh ===================================== @@ -39,10 +39,44 @@ compareObjs() { done } +# $1 = objects +# $2 = extra flags +compareHis() { + for o in $2 + do + echo $1 --show-iface $o + echo "--------------------------------------------------------------------------------" + # Compare the object dumps except for the first line which prints the file path + $1 --show-iface Cabal-3.12.0.0/hiout1/$o > dump1 + $1 --show-iface Cabal-3.12.0.0/hiout2/$o > dump2 + diff -C3 dump1 dump2 && echo "OK-hi" + echo "--------------------------------------------------------------------------------" + done +} + +#if diff -r Cabal-3.12.0.0/hiout1 Cabal-3.12.0.0/hiout2 +#then +# echo "OK-hi" +#else +# echo "--------------------------------------------------------------------------------" +# echo "Comparing all objects (1. headers, 2. disassembly). Stopping at first failure..." +# echo "--------------------------------------------------------------------------------" +# +# +# pushd Cabal-3.12.0.0/hiout1 >/dev/null +# OBJS=$(find . -type f) +# popd >/dev/null +# +# compareHis "/home/matt/ghc-rodrigo/_build/stage1/bin/ghc" "$OBJS" +# +# exit 1 +# +#fi + # Big fast check if diff -r Cabal-3.12.0.0/out1 Cabal-3.12.0.0/out2 then - echo "OK" + echo "OK-obj" else echo "--------------------------------------------------------------------------------" echo "Comparing all objects (1. headers, 2. disassembly). Stopping at first failure..." @@ -56,6 +90,7 @@ else compareObjs "$OBJS" "--all-headers" compareObjs "$OBJS" "--disassemble-all" + exit 1 fi View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4afb742fbba7b3a8cdbad3b770adab8105224b1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4afb742fbba7b3a8cdbad3b770adab8105224b1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 14:39:13 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 10:39:13 -0400 Subject: [Git][ghc/ghc][wip/romes/ncg-perf] ncg: Don't execute dwarfGen for SDoc unnecessarily Message-ID: <668e9d113c18b_2ecab910cf1606002c@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/ncg-perf at Glasgow Haskell Compiler / GHC Commits: e051a138 by Rodrigo Mesquita at 2024-07-10T15:38:58+01:00 ncg: Don't execute dwarfGen for SDoc unnecessarily `dwarfGen @SDoc` is only needed if -ddump-asm is enabled (see emitNativeCode). - - - - - 1 changed file: - compiler/GHC/CmmToAsm.hs Changes: ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -234,7 +234,8 @@ finishNativeGen logger config modLoc bufh us ngs else do compPath <- getCurrentDirectory let (dwarf_h, us') = dwarfGen compPath config modLoc us (ngs_debug ngs) - (dwarf_s, _) = dwarfGen compPath config modLoc us (ngs_debug ngs) + -- `dwarfGen @SDoc` is only needed if -ddump-asm is enabled (see emitNativeCode) + ~(dwarf_s, _) = dwarfGen compPath config modLoc us (ngs_debug ngs) emitNativeCode logger config bufh dwarf_h dwarf_s return us' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e051a1385d727e3fbafa39ac9b4cd13c508a5fde -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e051a1385d727e3fbafa39ac9b4cd13c508a5fde You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 10 14:43:20 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 10 Jul 2024 10:43:20 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/pprInstrH Message-ID: <668e9e08e3a30_2ecab911f7b286421a@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/pprInstrH at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/pprInstrH You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 02:15:44 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 10 Jul 2024 22:15:44 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 10 commits: Add support for building profiled dynamic way Message-ID: <668f40506c695_2ecab96a99dbc1224d2@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: ed8c672a by Matthew Pickering at 2024-07-10T22:15:14-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 728f3eb1 by Matthew Pickering at 2024-07-10T22:15:14-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - f6c99b2d by Sylvain Henry at 2024-07-10T22:15:19-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 6c1e9465 by Sylvain Henry at 2024-07-10T22:15:19-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - 3a17f4d2 by Sylvain Henry at 2024-07-10T22:15:19-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 50f2c67f by Simon Peyton Jones at 2024-07-10T22:15:19-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - e3cd6b5e by sheaf at 2024-07-10T22:15:22-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 294991cc by Matthew Pickering at 2024-07-10T22:15:22-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 734f9223 by Adam Sandberg Ericsson at 2024-07-10T22:15:23-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 1a63ab83 by Hécate Kleidukos at 2024-07-10T22:15:28-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b919967595a1c3dc87a0a9e4adccd086883d3965...1a63ab8334821cc878dfc87684064b5607408858 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b919967595a1c3dc87a0a9e4adccd086883d3965...1a63ab8334821cc878dfc87684064b5607408858 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 07:46:53 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 11 Jul 2024 03:46:53 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Add support for building profiled dynamic way Message-ID: <668f8dedde2cd_2007878ab61464893@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 1f5722c3 by Matthew Pickering at 2024-07-11T03:46:24-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - f0a3e568 by Matthew Pickering at 2024-07-11T03:46:24-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 6fd9158c by Alex Mason at 2024-07-11T03:46:30-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 381f9de5 by romes at 2024-07-11T03:46:33-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 998b7357 by Sylvain Henry at 2024-07-11T03:46:36-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 83321509 by Sylvain Henry at 2024-07-11T03:46:36-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - e50c0e3d by Sylvain Henry at 2024-07-11T03:46:36-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 9531c588 by Simon Peyton Jones at 2024-07-11T03:46:37-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 460be792 by sheaf at 2024-07-11T03:46:39-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - d3c14d4b by Matthew Pickering at 2024-07-11T03:46:40-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - b0615855 by Adam Sandberg Ericsson at 2024-07-11T03:46:41-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 0816ec83 by Hécate Kleidukos at 2024-07-11T03:46:43-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1a63ab8334821cc878dfc87684064b5607408858...0816ec8386396b999b671fb76f21d7ade2e15247 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1a63ab8334821cc878dfc87684064b5607408858...0816ec8386396b999b671fb76f21d7ade2e15247 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 09:08:06 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Thu, 11 Jul 2024 05:08:06 -0400 Subject: [Git][ghc/ghc][wip/corefile-recomp] 4323 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <668fa0f5f1228_200787152525010358b@gitlab.mail> Zubin pushed to branch wip/corefile-recomp at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 18a3dc3b by Zubin Duggal at 2024-07-11T14:37:18+05:30 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 30 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/Config.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/LRegSet.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/128a3799275ba60d23cfe5e4251422d086dc2e53...18a3dc3b223d4b193d068915a61f5eb549d3fe5e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/128a3799275ba60d23cfe5e4251422d086dc2e53...18a3dc3b223d4b193d068915a61f5eb549d3fe5e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 09:53:55 2024 From: gitlab at gitlab.haskell.org (Teo Camarasu (@teo)) Date: Thu, 11 Jul 2024 05:53:55 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T24150-9.10 Message-ID: <668fabb360c9_2007871d457b4111333@gitlab.mail> Teo Camarasu pushed new branch wip/T24150-9.10 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T24150-9.10 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 10:19:39 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Thu, 11 Jul 2024 06:19:39 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/25052 Message-ID: <668fb1bb9e97e_122b94274fe897418@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/25052 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/25052 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 10:26:32 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Thu, 11 Jul 2024 06:26:32 -0400 Subject: [Git][ghc/ghc][wip/romes/deterministic-label-map] 2 commits: Introduce back LabelMap non deterministic Message-ID: <668fb3582f0a4_122b9442c82c1006a8@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC Commits: 875be730 by Rodrigo Mesquita at 2024-07-11T11:24:37+01:00 Introduce back LabelMap non deterministic - - - - - 89ffb186 by Rodrigo Mesquita at 2024-07-11T11:26:05+01:00 Use NonDeterministic Label map in multiple passes (TODO: More could be available. Look through Det LabelMap uses again) - - - - - 29 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - + compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/StgToCmm/Heap.hs - compiler/GHC/StgToCmm/Monad.hs - compiler/GHC/Types/Unique/DFM.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/Dataflow.hs ===================================== @@ -43,7 +43,9 @@ import Data.Kind (Type) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap) +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label.NonDet hiding (LabelMap) type family Fact (x :: Extensibility) f :: Type type instance Fact C f = FactBase f @@ -156,7 +158,7 @@ fixpointAnalysis direction lattice do_block entry blockmap = loop start -- information in fbase1 and (if something changed) we update it -- and add the affected blocks to the worklist. (todo2, fbase2) = {-# SCC "mapFoldWithKey" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts in loop todo2 fbase2 loop _ !fbase1 = fbase1 @@ -227,9 +229,9 @@ fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap let block = block_arr ! index (new_block, out_facts) <- {-# SCC "do_block_rewrite" #-} do_block block fbase1 - let blocks2 = mapInsert (entryLabel new_block) new_block blocks1 + let blocks2 = Det.mapInsert (entryLabel new_block) new_block blocks1 (todo2, fbase2) = {-# SCC "mapFoldWithKey_rewrite" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts loop todo2 blocks2 fbase2 loop _ !blocks1 !fbase1 = return (blocks1, fbase1) @@ -320,16 +322,16 @@ sortBlocks direction entry blockmap = -- * for a forward analysis, we only need to re-analyze the current block -- (and that will in turn propagate facts into its successors). mkDepBlocks :: NonLocal node => Direction -> [Block node C C] -> LabelMap IntSet -mkDepBlocks Fwd blocks = go blocks 0 mapEmpty +mkDepBlocks Fwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - go bs (n + 1) $ mapInsert (entryLabel b) (IntSet.singleton n) dep_map -mkDepBlocks Bwd blocks = go blocks 0 mapEmpty + go bs (n + 1) $ Det.mapInsert (entryLabel b) (IntSet.singleton n) dep_map +mkDepBlocks Bwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - let insert m l = mapInsertWith IntSet.union l (IntSet.singleton n) m + let insert m l = Det.mapInsertWith IntSet.union l (IntSet.singleton n) m in go bs (n + 1) $ foldl' insert dep_map (successors b) -- | After some new facts have been generated by analysing a block, we @@ -353,7 +355,7 @@ updateFact fact_join dep_blocks (todo, fbase) lbl new_fact (Changed f) -> let !z = mapInsert lbl f fbase in (changed, z) where changed = todo `IntSet.union` - mapFindWithDefault IntSet.empty lbl dep_blocks + Det.mapFindWithDefault IntSet.empty lbl dep_blocks {- Note [No old fact] ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -7,11 +7,9 @@ {-# OPTIONS_GHC -Wno-unused-top-binds #-} module GHC.Cmm.Dataflow.Label - ( Label + ( Label(..) , LabelMap , LabelSet - , FactBase - , lookupFact , mkHooplLabel -- * Set , setEmpty @@ -295,10 +293,3 @@ instance TrieMap LabelMap where foldTM k m z = mapFoldr k z m filterTM f m = mapFilter f m ------------------------------------------------------------------------------ --- FactBase - -type FactBase f = LabelMap f - -lookupFact :: Label -> FactBase f -> Maybe f -lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -0,0 +1,297 @@ +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TypeFamilies #-} +{-# OPTIONS_GHC -Wno-unused-top-binds #-} + +-- | Non-deterministic 'LabelMap' and 'LabelSet': +-- +-- Labels that use non-deterministic Uniques will make this map +-- non-deterministic. In contrast, 'GHC.Cmm.Dataflow.Label.LabelMap' will be +-- deterministically ordered regardless of the non-deterministic origin of the +-- Uniques in the labels. +-- +-- We want to make sure that non-deterministic label maps are only used when +-- the non-determinism of the map cannot affect the determinism of the code +-- generation output. To that effect, this label map only exposes operations +-- which don't allow non-determinism from the outside, e.g., it exposes maps +-- and lookups, but not traversals or to-list functions. +module GHC.Cmm.Dataflow.Label.NonDet + ( Label + , LabelMap + , LabelSet + , FactBase + , lookupFact + , mkHooplLabel + -- * Set + , setEmpty + , setNull + , setSize + , setMember + , setSingleton + , setInsert + , setDelete + , setUnion + , setUnions + , setDifference + , setIntersection + , setIsSubsetOf + , setFilter + , setFromList + , nonDetSetFoldl + , nonDetSetFoldr + , nonDetSetElems + -- * Map + , mapNull + , mapSize + , mapMember + , mapLookup + , mapFindWithDefault + , mapEmpty + , mapSingleton + , mapInsert + , mapInsertWith + , mapDelete + , mapAlter + , mapAdjust + , mapUnion + , mapUnions + , mapUnionWithKey + , mapDifference + , mapIntersection + , mapIsSubmapOf + , mapMap + , mapMapWithKey + , mapFilter + , mapFilterWithKey + , mapFromList + , mapFromListWith + , nonDetMapElems + , nonDetMapFoldl + , nonDetMapFoldr + , nonDetMapFoldlWithKey + , nonDetMapFoldMapWithKey + , nonDetMapKeys + , nonDetMapToList + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable + +-- The code generator will eventually be using all the labels stored in a +-- LabelSet and LabelMap. For these reasons we use the strict variants of these +-- data structures. We inline selectively to enable the RULES in Word64Map/Set +-- to fire. +import GHC.Data.Word64Set (Word64Set) +import qualified GHC.Data.Word64Set as S +import GHC.Data.Word64Map.Strict (Word64Map) +import qualified GHC.Data.Word64Map.Strict as M + +import Data.List (foldl1') + +import GHC.Cmm.Dataflow.Label (Label(..), mkHooplLabel) + +----------------------------------------------------------------------------- +-- LabelSet + +newtype LabelSet = LS Word64Set + deriving newtype (Eq, Ord, Show, Monoid, Semigroup) + +setNull :: LabelSet -> Bool +setNull (LS s) = S.null s + +setSize :: LabelSet -> Int +setSize (LS s) = S.size s + +setMember :: Label -> LabelSet -> Bool +setMember (Label k) (LS s) = S.member k s + +setEmpty :: LabelSet +setEmpty = LS S.empty + +setSingleton :: Label -> LabelSet +setSingleton (Label k) = LS (S.singleton k) + +setInsert :: Label -> LabelSet -> LabelSet +setInsert (Label k) (LS s) = LS (S.insert k s) + +setDelete :: Label -> LabelSet -> LabelSet +setDelete (Label k) (LS s) = LS (S.delete k s) + +setUnion :: LabelSet -> LabelSet -> LabelSet +setUnion (LS x) (LS y) = LS (S.union x y) + +{-# INLINE setUnions #-} +setUnions :: [LabelSet] -> LabelSet +setUnions [] = setEmpty +setUnions sets = foldl1' setUnion sets + +setDifference :: LabelSet -> LabelSet -> LabelSet +setDifference (LS x) (LS y) = LS (S.difference x y) + +setIntersection :: LabelSet -> LabelSet -> LabelSet +setIntersection (LS x) (LS y) = LS (S.intersection x y) + +setIsSubsetOf :: LabelSet -> LabelSet -> Bool +setIsSubsetOf (LS x) (LS y) = S.isSubsetOf x y + +setFilter :: (Label -> Bool) -> LabelSet -> LabelSet +setFilter f (LS s) = LS (S.filter (f . mkHooplLabel) s) + +{-# INLINE setFromList #-} +setFromList :: [Label] -> LabelSet +setFromList ks = LS (S.fromList (map lblToUnique ks)) + +{-# INLINE nonDetSetFoldl #-} +nonDetSetFoldl :: (t -> Label -> t) -> t -> LabelSet -> t +nonDetSetFoldl k z (LS s) = S.foldl (\a v -> k a (mkHooplLabel v)) z s + +{-# INLINE nonDetSetFoldr #-} +nonDetSetFoldr :: (Label -> t -> t) -> t -> LabelSet -> t +nonDetSetFoldr k z (LS s) = S.foldr (\v a -> k (mkHooplLabel v) a) z s + +{-# INLINE nonDetSetElems #-} +nonDetSetElems :: LabelSet -> [Label] +nonDetSetElems (LS s) = map mkHooplLabel (S.elems s) + +----------------------------------------------------------------------------- +-- LabelMap + +newtype LabelMap v = LM (Word64Map v) + deriving newtype (Eq, Ord, Show, Functor) + +mapNull :: LabelMap a -> Bool +mapNull (LM m) = M.null m + +{-# INLINE mapSize #-} +mapSize :: LabelMap a -> Int +mapSize (LM m) = M.size m + +mapMember :: Label -> LabelMap a -> Bool +mapMember (Label k) (LM m) = M.member k m + +mapLookup :: Label -> LabelMap a -> Maybe a +mapLookup (Label k) (LM m) = M.lookup k m + +mapFindWithDefault :: a -> Label -> LabelMap a -> a +mapFindWithDefault def (Label k) (LM m) = M.findWithDefault def k m + +mapEmpty :: LabelMap v +mapEmpty = LM M.empty + +mapSingleton :: Label -> v -> LabelMap v +mapSingleton (Label k) v = LM (M.singleton k v) + +mapInsert :: Label -> v -> LabelMap v -> LabelMap v +mapInsert (Label k) v (LM m) = LM (M.insert k v m) + +mapInsertWith :: (v -> v -> v) -> Label -> v -> LabelMap v -> LabelMap v +mapInsertWith f (Label k) v (LM m) = LM (M.insertWith f k v m) + +mapDelete :: Label -> LabelMap v -> LabelMap v +mapDelete (Label k) (LM m) = LM (M.delete k m) + +mapAlter :: (Maybe v -> Maybe v) -> Label -> LabelMap v -> LabelMap v +mapAlter f (Label k) (LM m) = LM (M.alter f k m) + +mapAdjust :: (v -> v) -> Label -> LabelMap v -> LabelMap v +mapAdjust f (Label k) (LM m) = LM (M.adjust f k m) + +mapUnion :: LabelMap v -> LabelMap v -> LabelMap v +mapUnion (LM x) (LM y) = LM (M.union x y) + +{-# INLINE mapUnions #-} +mapUnions :: [LabelMap a] -> LabelMap a +mapUnions [] = mapEmpty +mapUnions maps = foldl1' mapUnion maps + +mapUnionWithKey :: (Label -> v -> v -> v) -> LabelMap v -> LabelMap v -> LabelMap v +mapUnionWithKey f (LM x) (LM y) = LM (M.unionWithKey (f . mkHooplLabel) x y) + +mapDifference :: LabelMap v -> LabelMap b -> LabelMap v +mapDifference (LM x) (LM y) = LM (M.difference x y) + +mapIntersection :: LabelMap v -> LabelMap b -> LabelMap v +mapIntersection (LM x) (LM y) = LM (M.intersection x y) + +mapIsSubmapOf :: Eq a => LabelMap a -> LabelMap a -> Bool +mapIsSubmapOf (LM x) (LM y) = M.isSubmapOf x y + +mapMap :: (a -> v) -> LabelMap a -> LabelMap v +mapMap f (LM m) = LM (M.map f m) + +mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v +mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) + +{-# INLINEABLE mapFilter #-} +mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v +mapFilter f (LM m) = LM (M.filter f m) + +{-# INLINEABLE mapFilterWithKey #-} +mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v +mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) + +{-# INLINE mapFromList #-} +mapFromList :: [(Label, v)] -> LabelMap v +mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) + +mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v +mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) + +{-# INLINE nonDetMapElems #-} +nonDetMapElems :: LabelMap a -> [a] +nonDetMapElems (LM m) = M.elems m + +{-# INLINE nonDetMapFoldl #-} +nonDetMapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a +nonDetMapFoldl k z (LM m) = M.foldl k z m + +{-# INLINE nonDetMapFoldr #-} +nonDetMapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b +nonDetMapFoldr k z (LM m) = M.foldr k z m + +{-# INLINE nonDetMapFoldlWithKey #-} +nonDetMapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t +nonDetMapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m + +nonDetMapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m +nonDetMapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m + +{-# INLINE nonDetMapKeys #-} +nonDetMapKeys :: LabelMap a -> [Label] +nonDetMapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) + +{-# INLINE nonDetMapToList #-} +nonDetMapToList :: LabelMap b -> [(Label, b)] +nonDetMapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] + +----------------------------------------------------------------------------- +-- Instances + +instance Outputable LabelSet where + ppr = ppr . nonDetSetElems + +instance Outputable a => Outputable (LabelMap a) where + ppr = ppr . nonDetMapToList + +instance OutputableP env a => OutputableP env (LabelMap a) where + pdoc env = pdoc env . nonDetMapToList + +-- instance TrieMap LabelMap where +-- type Key LabelMap = Label +-- emptyTM = mapEmpty +-- lookupTM k m = mapLookup k m +-- alterTM k f m = mapAlter f k m +-- foldTM k m z = mapFoldr k z m -- TODO:ERROR? +-- filterTM f m = mapFilter f m + +----------------------------------------------------------------------------- +-- FactBase + +type FactBase f = LabelMap f + +lookupFact :: Label -> FactBase f -> Maybe f +lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Graph.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Cmm.Switch (SwitchTargets) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.FastString import GHC.Types.ForeignCall import GHC.Data.OrdList ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -23,6 +23,8 @@ import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet (lookupFact) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module import GHC.Data.Graph.Directed @@ -532,7 +534,7 @@ newtype CAFfyLabel = CAFfyLabel CLabel deriving newtype instance OutputableP env CLabel => OutputableP env CAFfyLabel type CAFSet = Set CAFfyLabel -type CAFEnv = LabelMap CAFSet +type CAFEnv = NonDet.LabelMap CAFSet -- | Records the CAFfy references of a set of static data decls. type DataCAFEnv = Map CLabel CAFSet @@ -599,7 +601,7 @@ cafAnal -> CAFEnv cafAnal platform contLbls topLbl cmmGraph = analyzeCmmBwd cafLattice - (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty + (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph NonDet.mapEmpty cafLattice :: DataflowLattice CAFSet @@ -659,7 +661,7 @@ cafTransfers platform contLbls entry topLbl text "topLbl:" <+> pdoc platform topLbl $$ text "cafs in exit:" <+> pdoc platform joined $$ text "result:" <+> pdoc platform result) $ - mapSingleton (entryLabel eNode) result + NonDet.mapSingleton (entryLabel eNode) result -- ----------------------------------------------------------------------------- @@ -775,7 +777,7 @@ depAnalSRTs platform cafEnv cafEnv_static decls = | (l, lbl) <- labelledBlocks , Just (cafs :: Set CAFfyLabel) <- [case l of - BlockLabel l -> mapLookup l cafEnv + BlockLabel l -> NonDet.mapLookup l cafEnv DeclLabel cl -> Map.lookup cl cafEnv_static] , let cafs' = Set.delete lbl cafs ] @@ -810,7 +812,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep - , Just cafs <- mapLookup (g_entry g) cafEnv + , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv = Just (Just (g_entry g), mkCAFfyLabel platform top_lbl, cafs) | otherwise @@ -902,7 +904,7 @@ doSRTs cfg moduleSRTInfo procs data_ = do CmmStaticsRaw lbl _ -> (lbl, set) (proc_envs, procss) = unzip procs - cafEnv = mapUnions proc_envs + cafEnv = NonDet.mapUnions proc_envs decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss staticFuns = mapFromList (getStaticFuns decls) ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards, GADTs #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Cmm.LayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where @@ -26,6 +27,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label import GHC.Types.Unique.Supply +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Data.Maybe import GHC.Types.Unique.FM import GHC.Utils.Misc @@ -235,7 +237,7 @@ instance Outputable StackMap where cmmLayoutStack :: CmmConfig -> ProcPointSet -> ByteOff -> CmmGraph - -> UniqSM (CmmGraph, LabelMap StackMap) + -> UniqSM (CmmGraph, NonDet.LabelMap StackMap) cmmLayoutStack cfg procpoints entry_args graph@(CmmGraph { g_entry = entry }) = do @@ -262,17 +264,17 @@ cmmLayoutStack cfg procpoints entry_args layout :: CmmConfig -> LabelSet -- proc points - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> BlockId -- entry -> ByteOff -- stack args on entry - -> LabelMap StackMap -- [final] stack maps + -> NonDet.LabelMap StackMap -- [final] stack maps -> ByteOff -- [final] Sp high water mark -> [CmmBlock] -- [in] blocks -> UniqSM - ( LabelMap StackMap -- [out] stack maps + ( NonDet.LabelMap StackMap -- [out] stack maps , ByteOff -- [out] Sp high water mark , [CmmBlock] -- [out] new blocks ) @@ -282,12 +284,18 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl where (updfr, cont_info) = collectContInfo blocks - init_stackmap = mapSingleton entry StackMap{ sm_sp = entry_args - , sm_args = entry_args - , sm_ret_off = updfr - , sm_regs = emptyUFM - } - + init_stackmap = NonDet.mapSingleton entry + StackMap{ sm_sp = entry_args + , sm_args = entry_args + , sm_ret_off = updfr + , sm_regs = emptyUFM + } + + go :: [Block CmmNode C C] + -> NonDet.LabelMap StackMap + -> StackLoc + -> [CmmBlock] + -> UniqDSM (NonDet.LabelMap StackMap, StackLoc, [CmmBlock]) go [] acc_stackmaps acc_hwm acc_blocks = return (acc_stackmaps, acc_hwm, acc_blocks) @@ -296,7 +304,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl let (entry0@(CmmEntry entry_lbl tscope), middle0, last0) = blockSplit b0 let stack0 at StackMap { sm_sp = sp0 } - = mapFindWithDefault + = NonDet.mapFindWithDefault (pprPanic "no stack map for" (ppr entry_lbl)) entry_lbl acc_stackmaps @@ -328,7 +336,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl manifestSp cfg final_stackmaps stack0 sp0 final_sp_high entry0 middle_pre sp_off last1 fixup_blocks - let acc_stackmaps' = mapUnion acc_stackmaps out + let acc_stackmaps' = NonDet.mapUnion acc_stackmaps out -- If this block jumps to the GC, then we do not take its -- stack usage into account for the high-water mark. @@ -340,7 +348,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl this_sp_hwm | isGcJump last0 = 0 | otherwise = sp0 - sp_off - hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (mapElems out)) + hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (NonDet.nonDetMapElems out)) go bs acc_stackmaps' hwm' (final_blocks ++ acc_blocks) @@ -393,7 +401,7 @@ collectContInfo blocks -- on the stack and need to be immediately saved across a call, we -- want to just leave them where they are on the stack. -- -procMiddle :: LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap +procMiddle :: NonDet.LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap procMiddle stackmaps node sm = case node of CmmAssign (CmmLocal r) (CmmLoad (CmmStackSlot area off) _ _) @@ -404,10 +412,10 @@ procMiddle stackmaps node sm _other -> sm -getStackLoc :: Area -> ByteOff -> LabelMap StackMap -> StackLoc +getStackLoc :: Area -> ByteOff -> NonDet.LabelMap StackMap -> StackLoc getStackLoc Old n _ = n getStackLoc (Young l) n stackmaps = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Nothing -> pprPanic "getStackLoc" (ppr l) Just sm -> sm_sp sm - sm_args sm + n @@ -432,8 +440,8 @@ getStackLoc (Young l) n stackmaps = -- extra code that goes *after* the Sp adjustment. handleLastNode - :: CmmConfig -> ProcPointSet -> LabelMap CmmLocalLive -> LabelMap ByteOff - -> LabelMap StackMap -> StackMap -> CmmTickScope + :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> LabelMap ByteOff + -> NonDet.LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C -> UniqSM @@ -441,7 +449,7 @@ handleLastNode , ByteOff -- amount to adjust Sp , CmmNode O C -- new last node , [CmmBlock] -- new blocks - , LabelMap StackMap -- stackmaps for the continuations + , NonDet.LabelMap StackMap -- stackmaps for the continuations ) handleLastNode cfg procpoints liveness cont_info stackmaps @@ -452,7 +460,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- is cml_args, after popping any other junk from the stack. CmmCall{ cml_cont = Nothing, .. } -> do let sp_off = sp0 - cml_args - return ([], sp_off, last, [], mapEmpty) + return ([], sp_off, last, [], NonDet.mapEmpty) -- At each CmmCall with a continuation: CmmCall{ cml_cont = Just cont_lbl, .. } -> @@ -473,20 +481,20 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap + , NonDet.LabelMap StackMap ) lastCall lbl cml_args cml_ret_args cml_ret_off = ( assignments , spOffsetForCall sp0 cont_stack cml_args , last , [] -- no new blocks - , mapSingleton lbl cont_stack ) + , NonDet.mapSingleton lbl cont_stack ) where (assignments, cont_stack) = prepareStack lbl cml_ret_args cml_ret_off prepareStack lbl cml_ret_args cml_ret_off - | Just cont_stack <- mapLookup lbl stackmaps + | Just cont_stack <- NonDet.mapLookup lbl stackmaps -- If we have already seen this continuation before, then -- we just have to make the stack look the same: = (fixupStack stack0 cont_stack, cont_stack) @@ -506,7 +514,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap ) + , NonDet.LabelMap StackMap ) handleBranches -- See Note [diamond proc point] @@ -515,8 +523,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps = do let cont_args = mapFindWithDefault 0 l cont_info (assigs, cont_stack) = prepareStack l cont_args (sm_ret_off stack0) - out = mapFromList [ (l', cont_stack) - | l' <- successors last ] + out = NonDet.mapFromList + [ (l', cont_stack) + | l' <- successors last ] return ( assigs , spOffsetForCall sp0 cont_stack (platformWordSizeInBytes platform) , last @@ -532,7 +541,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , 0 , mapSuccessors fix_lbl last , concat [ blk | (_,_,_,blk) <- pps ] - , mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) + , NonDet.mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) -- For each successor of this block handleBranch :: BlockId -> UniqSM (BlockId, BlockId, StackMap, [CmmBlock]) @@ -540,7 +549,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- (a) if the successor already has a stackmap, we need to -- shuffle the current stack to make it look the same. -- We have to insert a new block to make this happen. - | Just stack2 <- mapLookup l stackmaps + | Just stack2 <- NonDet.mapLookup l stackmaps = do let assigs = fixupStack stack0 stack2 (tmp_lbl, block) <- makeFixupBlock cfg sp0 l stack2 tscp assigs @@ -563,7 +572,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- the destination, because this StackMap might be used -- by fixupStack if this is a join point. | otherwise = return (l, l, stack1, []) - where live = mapFindWithDefault (panic "handleBranch") l liveness + where live = NonDet.mapFindWithDefault (panic "handleBranch") l liveness stack1 = stack0 { sm_regs = filterUFM is_live (sm_regs stack0) } is_live (r,_) = r `elemRegSet` live @@ -612,7 +621,7 @@ fixupStack old_stack new_stack = concatMap move new_locs setupStackFrame :: Platform -> BlockId -- label of continuation - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> ByteOff -- updfr -> ByteOff -- bytes of return values on stack -> StackMap -- current StackMap @@ -622,7 +631,7 @@ setupStackFrame platform lbl liveness updfr_off ret_args stack0 = (cont_stack, assignments) where -- get the set of LocalRegs live in the continuation - live = mapFindWithDefault Set.empty lbl liveness + live = NonDet.mapFindWithDefault Set.empty lbl liveness -- the stack from the base to updfr_off is off-limits. -- our new stack frame contains: @@ -824,7 +833,7 @@ allocate platform ret_off live stackmap at StackMap{ sm_sp = sp0 -- manifestSp :: CmmConfig - -> LabelMap StackMap -- StackMaps for other blocks + -> NonDet.LabelMap StackMap -- StackMaps for other blocks -> StackMap -- StackMap for this block -> ByteOff -- Sp on entry to the block -> ByteOff -- SpHigh @@ -857,10 +866,10 @@ manifestSp cfg stackmaps stack0 sp0 sp_high fixup_blocks' = map (mapBlock3' (id, adj_post_sp, id)) fixup_blocks -getAreaOff :: LabelMap StackMap -> (Area -> StackLoc) +getAreaOff :: NonDet.LabelMap StackMap -> (Area -> StackLoc) getAreaOff _ Old = 0 getAreaOff stackmaps (Young l) = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Just sm -> sm_sp sm - sm_args sm Nothing -> pprPanic "getAreaOff" (ppr l) @@ -987,7 +996,7 @@ optStackCheck n = -- Note [Always false stack check] -- StackMap will invalidate its mapping there. -- elimStackStores :: StackMap - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> (Area -> ByteOff) -> [CmmNode O O] -> [CmmNode O O] @@ -1009,7 +1018,7 @@ elimStackStores stackmap stackmaps area_off nodes -- Update info tables to include stack liveness -setInfoTableStackMap :: Platform -> LabelMap StackMap -> CmmDecl -> CmmDecl +setInfoTableStackMap :: Platform -> NonDet.LabelMap StackMap -> CmmDecl -> CmmDecl setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) = CmmProc top_info{ info_tbls = mapMapWithKey fix_info info_tbls } l v g where @@ -1019,7 +1028,7 @@ setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) get_liveness :: BlockId -> Liveness get_liveness lbl - = case mapLookup lbl stackmaps of + = case NonDet.mapLookup lbl stackmaps of Nothing -> pprPanic "setInfoTableStackMap" (ppr lbl <+> pdoc platform info_tbls) Just sm -> stackMapToLiveness platform sm @@ -1044,18 +1053,18 @@ stackMapToLiveness platform StackMap{..} = insertReloadsAsNeeded :: Platform -> ProcPointSet - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> BlockId -> [CmmBlock] -> UniqSM [CmmBlock] insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = toBlockList . fst <$> - rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) mapEmpty + rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) NonDet.mapEmpty where rewriteCC :: RewriteFun CmmLocalLive rewriteCC (BlockCC e_node middle0 x_node) fact_base0 = do let entry_label = entryLabel e_node - stackmap = case mapLookup entry_label final_stackmaps of + stackmap = case NonDet.mapLookup entry_label final_stackmaps of Just sm -> sm Nothing -> panic "insertReloadsAsNeeded: rewriteCC: stackmap" @@ -1077,7 +1086,7 @@ insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = = (middle0, live_at_middle0) -- Final liveness for this block. - !fact_base2 = mapSingleton entry_label live_with_reloads + !fact_base2 = NonDet.mapSingleton entry_label live_with_reloads return (BlockCC e_node middle1 x_node, fact_base2) ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Platform import GHC.Platform.Regs (callerSaves) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm import GHC.Cmm.Liveness import GHC.Cmm.Switch (switchTargetsToList) ===================================== compiler/GHC/Cmm/Liveness.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.LRegSet import GHC.Data.Maybe @@ -57,7 +57,7 @@ cmmLocalLiveness platform graph = where entry = g_entry graph check facts = - noLiveOnEntry entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntry entry (expectJust "check" $ lookupFact entry facts) facts cmmGlobalLiveness :: Platform -> CmmGraph -> BlockEntryLiveness GlobalReg cmmGlobalLiveness platform graph = @@ -120,7 +120,7 @@ cmmLocalLivenessL platform graph = where entry = g_entry graph check facts = - noLiveOnEntryL entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntryL entry (expectJust "check" $ lookupFact entry facts) facts -- | On entry to the procedure, there had better not be any LocalReg's live-in. noLiveOnEntryL :: BlockId -> LRegSet -> a -> a ===================================== compiler/GHC/Cmm/Pipeline.hs ===================================== @@ -11,7 +11,7 @@ import GHC.Cmm import GHC.Cmm.Config import GHC.Cmm.ContFlowOpt import GHC.Cmm.CommonBlockElim -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Info.Build import GHC.Cmm.Lint import GHC.Cmm.LayoutStack ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -29,6 +29,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- Compute a minimal set of proc points for a control-flow graph. @@ -134,7 +135,7 @@ instance Outputable Status where -- Once you know what the proc-points are, figure out -- what proc-points each block is reachable from -- See Note [Proc-point analysis] -procPointAnalysis :: ProcPointSet -> CmmGraph -> LabelMap Status +procPointAnalysis :: ProcPointSet -> CmmGraph -> NonDet.LabelMap Status procPointAnalysis procPoints cmmGraph@(CmmGraph {g_graph = graph}) = analyzeCmmFwd procPointLattice procPointTransfer cmmGraph initProcPoints where @@ -196,14 +197,14 @@ extendPPSet extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block - in case mapLookup id env of + in case NonDet.mapLookup id env of Just ProcPoint -> setInsert id pps _ -> pps procPoints' = foldlGraphBlocks add setEmpty g newPoints = mapMaybe ppSuccessor blocks newPoint = listToMaybe newPoints ppSuccessor b = - let nreached id = case mapLookup id env `orElse` + let nreached id = case NonDet.mapLookup id env `orElse` pprPanic "no ppt" (ppr id <+> pdoc platform b) of ProcPoint -> 1 ReachedBy ps -> setSize ps @@ -235,7 +236,7 @@ extendPPSet platform g blocks procPoints = -- Input invariant: A block should only be reachable from a single ProcPoint. -- ToDo: use the _ret naming convention that the old code generator -- used. -- EZY -splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> LabelMap Status -> CmmDecl +splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> NonDet.LabelMap Status -> CmmDecl -> UniqSM [CmmDecl] splitAtProcPoints _ _ _ _ _ t@(CmmData _ _) = return [t] splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do @@ -249,7 +250,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let add_block :: LabelMap (LabelMap CmmBlock) -> CmmBlock -> LabelMap (LabelMap CmmBlock) add_block graphEnv b = - case mapLookup bid procMap of + case NonDet.mapLookup bid procMap of Just ProcPoint -> add graphEnv bid bid b Just (ReachedBy set) -> case setElems set of @@ -263,7 +264,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let liveness = cmmGlobalLiveness platform g let ppLiveness pp = filter isArgReg $ regSetToList $ - expectJust "ppLiveness" $ mapLookup pp liveness + expectJust "ppLiveness" $ NonDet.mapLookup pp liveness graphEnv <- return $ foldlGraphBlocks add_block mapEmpty g -- Build a map from proc point BlockId to pairs of: ===================================== compiler/GHC/Cmm/Sink.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Cmm.Liveness import GHC.Cmm.LRegSet import GHC.Cmm.Utils import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Dataflow.Graph import GHC.Platform.Regs ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -40,7 +40,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapEmpty, mapLookup, mapInsert) import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -26,7 +26,8 @@ import GHC.CmmToAsm.Config import GHC.Cmm import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember, mapLookup, mapElems, mapKeys, mapEmpty, mapInsert, mapDelete, mapFromList, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setEmpty, setMember, setFromList, setInsert) import GHC.Types.Unique.FM ===================================== compiler/GHC/CmmToAsm/PIC.hs ===================================== @@ -60,7 +60,7 @@ import GHC.CmmToAsm.Config import GHC.CmmToAsm.Types -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapMember) import GHC.Cmm import GHC.Cmm.CLabel import GHC.Cmm.Utils (cmmLoadBWord) ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -15,7 +15,7 @@ import GHC.CmmToAsm.Instr import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapFoldlWithKey, mapLookup, mapInsert) import GHC.Utils.Monad import GHC.Utils.Monad.State.Strict ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import Data.List (nub, foldl1', find) import Data.Maybe ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Platform.Reg import GHC.Data.Graph.Base -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup, Label, LabelMap) import GHC.Cmm import GHC.Types.Unique.FM import GHC.Types.Unique.Set ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -122,7 +122,7 @@ import GHC.Platform.Reg import GHC.Platform.Reg.Class (RegClass(..)) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Cmm hiding (RegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs ===================================== @@ -23,7 +23,7 @@ import GHC.CmmToAsm.Types import GHC.Platform.Reg import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.Graph.Directed import GHC.Utils.Panic import GHC.Utils.Monad (concatMapM) ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -46,7 +46,8 @@ import GHC.CmmToAsm.Types import GHC.CmmToAsm.Utils import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapToList, LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setMember, setFromList) import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -34,7 +34,7 @@ import GHC.Cmm import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.InitFini import GHC.CmmToAsm.Wasm.Types import GHC.CmmToAsm.Wasm.Utils ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -66,7 +66,7 @@ import GHC.Cmm.Switch import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember) import GHC.Cmm.CLabel import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -54,7 +54,7 @@ import GHC.CmmToAsm.Reg.Target import GHC.CmmToAsm.Config import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Platform.Regs import GHC.Cmm import GHC.Utils.Outputable ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.FastString import GHC.Data.OrdList ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -22,7 +22,7 @@ import Control.Monad import Data.List (delete, union, insert, intersect) import Data.Semigroup -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.Graph.Inductive.Graph import GHC.Types.Unique.Supply import GHC.Utils.Panic hiding (assert) ===================================== compiler/GHC/StgToCmm/Heap.hs ===================================== @@ -33,7 +33,7 @@ import GHC.StgToCmm.Closure import GHC.Cmm.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Runtime.Heap.Layout import GHC.Cmm.BlockId import GHC.Cmm ===================================== compiler/GHC/StgToCmm/Monad.hs ===================================== @@ -76,7 +76,7 @@ import GHC.StgToCmm.Sequel import GHC.Cmm.Graph as CmmGraph import GHC.Cmm.BlockId import GHC.Cmm.CLabel -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapSingleton, mapEmpty) import GHC.Runtime.Heap.Layout import GHC.Unit import GHC.Types.Id ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -21,6 +21,7 @@ is not deterministic. {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -Wall #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Types.Unique.DFM ( -- * Unique-keyed deterministic mappings ===================================== compiler/ghc.cabal.in ===================================== @@ -237,6 +237,7 @@ Library GHC.Cmm.Dataflow.Block GHC.Cmm.Dataflow.Graph GHC.Cmm.Dataflow.Label + GHC.Cmm.Dataflow.Label.NonDet GHC.Cmm.DebugBlock GHC.Cmm.Expr GHC.Cmm.GenericOpt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a7e58e4100d9e33f22a478447a05efd359bf3a2c...89ffb1862cb6c729c93691968c2804d6cf15838a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a7e58e4100d9e33f22a478447a05efd359bf3a2c...89ffb1862cb6c729c93691968c2804d6cf15838a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 10:38:11 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Thu, 11 Jul 2024 06:38:11 -0400 Subject: [Git][ghc/ghc][wip/romes/deterministic-label-map] Use NonDeterministic Label map in multiple passes Message-ID: <668fb612a7c59_122b9460abd01011a@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/deterministic-label-map at Glasgow Haskell Compiler / GHC Commits: 2d58e77c by Rodrigo Mesquita at 2024-07-11T11:37:48+01:00 Use NonDeterministic Label map in multiple passes (TODO: More could be available. Look through Det LabelMap uses again) - - - - - 29 changed files: - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Label.hs - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Data/Graph/Collapse.hs - compiler/GHC/StgToCmm/Heap.hs - compiler/GHC/StgToCmm/Monad.hs - compiler/GHC/Types/Unique/DFM.hs - compiler/ghc.cabal.in Changes: ===================================== compiler/GHC/Cmm/Dataflow.hs ===================================== @@ -43,7 +43,9 @@ import Data.Kind (Type) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap) +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label.NonDet hiding (LabelMap) type family Fact (x :: Extensibility) f :: Type type instance Fact C f = FactBase f @@ -156,7 +158,7 @@ fixpointAnalysis direction lattice do_block entry blockmap = loop start -- information in fbase1 and (if something changed) we update it -- and add the affected blocks to the worklist. (todo2, fbase2) = {-# SCC "mapFoldWithKey" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts in loop todo2 fbase2 loop _ !fbase1 = fbase1 @@ -227,9 +229,9 @@ fixpointRewrite dir lattice do_block entry blockmap = loop start blockmap let block = block_arr ! index (new_block, out_facts) <- {-# SCC "do_block_rewrite" #-} do_block block fbase1 - let blocks2 = mapInsert (entryLabel new_block) new_block blocks1 + let blocks2 = Det.mapInsert (entryLabel new_block) new_block blocks1 (todo2, fbase2) = {-# SCC "mapFoldWithKey_rewrite" #-} - mapFoldlWithKey + nonDetMapFoldlWithKey (updateFact join dep_blocks) (todo1, fbase1) out_facts loop todo2 blocks2 fbase2 loop _ !blocks1 !fbase1 = return (blocks1, fbase1) @@ -320,16 +322,16 @@ sortBlocks direction entry blockmap = -- * for a forward analysis, we only need to re-analyze the current block -- (and that will in turn propagate facts into its successors). mkDepBlocks :: NonLocal node => Direction -> [Block node C C] -> LabelMap IntSet -mkDepBlocks Fwd blocks = go blocks 0 mapEmpty +mkDepBlocks Fwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - go bs (n + 1) $ mapInsert (entryLabel b) (IntSet.singleton n) dep_map -mkDepBlocks Bwd blocks = go blocks 0 mapEmpty + go bs (n + 1) $ Det.mapInsert (entryLabel b) (IntSet.singleton n) dep_map +mkDepBlocks Bwd blocks = go blocks 0 Det.mapEmpty where go [] !_ !dep_map = dep_map go (b:bs) !n !dep_map = - let insert m l = mapInsertWith IntSet.union l (IntSet.singleton n) m + let insert m l = Det.mapInsertWith IntSet.union l (IntSet.singleton n) m in go bs (n + 1) $ foldl' insert dep_map (successors b) -- | After some new facts have been generated by analysing a block, we @@ -353,7 +355,7 @@ updateFact fact_join dep_blocks (todo, fbase) lbl new_fact (Changed f) -> let !z = mapInsert lbl f fbase in (changed, z) where changed = todo `IntSet.union` - mapFindWithDefault IntSet.empty lbl dep_blocks + Det.mapFindWithDefault IntSet.empty lbl dep_blocks {- Note [No old fact] ===================================== compiler/GHC/Cmm/Dataflow/Label.hs ===================================== @@ -7,11 +7,9 @@ {-# OPTIONS_GHC -Wno-unused-top-binds #-} module GHC.Cmm.Dataflow.Label - ( Label + ( Label(..) , LabelMap , LabelSet - , FactBase - , lookupFact , mkHooplLabel -- * Set , setEmpty @@ -295,10 +293,3 @@ instance TrieMap LabelMap where foldTM k m z = mapFoldr k z m filterTM f m = mapFilter f m ------------------------------------------------------------------------------ --- FactBase - -type FactBase f = LabelMap f - -lookupFact :: Label -> FactBase f -> Maybe f -lookupFact = mapLookup ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -39,10 +39,10 @@ module GHC.Cmm.Dataflow.Label.NonDet , setIntersection , setIsSubsetOf , setFilter - , setFoldl - , setFoldr , setFromList - , setElems + , nonDetSetFoldl + , nonDetSetFoldr + , nonDetSetElems -- * Map , mapNull , mapSize @@ -64,25 +64,23 @@ module GHC.Cmm.Dataflow.Label.NonDet , mapIsSubmapOf , mapMap , mapMapWithKey - , mapFoldl - , mapFoldr - , mapFoldlWithKey - , mapFoldMapWithKey , mapFilter , mapFilterWithKey - , mapElems - , mapKeys - , mapToList , mapFromList , mapFromListWith + , nonDetMapElems + , nonDetMapFoldl + , nonDetMapFoldr + , nonDetMapFoldlWithKey + , nonDetMapFoldMapWithKey + , nonDetMapKeys + , nonDetMapToList ) where import GHC.Prelude import GHC.Utils.Outputable -import GHC.Types.Unique (Uniquable(..), mkUniqueGrimily) - -- The code generator will eventually be using all the labels stored in a -- LabelSet and LabelMap. For these reasons we use the strict variants of these -- data structures. We inline selectively to enable the RULES in Word64Map/Set @@ -91,33 +89,10 @@ import GHC.Data.Word64Set (Word64Set) import qualified GHC.Data.Word64Set as S import GHC.Data.Word64Map.Strict (Word64Map) import qualified GHC.Data.Word64Map.Strict as M -import GHC.Data.TrieMap -import Data.Word (Word64) import Data.List (foldl1') - ------------------------------------------------------------------------------ --- Label ------------------------------------------------------------------------------ - -newtype Label = Label { lblToUnique :: Word64 } - deriving newtype (Eq, Ord) - -mkHooplLabel :: Word64 -> Label -mkHooplLabel = Label - -instance Show Label where - show (Label n) = "L" ++ show n - -instance Uniquable Label where - getUnique label = mkUniqueGrimily (lblToUnique label) - -instance Outputable Label where - ppr label = ppr (getUnique label) - -instance OutputableP env Label where - pdoc _ l = ppr l +import GHC.Cmm.Dataflow.Label (Label(..), mkHooplLabel) ----------------------------------------------------------------------------- -- LabelSet @@ -166,28 +141,27 @@ setIsSubsetOf (LS x) (LS y) = S.isSubsetOf x y setFilter :: (Label -> Bool) -> LabelSet -> LabelSet setFilter f (LS s) = LS (S.filter (f . mkHooplLabel) s) -{-# INLINE setFoldl #-} -setFoldl :: (t -> Label -> t) -> t -> LabelSet -> t -setFoldl k z (LS s) = S.foldl (\a v -> k a (mkHooplLabel v)) z s - -{-# INLINE setFoldr #-} -setFoldr :: (Label -> t -> t) -> t -> LabelSet -> t -setFoldr k z (LS s) = S.foldr (\v a -> k (mkHooplLabel v) a) z s - -{-# INLINE setElems #-} -setElems :: LabelSet -> [Label] -setElems (LS s) = map mkHooplLabel (S.elems s) - {-# INLINE setFromList #-} setFromList :: [Label] -> LabelSet setFromList ks = LS (S.fromList (map lblToUnique ks)) +{-# INLINE nonDetSetFoldl #-} +nonDetSetFoldl :: (t -> Label -> t) -> t -> LabelSet -> t +nonDetSetFoldl k z (LS s) = S.foldl (\a v -> k a (mkHooplLabel v)) z s + +{-# INLINE nonDetSetFoldr #-} +nonDetSetFoldr :: (Label -> t -> t) -> t -> LabelSet -> t +nonDetSetFoldr k z (LS s) = S.foldr (\v a -> k (mkHooplLabel v) a) z s + +{-# INLINE nonDetSetElems #-} +nonDetSetElems :: LabelSet -> [Label] +nonDetSetElems (LS s) = map mkHooplLabel (S.elems s) + ----------------------------------------------------------------------------- -- LabelMap newtype LabelMap v = LM (Word64Map v) - deriving newtype (Eq, Ord, Show, Functor, Foldable) - deriving stock Traversable + deriving newtype (Eq, Ord, Show, Functor) mapNull :: LabelMap a -> Bool mapNull (LM m) = M.null m @@ -252,21 +226,6 @@ mapMap f (LM m) = LM (M.map f m) mapMapWithKey :: (Label -> a -> v) -> LabelMap a -> LabelMap v mapMapWithKey f (LM m) = LM (M.mapWithKey (f . mkHooplLabel) m) -{-# INLINE mapFoldl #-} -mapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a -mapFoldl k z (LM m) = M.foldl k z m - -{-# INLINE mapFoldr #-} -mapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b -mapFoldr k z (LM m) = M.foldr k z m - -{-# INLINE mapFoldlWithKey #-} -mapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t -mapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m - -mapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m -mapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m - {-# INLINEABLE mapFilter #-} mapFilter :: (v -> Bool) -> LabelMap v -> LabelMap v mapFilter f (LM m) = LM (M.filter f m) @@ -275,18 +234,6 @@ mapFilter f (LM m) = LM (M.filter f m) mapFilterWithKey :: (Label -> v -> Bool) -> LabelMap v -> LabelMap v mapFilterWithKey f (LM m) = LM (M.filterWithKey (f . mkHooplLabel) m) -{-# INLINE mapElems #-} -mapElems :: LabelMap a -> [a] -mapElems (LM m) = M.elems m - -{-# INLINE mapKeys #-} -mapKeys :: LabelMap a -> [Label] -mapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) - -{-# INLINE mapToList #-} -mapToList :: LabelMap b -> [(Label, b)] -mapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] - {-# INLINE mapFromList #-} mapFromList :: [(Label, v)] -> LabelMap v mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) @@ -294,25 +241,52 @@ mapFromList assocs = LM (M.fromList [(lblToUnique k, v) | (k, v) <- assocs]) mapFromListWith :: (v -> v -> v) -> [(Label, v)] -> LabelMap v mapFromListWith f assocs = LM (M.fromListWith f [(lblToUnique k, v) | (k, v) <- assocs]) +{-# INLINE nonDetMapElems #-} +nonDetMapElems :: LabelMap a -> [a] +nonDetMapElems (LM m) = M.elems m + +{-# INLINE nonDetMapFoldl #-} +nonDetMapFoldl :: (a -> b -> a) -> a -> LabelMap b -> a +nonDetMapFoldl k z (LM m) = M.foldl k z m + +{-# INLINE nonDetMapFoldr #-} +nonDetMapFoldr :: (a -> b -> b) -> b -> LabelMap a -> b +nonDetMapFoldr k z (LM m) = M.foldr k z m + +{-# INLINE nonDetMapFoldlWithKey #-} +nonDetMapFoldlWithKey :: (t -> Label -> b -> t) -> t -> LabelMap b -> t +nonDetMapFoldlWithKey k z (LM m) = M.foldlWithKey (\a v -> k a (mkHooplLabel v)) z m + +nonDetMapFoldMapWithKey :: Monoid m => (Label -> t -> m) -> LabelMap t -> m +nonDetMapFoldMapWithKey f (LM m) = M.foldMapWithKey (\k v -> f (mkHooplLabel k) v) m + +{-# INLINE nonDetMapKeys #-} +nonDetMapKeys :: LabelMap a -> [Label] +nonDetMapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) + +{-# INLINE nonDetMapToList #-} +nonDetMapToList :: LabelMap b -> [(Label, b)] +nonDetMapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] + ----------------------------------------------------------------------------- -- Instances instance Outputable LabelSet where - ppr = ppr . setElems + ppr = ppr . nonDetSetElems instance Outputable a => Outputable (LabelMap a) where - ppr = ppr . mapToList + ppr = ppr . nonDetMapToList instance OutputableP env a => OutputableP env (LabelMap a) where - pdoc env = pdoc env . mapToList - -instance TrieMap LabelMap where - type Key LabelMap = Label - emptyTM = mapEmpty - lookupTM k m = mapLookup k m - alterTM k f m = mapAlter f k m - foldTM k m z = mapFoldr k z m - filterTM f m = mapFilter f m + pdoc env = pdoc env . nonDetMapToList + +-- instance TrieMap LabelMap where +-- type Key LabelMap = Label +-- emptyTM = mapEmpty +-- lookupTM k m = mapLookup k m +-- alterTM k f m = mapAlter f k m +-- foldTM k m z = mapFoldr k z m -- TODO:ERROR? +-- filterTM f m = mapFilter f m ----------------------------------------------------------------------------- -- FactBase ===================================== compiler/GHC/Cmm/Graph.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Cmm.Switch (SwitchTargets) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.FastString import GHC.Types.ForeignCall import GHC.Data.OrdList ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -23,6 +23,8 @@ import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet (lookupFact) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module import GHC.Data.Graph.Directed @@ -532,7 +534,7 @@ newtype CAFfyLabel = CAFfyLabel CLabel deriving newtype instance OutputableP env CLabel => OutputableP env CAFfyLabel type CAFSet = Set CAFfyLabel -type CAFEnv = LabelMap CAFSet +type CAFEnv = NonDet.LabelMap CAFSet -- | Records the CAFfy references of a set of static data decls. type DataCAFEnv = Map CLabel CAFSet @@ -599,7 +601,7 @@ cafAnal -> CAFEnv cafAnal platform contLbls topLbl cmmGraph = analyzeCmmBwd cafLattice - (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph mapEmpty + (cafTransfers platform contLbls (g_entry cmmGraph) topLbl) cmmGraph NonDet.mapEmpty cafLattice :: DataflowLattice CAFSet @@ -659,7 +661,7 @@ cafTransfers platform contLbls entry topLbl text "topLbl:" <+> pdoc platform topLbl $$ text "cafs in exit:" <+> pdoc platform joined $$ text "result:" <+> pdoc platform result) $ - mapSingleton (entryLabel eNode) result + NonDet.mapSingleton (entryLabel eNode) result -- ----------------------------------------------------------------------------- @@ -775,7 +777,7 @@ depAnalSRTs platform cafEnv cafEnv_static decls = | (l, lbl) <- labelledBlocks , Just (cafs :: Set CAFfyLabel) <- [case l of - BlockLabel l -> mapLookup l cafEnv + BlockLabel l -> NonDet.mapLookup l cafEnv DeclLabel cl -> Map.lookup cl cafEnv_static] , let cafs' = Set.delete lbl cafs ] @@ -810,7 +812,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep - , Just cafs <- mapLookup (g_entry g) cafEnv + , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv = Just (Just (g_entry g), mkCAFfyLabel platform top_lbl, cafs) | otherwise @@ -902,7 +904,7 @@ doSRTs cfg moduleSRTInfo procs data_ = do CmmStaticsRaw lbl _ -> (lbl, set) (proc_envs, procss) = unzip procs - cafEnv = mapUnions proc_envs + cafEnv = NonDet.mapUnions proc_envs decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss staticFuns = mapFromList (getStaticFuns decls) ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards, GADTs #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Cmm.LayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where @@ -26,6 +27,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label import GHC.Types.Unique.Supply +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Data.Maybe import GHC.Types.Unique.FM import GHC.Utils.Misc @@ -235,7 +237,7 @@ instance Outputable StackMap where cmmLayoutStack :: CmmConfig -> ProcPointSet -> ByteOff -> CmmGraph - -> UniqSM (CmmGraph, LabelMap StackMap) + -> UniqSM (CmmGraph, NonDet.LabelMap StackMap) cmmLayoutStack cfg procpoints entry_args graph@(CmmGraph { g_entry = entry }) = do @@ -262,17 +264,17 @@ cmmLayoutStack cfg procpoints entry_args layout :: CmmConfig -> LabelSet -- proc points - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> BlockId -- entry -> ByteOff -- stack args on entry - -> LabelMap StackMap -- [final] stack maps + -> NonDet.LabelMap StackMap -- [final] stack maps -> ByteOff -- [final] Sp high water mark -> [CmmBlock] -- [in] blocks -> UniqSM - ( LabelMap StackMap -- [out] stack maps + ( NonDet.LabelMap StackMap -- [out] stack maps , ByteOff -- [out] Sp high water mark , [CmmBlock] -- [out] new blocks ) @@ -282,12 +284,18 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl where (updfr, cont_info) = collectContInfo blocks - init_stackmap = mapSingleton entry StackMap{ sm_sp = entry_args - , sm_args = entry_args - , sm_ret_off = updfr - , sm_regs = emptyUFM - } - + init_stackmap = NonDet.mapSingleton entry + StackMap{ sm_sp = entry_args + , sm_args = entry_args + , sm_ret_off = updfr + , sm_regs = emptyUFM + } + + go :: [Block CmmNode C C] + -> NonDet.LabelMap StackMap + -> StackLoc + -> [CmmBlock] + -> UniqSM (NonDet.LabelMap StackMap, StackLoc, [CmmBlock]) go [] acc_stackmaps acc_hwm acc_blocks = return (acc_stackmaps, acc_hwm, acc_blocks) @@ -296,7 +304,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl let (entry0@(CmmEntry entry_lbl tscope), middle0, last0) = blockSplit b0 let stack0 at StackMap { sm_sp = sp0 } - = mapFindWithDefault + = NonDet.mapFindWithDefault (pprPanic "no stack map for" (ppr entry_lbl)) entry_lbl acc_stackmaps @@ -328,7 +336,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl manifestSp cfg final_stackmaps stack0 sp0 final_sp_high entry0 middle_pre sp_off last1 fixup_blocks - let acc_stackmaps' = mapUnion acc_stackmaps out + let acc_stackmaps' = NonDet.mapUnion acc_stackmaps out -- If this block jumps to the GC, then we do not take its -- stack usage into account for the high-water mark. @@ -340,7 +348,7 @@ layout cfg procpoints liveness entry entry_args final_stackmaps final_sp_high bl this_sp_hwm | isGcJump last0 = 0 | otherwise = sp0 - sp_off - hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (mapElems out)) + hwm' = maximum (acc_hwm : this_sp_hwm : map sm_sp (NonDet.nonDetMapElems out)) go bs acc_stackmaps' hwm' (final_blocks ++ acc_blocks) @@ -393,7 +401,7 @@ collectContInfo blocks -- on the stack and need to be immediately saved across a call, we -- want to just leave them where they are on the stack. -- -procMiddle :: LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap +procMiddle :: NonDet.LabelMap StackMap -> CmmNode e x -> StackMap -> StackMap procMiddle stackmaps node sm = case node of CmmAssign (CmmLocal r) (CmmLoad (CmmStackSlot area off) _ _) @@ -404,10 +412,10 @@ procMiddle stackmaps node sm _other -> sm -getStackLoc :: Area -> ByteOff -> LabelMap StackMap -> StackLoc +getStackLoc :: Area -> ByteOff -> NonDet.LabelMap StackMap -> StackLoc getStackLoc Old n _ = n getStackLoc (Young l) n stackmaps = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Nothing -> pprPanic "getStackLoc" (ppr l) Just sm -> sm_sp sm - sm_args sm + n @@ -432,8 +440,8 @@ getStackLoc (Young l) n stackmaps = -- extra code that goes *after* the Sp adjustment. handleLastNode - :: CmmConfig -> ProcPointSet -> LabelMap CmmLocalLive -> LabelMap ByteOff - -> LabelMap StackMap -> StackMap -> CmmTickScope + :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> LabelMap ByteOff + -> NonDet.LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C -> UniqSM @@ -441,7 +449,7 @@ handleLastNode , ByteOff -- amount to adjust Sp , CmmNode O C -- new last node , [CmmBlock] -- new blocks - , LabelMap StackMap -- stackmaps for the continuations + , NonDet.LabelMap StackMap -- stackmaps for the continuations ) handleLastNode cfg procpoints liveness cont_info stackmaps @@ -452,7 +460,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- is cml_args, after popping any other junk from the stack. CmmCall{ cml_cont = Nothing, .. } -> do let sp_off = sp0 - cml_args - return ([], sp_off, last, [], mapEmpty) + return ([], sp_off, last, [], NonDet.mapEmpty) -- At each CmmCall with a continuation: CmmCall{ cml_cont = Just cont_lbl, .. } -> @@ -473,20 +481,20 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap + , NonDet.LabelMap StackMap ) lastCall lbl cml_args cml_ret_args cml_ret_off = ( assignments , spOffsetForCall sp0 cont_stack cml_args , last , [] -- no new blocks - , mapSingleton lbl cont_stack ) + , NonDet.mapSingleton lbl cont_stack ) where (assignments, cont_stack) = prepareStack lbl cml_ret_args cml_ret_off prepareStack lbl cml_ret_args cml_ret_off - | Just cont_stack <- mapLookup lbl stackmaps + | Just cont_stack <- NonDet.mapLookup lbl stackmaps -- If we have already seen this continuation before, then -- we just have to make the stack look the same: = (fixupStack stack0 cont_stack, cont_stack) @@ -506,7 +514,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , ByteOff , CmmNode O C , [CmmBlock] - , LabelMap StackMap ) + , NonDet.LabelMap StackMap ) handleBranches -- See Note [diamond proc point] @@ -515,8 +523,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps = do let cont_args = mapFindWithDefault 0 l cont_info (assigs, cont_stack) = prepareStack l cont_args (sm_ret_off stack0) - out = mapFromList [ (l', cont_stack) - | l' <- successors last ] + out = NonDet.mapFromList + [ (l', cont_stack) + | l' <- successors last ] return ( assigs , spOffsetForCall sp0 cont_stack (platformWordSizeInBytes platform) , last @@ -532,7 +541,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps , 0 , mapSuccessors fix_lbl last , concat [ blk | (_,_,_,blk) <- pps ] - , mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) + , NonDet.mapFromList [ (l, sm) | (l,_,sm,_) <- pps ] ) -- For each successor of this block handleBranch :: BlockId -> UniqSM (BlockId, BlockId, StackMap, [CmmBlock]) @@ -540,7 +549,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- (a) if the successor already has a stackmap, we need to -- shuffle the current stack to make it look the same. -- We have to insert a new block to make this happen. - | Just stack2 <- mapLookup l stackmaps + | Just stack2 <- NonDet.mapLookup l stackmaps = do let assigs = fixupStack stack0 stack2 (tmp_lbl, block) <- makeFixupBlock cfg sp0 l stack2 tscp assigs @@ -563,7 +572,7 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- the destination, because this StackMap might be used -- by fixupStack if this is a join point. | otherwise = return (l, l, stack1, []) - where live = mapFindWithDefault (panic "handleBranch") l liveness + where live = NonDet.mapFindWithDefault (panic "handleBranch") l liveness stack1 = stack0 { sm_regs = filterUFM is_live (sm_regs stack0) } is_live (r,_) = r `elemRegSet` live @@ -612,7 +621,7 @@ fixupStack old_stack new_stack = concatMap move new_locs setupStackFrame :: Platform -> BlockId -- label of continuation - -> LabelMap CmmLocalLive -- liveness + -> NonDet.LabelMap CmmLocalLive -- liveness -> ByteOff -- updfr -> ByteOff -- bytes of return values on stack -> StackMap -- current StackMap @@ -622,7 +631,7 @@ setupStackFrame platform lbl liveness updfr_off ret_args stack0 = (cont_stack, assignments) where -- get the set of LocalRegs live in the continuation - live = mapFindWithDefault Set.empty lbl liveness + live = NonDet.mapFindWithDefault Set.empty lbl liveness -- the stack from the base to updfr_off is off-limits. -- our new stack frame contains: @@ -824,7 +833,7 @@ allocate platform ret_off live stackmap at StackMap{ sm_sp = sp0 -- manifestSp :: CmmConfig - -> LabelMap StackMap -- StackMaps for other blocks + -> NonDet.LabelMap StackMap -- StackMaps for other blocks -> StackMap -- StackMap for this block -> ByteOff -- Sp on entry to the block -> ByteOff -- SpHigh @@ -857,10 +866,10 @@ manifestSp cfg stackmaps stack0 sp0 sp_high fixup_blocks' = map (mapBlock3' (id, adj_post_sp, id)) fixup_blocks -getAreaOff :: LabelMap StackMap -> (Area -> StackLoc) +getAreaOff :: NonDet.LabelMap StackMap -> (Area -> StackLoc) getAreaOff _ Old = 0 getAreaOff stackmaps (Young l) = - case mapLookup l stackmaps of + case NonDet.mapLookup l stackmaps of Just sm -> sm_sp sm - sm_args sm Nothing -> pprPanic "getAreaOff" (ppr l) @@ -987,7 +996,7 @@ optStackCheck n = -- Note [Always false stack check] -- StackMap will invalidate its mapping there. -- elimStackStores :: StackMap - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> (Area -> ByteOff) -> [CmmNode O O] -> [CmmNode O O] @@ -1009,7 +1018,7 @@ elimStackStores stackmap stackmaps area_off nodes -- Update info tables to include stack liveness -setInfoTableStackMap :: Platform -> LabelMap StackMap -> CmmDecl -> CmmDecl +setInfoTableStackMap :: Platform -> NonDet.LabelMap StackMap -> CmmDecl -> CmmDecl setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) = CmmProc top_info{ info_tbls = mapMapWithKey fix_info info_tbls } l v g where @@ -1019,7 +1028,7 @@ setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) get_liveness :: BlockId -> Liveness get_liveness lbl - = case mapLookup lbl stackmaps of + = case NonDet.mapLookup lbl stackmaps of Nothing -> pprPanic "setInfoTableStackMap" (ppr lbl <+> pdoc platform info_tbls) Just sm -> stackMapToLiveness platform sm @@ -1044,18 +1053,18 @@ stackMapToLiveness platform StackMap{..} = insertReloadsAsNeeded :: Platform -> ProcPointSet - -> LabelMap StackMap + -> NonDet.LabelMap StackMap -> BlockId -> [CmmBlock] -> UniqSM [CmmBlock] insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = toBlockList . fst <$> - rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) mapEmpty + rewriteCmmBwd liveLattice rewriteCC (ofBlockList entry blocks) NonDet.mapEmpty where rewriteCC :: RewriteFun CmmLocalLive rewriteCC (BlockCC e_node middle0 x_node) fact_base0 = do let entry_label = entryLabel e_node - stackmap = case mapLookup entry_label final_stackmaps of + stackmap = case NonDet.mapLookup entry_label final_stackmaps of Just sm -> sm Nothing -> panic "insertReloadsAsNeeded: rewriteCC: stackmap" @@ -1077,7 +1086,7 @@ insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = = (middle0, live_at_middle0) -- Final liveness for this block. - !fact_base2 = mapSingleton entry_label live_with_reloads + !fact_base2 = NonDet.mapSingleton entry_label live_with_reloads return (BlockCC e_node middle1 x_node, fact_base2) ===================================== compiler/GHC/Cmm/Lint.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Platform import GHC.Platform.Regs (callerSaves) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm import GHC.Cmm.Liveness import GHC.Cmm.Switch (switchTargetsToList) ===================================== compiler/GHC/Cmm/Liveness.hs ===================================== @@ -19,7 +19,7 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.LRegSet import GHC.Data.Maybe @@ -57,7 +57,7 @@ cmmLocalLiveness platform graph = where entry = g_entry graph check facts = - noLiveOnEntry entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntry entry (expectJust "check" $ lookupFact entry facts) facts cmmGlobalLiveness :: Platform -> CmmGraph -> BlockEntryLiveness GlobalReg cmmGlobalLiveness platform graph = @@ -120,7 +120,7 @@ cmmLocalLivenessL platform graph = where entry = g_entry graph check facts = - noLiveOnEntryL entry (expectJust "check" $ mapLookup entry facts) facts + noLiveOnEntryL entry (expectJust "check" $ lookupFact entry facts) facts -- | On entry to the procedure, there had better not be any LocalReg's live-in. noLiveOnEntryL :: BlockId -> LRegSet -> a -> a ===================================== compiler/GHC/Cmm/Pipeline.hs ===================================== @@ -11,7 +11,7 @@ import GHC.Cmm import GHC.Cmm.Config import GHC.Cmm.ContFlowOpt import GHC.Cmm.CommonBlockElim -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Info.Build import GHC.Cmm.Lint import GHC.Cmm.LayoutStack ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -29,6 +29,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- Compute a minimal set of proc points for a control-flow graph. @@ -134,7 +135,7 @@ instance Outputable Status where -- Once you know what the proc-points are, figure out -- what proc-points each block is reachable from -- See Note [Proc-point analysis] -procPointAnalysis :: ProcPointSet -> CmmGraph -> LabelMap Status +procPointAnalysis :: ProcPointSet -> CmmGraph -> NonDet.LabelMap Status procPointAnalysis procPoints cmmGraph@(CmmGraph {g_graph = graph}) = analyzeCmmFwd procPointLattice procPointTransfer cmmGraph initProcPoints where @@ -196,14 +197,14 @@ extendPPSet extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block - in case mapLookup id env of + in case NonDet.mapLookup id env of Just ProcPoint -> setInsert id pps _ -> pps procPoints' = foldlGraphBlocks add setEmpty g newPoints = mapMaybe ppSuccessor blocks newPoint = listToMaybe newPoints ppSuccessor b = - let nreached id = case mapLookup id env `orElse` + let nreached id = case NonDet.mapLookup id env `orElse` pprPanic "no ppt" (ppr id <+> pdoc platform b) of ProcPoint -> 1 ReachedBy ps -> setSize ps @@ -235,7 +236,7 @@ extendPPSet platform g blocks procPoints = -- Input invariant: A block should only be reachable from a single ProcPoint. -- ToDo: use the _ret naming convention that the old code generator -- used. -- EZY -splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> LabelMap Status -> CmmDecl +splitAtProcPoints :: Platform -> CLabel -> ProcPointSet-> ProcPointSet -> NonDet.LabelMap Status -> CmmDecl -> UniqSM [CmmDecl] splitAtProcPoints _ _ _ _ _ t@(CmmData _ _) = return [t] splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do @@ -249,7 +250,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let add_block :: LabelMap (LabelMap CmmBlock) -> CmmBlock -> LabelMap (LabelMap CmmBlock) add_block graphEnv b = - case mapLookup bid procMap of + case NonDet.mapLookup bid procMap of Just ProcPoint -> add graphEnv bid bid b Just (ReachedBy set) -> case setElems set of @@ -263,7 +264,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let liveness = cmmGlobalLiveness platform g let ppLiveness pp = filter isArgReg $ regSetToList $ - expectJust "ppLiveness" $ mapLookup pp liveness + expectJust "ppLiveness" $ NonDet.mapLookup pp liveness graphEnv <- return $ foldlGraphBlocks add_block mapEmpty g -- Build a map from proc point BlockId to pairs of: ===================================== compiler/GHC/Cmm/Sink.hs ===================================== @@ -14,7 +14,7 @@ import GHC.Cmm.Liveness import GHC.Cmm.LRegSet import GHC.Cmm.Utils import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.Dataflow.Graph import GHC.Platform.Regs ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -40,7 +40,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapEmpty, mapLookup, mapInsert) import GHC.Cmm.Dataflow.Graph import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/BlockLayout.hs ===================================== @@ -26,7 +26,8 @@ import GHC.CmmToAsm.Config import GHC.Cmm import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember, mapLookup, mapElems, mapKeys, mapEmpty, mapInsert, mapDelete, mapFromList, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setEmpty, setMember, setFromList, setInsert) import GHC.Types.Unique.FM ===================================== compiler/GHC/CmmToAsm/PIC.hs ===================================== @@ -60,7 +60,7 @@ import GHC.CmmToAsm.Config import GHC.CmmToAsm.Types -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapMember) import GHC.Cmm import GHC.Cmm.CLabel import GHC.Cmm.Utils (cmmLoadBWord) ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -15,7 +15,7 @@ import GHC.CmmToAsm.Instr import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapFoldlWithKey, mapLookup, mapInsert) import GHC.Utils.Monad import GHC.Utils.Monad.State.Strict ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs ===================================== @@ -49,7 +49,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import Data.List (nub, foldl1', find) import Data.Maybe ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Platform.Reg import GHC.Data.Graph.Base -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup, Label, LabelMap) import GHC.Cmm import GHC.Types.Unique.FM import GHC.Types.Unique.Set ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -122,7 +122,7 @@ import GHC.Platform.Reg import GHC.Platform.Reg.Class (RegClass(..)) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Cmm hiding (RegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs ===================================== @@ -23,7 +23,7 @@ import GHC.CmmToAsm.Types import GHC.Platform.Reg import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.Graph.Directed import GHC.Utils.Panic import GHC.Utils.Monad (concatMapM) ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -46,7 +46,8 @@ import GHC.CmmToAsm.Types import GHC.CmmToAsm.Utils import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapToList, LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap) +import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setMember, setFromList) import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Data.Graph.Directed ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -34,7 +34,7 @@ import GHC.Cmm import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Cmm.InitFini import GHC.CmmToAsm.Wasm.Types import GHC.CmmToAsm.Wasm.Utils ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -66,7 +66,7 @@ import GHC.Cmm.Switch import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (LabelMap, mapMember) import GHC.Cmm.CLabel import GHC.Types.Tickish ( GenTickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -54,7 +54,7 @@ import GHC.CmmToAsm.Reg.Target import GHC.CmmToAsm.Config import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Platform.Regs import GHC.Cmm import GHC.Utils.Outputable ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapLookup) import GHC.Data.FastString import GHC.Data.OrdList ===================================== compiler/GHC/Data/Graph/Collapse.hs ===================================== @@ -22,7 +22,7 @@ import Control.Monad import Data.List (delete, union, insert, intersect) import Data.Semigroup -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Data.Graph.Inductive.Graph import GHC.Types.Unique.Supply import GHC.Utils.Panic hiding (assert) ===================================== compiler/GHC/StgToCmm/Heap.hs ===================================== @@ -33,7 +33,7 @@ import GHC.StgToCmm.Closure import GHC.Cmm.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label.NonDet import GHC.Runtime.Heap.Layout import GHC.Cmm.BlockId import GHC.Cmm ===================================== compiler/GHC/StgToCmm/Monad.hs ===================================== @@ -76,7 +76,7 @@ import GHC.StgToCmm.Sequel import GHC.Cmm.Graph as CmmGraph import GHC.Cmm.BlockId import GHC.Cmm.CLabel -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (mapSingleton, mapEmpty) import GHC.Runtime.Heap.Layout import GHC.Unit import GHC.Types.Id ===================================== compiler/GHC/Types/Unique/DFM.hs ===================================== @@ -21,6 +21,7 @@ is not deterministic. {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# OPTIONS_GHC -Wall #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-stg-final -ddump-to-file -dumpdir=/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.bJv7ldTSvf #-} module GHC.Types.Unique.DFM ( -- * Unique-keyed deterministic mappings ===================================== compiler/ghc.cabal.in ===================================== @@ -237,6 +237,7 @@ Library GHC.Cmm.Dataflow.Block GHC.Cmm.Dataflow.Graph GHC.Cmm.Dataflow.Label + GHC.Cmm.Dataflow.Label.NonDet GHC.Cmm.DebugBlock GHC.Cmm.Expr GHC.Cmm.GenericOpt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d58e77c2e7a9386972e3ba704183dc396c12d3f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2d58e77c2e7a9386972e3ba704183dc396c12d3f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 11:19:48 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 11 Jul 2024 07:19:48 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] Use NonDet for CFG Message-ID: <668fbfd424724_122b94c5ab84123265@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 1ba0d779 by Matthew Pickering at 2024-07-11T12:13:26+01:00 Use NonDet for CFG - - - - - 11 changed files: - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - testsuite/tests/determinism/object/check-standalone.sh - testsuite/tests/determinism/object/check.sh Changes: ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -75,6 +75,10 @@ module GHC.Cmm.Dataflow.Label.NonDet , nonDetMapFoldMapWithKey , nonDetMapKeys , nonDetMapToList + , nonDetMapM + , allLM + , anyLM + , mapSum ) where import GHC.Prelude @@ -268,6 +272,18 @@ nonDetMapKeys (LM m) = map (mkHooplLabel . fst) (M.toList m) nonDetMapToList :: LabelMap b -> [(Label, b)] nonDetMapToList (LM m) = [(mkHooplLabel k, v) | (k, v) <- M.toList m] +nonDetMapM :: Monad m => (a -> m b) -> LabelMap a -> m (LabelMap b) +nonDetMapM f (LM m) = LM <$> M.traverseWithKey (\_ x -> f x) m + +allLM :: (a -> Bool) -> LabelMap a -> Bool +allLM f (LM m) = all f m + +anyLM :: (a -> Bool) -> LabelMap a -> Bool +anyLM f (LM m) = any f m + +mapSum :: Num a => LabelMap a -> a +mapSum (LM m) = sum m + ----------------------------------------------------------------------------- -- Instances ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -74,7 +74,7 @@ renameDetUniq uq = do case lookupUFM m uq of Nothing -> do new_w <- gets supply -- New deterministic unique in this `DetRnM` - let (tag, _) = unpkUnique uq + let --(_, _) = unpkUnique uq det_uniq = mkUnique 'Q' new_w modify' (\DetUniqFM{mapping, supply} -> -- Update supply and mapping ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -96,6 +96,7 @@ import GHC.Cmm.BlockId import GHC.StgToCmm.CgUtils ( fixStgRegisters ) import GHC.Cmm import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.GenericOpt import GHC.Cmm.CLabel @@ -615,7 +616,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count {-# SCC "generateJumpTables" #-} generateJumpTables ncgImpl alloced - when (not $ null nativeCfgWeights) $ putDumpFileMaybe logger + when (not $ NonDet.mapNull nativeCfgWeights) $ putDumpFileMaybe logger Opt_D_dump_cfg_weights "CFG Update information" FormatText ( text "stack:" <+> ppr stack_updt_blks $$ @@ -639,7 +640,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count when ( ncgEnableDeadCodeElimination config && (ncgAsmLinting config || debugIsOn )) $ do let blocks = concatMap getBlks shorted - let labels = setFromList $ fmap blockId blocks :: LabelSet + let labels = NonDet.setFromList $ fmap blockId blocks :: NonDet.LabelSet let cfg = fromJust optimizedCFG return $! seq (sanityCheckCfg cfg labels $ text "cfg not in lockstep") () @@ -688,7 +689,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count maybeDumpCfg :: Logger -> Maybe CFG -> String -> SDoc -> IO () maybeDumpCfg _logger Nothing _ _ = return () maybeDumpCfg logger (Just cfg) msg proc_name - | null cfg = return () + | NonDet.mapNull cfg = return () | otherwise = putDumpFileMaybe logger Opt_D_dump_cfg_weights msg @@ -836,17 +837,17 @@ shortcutBranches config ncgImpl tops weights = (tops, weights) where (tops', mappings) = mapAndUnzip (build_mapping ncgImpl) tops - mapping = mapUnions mappings :: LabelMap jumpDest + mapping = NonDet.mapUnions mappings :: NonDet.LabelMap jumpDest mappingBid = fmap (getJumpDestBlockId ncgImpl) mapping build_mapping :: forall instr t d statics jumpDest. NcgImpl statics instr jumpDest -> GenCmmDecl d (LabelMap t) (ListGraph instr) -> (GenCmmDecl d (LabelMap t) (ListGraph instr) - ,LabelMap jumpDest) -build_mapping _ top@(CmmData _ _) = (top, mapEmpty) + ,NonDet.LabelMap jumpDest) +build_mapping _ top@(CmmData _ _) = (top, NonDet.mapEmpty) build_mapping _ (CmmProc info lbl live (ListGraph [])) - = (CmmProc info lbl live (ListGraph []), mapEmpty) + = (CmmProc info lbl live (ListGraph []), NonDet.mapEmpty) build_mapping ncgImpl (CmmProc info lbl live (ListGraph (head:blocks))) = (CmmProc info lbl live (ListGraph (head:others)), mapping) -- drop the shorted blocks, but don't ever drop the first one, @@ -874,19 +875,19 @@ build_mapping ncgImpl (CmmProc info lbl live (ListGraph (head:blocks))) has_info l = mapMember l info -- build a mapping from BlockId to JumpDest for shorting branches - mapping = mapFromList shortcut_blocks + mapping = NonDet.mapFromList shortcut_blocks apply_mapping :: NcgImpl statics instr jumpDest - -> LabelMap jumpDest + -> NonDet.LabelMap jumpDest -> GenCmmDecl statics h (ListGraph instr) -> GenCmmDecl statics h (ListGraph instr) apply_mapping ncgImpl ufm (CmmData sec statics) - = CmmData sec (shortcutStatics ncgImpl (\bid -> mapLookup bid ufm) statics) + = CmmData sec (shortcutStatics ncgImpl (\bid -> NonDet.mapLookup bid ufm) statics) apply_mapping ncgImpl ufm (CmmProc info lbl live (ListGraph blocks)) = CmmProc info lbl live (ListGraph $ map short_bb blocks) where short_bb (BasicBlock id insns) = BasicBlock id $! map short_insn insns - short_insn i = shortcutJump ncgImpl (\bid -> mapLookup bid ufm) i + short_insn i = shortcutJump ncgImpl (\bid -> NonDet.mapLookup bid ufm) i -- shortcutJump should apply the mapping repeatedly, -- just in case we can short multiple branches. ===================================== compiler/GHC/CmmToAsm/CFG.hs ===================================== @@ -5,6 +5,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TupleSections #-} +{-# OPTIONS_GHC -ddump-simpl -ddump-to-file #-} -- -- Copyright (c) 2018 Andreas Klebinger -- @@ -48,7 +49,9 @@ import GHC.Cmm.BlockId import GHC.Cmm as Cmm import GHC.Cmm.Switch -import GHC.Cmm.Dataflow.Label +--import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Cmm.Dataflow.Block import qualified GHC.Cmm.Dataflow.Graph as G @@ -106,7 +109,7 @@ newtype EdgeWeight instance Outputable EdgeWeight where ppr (EdgeWeight w) = doublePrec 5 w -type EdgeInfoMap edgeInfo = LabelMap (LabelMap edgeInfo) +type EdgeInfoMap edgeInfo = NonDet.LabelMap (NonDet.LabelMap edgeInfo) -- | A control flow graph where edges have been annotated with a weight. -- Implemented as IntMap (IntMap \) @@ -208,22 +211,22 @@ setEdgeWeight cfg !weight from to getCfgNodes :: CFG -> [BlockId] getCfgNodes m = - mapKeys m + NonDet.nonDetMapKeys m -- | Is this block part of this graph? hasNode :: CFG -> BlockId -> Bool hasNode m node = -- Check the invariant that each node must exist in the first map or not at all. - assert (found || not (any (mapMember node) m)) + assert (found || not (NonDet.anyLM (NonDet.mapMember node) m)) found where - found = mapMember node m + found = NonDet.mapMember node m -- | Check if the nodes in the cfg and the set of blocks are the same. -- In a case of a mismatch we panic and show the difference. -sanityCheckCfg :: CFG -> LabelSet -> SDoc -> Bool +sanityCheckCfg :: CFG -> NonDet.LabelSet -> SDoc -> Bool sanityCheckCfg m blockSet msg | blockSet == cfgNodes = True @@ -235,17 +238,17 @@ sanityCheckCfg m blockSet msg msg ) False where - cfgNodes = setFromList $ getCfgNodes m :: LabelSet - diff = (setUnion cfgNodes blockSet) `setDifference` (setIntersection cfgNodes blockSet) :: LabelSet + cfgNodes = NonDet.setFromList $ getCfgNodes m :: NonDet.LabelSet + diff = (NonDet.setUnion cfgNodes blockSet) `NonDet.setDifference` (NonDet.setIntersection cfgNodes blockSet) :: NonDet.LabelSet -- | Filter the CFG with a custom function f. -- Parameters are `f from to edgeInfo` filterEdges :: (BlockId -> BlockId -> EdgeInfo -> Bool) -> CFG -> CFG filterEdges f cfg = - mapMapWithKey filterSources cfg + NonDet.mapMapWithKey filterSources cfg where filterSources from m = - mapFilterWithKey (\to w -> f from to w) m + NonDet.mapFilterWithKey (\to w -> f from to w) m {- Note [Updating the CFG during shortcutting] @@ -295,56 +298,56 @@ This function (shortcutWeightMap) takes the same mapping and applies the mapping to the CFG in the way laid out above. -} -shortcutWeightMap :: LabelMap (Maybe BlockId) -> CFG -> CFG +shortcutWeightMap :: NonDet.LabelMap (Maybe BlockId) -> CFG -> CFG shortcutWeightMap cuts cfg - | mapNull cuts = cfg + | NonDet.mapNull cuts = cfg | otherwise = normalised_cfg where -- First take the cuts map and collapse any shortcuts, for example -- if the cuts map has A -> B and B -> C then we want to rewrite -- A -> C and B -> C directly. - normalised_cuts_st :: forall s . ST s (LabelMap (Maybe BlockId)) + normalised_cuts_st :: forall s . ST s (NonDet.LabelMap (Maybe BlockId)) normalised_cuts_st = do (null :: Point s (Maybe BlockId)) <- fresh Nothing - let cuts_list = mapToList cuts + let cuts_list = NonDet.nonDetMapToList cuts -- Create a unification variable for each of the nodes in a rewrite cuts_vars <- traverse (\p -> (p,) <$> fresh (Just p)) (concatMap (\(a, b) -> [a] ++ maybe [] (:[]) b) cuts_list) - let cuts_map = mapFromList cuts_vars :: LabelMap (Point s (Maybe BlockId)) + let cuts_map = NonDet.mapFromList cuts_vars :: NonDet.LabelMap (Point s (Maybe BlockId)) -- Then unify according to the rewrites in the cuts map - mapM_ (\(from, to) -> expectJust "shortcutWeightMap" (mapLookup from cuts_map) - `union` expectJust "shortcutWeightMap" (maybe (Just null) (flip mapLookup cuts_map) to) ) cuts_list + mapM_ (\(from, to) -> expectJust "shortcutWeightMap" (NonDet.mapLookup from cuts_map) + `union` expectJust "shortcutWeightMap" (maybe (Just null) (flip NonDet.mapLookup cuts_map) to) ) cuts_list -- Then recover the unique representative, which is the result of following -- the chain to the end. - mapM find cuts_map + NonDet.nonDetMapM find cuts_map normalised_cuts = runST normalised_cuts_st - cuts_domain :: LabelSet - cuts_domain = setFromList $ mapKeys cuts + cuts_domain :: NonDet.LabelSet + cuts_domain = NonDet.setFromList $ NonDet.nonDetMapKeys cuts -- The CFG is shortcutted using the normalised cuts map normalised_cfg :: CFG - normalised_cfg = mapFoldlWithKey update_edge mapEmpty cfg + normalised_cfg = NonDet.nonDetMapFoldlWithKey update_edge NonDet.mapEmpty cfg - update_edge :: CFG -> Label -> LabelMap EdgeInfo -> CFG + update_edge :: CFG -> NonDet.Label -> NonDet.LabelMap EdgeInfo -> CFG update_edge new_map from edge_map -- If the from edge is in the cuts map then delete the edge - | setMember from cuts_domain = new_map + | NonDet.setMember from cuts_domain = new_map -- Otherwise we are keeping the edge, but might have shortcutted some of -- the target nodes. - | otherwise = mapInsert from (mapFoldlWithKey update_from_edge mapEmpty edge_map) new_map + | otherwise = NonDet.mapInsert from (NonDet.nonDetMapFoldlWithKey update_from_edge NonDet.mapEmpty edge_map) new_map - update_from_edge :: LabelMap a -> Label -> a -> LabelMap a + update_from_edge :: NonDet.LabelMap a -> NonDet.Label -> a -> NonDet.LabelMap a update_from_edge new_map to_edge edge_info -- Edge is in the normalised cuts - | Just new_edge <- mapLookup to_edge normalised_cuts = + | Just new_edge <- NonDet.mapLookup to_edge normalised_cuts = case new_edge of -- The result was Nothing, so edge is deleted Nothing -> new_map -- The new target for the edge, write it with the old edge_info. - Just new_to -> mapInsert new_to edge_info new_map + Just new_to -> NonDet.mapInsert new_to edge_info new_map -- Node wasn't in the cuts map, so just add it back - | otherwise = mapInsert to_edge edge_info new_map + | otherwise = NonDet.mapInsert to_edge edge_info new_map -- | Sometimes we insert a block which should unconditionally be executed @@ -368,14 +371,14 @@ addImmediateSuccessor weights node follower cfg -- | Adds a new edge, overwrites existing edges if present addEdge :: BlockId -> BlockId -> EdgeInfo -> CFG -> CFG addEdge from to info cfg = - mapAlter addFromToEdge from $ - mapAlter addDestNode to cfg + NonDet.mapAlter addFromToEdge from $ + NonDet.mapAlter addDestNode to cfg where -- Simply insert the edge into the edge list. - addFromToEdge Nothing = Just $ mapSingleton to info - addFromToEdge (Just wm) = Just $ mapInsert to info wm + addFromToEdge Nothing = Just $ NonDet.mapSingleton to info + addFromToEdge (Just wm) = Just $ NonDet.mapInsert to info wm -- We must add the destination node explicitly - addDestNode Nothing = Just $ mapEmpty + addDestNode Nothing = Just $ NonDet.mapEmpty addDestNode n@(Just _) = n @@ -388,29 +391,29 @@ addWeightEdge from to weight cfg = delEdge :: BlockId -> BlockId -> CFG -> CFG delEdge from to m = - mapAdjust (mapDelete to) from m + NonDet.mapAdjust (NonDet.mapDelete to) from m -- | Destinations from bid ordered by weight (descending) getSuccEdgesSorted :: CFG -> BlockId -> [(BlockId,EdgeInfo)] getSuccEdgesSorted m bid = - let destMap = mapFindWithDefault mapEmpty bid m - cfgEdges = mapToList destMap + let destMap = NonDet.mapFindWithDefault NonDet.mapEmpty bid m + cfgEdges = NonDet.nonDetMapToList destMap sortedEdges = sortWith (negate . edgeWeight . snd) cfgEdges in --pprTrace "getSuccEdgesSorted" (ppr bid <+> text "map:" <+> ppr m) sortedEdges -- | Get successors of a given node with edge weights. getSuccessorEdges :: HasDebugCallStack => CFG -> BlockId -> [(BlockId,EdgeInfo)] -getSuccessorEdges m bid = maybe lookupError mapToList (mapLookup bid m) +getSuccessorEdges m bid = maybe lookupError NonDet.nonDetMapToList (NonDet.mapLookup bid m) where lookupError = pprPanic "getSuccessorEdges: Block does not exist" $ ppr bid <+> pprEdgeWeights m getEdgeInfo :: BlockId -> BlockId -> CFG -> Maybe EdgeInfo getEdgeInfo from to m - | Just wm <- mapLookup from m - , Just info <- mapLookup to wm + | Just wm <- NonDet.mapLookup from m + , Just info <- NonDet.mapLookup to wm = Just $! info | otherwise = Nothing @@ -425,26 +428,26 @@ getTransitionSource from to cfg = transitionSource $ expectJust "Source info for getEdgeInfo from to cfg reverseEdges :: CFG -> CFG -reverseEdges cfg = mapFoldlWithKey (\cfg from toMap -> go (addNode cfg from) from toMap) mapEmpty cfg +reverseEdges cfg = NonDet.nonDetMapFoldlWithKey (\cfg from toMap -> go (addNode cfg from) from toMap) NonDet.mapEmpty cfg where -- We must preserve nodes without outgoing edges! addNode :: CFG -> BlockId -> CFG - addNode cfg b = mapInsertWith mapUnion b mapEmpty cfg - go :: CFG -> BlockId -> (LabelMap EdgeInfo) -> CFG - go cfg from toMap = mapFoldlWithKey (\cfg to info -> addEdge to from info cfg) cfg toMap :: CFG + addNode cfg b = NonDet.mapInsertWith NonDet.mapUnion b NonDet.mapEmpty cfg + go :: CFG -> BlockId -> (NonDet.LabelMap EdgeInfo) -> CFG + go cfg from toMap = NonDet.nonDetMapFoldlWithKey (\cfg to info -> addEdge to from info cfg) cfg toMap :: CFG -- | Returns a unordered list of all edges with info infoEdgeList :: CFG -> [CfgEdge] infoEdgeList m = - go (mapToList m) [] + go (NonDet.nonDetMapToList m) [] where -- We avoid foldMap to avoid thunk buildup - go :: [(BlockId,LabelMap EdgeInfo)] -> [CfgEdge] -> [CfgEdge] + go :: [(BlockId,NonDet.LabelMap EdgeInfo)] -> [CfgEdge] -> [CfgEdge] go [] acc = acc go ((from,toMap):xs) acc - = go' xs from (mapToList toMap) acc - go' :: [(BlockId,LabelMap EdgeInfo)] -> BlockId -> [(BlockId,EdgeInfo)] -> [CfgEdge] -> [CfgEdge] + = go' xs from (NonDet.nonDetMapToList toMap) acc + go' :: [(BlockId,NonDet.LabelMap EdgeInfo)] -> BlockId -> [(BlockId,EdgeInfo)] -> [CfgEdge] -> [CfgEdge] go' froms _ [] acc = go froms acc go' froms from ((to,info):tos) acc = go' froms from tos (CfgEdge from to info : acc) @@ -452,14 +455,14 @@ infoEdgeList m = -- | Returns a unordered list of all edges without weights edgeList :: CFG -> [Edge] edgeList m = - go (mapToList m) [] + go (NonDet.nonDetMapToList m) [] where -- We avoid foldMap to avoid thunk buildup - go :: [(BlockId,LabelMap EdgeInfo)] -> [Edge] -> [Edge] + go :: [(BlockId,NonDet.LabelMap EdgeInfo)] -> [Edge] -> [Edge] go [] acc = acc go ((from,toMap):xs) acc - = go' xs from (mapKeys toMap) acc - go' :: [(BlockId,LabelMap EdgeInfo)] -> BlockId -> [BlockId] -> [Edge] -> [Edge] + = go' xs from (NonDet.nonDetMapKeys toMap) acc + go' :: [(BlockId,NonDet.LabelMap EdgeInfo)] -> BlockId -> [BlockId] -> [Edge] -> [Edge] go' froms _ [] acc = go froms acc go' froms from (to:tos) acc = go' froms from tos ((from,to) : acc) @@ -467,8 +470,8 @@ edgeList m = -- | Get successors of a given node without edge weights. getSuccessors :: HasDebugCallStack => CFG -> BlockId -> [BlockId] getSuccessors m bid - | Just wm <- mapLookup bid m - = mapKeys wm + | Just wm <- NonDet.mapLookup bid m + = NonDet.nonDetMapKeys wm | otherwise = lookupError where lookupError = pprPanic "getSuccessors: Block does not exist" $ @@ -487,8 +490,8 @@ pprEdgeWeights m = printNode node = text "\t" <> ppr node <> text ";\n" getEdgeNodes (CfgEdge from to _) = [from,to] - edgeNodes = setFromList $ concatMap getEdgeNodes edges :: LabelSet - nodes = filter (\n -> (not . setMember n) edgeNodes) . mapKeys $ mapFilter null m + edgeNodes = NonDet.setFromList $ concatMap getEdgeNodes edges :: NonDet.LabelSet + nodes = filter (\n -> (not . NonDet.setMember n) edgeNodes) . NonDet.nonDetMapKeys $ NonDet.mapFilter NonDet.mapNull m in text "digraph {\n" <> (foldl' (<>) empty (map printEdge edges)) <> @@ -601,7 +604,7 @@ addNodesBetween weights m updates = -} -- | Generate weights for a Cmm proc based on some simple heuristics. getCfgProc :: Platform -> Weights -> RawCmmDecl -> CFG -getCfgProc _ _ (CmmData {}) = mapEmpty +getCfgProc _ _ (CmmData {}) = NonDet.mapEmpty getCfgProc platform weights (CmmProc _info _lab _live graph) = getCfg platform weights graph getCfg :: Platform -> Weights -> CmmGraph -> CFG @@ -621,14 +624,14 @@ getCfg platform weights graph = } = weights -- Explicitly add all nodes to the cfg to ensure they are part of the -- CFG. - edgelessCfg = mapFromList $ zip (map G.entryLabel blocks) (repeat mapEmpty) + edgelessCfg = NonDet.mapFromList $ zip (map G.entryLabel blocks) (repeat NonDet.mapEmpty) insertEdge :: CFG -> ((BlockId,BlockId),EdgeInfo) -> CFG insertEdge m ((from,to),weight) = - mapAlter f from m + NonDet.mapAlter f from m where - f :: Maybe (LabelMap EdgeInfo) -> Maybe (LabelMap EdgeInfo) - f Nothing = Just $ mapSingleton to weight - f (Just destMap) = Just $ mapInsert to weight destMap + f :: Maybe (NonDet.LabelMap EdgeInfo) -> Maybe (NonDet.LabelMap EdgeInfo) + f Nothing = Just $ NonDet.mapSingleton to weight + f (Just destMap) = Just $ NonDet.mapInsert to weight destMap getBlockEdges :: CmmBlock -> [((BlockId,BlockId),EdgeInfo)] getBlockEdges block = case branch of @@ -724,13 +727,13 @@ optHsPatterns weights (CmmProc info _lab _live graph) cfg = cfg backedges -- Since we cant fall through info tables we penalize these. - penalizeInfoTables :: LabelMap a -> CFG -> CFG + penalizeInfoTables :: Det.LabelMap a -> CFG -> CFG penalizeInfoTables info cfg = mapWeights fupdate cfg where fupdate :: BlockId -> BlockId -> EdgeWeight -> EdgeWeight fupdate _ to weight - | mapMember to info + | Det.mapMember to info = weight - (fromIntegral $ infoTablePenalty weights) | otherwise = weight @@ -769,7 +772,7 @@ optHsPatterns weights (CmmProc info _lab _live graph) cfg = where fallthroughTarget :: BlockId -> EdgeInfo -> Bool fallthroughTarget to (EdgeInfo source _weight) - | mapMember to info = False + | Det.mapMember to info = False | AsmCodeGen <- source = True | CmmSource { trans_cmmNode = CmmBranch {} } <- source = True | CmmSource { trans_cmmNode = CmmCondBranch {} } <- source = True @@ -782,9 +785,9 @@ staticPredCfg entry cfg = cfg' (_, globalEdgeWeights) = {-# SCC mkGlobalWeights #-} mkGlobalWeights entry cfg cfg' = {-# SCC rewriteEdges #-} - mapFoldlWithKey + NonDet.nonDetMapFoldlWithKey (\cfg from m -> - mapFoldlWithKey + NonDet.nonDetMapFoldlWithKey (\cfg to w -> setEdgeWeight cfg (EdgeWeight w) from to ) cfg m ) cfg @@ -792,9 +795,9 @@ staticPredCfg entry cfg = cfg' -- | Determine loop membership of blocks based on SCC analysis -- This is faster but only gives yes/no answers. -loopMembers :: HasDebugCallStack => CFG -> LabelMap Bool +loopMembers :: HasDebugCallStack => CFG -> NonDet.LabelMap Bool loopMembers cfg = - foldl' (flip setLevel) mapEmpty sccs + foldl' (flip setLevel) NonDet.mapEmpty sccs where mkNode :: BlockId -> Node BlockId BlockId mkNode bid = DigraphNode bid bid (getSuccessors cfg bid) @@ -802,19 +805,19 @@ loopMembers cfg = sccs = stronglyConnCompFromEdgedVerticesOrd nodes - setLevel :: SCC BlockId -> LabelMap Bool -> LabelMap Bool - setLevel (AcyclicSCC bid) m = mapInsert bid False m - setLevel (CyclicSCC bids) m = foldl' (\m k -> mapInsert k True m) m bids + setLevel :: SCC BlockId -> NonDet.LabelMap Bool -> NonDet.LabelMap Bool + setLevel (AcyclicSCC bid) m = NonDet.mapInsert bid False m + setLevel (CyclicSCC bids) m = foldl' (\m k -> NonDet.mapInsert k True m) m bids -loopLevels :: CFG -> BlockId -> LabelMap Int +loopLevels :: CFG -> BlockId -> NonDet.LabelMap Int loopLevels cfg root = liLevels loopInfos where loopInfos = loopInfo cfg root data LoopInfo = LoopInfo { liBackEdges :: [(Edge)] -- ^ List of back edges - , liLevels :: LabelMap Int -- ^ BlockId -> LoopLevel mapping - , liLoops :: [(Edge, LabelSet)] -- ^ (backEdge, loopBody), body includes header + , liLevels :: NonDet.LabelMap Int -- ^ BlockId -> LoopLevel mapping + , liLoops :: [(Edge, NonDet.LabelSet)] -- ^ (backEdge, loopBody), body includes header } instance Outputable LoopInfo where @@ -843,13 +846,13 @@ instance Outputable LoopInfo where -- to care about that special case. loopInfo :: HasDebugCallStack => CFG -> BlockId -> LoopInfo loopInfo cfg root = LoopInfo { liBackEdges = backEdges - , liLevels = mapFromList loopCounts + , liLevels = NonDet.mapFromList loopCounts , liLoops = loopBodies } where revCfg = reverseEdges cfg graph = -- pprTrace "CFG - loopInfo" (pprEdgeWeights cfg) $ - fmap (setFromList . mapKeys ) cfg :: LabelMap LabelSet + fmap (NonDet.setFromList . NonDet.nonDetMapKeys ) cfg :: NonDet.LabelMap NonDet.LabelSet --TODO - This should be a no op: Export constructors? Use unsafeCoerce? ... @@ -858,7 +861,7 @@ loopInfo cfg root = LoopInfo { liBackEdges = backEdges tree = fmap toBlockId $ Dom.domTree rooted :: Tree BlockId -- Map from Nodes to their dominators - domMap :: LabelMap LabelSet + domMap :: NonDet.LabelMap NonDet.LabelSet domMap = mkDomMap tree edges = edgeList cfg :: [(BlockId, BlockId)] @@ -867,56 +870,56 @@ loopInfo cfg root = LoopInfo { liBackEdges = backEdges -- identify back edges isBackEdge (from,to) - | Just doms <- mapLookup from domMap - , setMember to doms + | Just doms <- NonDet.mapLookup from domMap + , NonDet.setMember to doms = True | otherwise = False -- See Note [Determining the loop body] -- Get the loop body associated with a back edge. findBody edge@(tail, head) - = ( edge, setInsert head $ go (setSingleton tail) (setSingleton tail) ) + = ( edge, NonDet.setInsert head $ go (NonDet.setSingleton tail) (NonDet.setSingleton tail) ) where -- See Note [Determining the loop body] - go :: LabelSet -> LabelSet -> LabelSet + go :: NonDet.LabelSet -> NonDet.LabelSet -> NonDet.LabelSet go found current - | setNull current = found - | otherwise = go (setUnion newSuccessors found) + | NonDet.setNull current = found + | otherwise = go (NonDet.setUnion newSuccessors found) newSuccessors where -- Really predecessors, since we use the reversed cfg. - newSuccessors = setFilter (\n -> not $ setMember n found) successors :: LabelSet - successors = setDelete head $ setUnions $ map - (\x -> if x == head then setEmpty else setFromList (getSuccessors revCfg x)) - (setElems current) :: LabelSet + newSuccessors = NonDet.setFilter (\n -> not $ NonDet.setMember n found) successors :: NonDet.LabelSet + successors = NonDet.setDelete head $ NonDet.setUnions $ map + (\x -> if x == head then NonDet.setEmpty else NonDet.setFromList (getSuccessors revCfg x)) + (NonDet.nonDetSetElems current) :: NonDet.LabelSet backEdges = filter isBackEdge edges - loopBodies = map findBody backEdges :: [(Edge, LabelSet)] + loopBodies = map findBody backEdges :: [(Edge, NonDet.LabelSet)] -- Block b is part of n loop bodies => loop nest level of n loopCounts = let bodies = map (first snd) loopBodies -- [(Header, Body)] - loopCount n = length $ nub . map fst . filter (setMember n . snd) $ bodies + loopCount n = length $ nub . map fst . filter (NonDet.setMember n . snd) $ bodies in map (\n -> (n, loopCount n)) $ nodes :: [(BlockId, Int)] - toWord64Set :: LabelSet -> Word64Set - toWord64Set s = WS.fromList . map fromBlockId . setElems $ s - toWord64Map :: LabelMap a -> Word64Map a - toWord64Map m = WM.fromList $ map (\(x,y) -> (fromBlockId x,y)) $ mapToList m + toWord64Set :: NonDet.LabelSet -> Word64Set + toWord64Set s = WS.fromList . map fromBlockId . NonDet.nonDetSetElems $ s + toWord64Map :: NonDet.LabelMap a -> Word64Map a + toWord64Map m = WM.fromList $ map (\(x,y) -> (fromBlockId x,y)) $ NonDet.nonDetMapToList m - mkDomMap :: Tree BlockId -> LabelMap LabelSet - mkDomMap root = mapFromList $ go setEmpty root + mkDomMap :: Tree BlockId -> NonDet.LabelMap NonDet.LabelSet + mkDomMap root = NonDet.mapFromList $ go NonDet.setEmpty root where - go :: LabelSet -> Tree BlockId -> [(Label,LabelSet)] + go :: NonDet.LabelSet -> Tree BlockId -> [(NonDet.Label,NonDet.LabelSet)] go parents (Node lbl []) = [(lbl, parents)] go parents (Node _ leaves) = let nodes = map rootLabel leaves entries = map (\x -> (x,parents)) nodes in entries ++ concatMap - (\n -> go (setInsert (rootLabel n) parents) n) + (\n -> go (NonDet.setInsert (rootLabel n) parents) n) leaves fromBlockId :: BlockId -> Word64 @@ -937,7 +940,7 @@ revPostorderFrom cfg root = map fromNode $ G.revPostorderFrom hooplGraph root where nodes = getCfgNodes cfg - hooplGraph = foldl' (\m n -> mapInsert n (toNode n) m) mapEmpty nodes + hooplGraph = foldl' (\m n -> Det.mapInsert n (toNode n) m) Det.mapEmpty nodes fromNode :: BlockNode C C -> BlockId fromNode (BN x) = fst x @@ -969,19 +972,19 @@ revPostorderFrom cfg root = {-# NOINLINE mkGlobalWeights #-} {-# SCC mkGlobalWeights #-} -mkGlobalWeights :: HasDebugCallStack => BlockId -> CFG -> (LabelMap Double, LabelMap (LabelMap Double)) +mkGlobalWeights :: HasDebugCallStack => BlockId -> CFG -> (NonDet.LabelMap Double, NonDet.LabelMap (NonDet.LabelMap Double)) mkGlobalWeights root localCfg - | null localCfg = panic "Error - Empty CFG" + | NonDet.mapNull localCfg = panic "Error - Empty CFG" | otherwise = (blockFreqs', edgeFreqs') where -- Calculate fixpoints (blockFreqs, edgeFreqs) = calcFreqs nodeProbs backEdges' bodies' revOrder' - blockFreqs' = mapFromList $ map (first fromVertex) (assocs blockFreqs) :: LabelMap Double + blockFreqs' = NonDet.mapFromList $ map (first fromVertex) (assocs blockFreqs) :: NonDet.LabelMap Double edgeFreqs' = fmap fromVertexMap $ fromVertexMap edgeFreqs - fromVertexMap :: IM.IntMap x -> LabelMap x - fromVertexMap m = mapFromList . map (first fromVertex) $ IM.toList m + fromVertexMap :: IM.IntMap x -> NonDet.LabelMap x + fromVertexMap m = NonDet.mapFromList . map (first fromVertex) $ IM.toList m revOrder = revPostorderFrom localCfg root :: [BlockId] loopResults@(LoopInfo backedges _levels bodies) = loopInfo localCfg root @@ -998,13 +1001,13 @@ mkGlobalWeights root localCfg -- order simply by sorting. -- TODO: The sort is redundant if we can guarantee that setElems returns elements ascending calcBody (backedge, blocks) = - (toVertex $ snd backedge, sort . map toVertex $ (setElems blocks)) + (toVertex $ snd backedge, sort . map toVertex $ (NonDet.nonDetSetElems blocks)) - vertexMapping = mapFromList $ zip revOrder [0..] :: LabelMap Int - blockMapping = listArray (0,mapSize vertexMapping - 1) revOrder :: Array Int BlockId + vertexMapping = NonDet.mapFromList $ zip revOrder [0..] :: NonDet.LabelMap Int + blockMapping = listArray (0,NonDet.mapSize vertexMapping - 1) revOrder :: Array Int BlockId -- Map from blockId to indices starting at zero toVertex :: BlockId -> Int - toVertex blockId = expectJust "mkGlobalWeights" $ mapLookup blockId vertexMapping + toVertex blockId = expectJust "mkGlobalWeights" $ NonDet.mapLookup blockId vertexMapping -- Map from indices starting at zero to blockIds fromVertex :: Int -> BlockId fromVertex vertex = blockMapping ! vertex @@ -1059,7 +1062,7 @@ staticBranchPrediction _root (LoopInfo l_backEdges loopLevels l_loops) cfg = nodes = getCfgNodes cfg backedges = S.fromList $ l_backEdges -- Loops keyed by their back edge - loops = M.fromList $ l_loops :: M.Map Edge LabelSet + loops = M.fromList $ l_loops :: M.Map Edge NonDet.LabelSet loopHeads = S.fromList $ map snd $ M.keys loops update :: CFG -> BlockId -> CFG @@ -1163,8 +1166,8 @@ staticBranchPrediction _root (LoopInfo l_backEdges loopLevels l_loops) cfg = LT -> Just (1-pred_LEH) --s1 exits to a shallower loop level (exits loop) GT -> Just (pred_LEH) --s1 exits to a deeper loop level where - s1Level = mapLookup s1 loopLevels - s2Level = mapLookup s2 loopLevels + s1Level = NonDet.mapLookup s1 loopLevels + s2Level = NonDet.mapLookup s2 loopLevels -- Comparing to a constant is unlikely to be equal. ohPredicts (s1,_s2) @@ -1192,28 +1195,28 @@ staticBranchPrediction _root (LoopInfo l_backEdges loopLevels l_loops) cfg = -- Ignoring rounding errors all outgoing edges sum up to 1. cfgEdgeProbabilities :: CFG -> (BlockId -> Int) -> IM.IntMap (IM.IntMap Prob) cfgEdgeProbabilities cfg toVertex - = mapFoldlWithKey foldEdges IM.empty cfg + = NonDet.nonDetMapFoldlWithKey foldEdges IM.empty cfg where foldEdges = (\m from toMap -> IM.insert (toVertex from) (normalize toMap) m) - normalize :: (LabelMap EdgeInfo) -> (IM.IntMap Prob) + normalize :: (NonDet.LabelMap EdgeInfo) -> (IM.IntMap Prob) normalize weightMap - | edgeCount <= 1 = mapFoldlWithKey (\m k _ -> IM.insert (toVertex k) 1.0 m) IM.empty weightMap - | otherwise = mapFoldlWithKey (\m k _ -> IM.insert (toVertex k) (normalWeight k) m) IM.empty weightMap + | edgeCount <= 1 = NonDet.nonDetMapFoldlWithKey (\m k _ -> IM.insert (toVertex k) 1.0 m) IM.empty weightMap + | otherwise = NonDet.nonDetMapFoldlWithKey (\m k _ -> IM.insert (toVertex k) (normalWeight k) m) IM.empty weightMap where - edgeCount = mapSize weightMap + edgeCount = NonDet.mapSize weightMap -- Negative weights are generally allowed but are mapped to zero. -- We then check if there is at least one non-zero edge and if not -- assign uniform weights to all branches. minWeight = 0 :: Prob weightMap' = fmap (\w -> max (weightToDouble . edgeWeight $ w) minWeight) weightMap - totalWeight = sum weightMap' + totalWeight = NonDet.mapSum weightMap' normalWeight :: BlockId -> Prob normalWeight bid | totalWeight == 0 = 1.0 / fromIntegral edgeCount - | Just w <- mapLookup bid weightMap' + | Just w <- NonDet.mapLookup bid weightMap' = w/totalWeight | otherwise = panic "impossible" ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -16,6 +16,7 @@ import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Label (mapFoldlWithKey, mapLookup, mapInsert) +--import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Utils.Monad import GHC.Utils.Monad.State.Strict ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs ===================================== @@ -50,6 +50,7 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform import GHC.Cmm.Dataflow.Label (mapLookup) +--import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup) import Data.List (nub, foldl1', find) import Data.Maybe ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs ===================================== @@ -24,7 +24,8 @@ import GHC.Platform.Reg import GHC.Data.Graph.Base -import GHC.Cmm.Dataflow.Label (mapLookup, Label, LabelMap) +import GHC.Cmm.Dataflow.Label (mapLookup) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup, Label, LabelMap) import GHC.Cmm import GHC.Types.Unique.FM import GHC.Types.Unique.Set @@ -150,9 +151,9 @@ slurpSpillCostInfo platform cfg cmm incUses count reg = modify $ \s -> addToUFM_C plusSpillCostRecord s reg (reg, 0, count, 0) incLifetime reg = modify $ \s -> addToUFM_C plusSpillCostRecord s reg (reg, 0, 0, 1) - blockFreq :: Maybe (LabelMap Double) -> Label -> Double + blockFreq :: Maybe (NonDet.LabelMap Double) -> NonDet.Label -> Double blockFreq freqs bid - | Just freq <- join (mapLookup bid <$> freqs) + | Just freq <- join (NonDet.mapLookup bid <$> freqs) = max 1.0 (10000 * freq) | otherwise = 1.0 -- Only if no cfg given ===================================== compiler/GHC/CmmToAsm/Reg/Linear/Base.hs ===================================== @@ -35,6 +35,7 @@ import GHC.Types.Unique.FM import GHC.Types.Unique.DSM import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Label +--import qualified GHC.Cmm.Dataflow.Label as NonDet import GHC.CmmToAsm.Reg.Utils data ReadingOrWriting = Reading | Writing deriving (Eq,Ord) ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -14,7 +14,7 @@ module GHC.CmmToAsm.Reg.Liveness ( RegSet, RegMap, emptyRegMap, - BlockMap, mapEmpty, + BlockMap, LiveCmmDecl, InstrSR (..), LiveInstr (..), @@ -46,8 +46,9 @@ import GHC.CmmToAsm.Types import GHC.CmmToAsm.Utils import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label (mapToList, LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap) +import GHC.Cmm.Dataflow.Label (LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap, mapMapWithKey, mapToList) import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setMember, setFromList) +--import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Data.Graph.Directed @@ -927,9 +928,9 @@ livenessSCCs platform blockmap done -- BlockMaps for equality. equalBlockMaps a b = a' == b' - where a' = map f $ mapToList a - b' = map f $ mapToList b - f (key,elt) = (key, nonDetEltsUniqSet elt) + where a' = mapToList $ mapMapWithKey f a + b' = mapToList $ mapMapWithKey f b + f key elt = (key, nonDetEltsUniqSet elt) -- See Note [Unique Determinism and code generation] ===================================== testsuite/tests/determinism/object/check-standalone.sh ===================================== @@ -12,4 +12,4 @@ cabal build -w $1 --ghc-options="-fforce-recomp -j4 -ddump-to-file -fobject-dete # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out1 Cabal cabal build -w $1 --ghc-options="-fforce-recomp -j4 -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism" --ghc-options=-odir=out2 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out2 Cabal -./check.sh darwin +./check.sh linux ===================================== testsuite/tests/determinism/object/check.sh ===================================== @@ -54,24 +54,24 @@ compareHis() { done } -#if diff -r Cabal-3.12.0.0/hiout1 Cabal-3.12.0.0/hiout2 -#then -# echo "OK-hi" -#else -# echo "--------------------------------------------------------------------------------" -# echo "Comparing all objects (1. headers, 2. disassembly). Stopping at first failure..." -# echo "--------------------------------------------------------------------------------" -# -# -# pushd Cabal-3.12.0.0/hiout1 >/dev/null -# OBJS=$(find . -type f) -# popd >/dev/null -# -# compareHis "/home/matt/ghc-rodrigo/_build/stage1/bin/ghc" "$OBJS" -# -# exit 1 -# -#fi +if diff -r Cabal-3.12.0.0/hiout1 Cabal-3.12.0.0/hiout2 +then + echo "OK-hi" +else + echo "--------------------------------------------------------------------------------" + echo "Comparing all objects (1. headers, 2. disassembly). Stopping at first failure..." + echo "--------------------------------------------------------------------------------" + + + pushd Cabal-3.12.0.0/hiout1 >/dev/null + OBJS=$(find . -type f) + popd >/dev/null + + compareHis "/home/matt/ghc-rodrigo/_build/stage1/bin/ghc" "$OBJS" + + exit 1 + +fi # Big fast check if diff -r Cabal-3.12.0.0/out1 Cabal-3.12.0.0/out2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ba0d779af70e3c1b79283dee852802f6060cdd1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1ba0d779af70e3c1b79283dee852802f6060cdd1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 11:22:15 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Thu, 11 Jul 2024 07:22:15 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Add vector fused multiply-add operations Message-ID: <668fc067b26b4_122b94d323a4124042@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: fdb26668 by sheaf at 2024-07-11T13:22:03+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 6fc83336 by sheaf at 2024-07-11T13:22:03+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 7a572e02 by sheaf at 2024-07-11T13:22:03+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - a122ae4e by sheaf at 2024-07-11T13:22:03+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 95dbdaa5 by sheaf at 2024-07-11T13:22:04+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd011.stdout - utils/deriveConstants/Main.hs - utils/genapply/Main.hs - utils/genprimopcode/Lexer.x - utils/genprimopcode/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/227ab64d3a04af4473e5822d8abc83f17fe0fea9...95dbdaa5f5726d92372d1c5943d3bcc54d646dba -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/227ab64d3a04af4473e5822d8abc83f17fe0fea9...95dbdaa5f5726d92372d1c5943d3bcc54d646dba You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 11:27:45 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 11 Jul 2024 07:27:45 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: Add support for building profiled dynamic way Message-ID: <668fc1b147fa2_122b94f2e3881265fc@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 38233e02 by Matthew Pickering at 2024-07-11T07:27:14-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - e4900439 by Matthew Pickering at 2024-07-11T07:27:14-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - b4358b69 by Alex Mason at 2024-07-11T07:27:16-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - e0704544 by romes at 2024-07-11T07:27:19-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 14dc02e2 by Sylvain Henry at 2024-07-11T07:27:22-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - b635a4fc by Sylvain Henry at 2024-07-11T07:27:22-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c980acba by Sylvain Henry at 2024-07-11T07:27:22-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 9e9e5cd5 by Simon Peyton Jones at 2024-07-11T07:27:23-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 4c55cb89 by Matthew Pickering at 2024-07-11T07:27:24-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 48cd0c90 by Adam Sandberg Ericsson at 2024-07-11T07:27:24-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 3c9a1e7e by Hécate Kleidukos at 2024-07-11T07:27:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0816ec8386396b999b671fb76f21d7ade2e15247...3c9a1e7efaf0bd712bc7e210578b72bf2bcc16b5 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0816ec8386396b999b671fb76f21d7ade2e15247...3c9a1e7efaf0bd712bc7e210578b72bf2bcc16b5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 12:16:00 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Thu, 11 Jul 2024 08:16:00 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: The X86 SIMD patch. Message-ID: <668fcd00690a1_122b9415b600c14314e@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 79e1f46f by sheaf at 2024-07-11T14:15:28+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 9fa0967b by sheaf at 2024-07-11T14:15:28+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 69bed458 by sheaf at 2024-07-11T14:15:29+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - b6364cd1 by sheaf at 2024-07-11T14:15:29+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 72a8bf77 by sheaf at 2024-07-11T14:15:29+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 31a50ec0 by sheaf at 2024-07-11T14:15:29+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/95dbdaa5f5726d92372d1c5943d3bcc54d646dba...31a50ec0c8d12bdbd07e4a1a05428ac2e0f77e1d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/95dbdaa5f5726d92372d1c5943d3bcc54d646dba...31a50ec0c8d12bdbd07e4a1a05428ac2e0f77e1d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 12:48:38 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Thu, 11 Jul 2024 08:48:38 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: The X86 SIMD patch. Message-ID: <668fd4a61050d_122b941ac924c1493d6@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 363e305d by sheaf at 2024-07-11T14:48:27+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 93be7d6d by sheaf at 2024-07-11T14:48:27+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 2c16bb1b by sheaf at 2024-07-11T14:48:27+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - d8e12f76 by sheaf at 2024-07-11T14:48:27+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - b7ea40bf by sheaf at 2024-07-11T14:48:27+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 82f8f06c by sheaf at 2024-07-11T14:48:27+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31a50ec0c8d12bdbd07e4a1a05428ac2e0f77e1d...82f8f06c6d55ee3149f2ab912c73c3569d350f75 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/31a50ec0c8d12bdbd07e4a1a05428ac2e0f77e1d...82f8f06c6d55ee3149f2ab912c73c3569d350f75 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 13:18:27 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Thu, 11 Jul 2024 09:18:27 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/trace-foreign-calls-edsko Message-ID: <668fdba31d9cd_122b941fe6e281607ce@gitlab.mail> Zubin pushed new branch wip/trace-foreign-calls-edsko at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/trace-foreign-calls-edsko You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 13:20:25 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Thu, 11 Jul 2024 09:20:25 -0400 Subject: [Git][ghc/ghc][wip/trace-foreign-calls-edsko] wip Message-ID: <668fdc1954431_122b9420613d016093@gitlab.mail> Zubin pushed to branch wip/trace-foreign-calls-edsko at Glasgow Haskell Compiler / GHC Commits: 7c5290f6 by Zubin Duggal at 2024-07-11T18:50:09+05:30 wip - - - - - 11 changed files: - libraries/base/src/Foreign/C/Types.hs - libraries/base/src/System/Posix/Types.hs - libraries/binary - libraries/containers - libraries/filepath - libraries/ghc-boot-th/GHC/Lexeme.hs - libraries/ghc-internal/src/GHC/Internal/Data/Enum.hs - libraries/ghc-internal/src/GHC/Internal/Type/Reflection.hs - libraries/template-haskell/vendored-filepath/System/FilePath/Posix.hs - libraries/unix - trace-foreign-calls Changes: ===================================== libraries/base/src/Foreign/C/Types.hs ===================================== @@ -1,3 +1,4 @@ +{-# LANGUAGE Safe #-} -- | -- -- Module : Foreign.C.Types ===================================== libraries/base/src/System/Posix/Types.hs ===================================== @@ -1,3 +1,4 @@ +{-# LANGUAGE Safe #-} -- | -- -- Module : System.Posix.Types ===================================== libraries/binary ===================================== @@ -1 +1 @@ -Subproject commit a501955f7ab48da81d732958c8834caaa3e470b6 +Subproject commit 5ba30b2ff84ed6498e77f2fdc18576911b0c13a1 ===================================== libraries/containers ===================================== @@ -1 +1 @@ -Subproject commit 4fda06c43ea14f808748aa8988158946c3ce0caf +Subproject commit c9a11359ec5135049e9bcabaa03e61891c0dfecb ===================================== libraries/filepath ===================================== @@ -1 +1 @@ -Subproject commit 87a09e296ea6fc137a0b32edda1bd0f54332642e +Subproject commit 3f1294d05797113eaa1e5623e141d8e0e3e7ae80 ===================================== libraries/ghc-boot-th/GHC/Lexeme.hs ===================================== @@ -1,3 +1,4 @@ +{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Lexeme ===================================== libraries/ghc-internal/src/GHC/Internal/Data/Enum.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | ===================================== libraries/ghc-internal/src/GHC/Internal/Type/Reflection.hs ===================================== @@ -1,5 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | ===================================== libraries/template-haskell/vendored-filepath/System/FilePath/Posix.hs ===================================== @@ -1,6 +1,7 @@ -- Vendored from filepath v1.4.2.2 {-# LANGUAGE PatternGuards #-} +{-# LANGUAGE Safe #-} -- This template expects CPP definitions for: -- MODULE_NAME = Posix | Windows ===================================== libraries/unix ===================================== @@ -1 +1 @@ -Subproject commit 69552a5267c7dc5c46a8bceec5ec4b40d26b9463 +Subproject commit a0c4407cf2ef62e1f70c4563a12c933826e22103 ===================================== trace-foreign-calls ===================================== @@ -1 +1 @@ -Subproject commit fdc918e22f30eef762d3ebdde325b160529d3b7c +Subproject commit d2e809aac6c29a65c53fb4562c4e44cb9be9113b View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c5290f6faf80c5d905d40523578dc9cf9ad97fa -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7c5290f6faf80c5d905d40523578dc9cf9ad97fa You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 14:19:47 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 11 Jul 2024 10:19:47 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] fix Ord instance Message-ID: <668fea0339874_122b94273a1ac1690f4@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 599aec7a by Matthew Pickering at 2024-07-11T15:19:17+01:00 fix Ord instance - - - - - 2 changed files: - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/CmmToAsm/CFG.hs Changes: ===================================== compiler/GHC/Cmm/CLabel.hs ===================================== @@ -346,6 +346,8 @@ instance Ord CLabel where compare (IdLabel a1 b1 c1) (IdLabel a2 b2 c2) | isExternalName a1, isExternalName a2 = stableNameCmp a1 a2 S.<> compare b1 b2 S.<> compare c1 c2 + | isExternalName a1 = GT + | isExternalName a2 = LT compare (IdLabel a1 b1 c1) (IdLabel a2 b2 c2) = -- Comparing names here should deterministic because all unique should have been renamed deterministically ...... ===================================== compiler/GHC/CmmToAsm/CFG.hs ===================================== @@ -5,7 +5,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TupleSections #-} -{-# OPTIONS_GHC -ddump-simpl -ddump-to-file #-} -- -- Copyright (c) 2018 Andreas Klebinger -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/599aec7aa5fa1524e4f8a18ccc44769f7a98fe1c -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/599aec7aa5fa1524e4f8a18ccc44769f7a98fe1c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 15:30:02 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 11 Jul 2024 11:30:02 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/refactor_ci_groups Message-ID: <668ffa7a68e9b_122b9430841f417429@gitlab.mail> Matthew Pickering pushed new branch wip/refactor_ci_groups at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/refactor_ci_groups You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 17:01:25 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 11 Jul 2024 13:01:25 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] More NonDet Message-ID: <66900fe5e2ea4_2aa59d4bd1b08826@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 7cf3301e by Matthew Pickering at 2024-07-11T17:58:38+01:00 More NonDet - - - - - 9 changed files: - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs Changes: ===================================== compiler/GHC/Cmm/DebugBlock.hs ===================================== @@ -57,6 +57,7 @@ import Data.Maybe import Data.List ( minimumBy, nubBy ) import Data.Ord ( comparing ) import qualified Data.Map as Map +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- | Debug information about a block of code. Ticks scope over nested -- blocks. @@ -250,7 +251,7 @@ cmmDebugLabels is_valid_label isMeta nats = seqList lbls lbls -- | Sets position and unwind table fields in the debug block tree according to -- native generated code. -cmmDebugLink :: [Label] -> LabelMap [UnwindPoint] +cmmDebugLink :: [Label] -> NonDet.LabelMap [UnwindPoint] -> [DebugBlock] -> [DebugBlock] cmmDebugLink labels unwindPts blocks = mapMaybe link blocks where blockPos :: LabelMap Int @@ -262,7 +263,7 @@ cmmDebugLink labels unwindPts blocks = mapMaybe link blocks pos -> Just $ block { dblPosition = pos , dblBlocks = mapMaybe link (dblBlocks block) - , dblUnwind = fromMaybe mempty $ mapLookup (dblLabel block) unwindPts + , dblUnwind = fromMaybe mempty $ NonDet.mapLookup (dblLabel block) unwindPts } -- | Converts debug blocks into a label map for easier lookups ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -169,7 +169,7 @@ data NativeGenAcc statics instr , ngs_labels :: ![Label] , ngs_debug :: ![DebugBlock] , ngs_dwarfFiles :: !DwarfFiles - , ngs_unwinds :: !(LabelMap [UnwindPoint]) + , ngs_unwinds :: !(NonDet.LabelMap [UnwindPoint]) -- ^ see Note [Unwinding information in the NCG] -- and Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock". } @@ -213,7 +213,7 @@ nativeCodeGen' logger config modLoc ncgImpl h us cmms -- Pretty if it weren't for the fact that we do lots of little -- printDocs here (in order to do codegen in constant space). bufh <- newBufHandle h - let ngs0 = NGS [] [] [] [] [] [] emptyUFM mapEmpty + let ngs0 = NGS [] [] [] [] [] [] emptyUFM NonDet.mapEmpty (ngs, us', a) <- cmmNativeGenStream logger config modLoc ncgImpl bufh us cmms ngs0 _ <- finishNativeGen logger config modLoc bufh us' ngs @@ -408,7 +408,7 @@ cmmNativeGens logger config ncgImpl h dbgMap = go , ngs_linearStats = linearStats `mCon` ngs_linearStats ngs , ngs_labels = ngs_labels ngs ++ labels' , ngs_dwarfFiles = fileIds' - , ngs_unwinds = ngs_unwinds ngs `mapUnion` unwinds + , ngs_unwinds = ngs_unwinds ngs `NonDet.mapUnion` unwinds } go us' cmms ngs' (count + 1) @@ -442,7 +442,7 @@ cmmNativeGen , [CLabel] -- things imported by this cmm , Maybe [Color.RegAllocStats statics instr] -- stats for the coloring register allocator , Maybe [Linear.RegAllocStats] -- stats for the linear register allocators - , LabelMap [UnwindPoint] -- unwinding information for blocks + , BlockMap [UnwindPoint] -- unwinding information for blocks , Maybe CFG -- final CFG ) @@ -671,10 +671,10 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count let unwinds :: BlockMap [UnwindPoint] unwinds = {-# SCC "unwindingInfo" #-} - foldl' addUnwind mapEmpty branchOpt + foldl' addUnwind NonDet.mapEmpty branchOpt where addUnwind acc proc = - acc `mapUnion` computeUnwinding config ncgImpl proc + acc `NonDet.mapUnion` computeUnwinding config ncgImpl proc return ( us_seq , fileIds' @@ -719,12 +719,12 @@ computeUnwinding :: Instruction instr -> NcgImpl statics instr jumpDest -> NatCmmDecl statics instr -- ^ the native code generated for the procedure - -> LabelMap [UnwindPoint] + -> BlockMap [UnwindPoint] -- ^ unwinding tables for all points of all blocks of the -- procedure computeUnwinding config _ _ - | not (ncgComputeUnwinding config) = mapEmpty -computeUnwinding _ _ (CmmData _ _) = mapEmpty + | not (ncgComputeUnwinding config) = NonDet.mapEmpty +computeUnwinding _ _ (CmmData _ _) = NonDet.mapEmpty computeUnwinding _ ncgImpl (CmmProc _ _ _ (ListGraph blks)) = -- In general we would need to push unwinding information down the -- block-level call-graph to ensure that we fully account for all @@ -734,8 +734,8 @@ computeUnwinding _ ncgImpl (CmmProc _ _ _ (ListGraph blks)) = -- Sp. The fact that GHC.Cmm.LayoutStack already ensures that we have unwind -- information at the beginning of every block means that there is no need -- to perform this sort of push-down. - mapFromList [ (blk_lbl, extractUnwindPoints ncgImpl instrs) - | BasicBlock blk_lbl instrs <- blks ] + NonDet.mapFromList [ (blk_lbl, extractUnwindPoints ncgImpl instrs) + | BasicBlock blk_lbl instrs <- blks ] -- | Build a doc for all the imports. -- ===================================== compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs ===================================== @@ -15,8 +15,7 @@ import GHC.CmmToAsm.Instr import GHC.Platform.Reg import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label (mapFoldlWithKey, mapLookup, mapInsert) ---import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Utils.Monad import GHC.Utils.Monad.State.Strict @@ -124,7 +123,7 @@ regSpill_top platform regSlotMap cmm -- after we've done a successful allocation. let liveSlotsOnEntry' :: BlockMap IntSet liveSlotsOnEntry' - = mapFoldlWithKey patchLiveSlot + = NonDet.nonDetMapFoldlWithKey patchLiveSlot liveSlotsOnEntry liveVRegsOnEntry let info' @@ -148,7 +147,7 @@ regSpill_top platform regSlotMap cmm = let -- Slots that are already recorded as being live. curSlotsLive = fromMaybe IntSet.empty - $ mapLookup blockId slotMap + $ NonDet.mapLookup blockId slotMap moreSlotsLive = IntSet.fromList $ mapMaybe (lookupUFM regSlotMap) @@ -156,8 +155,8 @@ regSpill_top platform regSlotMap cmm -- See Note [Unique Determinism and code generation] slotMap' - = mapInsert blockId (IntSet.union curSlotsLive moreSlotsLive) - slotMap + = NonDet.mapInsert blockId (IntSet.union curSlotsLive moreSlotsLive) + slotMap in slotMap' ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs ===================================== @@ -49,8 +49,7 @@ import GHC.Utils.Monad.State.Strict import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform -import GHC.Cmm.Dataflow.Label (mapLookup) ---import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup) import Data.List (nub, foldl1', find) import Data.Maybe @@ -391,7 +390,7 @@ cleanBackward' liveSlotsOnEntry reloadedBy noReloads acc (li : instrs) = do let slotsReloadedByTargets = IntSet.unions - $ mapMaybe (flip mapLookup liveSlotsOnEntry) + $ mapMaybe (flip NonDet.mapLookup liveSlotsOnEntry) $ targets let noReloads' ===================================== compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs ===================================== @@ -24,7 +24,6 @@ import GHC.Platform.Reg import GHC.Data.Graph.Base -import GHC.Cmm.Dataflow.Label (mapLookup) import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup, Label, LabelMap) import GHC.Cmm import GHC.Types.Unique.FM @@ -99,7 +98,7 @@ slurpSpillCostInfo platform cfg cmm -- the info table from the CmmProc. countBlock info freqMap (BasicBlock blockId instrs) | LiveInfo _ _ blockLive _ <- info - , Just rsLiveEntry <- mapLookup blockId blockLive + , Just rsLiveEntry <- NonDet.mapLookup blockId blockLive , rsLiveEntry_virt <- takeVirtuals rsLiveEntry = countLIs (ceiling $ blockFreq freqMap blockId) rsLiveEntry_virt instrs ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -122,7 +122,7 @@ import GHC.Platform.Reg import GHC.Platform.Reg.Class (RegClass(..)) import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label (mapLookup) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup) import GHC.Cmm hiding (RegSet) import GHC.Data.Graph.Directed @@ -359,7 +359,7 @@ initBlock id block_live -- empty. Nothing -> do -- pprTrace "initFreeRegs" (text $ show initFreeRegs) (return ()) - case mapLookup id block_live of + case NonDet.mapLookup id block_live of Nothing -> setFreeRegsR (frInitFreeRegs platform) Just live -> ===================================== compiler/GHC/CmmToAsm/Reg/Linear/Base.hs ===================================== @@ -34,8 +34,7 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.DSM import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label ---import qualified GHC.Cmm.Dataflow.Label as NonDet +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.CmmToAsm.Reg.Utils data ReadingOrWriting = Reading | Writing deriving (Eq,Ord) @@ -51,7 +50,7 @@ data BlockAssignment freeRegs -- | Find the register mapping for a specific BlockId. lookupBlockAssignment :: BlockId -> BlockAssignment freeRegs -> Maybe (freeRegs, RegMap Loc) -lookupBlockAssignment bid ba = mapLookup bid (blockMap ba) +lookupBlockAssignment bid ba = NonDet.mapLookup bid (blockMap ba) -- | Lookup which register a virtual register was first assigned to. lookupFirstUsed :: VirtualReg -> BlockAssignment freeRegs -> Maybe RealReg @@ -59,7 +58,7 @@ lookupFirstUsed vr ba = lookupUFM (firstUsed ba) vr -- | An initial empty 'BlockAssignment' emptyBlockAssignment :: BlockAssignment freeRegs -emptyBlockAssignment = BlockAssignment mapEmpty mempty +emptyBlockAssignment = BlockAssignment NonDet.mapEmpty mempty -- | Add new register mappings for a specific block. updateBlockAssignment :: BlockId @@ -67,7 +66,7 @@ updateBlockAssignment :: BlockId -> BlockAssignment freeRegs -> BlockAssignment freeRegs updateBlockAssignment dest (freeRegs, regMap) (BlockAssignment {..}) = - BlockAssignment (mapInsert dest (freeRegs, regMap) blockMap) + BlockAssignment (NonDet.mapInsert dest (freeRegs, regMap) blockMap) (mergeUFM combWithExisting id (mapMaybeUFM fromLoc) (firstUsed) (toVRegMap regMap)) where -- The blocks are processed in dependency order, so if there's already an ===================================== compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs ===================================== @@ -23,7 +23,7 @@ import GHC.CmmToAsm.Types import GHC.Platform.Reg import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label (mapLookup) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet (mapLookup) import GHC.Data.Graph.Directed import GHC.Utils.Panic import GHC.Utils.Monad (concatMapM) @@ -89,7 +89,7 @@ joinToTargets' block_live new_blocks block_id instr (dest:dests) -- adjust the current assignment to remove any vregs that are not live -- on entry to the destination block. - let Just live_set = mapLookup dest block_live + let Just live_set = NonDet.mapLookup dest block_live let still_live uniq _ = uniq `elemUniqSet_Directly` live_set let adjusted_assig = filterUFM_Directly still_live assig ===================================== compiler/GHC/CmmToAsm/Reg/Liveness.hs ===================================== @@ -46,9 +46,9 @@ import GHC.CmmToAsm.Types import GHC.CmmToAsm.Utils import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label (LabelMap, mapInsert, mapEmpty, mapFilterWithKey, mapLookup, mapMap, mapMapWithKey, mapToList) +import GHC.Cmm.Dataflow.Label (LabelMap, mapFilterWithKey) import GHC.Cmm.Dataflow.Label.NonDet (LabelSet, setMember, setFromList) ---import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm hiding (RegSet, emptyRegSet) import GHC.Data.Graph.Directed @@ -82,7 +82,7 @@ emptyRegMap = emptyUFM emptyRegSet :: RegSet emptyRegSet = emptyUniqSet -type BlockMap a = LabelMap a +type BlockMap a = NonDet.LabelMap a type SlotMap a = UniqFM Slot a @@ -348,7 +348,7 @@ slurpConflicts live slurpBlock info rs (BasicBlock blockId instrs) | LiveInfo _ _ blockLive _ <- info - , Just rsLiveEntry <- mapLookup blockId blockLive + , Just rsLiveEntry <- NonDet.mapLookup blockId blockLive , (conflicts, moves) <- slurpLIs rsLiveEntry rs instrs = (consBag rsLiveEntry conflicts, moves) @@ -625,7 +625,7 @@ patchEraseLive patchF cmm = let patchRegSet set = mkUniqSet $ map patchF $ nonDetEltsUFM set -- See Note [Unique Determinism and code generation] - blockMap' = mapMap (patchRegSet . getUniqSet) blockMap + blockMap' = NonDet.mapMap (patchRegSet . getUniqSet) blockMap info' = LiveInfo static id blockMap' mLiveSlots in CmmProc info' label live $ map patchSCC sccs @@ -705,10 +705,10 @@ natCmmTopToLive _ (CmmData i d) = CmmData i d natCmmTopToLive _ (CmmProc info lbl live (ListGraph [])) - = CmmProc (LiveInfo info [] mapEmpty mapEmpty) lbl live [] + = CmmProc (LiveInfo info [] NonDet.mapEmpty NonDet.mapEmpty) lbl live [] natCmmTopToLive mCfg proc@(CmmProc info lbl live (ListGraph blocks@(first : _))) - = CmmProc (LiveInfo info' (first_id : entry_ids) mapEmpty mapEmpty) + = CmmProc (LiveInfo info' (first_id : entry_ids) NonDet.mapEmpty NonDet.mapEmpty) lbl live sccsLive where first_id = blockId first @@ -794,7 +794,7 @@ regLiveness _ (CmmData i d) regLiveness _ (CmmProc info lbl live []) | LiveInfo static mFirst _ _ <- info = return $ CmmProc - (LiveInfo static mFirst mapEmpty mapEmpty) + (LiveInfo static mFirst NonDet.mapEmpty NonDet.mapEmpty) lbl live [] regLiveness platform (CmmProc info lbl live sccs) @@ -876,7 +876,7 @@ computeLiveness computeLiveness platform sccs = case checkIsReverseDependent sccs of - Nothing -> livenessSCCs platform mapEmpty [] sccs + Nothing -> livenessSCCs platform NonDet.mapEmpty [] sccs Just bad -> let sccs' = fmap (fmap (fmap (fmap (pprInstr platform)))) sccs in pprPanic "RegAlloc.Liveness.computeLiveness" (vcat [ text "SCCs aren't in reverse dependent order" @@ -928,8 +928,8 @@ livenessSCCs platform blockmap done -- BlockMaps for equality. equalBlockMaps a b = a' == b' - where a' = mapToList $ mapMapWithKey f a - b' = mapToList $ mapMapWithKey f b + where a' = NonDet.nonDetMapToList $ NonDet.mapMapWithKey f a + b' = NonDet.nonDetMapToList $ NonDet.mapMapWithKey f b f key elt = (key, nonDetEltsUniqSet elt) -- See Note [Unique Determinism and code generation] @@ -948,7 +948,7 @@ livenessBlock platform blockmap (BasicBlock block_id instrs) = let (regsLiveOnEntry, instrs1) = livenessBack platform emptyUniqSet blockmap [] (reverse instrs) - blockmap' = mapInsert block_id regsLiveOnEntry blockmap + blockmap' = NonDet.mapInsert block_id regsLiveOnEntry blockmap instrs2 = livenessForward platform regsLiveOnEntry instrs1 @@ -1058,7 +1058,7 @@ liveness1 platform liveregs blockmap (LiveInstr instr _) not_a_branch = null targets targetLiveRegs target - = case mapLookup target blockmap of + = case NonDet.mapLookup target blockmap of Just ra -> ra Nothing -> emptyRegSet View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cf3301e1fdb0136d4087e4977330b6775858a28 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7cf3301e1fdb0136d4087e4977330b6775858a28 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 11 20:48:55 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 11 Jul 2024 16:48:55 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 14 commits: compiler: Fingerprint -fwrite-if-simplified-core Message-ID: <669045371378e_2c216ef9a09c781f8@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: c5ff9305 by Zubin Duggal at 2024-07-11T16:48:32-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 280794ad by Matthew Pickering at 2024-07-11T16:48:32-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 5591a614 by Matthew Pickering at 2024-07-11T16:48:32-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 8d8de509 by Alex Mason at 2024-07-11T16:48:35-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 75436637 by Sylvain Henry at 2024-07-11T16:48:41-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 33b094b6 by Sylvain Henry at 2024-07-11T16:48:41-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - 154a7975 by Sylvain Henry at 2024-07-11T16:48:41-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - c0b574fc by Simon Peyton Jones at 2024-07-11T16:48:41-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - bb95d7eb by Matthew Pickering at 2024-07-11T16:48:42-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 683807ec by Alan Zimmerman at 2024-07-11T16:48:42-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7c663bd3 by Matthew Pickering at 2024-07-11T16:48:43-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - e842101e by Matthew Pickering at 2024-07-11T16:48:43-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 8d5ee967 by Adam Sandberg Ericsson at 2024-07-11T16:48:44-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 1f930a0e by Hécate Kleidukos at 2024-07-11T16:48:46-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c9a1e7efaf0bd712bc7e210578b72bf2bcc16b5...1f930a0e3fed1a103f2b0e2a6b32a39309eb7603 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c9a1e7efaf0bd712bc7e210578b72bf2bcc16b5...1f930a0e3fed1a103f2b0e2a6b32a39309eb7603 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 05:11:02 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 01:11:02 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 14 commits: compiler: Fingerprint -fwrite-if-simplified-core Message-ID: <6690bae623376_2c216e542043c1351b@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: f26034fa by Zubin Duggal at 2024-07-12T01:09:47-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 83539def by Matthew Pickering at 2024-07-12T01:09:48-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - b1d87a92 by Matthew Pickering at 2024-07-12T01:09:48-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 5af12731 by Alex Mason at 2024-07-12T01:09:51-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - d8459db0 by Sylvain Henry at 2024-07-12T01:09:57-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 239ff7c1 by Sylvain Henry at 2024-07-12T01:09:57-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - acc59b74 by Sylvain Henry at 2024-07-12T01:09:57-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - c828037b by Simon Peyton Jones at 2024-07-12T01:09:57-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 2d80d335 by Matthew Pickering at 2024-07-12T01:09:58-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - f19c1cc0 by Alan Zimmerman at 2024-07-12T01:09:59-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 800fbc15 by Matthew Pickering at 2024-07-12T01:09:59-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 2b0081c6 by Matthew Pickering at 2024-07-12T01:09:59-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - fd287e2e by Adam Sandberg Ericsson at 2024-07-12T01:10:00-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 7c7ee50f by Hécate Kleidukos at 2024-07-12T01:10:02-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1f930a0e3fed1a103f2b0e2a6b32a39309eb7603...7c7ee50f27a76dee27eddf8bb058864f3d3863d2 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1f930a0e3fed1a103f2b0e2a6b32a39309eb7603...7c7ee50f27a76dee27eddf8bb058864f3d3863d2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 07:32:31 2024 From: gitlab at gitlab.haskell.org (Sylvain Henry (@hsyl20)) Date: Fri, 12 Jul 2024 03:32:31 -0400 Subject: [Git][ghc/ghc][wip/remove-cc-var] testsuite: Replace $CC with $TEST_CC Message-ID: <6690dc0fbc43c_2c216e669ee601662f2@gitlab.mail> Sylvain Henry pushed to branch wip/remove-cc-var at Glasgow Haskell Compiler / GHC Commits: 19b7a0af by Matthew Pickering at 2024-07-12T09:32:15+02:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 4 changed files: - testsuite/tests/rts/Makefile - testsuite/tests/rts/all.T - testsuite/tests/rts/linker/Makefile - testsuite/tests/rts/linker/T11223/Makefile Changes: ===================================== testsuite/tests/rts/Makefile ===================================== @@ -23,8 +23,8 @@ T4059: ./T4059 exec_signals-prep: - $(CC) -o exec_signals_child exec_signals_child.c - $(CC) -o exec_signals_prepare exec_signals_prepare.c + $(TEST_CC) -o exec_signals_child exec_signals_child.c + $(TEST_CC) -o exec_signals_prepare exec_signals_prepare.c .PHONY: T4850 T4850: ===================================== testsuite/tests/rts/all.T ===================================== @@ -221,7 +221,8 @@ test('exec_signals', [when(opsys('mingw32'), skip), pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'), cmd_prefix('./exec_signals_prepare'), - req_process], + req_process, + req_c], compile_and_run, ['']) test('return_mem_to_os', normal, compile_and_run, ['']) ===================================== testsuite/tests/rts/linker/Makefile ===================================== @@ -69,7 +69,7 @@ linker_unload_native: $(RM) Test.o Test.hi Test.a Test.so Test2.so "$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 -dynamic -fPIC -o Test.a # only libraries without DT_NEEDED are supported - "$(CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ + "$(TEST_CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ -Wl,--whole-archive Test.a cp Test.so Test2.so ===================================== testsuite/tests/rts/linker/T11223/Makefile ===================================== @@ -11,44 +11,44 @@ CC=$(TEST_CC) .PHONY: t_11223_simple_link t_11223_simple_link: $(RM) -f foo_simple.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_simple.o + "$(TEST_CC)" -c foo.c -o foo_simple.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs .PHONY: t_11223_simple_link_lib t_11223_simple_link_lib: $(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a - "$(CC)" -c foo.c -o foo_lib.o + "$(TEST_CC)" -c foo.c -o foo_lib.o "$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)" .PHONY: t_11223_simple_duplicate t_11223_simple_duplicate: $(RM) -f foo_dup.o bar_dup.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_dup.o - "$(CC)" -c bar.c -o bar_dup.o + "$(TEST_CC)" -c foo.c -o foo_dup.o + "$(TEST_CC)" -c bar.c -o bar_dup.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs .PHONY: t_11223_simple_duplicate_lib t_11223_simple_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libfoo_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)" .PHONY: t_11223_simple_unused_duplicate_lib t_11223_simple_unused_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libbar_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)" .PHONY: t_11223_link_order_a_b_succeed t_11223_link_order_a_b_succeed: $(RM) -f foo_link_lib_1.o bar_link_lib_1.o foo.hi foo.o libbar_link_lib_1.a libfoo_link_lib_1.a - "$(CC)" -c foo.c -o foo_link_lib_1.o - "$(CC)" -c bar.c -o bar_link_lib_1.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_1.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_1.o "$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null "$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)" @@ -56,8 +56,8 @@ t_11223_link_order_a_b_succeed: .PHONY: t_11223_link_order_b_a_succeed t_11223_link_order_b_a_succeed: $(RM) -f foo_link_lib_2.o bar_link_lib_2.o foo.hi foo.o libbar_link_lib_2.a libfoo_link_lib_2.a - "$(CC)" -c foo.c -o foo_link_lib_2.o - "$(CC)" -c bar.c -o bar_link_lib_2.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_2.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_2.o "$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null "$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)" @@ -65,8 +65,8 @@ t_11223_link_order_b_a_succeed: .PHONY: t_11223_link_order_a_b_2_fail t_11223_link_order_a_b_2_fail: $(RM) -f foo_link_lib_3.o bar_link_lib_3.o foo.hi foo.o libbar_link_lib_3.a libfoo_link_lib_3.a - "$(CC)" -c foo.c -o foo_link_lib_3.o - "$(CC)" -c bar.c -o bar_link_lib_3.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_3.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_3.o "$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null "$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)" @@ -74,8 +74,8 @@ t_11223_link_order_a_b_2_fail: .PHONY: t_11223_link_order_b_a_2_succeed t_11223_link_order_b_a_2_succeed: $(RM) -f foo_link_lib_4.o bar_link_lib_4.o foo.hi foo.o libbar_link_lib_4.a libfoo_link_lib_4.a - "$(CC)" -c foo.c -o foo_link_lib_4.o - "$(CC)" -c bar.c -o bar_link_lib_4.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_4.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_4.o "$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null "$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)" @@ -87,40 +87,40 @@ t_11223_link_order_b_a_2_succeed: .PHONY: t_11223_weak_only_link_fail t_11223_weak_only_link_fail: $(RM) -f power_w1.o power.hi power.o - "$(CC)" -c power.c -DWEAK -o power_w1.o + "$(TEST_CC)" -c power.c -DWEAK -o power_w1.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o .PHONY: t_11223_weak_only_link_succeed t_11223_weak_only_link_succeed: $(RM) -f power_w2.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o power_w2.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o power_w2.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o .PHONY: t_11223_weak_both_link_order_a_b_succeed t_11223_weak_both_link_order_a_b_succeed: $(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o - "$(CC)" -c power.c -DWEAK -o fast_power_w3.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w3.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w3.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o .PHONY: t_11223_weak_both_link_order_b_a_succeed t_11223_weak_both_link_order_b_a_succeed: $(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o - "$(CC)" -c power.c -DWEAK -o fast_power_w4.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w4.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w4.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o .PHONY: t_11223_weak_single_link_order_a_b_succeed t_11223_weak_single_link_order_a_b_succeed: $(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o - "$(CC)" -c power_slow.c -o slow_power_w5.o - "$(CC)" -c power.c -DWEAK -o fast_power_w5.o + "$(TEST_CC)" -c power_slow.c -o slow_power_w5.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w5.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o .PHONY: t_11223_weak_single_link_order_b_a_succeed t_11223_weak_single_link_order_b_a_succeed: $(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o - "$(CC)" -c power.c -o fast_power_w6.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w6.o + "$(TEST_CC)" -c power.c -o fast_power_w6.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/19b7a0af2172a42989f23f1ba1d11374bd980d40 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/19b7a0af2172a42989f23f1ba1d11374bd980d40 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 07:36:56 2024 From: gitlab at gitlab.haskell.org (Sylvain Henry (@hsyl20)) Date: Fri, 12 Jul 2024 03:36:56 -0400 Subject: [Git][ghc/ghc][wip/remove-cc-var] testsuite: Replace $CC with $TEST_CC Message-ID: <6690dd18ec990_2c216e67ff764168491@gitlab.mail> Sylvain Henry pushed to branch wip/remove-cc-var at Glasgow Haskell Compiler / GHC Commits: c240f9e3 by Matthew Pickering at 2024-07-12T09:36:47+02:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 4 changed files: - testsuite/tests/rts/Makefile - testsuite/tests/rts/all.T - testsuite/tests/rts/linker/Makefile - testsuite/tests/rts/linker/T11223/Makefile Changes: ===================================== testsuite/tests/rts/Makefile ===================================== @@ -23,8 +23,8 @@ T4059: ./T4059 exec_signals-prep: - $(CC) -o exec_signals_child exec_signals_child.c - $(CC) -o exec_signals_prepare exec_signals_prepare.c + $(TEST_CC) -o exec_signals_child exec_signals_child.c + $(TEST_CC) -o exec_signals_prepare exec_signals_prepare.c .PHONY: T4850 T4850: ===================================== testsuite/tests/rts/all.T ===================================== @@ -221,7 +221,12 @@ test('exec_signals', [when(opsys('mingw32'), skip), pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'), cmd_prefix('./exec_signals_prepare'), - req_process], + req_process, + req_c], # C compiler is used to build exec_signals_prepare/child programs. + # With the JS backend, it fails because these programs are + # compiled with Emscipten and they can't be directly executed + # (permission denied error); they must be loaded in nodejs (or + # compiled with the host CC compiler). compile_and_run, ['']) test('return_mem_to_os', normal, compile_and_run, ['']) ===================================== testsuite/tests/rts/linker/Makefile ===================================== @@ -69,7 +69,7 @@ linker_unload_native: $(RM) Test.o Test.hi Test.a Test.so Test2.so "$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 -dynamic -fPIC -o Test.a # only libraries without DT_NEEDED are supported - "$(CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ + "$(TEST_CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ -Wl,--whole-archive Test.a cp Test.so Test2.so ===================================== testsuite/tests/rts/linker/T11223/Makefile ===================================== @@ -11,44 +11,44 @@ CC=$(TEST_CC) .PHONY: t_11223_simple_link t_11223_simple_link: $(RM) -f foo_simple.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_simple.o + "$(TEST_CC)" -c foo.c -o foo_simple.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs .PHONY: t_11223_simple_link_lib t_11223_simple_link_lib: $(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a - "$(CC)" -c foo.c -o foo_lib.o + "$(TEST_CC)" -c foo.c -o foo_lib.o "$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)" .PHONY: t_11223_simple_duplicate t_11223_simple_duplicate: $(RM) -f foo_dup.o bar_dup.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_dup.o - "$(CC)" -c bar.c -o bar_dup.o + "$(TEST_CC)" -c foo.c -o foo_dup.o + "$(TEST_CC)" -c bar.c -o bar_dup.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs .PHONY: t_11223_simple_duplicate_lib t_11223_simple_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libfoo_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)" .PHONY: t_11223_simple_unused_duplicate_lib t_11223_simple_unused_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libbar_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)" .PHONY: t_11223_link_order_a_b_succeed t_11223_link_order_a_b_succeed: $(RM) -f foo_link_lib_1.o bar_link_lib_1.o foo.hi foo.o libbar_link_lib_1.a libfoo_link_lib_1.a - "$(CC)" -c foo.c -o foo_link_lib_1.o - "$(CC)" -c bar.c -o bar_link_lib_1.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_1.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_1.o "$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null "$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)" @@ -56,8 +56,8 @@ t_11223_link_order_a_b_succeed: .PHONY: t_11223_link_order_b_a_succeed t_11223_link_order_b_a_succeed: $(RM) -f foo_link_lib_2.o bar_link_lib_2.o foo.hi foo.o libbar_link_lib_2.a libfoo_link_lib_2.a - "$(CC)" -c foo.c -o foo_link_lib_2.o - "$(CC)" -c bar.c -o bar_link_lib_2.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_2.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_2.o "$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null "$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)" @@ -65,8 +65,8 @@ t_11223_link_order_b_a_succeed: .PHONY: t_11223_link_order_a_b_2_fail t_11223_link_order_a_b_2_fail: $(RM) -f foo_link_lib_3.o bar_link_lib_3.o foo.hi foo.o libbar_link_lib_3.a libfoo_link_lib_3.a - "$(CC)" -c foo.c -o foo_link_lib_3.o - "$(CC)" -c bar.c -o bar_link_lib_3.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_3.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_3.o "$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null "$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)" @@ -74,8 +74,8 @@ t_11223_link_order_a_b_2_fail: .PHONY: t_11223_link_order_b_a_2_succeed t_11223_link_order_b_a_2_succeed: $(RM) -f foo_link_lib_4.o bar_link_lib_4.o foo.hi foo.o libbar_link_lib_4.a libfoo_link_lib_4.a - "$(CC)" -c foo.c -o foo_link_lib_4.o - "$(CC)" -c bar.c -o bar_link_lib_4.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_4.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_4.o "$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null "$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)" @@ -87,40 +87,40 @@ t_11223_link_order_b_a_2_succeed: .PHONY: t_11223_weak_only_link_fail t_11223_weak_only_link_fail: $(RM) -f power_w1.o power.hi power.o - "$(CC)" -c power.c -DWEAK -o power_w1.o + "$(TEST_CC)" -c power.c -DWEAK -o power_w1.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o .PHONY: t_11223_weak_only_link_succeed t_11223_weak_only_link_succeed: $(RM) -f power_w2.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o power_w2.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o power_w2.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o .PHONY: t_11223_weak_both_link_order_a_b_succeed t_11223_weak_both_link_order_a_b_succeed: $(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o - "$(CC)" -c power.c -DWEAK -o fast_power_w3.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w3.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w3.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o .PHONY: t_11223_weak_both_link_order_b_a_succeed t_11223_weak_both_link_order_b_a_succeed: $(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o - "$(CC)" -c power.c -DWEAK -o fast_power_w4.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w4.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w4.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o .PHONY: t_11223_weak_single_link_order_a_b_succeed t_11223_weak_single_link_order_a_b_succeed: $(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o - "$(CC)" -c power_slow.c -o slow_power_w5.o - "$(CC)" -c power.c -DWEAK -o fast_power_w5.o + "$(TEST_CC)" -c power_slow.c -o slow_power_w5.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w5.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o .PHONY: t_11223_weak_single_link_order_b_a_succeed t_11223_weak_single_link_order_b_a_succeed: $(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o - "$(CC)" -c power.c -o fast_power_w6.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w6.o + "$(TEST_CC)" -c power.c -o fast_power_w6.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c240f9e316d2458266e431ca1474c50450978d79 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c240f9e316d2458266e431ca1474c50450978d79 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 08:47:51 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Fri, 12 Jul 2024 04:47:51 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: Use xmm registers in genapply Message-ID: <6690edb77be1d_27caeb667fd89199f@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: c298e0b6 by sheaf at 2024-07-12T10:43:51+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - c52aa4a8 by sheaf at 2024-07-12T10:46:51+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 65ed3096 by sheaf at 2024-07-12T10:47:23+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - df40af81 by sheaf at 2024-07-12T10:47:26+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - f6edcc27 by sheaf at 2024-07-12T10:47:26+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - a404de12 by sheaf at 2024-07-12T10:47:26+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82f8f06c6d55ee3149f2ab912c73c3569d350f75...a404de1254f7185128a8566ebce23ec418bf2c23 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/82f8f06c6d55ee3149f2ab912c73c3569d350f75...a404de1254f7185128a8566ebce23ec418bf2c23 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 08:50:41 2024 From: gitlab at gitlab.haskell.org (Hannes Siebenhandl (@fendor)) Date: Fri, 12 Jul 2024 04:50:41 -0400 Subject: [Git][ghc/ghc][wip/perf-ci] 63 commits: GHCi interpreter: Tag constructor closures when possible. Message-ID: <6690ee60edc2e_27caeb8f1c189434a@gitlab.mail> Hannes Siebenhandl pushed to branch wip/perf-ci at Glasgow Haskell Compiler / GHC Commits: 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 4ee2fabb by Fendor at 2024-07-12T10:48:16+02:00 testsuite: Add support to capture performance metrics via 'perf' Performance metrics collected via 'perf' can be more accurate for run-time performance than GHC's rts, due to the usage of hardware counters. We allow performance tests to also record PMU events according to 'perf list'. - - - - - 0b9e66b6 by Fendor at 2024-07-12T10:48:16+02:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 52682e02 by Fendor at 2024-07-12T10:48:16+02:00 Enable perf profiling for compiler performance tests - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/739f71468c45ecdebc12b350f946c661facef53b...52682e0254ce27599a949b8a93f1c423f02d6843 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/739f71468c45ecdebc12b350f946c661facef53b...52682e0254ce27599a949b8a93f1c423f02d6843 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 08:50:38 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Fri, 12 Jul 2024 04:50:38 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: Use xmm registers in genapply Message-ID: <6690ee5ec26ed_27caeb8ef09494128@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: af89b407 by sheaf at 2024-07-12T10:50:12+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - db877fe3 by sheaf at 2024-07-12T10:50:15+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - b0de3c88 by sheaf at 2024-07-12T10:50:16+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 21c316b7 by sheaf at 2024-07-12T10:50:16+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 0cf2bc76 by sheaf at 2024-07-12T10:50:16+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 0f603b13 by sheaf at 2024-07-12T10:50:16+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a404de1254f7185128a8566ebce23ec418bf2c23...0f603b13b87479e95ecd68969b36150230dc6a77 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a404de1254f7185128a8566ebce23ec418bf2c23...0f603b13b87479e95ecd68969b36150230dc6a77 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 08:51:49 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 04:51:49 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 13 commits: compiler: Fingerprint -fwrite-if-simplified-core Message-ID: <6690eea5ca996_27caebac8168104446@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: c718fc8b by Zubin Duggal at 2024-07-12T04:50:09-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - a18c8b99 by Matthew Pickering at 2024-07-12T04:50:09-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 5cbd08ae by Matthew Pickering at 2024-07-12T04:50:09-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - c9b25481 by Alex Mason at 2024-07-12T04:50:14-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 40d229c6 by Sylvain Henry at 2024-07-12T04:50:29-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - a2476451 by Sylvain Henry at 2024-07-12T04:50:29-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - 473d7565 by Sylvain Henry at 2024-07-12T04:50:29-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 4e7d206f by Simon Peyton Jones at 2024-07-12T04:50:29-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 2cb435c7 by Alan Zimmerman at 2024-07-12T04:50:30-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 736ce109 by Matthew Pickering at 2024-07-12T04:50:30-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - e15d929e by Matthew Pickering at 2024-07-12T04:50:30-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 5ac32486 by Adam Sandberg Ericsson at 2024-07-12T04:50:31-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - c751c583 by Hécate Kleidukos at 2024-07-12T04:50:36-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c7ee50f27a76dee27eddf8bb058864f3d3863d2...c751c583e07a68876f00288686555b2925e6b664 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c7ee50f27a76dee27eddf8bb058864f3d3863d2...c751c583e07a68876f00288686555b2925e6b664 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 09:27:37 2024 From: gitlab at gitlab.haskell.org (Teo Camarasu (@teo)) Date: Fri, 12 Jul 2024 05:27:37 -0400 Subject: [Git][ghc/ghc][wip/T24150-9.10] rts: Allocate non-moving segments with megablocks Message-ID: <6690f7093ce8c_27caeb11361081258a9@gitlab.mail> Teo Camarasu pushed to branch wip/T24150-9.10 at Glasgow Haskell Compiler / GHC Commits: c9799fe6 by Teo Camarasu at 2024-07-12T10:27:11+01:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T18223 T19695 ------------------------- (cherry picked from commit 5e36e7ced6a8aa183762e1df97da20b460e19bcf) - - - - - 17 changed files: - + docs/users_guide/9.10.2-notes.rst - docs/users_guide/eventlog-formats.rst - rts/RtsStartup.c - rts/Trace.c - rts/Trace.h - rts/eventlog/EventLog.c - rts/eventlog/EventLog.h - rts/gen_event_types.py - rts/include/rts/storage/Block.h - rts/include/stg/SMP.h - rts/sm/BlockAlloc.c - rts/sm/GC.c - rts/sm/NonMoving.c - rts/sm/NonMoving.h - rts/sm/NonMovingAllocate.c - rts/sm/Sanity.c - testsuite/tests/rts/atomicinc.c Changes: ===================================== docs/users_guide/9.10.2-notes.rst ===================================== @@ -0,0 +1,89 @@ +.. _release-9-10-2: + +Version 9.10.2 +============== +The significant changes to the various parts of the compiler are listed in the +following sections. See the `migration guide +`_ on the GHC Wiki +for specific guidance on migrating programs to this release. + +Language +~~~~~~~~ + + +Compiler +~~~~~~~~ + + +JavaScript backend +~~~~~~~~~~~~~~~~~~ + +WebAssembly backend +~~~~~~~~~~~~~~~~~~~ + +GHCi +~~~~ + +Runtime system +~~~~~~~~~~~~~~ + +- Reduce fragmentation incurred by the nonmoving GC's segment allocator. In one application this reduced resident set size by 26%. See :ghc-ticket:`24150`. + +``base`` library +~~~~~~~~~~~~~~~~ + +``ghc`` library +~~~~~~~~~~~~~~~ + +``ghc-heap`` library +~~~~~~~~~~~~~~~~~~~~ + +``ghc-experimental`` library +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``template-haskell`` library +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Included libraries +~~~~~~~~~~~~~~~~~~ + +The package database provided with this distribution also contains a number of +packages other than GHC itself. See the changelogs provided with these packages +for further change information. + +.. ghc-package-list:: + + libraries/array/array.cabal: Dependency of ``ghc`` library + libraries/base/base.cabal: Core library + libraries/binary/binary.cabal: Dependency of ``ghc`` library + libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library + libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility + libraries/Cabal/Cabal-syntax/Cabal-syntax.cabal: Dependency of ``ghc-pkg`` utility + libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library + libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library + libraries/directory/directory.cabal: Dependency of ``ghc`` library + libraries/exceptions/exceptions.cabal: Dependency of ``ghc`` and ``haskeline`` library + libraries/filepath/filepath.cabal: Dependency of ``ghc`` library + compiler/ghc.cabal: The compiler itself + libraries/ghci/ghci.cabal: The REPL interface + libraries/ghc-boot/ghc-boot.cabal: Internal compiler library + libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library + libraries/ghc-compact/ghc-compact.cabal: Core library + libraries/ghc-heap/ghc-heap.cabal: GHC heap-walking library + libraries/ghc-prim/ghc-prim.cabal: Core library + libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable + libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable + libraries/integer-gmp/integer-gmp.cabal: Core library + libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library + libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library + libraries/pretty/pretty.cabal: Dependency of ``ghc`` library + libraries/process/process.cabal: Dependency of ``ghc`` library + libraries/stm/stm.cabal: Dependency of ``haskeline`` library + libraries/template-haskell/template-haskell.cabal: Core library + libraries/terminfo/terminfo.cabal: Dependency of ``haskeline`` library + libraries/text/text.cabal: Dependency of ``Cabal`` library + libraries/time/time.cabal: Dependency of ``ghc`` library + libraries/transformers/transformers.cabal: Dependency of ``ghc`` library + libraries/unix/unix.cabal: Dependency of ``ghc`` library + libraries/Win32/Win32.cabal: Dependency of ``ghc`` library + libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable ===================================== docs/users_guide/eventlog-formats.rst ===================================== @@ -855,6 +855,9 @@ A typical non-moving collection cycle will look something like the following: 12. A :event-type:`NONMOVING_HEAP_CENSUS` event will be emitted describing the fragmentation state of the non-moving heap. +13. A :event-type:`NONMOVING_PRUNED_SEGMENTS` event will be emitted showing + information about freeing of segments. + .. event-type:: CONC_MARK_BEGIN @@ -929,6 +932,17 @@ heap. Describes the occupancy of the *blk_sz* sub-heap. +.. event-type:: NONMOVING_PRUNED_SEGMENTS + + :tag: 208 + :length: fixed + :field Word32: number of pruned segments. + :field Word32: number of segments remaining on the free list. + + Report the amount of segments pruned and those remaining on the nonmoving + heap's segment free list. Segments will be retained on the free list until + the entire megablock containing them can be freed. + .. _ticky-event-format: Ticky counters ===================================== rts/RtsStartup.c ===================================== @@ -454,7 +454,7 @@ hs_exit_(bool wait_foreign) uint32_t g, i; // N.B. atomic_dec returns the new value. - StgInt init_count = (StgInt)atomic_dec(&hs_init_count); + StgInt init_count = (StgInt)atomic_dec(&hs_init_count, 1); if (init_count > 0) { // ignore until it's the last one return; ===================================== rts/Trace.c ===================================== @@ -926,6 +926,12 @@ void traceNonmovingHeapCensus(uint16_t blk_size, postNonmovingHeapCensus(blk_size, census); } +void traceNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments) +{ + if (eventlog_enabled && TRACE_nonmoving_gc) + postNonmovingPrunedSegments(pruned_segments, free_segments); +} + void traceThreadStatus_ (StgTSO *tso USED_IF_DEBUG) { #if defined(DEBUG) ===================================== rts/Trace.h ===================================== @@ -331,6 +331,7 @@ void traceConcSweepEnd(void); void traceConcUpdRemSetFlush(Capability *cap); void traceNonmovingHeapCensus(uint16_t blk_size, const struct NonmovingAllocCensus *census); +void traceNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments); void traceIPE(const InfoProvEnt *ipe); void flushTrace(void); ===================================== rts/eventlog/EventLog.c ===================================== @@ -1154,6 +1154,15 @@ void postNonmovingHeapCensus(uint16_t blk_size, RELEASE_LOCK(&eventBufMutex); } +void postNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments) +{ + ACQUIRE_LOCK(&eventBufMutex); + postEventHeader(&eventBuf, EVENT_NONMOVING_PRUNED_SEGMENTS); + postWord32(&eventBuf, pruned_segments); + postWord32(&eventBuf, free_segments); + RELEASE_LOCK(&eventBufMutex); +} + void closeBlockMarker (EventsBuf *ebuf) { if (ebuf->marker) ===================================== rts/eventlog/EventLog.h ===================================== @@ -196,6 +196,7 @@ void postConcUpdRemSetFlush(Capability *cap); void postConcMarkEnd(StgWord32 marked_obj_count); void postNonmovingHeapCensus(uint16_t blk_size, const struct NonmovingAllocCensus *census); +void postNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments); #if defined(TICKY_TICKY) void postTickyCounterDefs(StgEntCounter *p); ===================================== rts/gen_event_types.py ===================================== @@ -132,6 +132,7 @@ event_types = [ EventType(205, 'CONC_SWEEP_END', [], 'End concurrent sweep phase'), EventType(206, 'CONC_UPD_REM_SET_FLUSH', [CapNo], 'Update remembered set flushed'), EventType(207, 'NONMOVING_HEAP_CENSUS', [Word16, Word32, Word32, Word32], 'Nonmoving heap census'), + EventType(208, 'NONMOVING_PRUNED_SEGMENTS', [Word32, Word32], 'Report the amount of segments pruned and remaining on the free list.'), # Ticky-ticky profiling EventType(210, 'TICKY_COUNTER_DEF', VariableLength, 'Ticky-ticky entry counter definition'), ===================================== rts/include/rts/storage/Block.h ===================================== @@ -323,6 +323,10 @@ bdescr *allocGroupOnNode(uint32_t node, W_ n); // bdescr *allocAlignedGroupOnNode(uint32_t node, W_ n); +// Allocate a MBlock worth of `n` block sized chunks aligned at `n`-block boundry. +// This returns a linked list of `bdescr` of length `BLOCKS_PER_MBLOCK / n`. +bdescr *allocMBlockAlignedGroupOnNode(uint32_t node, W_ n); + EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node); EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node) { ===================================== rts/include/stg/SMP.h ===================================== @@ -82,13 +82,13 @@ EXTERN_INLINE StgWord cas_seq_cst_relaxed(StgVolatilePtr p, StgWord o, StgWord n EXTERN_INLINE StgWord atomic_inc(StgVolatilePtr p, StgWord n); /* - * Atomic decrement + * Atomic subtraction by the provided quantity. * - * atomic_dec(p) { - * return --(*p); + * atomic_dec(p, n) { + * return ((*p) -= n); * } */ -EXTERN_INLINE StgWord atomic_dec(StgVolatilePtr p); +EXTERN_INLINE StgWord atomic_dec(StgVolatilePtr p, StgWord n); /* * Busy-wait nop: this is a hint to the CPU that we are currently in a @@ -479,9 +479,9 @@ atomic_inc(StgVolatilePtr p, StgWord incr) } EXTERN_INLINE StgWord -atomic_dec(StgVolatilePtr p) +atomic_dec(StgVolatilePtr p, StgWord decr) { - return __atomic_sub_fetch(p, 1, __ATOMIC_SEQ_CST); + return __atomic_sub_fetch(p, decr, __ATOMIC_SEQ_CST); } /* @@ -628,9 +628,9 @@ atomic_inc(StgVolatilePtr p, StgWord incr) } INLINE_HEADER StgWord -atomic_dec(StgVolatilePtr p) +atomic_dec(StgVolatilePtr p, StgWord decr) { - return --(*p); + return ((*p) -= decr); } #endif ===================================== rts/sm/BlockAlloc.c ===================================== @@ -394,6 +394,53 @@ split_block_low (bdescr *bd, W_ n) } +// A variant of `split_block_high` where we keep both blocks. +// The returned block has size `n`, which is split off `bd`. +static bdescr * +split_block_high_no_free (bdescr *bd, W_ n) +{ + ASSERT(bd->blocks > n); + + bdescr* ret = bd + bd->blocks - n; // take n blocks off the end + ret->blocks = n; + ret->start = ret->free = bd->start + (bd->blocks - n)*BLOCK_SIZE_W; + ret->link = NULL; + + bd->blocks -= n; + + setup_tail(ret); + setup_tail(bd); + + return ret; +} + +// Allocate a MBlock worth of `n` block sized chunks aligned at `n`-block boundry. +// This returns a linked list of `bdescr` of length `BLOCKS_PER_MBLOCK / n`. +// We assume relevant locks are held. +bdescr * +allocMBlockAlignedGroupOnNode(uint32_t node, W_ n) +{ + bdescr *bd = allocGroupOnNode(node, BLOCKS_PER_MBLOCK); + + // Free unaligned blocks, as we can't use these. + ASSERT(bd->blocks == BLOCKS_PER_MBLOCK); + bd = split_block_high(bd, bd->blocks - bd->blocks % n); + ASSERT(bd->blocks % n == 0); + + bdescr *last = NULL; + bdescr *chunk = NULL; + // Chain the aligned groups together into a linked-list + while (bd->blocks > n) { + chunk = split_block_high_no_free(bd, n); + chunk->link = last; + last = chunk; + } + bd->link = chunk; + + return bd; +} + + /* Find a fitting block for the allocation request in the given free list. Returns: - not NULL: when an exact match was found in the free list. ===================================== rts/sm/GC.c ===================================== @@ -1313,7 +1313,7 @@ dec_running (void) ACQUIRE_LOCK(&gc_running_mutex); #endif - StgWord r = atomic_dec(&gc_running_threads); + StgWord r = atomic_dec(&gc_running_threads, 1); #if defined(THREADED_RTS) if (r == 0) { ===================================== rts/sm/NonMoving.c ===================================== @@ -248,6 +248,8 @@ static void nonmovingBumpEpoch(void) { * * - Note [Allocator sizes] goes into detail about our choice of allocator sizes. * + * - Note [Segment allocation strategy] explains our segment allocation strategy. + * * [ueno 2016]: * Katsuhiro Ueno and Atsushi Ohori. 2016. A fully concurrent garbage * collector for functional programs on multicore processors. SIGPLAN Not. 51, @@ -560,6 +562,22 @@ static void nonmovingBumpEpoch(void) { * * See #23340 * + * Note [Segment allocation strategy] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Non-moving segments must be aligned. In order, to efficiently service these + * allocations, we allocate segments in bulk + * We allocate an entire megablocks worth of segments at once. + * All unused segments are placed on the `nonmovingHeap.free` list. + * + * Symmetrically we only de-allocate segments if all the segments in a megablock are free-able, ie, + * are on `nonmovingHeap.free`. We prune the free list in `nonmovingPruneFreeSegmentList`, + * called during concurrent sweep phase. + * Note that during pruning of the free list, free segments are not available for use by the + * mutator. This might lead to extra allocation of segments. But the risk is low as just after sweep + * there is usually a large amount of partially full segments, and pruning the free list is quite + * quick. + * + * See #24150 */ memcount nonmoving_segment_live_words = 0; @@ -578,19 +596,6 @@ static void nonmovingExitConcurrentWorker(void); // Add a segment to the free list. void nonmovingPushFreeSegment(struct NonmovingSegment *seg) { - // See Note [Live data accounting in nonmoving collector]. - if (RELAXED_LOAD(&nonmovingHeap.n_free) > NONMOVING_MAX_FREE) { - bdescr *bd = Bdescr((StgPtr) seg); - ACQUIRE_SM_LOCK; - ASSERT(oldest_gen->n_blocks >= bd->blocks); - ASSERT(oldest_gen->n_words >= BLOCK_SIZE_W * bd->blocks); - oldest_gen->n_blocks -= bd->blocks; - oldest_gen->n_words -= BLOCK_SIZE_W * bd->blocks; - freeGroup(bd); - RELEASE_SM_LOCK; - return; - } - SET_SEGMENT_STATE(seg, FREE); while (true) { struct NonmovingSegment *old = nonmovingHeap.free; @@ -601,6 +606,110 @@ void nonmovingPushFreeSegment(struct NonmovingSegment *seg) __sync_add_and_fetch(&nonmovingHeap.n_free, 1); } +static int +cmp_segment_ptr (const void *x, const void *y) +{ + const struct NonMovingSegment *p1 = *(const struct NonMovingSegment**)x; + const struct NonMovingSegment *p2 = *(const struct NonMovingSegment**)y; + if (p1 > p2) return +1; + else if (p1 < p2) return -1; + else return 0; +} + +// Prune the free list of segments that can be freed. +// Segments can be freed if all segments from a mblock are on the free list. +void nonmovingPruneFreeSegmentList(void) +{ + trace(TRACE_nonmoving_gc, "Pruning free segment list."); + // Atomically grab the entire free list. + struct NonmovingSegment *free; + size_t length; + while (true) { + free = ACQUIRE_LOAD(&nonmovingHeap.free); + length = ACQUIRE_LOAD(&nonmovingHeap.n_free); + if (cas((StgVolatilePtr) &nonmovingHeap.free, + (StgWord) free, + (StgWord) NULL) == (StgWord) free) { + atomic_dec((StgVolatilePtr) &nonmovingHeap.n_free, length); + break; + } + // Save the current free list so the sanity checker can see these segments. + nonmovingHeap.saved_free = free; + } + + // Sort the free list by address. + struct NonmovingSegment **sorted = stgMallocBytes(sizeof(struct NonmovingSegment*) * length, "sorted free segment list"); + for(size_t i = 0; ilink; + } + // we should have reached the end of the free list + ASSERT(free == NULL); + + qsort(sorted, length, sizeof(struct NonmovingSegment*), cmp_segment_ptr); + + // Walk the sorted list and either: + // - free segments if the entire megablock is free + // - put it back on the free list + size_t new_length = 0; + size_t free_in_megablock = 0; + // iterate through segments by megablock + for(size_t i = 0; ilink = last; + new_length++; + } + } else { + // the megablock is free, so let's free all the segments. + ACQUIRE_SM_LOCK; + for(size_t j = 0; j < free_in_megablock;j++){ + bdescr *bd = Bdescr((StgPtr)sorted[i+j]); + freeGroup(bd); + } + RELEASE_SM_LOCK; + } + } + stgFree(sorted); + // If we have any segments left over, then put them back on the free list. + if(free) { + struct NonmovingSegment* tail = free; + while(tail->link) { + tail = tail->link; + } + while (true) { + struct NonmovingSegment* rest = ACQUIRE_LOAD(&nonmovingHeap.free); + tail->link = rest; + if (cas((StgVolatilePtr) &nonmovingHeap.free, + (StgWord) rest, + (StgWord) free) == (StgWord) rest) { + __sync_add_and_fetch(&nonmovingHeap.n_free, new_length); + break; + } + } + } + size_t pruned_segments = length - new_length; + // See Note [Live data accounting in nonmoving collector]. + oldest_gen->n_blocks -= pruned_segments * NONMOVING_SEGMENT_BLOCKS; + oldest_gen->n_words -= pruned_segments * NONMOVING_SEGMENT_SIZE; + nonmovingHeap.saved_free = NULL; + debugTrace(DEBUG_nonmoving_gc, + "Pruned %d free segments, leaving %d on the free segment list.", + pruned_segments, new_length); + traceNonmovingPrunedSegments(pruned_segments, new_length); + trace(TRACE_nonmoving_gc, "Finished pruning free segment list."); + +} + void nonmovingInitAllocator(struct NonmovingAllocator* alloc, uint16_t block_size) { *alloc = (struct NonmovingAllocator) @@ -1216,6 +1325,7 @@ concurrent_marking: nonmovingSweepStableNameTable(); nonmovingSweep(); + nonmovingPruneFreeSegmentList(); ASSERT(nonmovingHeap.sweep_list == NULL); debugTrace(DEBUG_nonmoving_gc, "Finished sweeping."); traceConcSweepEnd(); ===================================== rts/sm/NonMoving.h ===================================== @@ -119,16 +119,16 @@ extern uint8_t nonmoving_alloca_dense_cnt; // NONMOVING_SEGMENT_SIZE (in bytes) extern uint8_t nonmoving_alloca_cnt; -// maximum number of free segments to hold on to -#define NONMOVING_MAX_FREE 16 - struct NonmovingHeap { struct NonmovingAllocator *allocators; - // free segment list. This is a cache where we keep up to - // NONMOVING_MAX_FREE segments to avoid thrashing the block allocator. + // free segment list. This is a cache where we keep segments + // belonging to megablocks that are only partially free. // Note that segments in this list are still counted towards // oldest_gen->n_blocks. struct NonmovingSegment *free; + // saved free segment list, so the sanity checker can + // see the segments while the free list is being pruned. + struct NonmovingSegment *saved_free; // how many segments in free segment list? accessed atomically. unsigned int n_free; @@ -172,6 +172,7 @@ void nonmovingCollect(StgWeak **dead_weaks, bool concurrent); void nonmovingPushFreeSegment(struct NonmovingSegment *seg); +void nonmovingPruneFreeSegmentList(void); INLINE_HEADER unsigned long log2_ceil(unsigned long x) { ===================================== rts/sm/NonMovingAllocate.c ===================================== @@ -65,19 +65,42 @@ static struct NonmovingSegment *nonmovingAllocSegment(enum AllocLockMode mode, u struct NonmovingSegment *ret; ret = nonmovingPopFreeSegment(); - // Nothing in the free list, allocate a new segment... + // Nothing in the free list, allocate a new segment. + // We allocate a full megablock, and add spare segments to our free list. if (ret == NULL) { acquire_alloc_lock(mode); - bdescr *bd = allocAlignedGroupOnNode(node, NONMOVING_SEGMENT_BLOCKS); - // See Note [Live data accounting in nonmoving collector]. - oldest_gen->n_blocks += bd->blocks; - oldest_gen->n_words += BLOCK_SIZE_W * bd->blocks; + // Another thread might have allocated while we were waiting for the lock. + ret = nonmovingPopFreeSegment(); + if (ret != NULL) { + release_alloc_lock(mode); + // Check alignment + ASSERT(((uintptr_t)ret % NONMOVING_SEGMENT_SIZE) == 0); + return ret; + } + + bdescr *bd = allocMBlockAlignedGroupOnNode(node, NONMOVING_SEGMENT_BLOCKS); release_alloc_lock(mode); - for (StgWord32 i = 0; i < bd->blocks; ++i) { + W_ alloc_blocks = BLOCKS_PER_MBLOCK - (BLOCKS_PER_MBLOCK % NONMOVING_SEGMENT_BLOCKS); + + // See Note [Live data accounting in nonmoving collector]. + oldest_gen->n_blocks += alloc_blocks; + oldest_gen->n_words += BLOCK_SIZE_W * alloc_blocks; + + for (StgWord32 i = 0; i < alloc_blocks; ++i) { initBdescr(&bd[i], oldest_gen, oldest_gen); bd[i].flags = BF_NONMOVING; } + + // Push all but the last segment to the free segment list. + while(bd->link) { + bdescr *next_bd = bd->link; + bd->link = NULL; + nonmovingPushFreeSegment((struct NonmovingSegment *)bd->start); + bd = next_bd; + } + + // Use the last segment to service the allocation. ret = (struct NonmovingSegment *)bd->start; } ===================================== rts/sm/Sanity.c ===================================== @@ -1238,6 +1238,7 @@ countNonMovingHeap(struct NonmovingHeap *heap) } ret += countNonMovingSegments(heap->sweep_list); ret += countNonMovingSegments(heap->free); + ret += countNonMovingSegments(heap->saved_free); return ret; } ===================================== testsuite/tests/rts/atomicinc.c ===================================== @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) CHECK(j == 1); CHECK(i == 1); - j = atomic_dec(&i); + j = atomic_dec(&i,1); CHECK(j == 0); CHECK(i == 0); View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c9799fe6da7a2b49e99eccf7197f041dd87fd532 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c9799fe6da7a2b49e99eccf7197f041dd87fd532 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 09:56:58 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Fri, 12 Jul 2024 05:56:58 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 6 commits: The X86 SIMD patch. Message-ID: <6690fdea7f397_27caeb152cd9812979@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 5636dc29 by sheaf at 2024-07-12T11:56:33+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 2dae414d by sheaf at 2024-07-12T11:56:36+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 8f9d3df2 by sheaf at 2024-07-12T11:56:37+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - f208e1a1 by sheaf at 2024-07-12T11:56:37+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 4a4e0b85 by sheaf at 2024-07-12T11:56:37+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 6acabf91 by sheaf at 2024-07-12T11:56:37+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0f603b13b87479e95ecd68969b36150230dc6a77...6acabf91bf358b153c73d3afcbba888cec58fb8b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0f603b13b87479e95ecd68969b36150230dc6a77...6acabf91bf358b153c73d3afcbba888cec58fb8b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 10:04:07 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Fri, 12 Jul 2024 06:04:07 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <6690ff97c8530_27caeb173dccc1321c2@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 8b2ceee7 by sheaf at 2024-07-12T12:03:56+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 395f7b7b by sheaf at 2024-07-12T12:03:56+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - b75bcc32 by sheaf at 2024-07-12T12:03:57+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 6467352a by sheaf at 2024-07-12T12:03:57+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - f13b09c9 by sheaf at 2024-07-12T12:03:57+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - + testsuite/tests/codeGen/should_run/T25062.hs - testsuite/tests/codeGen/should_run/all.T - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd011.stdout - utils/deriveConstants/Main.hs - utils/genapply/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6acabf91bf358b153c73d3afcbba888cec58fb8b...f13b09c9daa35dab229b81196ae1a5224514a3a7 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6acabf91bf358b153c73d3afcbba888cec58fb8b...f13b09c9daa35dab229b81196ae1a5224514a3a7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 10:53:15 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 12 Jul 2024 06:53:15 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] More explicit Message-ID: <66910b1af0953_27caeb1ea83f41435b6@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: fef3e436 by Matthew Pickering at 2024-07-12T11:52:35+01:00 More explicit - - - - - 23 changed files: - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/CommonBlockElim.hs - compiler/GHC/Cmm/ContFlowOpt.hs - compiler/GHC/Cmm/Dataflow/Graph.hs - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Dominators.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/Wasm/ControlFlow/FromCmm.hs Changes: ===================================== compiler/GHC/Cmm.hs ===================================== @@ -51,7 +51,7 @@ import GHC.Runtime.Heap.Layout import GHC.Cmm.Expr import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Utils.Outputable import Data.Void (Void) @@ -79,7 +79,7 @@ type CmmGroup = GenCmmGroup CmmStatics CmmTopInfo CmmGraph -- | Cmm group with SRTs type CmmGroupSRTs = GenCmmGroup RawCmmStatics CmmTopInfo CmmGraph -- | "Raw" cmm group (TODO (osa): not sure what that means) -type RawCmmGroup = GenCmmGroup RawCmmStatics (LabelMap RawCmmStatics) CmmGraph +type RawCmmGroup = GenCmmGroup RawCmmStatics (Det.LabelMap RawCmmStatics) CmmGraph ----------------------------------------------------------------------------- -- CmmDecl, GenCmmDecl @@ -131,7 +131,7 @@ cmmDataDeclCmmDecl = \ case type RawCmmDecl = GenCmmDecl RawCmmStatics - (LabelMap RawCmmStatics) + (Det.LabelMap RawCmmStatics) CmmGraph ----------------------------------------------------------------------------- @@ -145,7 +145,7 @@ type CmmBlock = Block CmmNode C C instance OutputableP Platform CmmGraph where pdoc = pprCmmGraph -toBlockMap :: CmmGraph -> LabelMap CmmBlock +toBlockMap :: CmmGraph -> Det.LabelMap CmmBlock toBlockMap (CmmGraph {g_graph=GMany NothingO body NothingO}) = body pprCmmGraph :: Platform -> CmmGraph -> SDoc @@ -163,7 +163,7 @@ revPostorder g = {-# SCC "revPostorder" #-} revPostorderFrom (toBlockMap g) (g_entry g) toBlockList :: CmmGraph -> [CmmBlock] -toBlockList g = mapElems $ toBlockMap g +toBlockList g = Det.mapElems $ toBlockMap g ----------------------------------------------------------------------------- -- Info Tables @@ -171,7 +171,7 @@ toBlockList g = mapElems $ toBlockMap g -- | CmmTopInfo is attached to each CmmDecl (see defn of CmmGroup), and contains -- the extra info (beyond the executable code) that belongs to that CmmDecl. -data CmmTopInfo = TopInfo { info_tbls :: LabelMap CmmInfoTable +data CmmTopInfo = TopInfo { info_tbls :: Det.LabelMap CmmInfoTable , stack_info :: CmmStackInfo } instance OutputableP Platform CmmTopInfo where @@ -183,7 +183,7 @@ pprTopInfo platform (TopInfo {info_tbls=info_tbl, stack_info=stack_info}) = text "stack_info: " <> ppr stack_info] topInfoTable :: GenCmmDecl a CmmTopInfo (GenCmmGraph n) -> Maybe CmmInfoTable -topInfoTable (CmmProc infos _ _ g) = mapLookup (g_entry g) (info_tbls infos) +topInfoTable (CmmProc infos _ _ g) = Det.mapLookup (g_entry g) (info_tbls infos) topInfoTable _ = Nothing data CmmStackInfo ===================================== compiler/GHC/Cmm/BlockId.hs ===================================== @@ -17,7 +17,7 @@ import GHC.Types.Name import GHC.Types.Unique import qualified GHC.Types.Unique.DSM as DSM -import GHC.Cmm.Dataflow.Label (Label, mkHooplLabel) +import qualified GHC.Cmm.Dataflow.Label as Det (Label, mkHooplLabel) ---------------------------------------------------------------- --- Block Ids, their environments, and their sets @@ -31,10 +31,10 @@ most assembly languages allow, a label is visible throughout the entire compilation unit in which it appears. -} -type BlockId = Label +type BlockId = Det.Label mkBlockId :: Unique -> BlockId -mkBlockId unique = mkHooplLabel $ getKey unique +mkBlockId unique = Det.mkHooplLabel $ getKey unique -- If the monad unique instance uses a deterministic unique supply, this will -- give you a deterministic unique. Otherwise, it will not. Note that from Cmm ===================================== compiler/GHC/Cmm/CommonBlockElim.hs ===================================== @@ -16,7 +16,8 @@ import GHC.Cmm.ContFlowOpt import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import Data.Functor.Classes (liftEq) import Data.Maybe (mapMaybe) import qualified Data.List as List @@ -62,7 +63,7 @@ import qualified Data.List.NonEmpty as NE elimCommonBlocks :: CmmGraph -> CmmGraph elimCommonBlocks g = replaceLabels env $ copyTicks env g where - env = iterate mapEmpty blocks_with_key + env = iterate NonDet.mapEmpty blocks_with_key -- The order of blocks doesn't matter here. While we could use -- revPostorder which drops unreachable blocks this is done in -- ContFlowOpt already which runs before this pass. So we use @@ -73,26 +74,26 @@ elimCommonBlocks g = replaceLabels env $ copyTicks env g -- Invariant: The blocks in the list are pairwise distinct -- (so avoid comparing them again) type DistinctBlocks = [CmmBlock] -type Key = [Label] -type Subst = LabelMap BlockId +type Key = [NonDet.Label] +type Subst = NonDet.LabelMap BlockId -- The outer list groups by hash. We retain this grouping throughout. iterate :: Subst -> [[(Key, DistinctBlocks)]] -> Subst iterate subst blocks - | mapNull new_substs = subst + | NonDet.mapNull new_substs = subst | otherwise = iterate subst' updated_blocks where grouped_blocks :: [[(Key, NonEmpty DistinctBlocks)]] grouped_blocks = map groupByLabel blocks merged_blocks :: [[(Key, DistinctBlocks)]] - (new_substs, merged_blocks) = List.mapAccumL (List.mapAccumL go) mapEmpty grouped_blocks + (new_substs, merged_blocks) = List.mapAccumL (List.mapAccumL go) NonDet.mapEmpty grouped_blocks where - go !new_subst1 (k,dbs) = (new_subst1 `mapUnion` new_subst2, (k,db)) + go !new_subst1 (k,dbs) = (new_subst1 `NonDet.mapUnion` new_subst2, (k,db)) where (new_subst2, db) = mergeBlockList subst dbs - subst' = subst `mapUnion` new_substs + subst' = subst `NonDet.mapUnion` new_substs updated_blocks = map (map (first (map (lookupBid subst')))) merged_blocks -- Combine two lists of blocks. @@ -100,21 +101,21 @@ iterate subst blocks mergeBlocks :: Subst -> DistinctBlocks -> DistinctBlocks -> (Subst, DistinctBlocks) mergeBlocks subst existing new = go new where - go [] = (mapEmpty, existing) + go [] = (NonDet.mapEmpty, existing) go (b:bs) = case List.find (eqBlockBodyWith (eqBid subst) b) existing of -- This block is a duplicate. Drop it, and add it to the substitution - Just b' -> first (mapInsert (entryLabel b) (entryLabel b')) $ go bs + Just b' -> first (NonDet.mapInsert (entryLabel b) (entryLabel b')) $ go bs -- This block is not a duplicate, keep it. Nothing -> second (b:) $ go bs mergeBlockList :: Subst -> NonEmpty DistinctBlocks -> (Subst, DistinctBlocks) -mergeBlockList subst (b:|bs) = go mapEmpty b bs +mergeBlockList subst (b:|bs) = go NonDet.mapEmpty b bs where go !new_subst1 b [] = (new_subst1, b) go !new_subst1 b1 (b2:bs) = go new_subst b bs where (new_subst2, b) = mergeBlocks subst b1 b2 - new_subst = new_subst1 `mapUnion` new_subst2 + new_subst = new_subst1 `NonDet.mapUnion` new_subst2 -- ----------------------------------------------------------------------------- @@ -197,10 +198,10 @@ dont_care _other = False -- Utilities: equality and substitution on the graph. -- Given a map ``subst'' from BlockID -> BlockID, we define equality. -eqBid :: LabelMap BlockId -> BlockId -> BlockId -> Bool +eqBid :: NonDet.LabelMap BlockId -> BlockId -> BlockId -> Bool eqBid subst bid bid' = lookupBid subst bid == lookupBid subst bid' -lookupBid :: LabelMap BlockId -> BlockId -> BlockId -lookupBid subst bid = case mapLookup bid subst of +lookupBid :: NonDet.LabelMap BlockId -> BlockId -> BlockId +lookupBid subst bid = case NonDet.mapLookup bid subst of Just bid -> lookupBid subst bid Nothing -> bid @@ -270,18 +271,18 @@ eqLastWith _ _ _ = False -- the same ticks as the respective "source" blocks. This not only -- means copying ticks, but also adjusting tick scopes where -- necessary. -copyTicks :: LabelMap BlockId -> CmmGraph -> CmmGraph +copyTicks :: NonDet.LabelMap BlockId -> CmmGraph -> CmmGraph copyTicks env g - | mapNull env = g - | otherwise = ofBlockMap (g_entry g) $ mapMap copyTo blockMap + | NonDet.mapNull env = g + | otherwise = ofBlockMap (g_entry g) $ Det.mapMap copyTo blockMap where -- Reverse block merge map blockMap = toBlockMap g - revEnv = mapFoldlWithKey insertRev M.empty env + revEnv = NonDet.nonDetMapFoldlWithKey insertRev M.empty env insertRev m k x = M.insertWith (const (k:)) x [k] m -- Copy ticks and scopes into the given block copyTo block = case M.lookup (entryLabel block) revEnv of Nothing -> block - Just ls -> foldr copy block $ mapMaybe (flip mapLookup blockMap) ls + Just ls -> foldr copy block $ mapMaybe (flip Det.mapLookup blockMap) ls copy from to = let ticks = blockTicks from CmmEntry _ scp0 = firstNode from @@ -293,7 +294,7 @@ copyTicks env g -- See Note [Compressed TrieMap] in GHC.Core.Map.Expr about the usage of GenMap. groupByLabel :: [(Key, DistinctBlocks)] -> [(Key, NonEmpty DistinctBlocks)] groupByLabel = - go (TM.emptyTM :: TM.ListMap (TM.GenMap LabelMap) (Key, NonEmpty DistinctBlocks)) + go (TM.emptyTM :: TM.ListMap (TM.GenMap NonDet.LabelMap) (Key, NonEmpty DistinctBlocks)) where go !m [] = TM.foldTM (:) m [] go !m ((k,v) : entries) = go (TM.alterTM k adjust m) entries ===================================== compiler/GHC/Cmm/ContFlowOpt.hs ===================================== @@ -11,7 +11,8 @@ import GHC.Prelude hiding (succ, unzip, zip) import GHC.Cmm.Dataflow.Block hiding (blockConcat) import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Utils @@ -139,13 +140,13 @@ cmmCfgOptsProc :: Bool -> CmmDecl -> CmmDecl cmmCfgOptsProc split (CmmProc info lbl live g) = CmmProc info' lbl live g' where (g', env) = blockConcat split g info' = info{ info_tbls = new_info_tbls } - new_info_tbls = mapFromList (map upd_info (mapToList (info_tbls info))) + new_info_tbls = Det.mapFromList (map upd_info (Det.mapToList (info_tbls info))) -- If we changed any labels, then we have to update the info tables -- too, except for the top-level info table because that might be -- referred to by other procs. upd_info (k,info) - | Just k' <- mapLookup k env + | Just k' <- NonDet.mapLookup k env = (k', if k' == g_entry g' then info else info{ cit_lbl = infoTblLbl k' }) @@ -154,7 +155,7 @@ cmmCfgOptsProc split (CmmProc info lbl live g) = CmmProc info' lbl live g' cmmCfgOptsProc _ top = top -blockConcat :: Bool -> CmmGraph -> (CmmGraph, LabelMap BlockId) +blockConcat :: Bool -> CmmGraph -> (CmmGraph, NonDet.LabelMap BlockId) blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } = (replaceLabels shortcut_map $ ofBlockMap new_entry new_blocks, shortcut_map') where @@ -162,9 +163,9 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- Remember to update the shortcut_map, since we also have to -- update the info_tbls mapping now. (new_entry, shortcut_map') - | Just entry_blk <- mapLookup entry_id new_blocks + | Just entry_blk <- Det.mapLookup entry_id new_blocks , Just dest <- canShortcut entry_blk - = (dest, mapInsert entry_id dest shortcut_map) + = (dest, NonDet.mapInsert entry_id dest shortcut_map) | otherwise = (entry_id, shortcut_map) @@ -179,7 +180,7 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- * map containing number of predecessors for each block. We discard -- it after we process all blocks. (new_blocks, shortcut_map, _) = - foldr maybe_concat (blockmap, mapEmpty, initialBackEdges) blocks + foldr maybe_concat (blockmap, NonDet.mapEmpty, initialBackEdges) blocks -- Map of predecessors for initial graph. We increase number of -- predecessors for entry block by one to denote that it is @@ -188,8 +189,8 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } initialBackEdges = incPreds entry_id (predMap blocks) maybe_concat :: CmmBlock - -> (LabelMap CmmBlock, LabelMap BlockId, LabelMap Int) - -> (LabelMap CmmBlock, LabelMap BlockId, LabelMap Int) + -> (Det.LabelMap CmmBlock, NonDet.LabelMap BlockId, NonDet.LabelMap Int) + -> (Det.LabelMap CmmBlock, NonDet.LabelMap BlockId, NonDet.LabelMap Int) maybe_concat block (!blocks, !shortcut_map, !backEdges) -- If: -- (1) current block ends with unconditional branch to b' and @@ -207,11 +208,11 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- we can ignore the contents of shortcut_map | CmmBranch b' <- last , hasOnePredecessor b' - , Just blk' <- mapLookup b' blocks + , Just blk' <- Det.mapLookup b' blocks = let bid' = entryLabel blk' - in ( mapDelete bid' $ mapInsert bid (splice head blk') blocks + in ( Det.mapDelete bid' $ Det.mapInsert bid (splice head blk') blocks , shortcut_map - , mapDelete b' backEdges ) + , NonDet.mapDelete b' backEdges ) -- If: -- (1) we are splitting proc points (see Note @@ -229,10 +230,10 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- with dest. | splitting_procs , Just b' <- callContinuation_maybe last - , Just blk' <- mapLookup b' blocks + , Just blk' <- Det.mapLookup b' blocks , Just dest <- canShortcut blk' - = ( mapInsert bid (blockJoinTail head (update_cont dest)) blocks - , mapInsert b' dest shortcut_map + = ( Det.mapInsert bid (blockJoinTail head (update_cont dest)) blocks + , NonDet.mapInsert b' dest shortcut_map , decPreds b' $ incPreds dest backEdges ) -- If: @@ -249,7 +250,7 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } | Nothing <- callContinuation_maybe last = let oldSuccs = successors last newSuccs = successors rewrite_last - in ( mapInsert bid (blockJoinTail head rewrite_last) blocks + in ( Det.mapInsert bid (blockJoinTail head rewrite_last) blocks , shortcut_map , if oldSuccs == newSuccs then backEdges @@ -273,7 +274,7 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } shortcut_last = mapSuccessors shortcut last where shortcut l = - case mapLookup l blocks of + case Det.mapLookup l blocks of Just b | Just dest <- canShortcut b -> dest _otherwise -> l @@ -307,7 +308,7 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } invertLikeliness = fmap not -- Number of predecessors for a block - numPreds bid = mapLookup bid backEdges `orElse` 0 + numPreds bid = NonDet.mapLookup bid backEdges `orElse` 0 hasOnePredecessor b = numPreds b == 1 @@ -344,11 +345,11 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- that invariant, but calling replaceLabels may introduce unreachable blocks. -- We rely on subsequent passes in the Cmm pipeline to remove unreachable -- blocks. -incPreds, decPreds :: BlockId -> LabelMap Int -> LabelMap Int -incPreds bid edges = mapInsertWith (+) bid 1 edges -decPreds bid edges = case mapLookup bid edges of - Just preds | preds > 1 -> mapInsert bid (preds - 1) edges - Just _ -> mapDelete bid edges +incPreds, decPreds :: BlockId -> NonDet.LabelMap Int -> NonDet.LabelMap Int +incPreds bid edges = NonDet.mapInsertWith (+) bid 1 edges +decPreds bid edges = case NonDet.mapLookup bid edges of + Just preds | preds > 1 -> NonDet.mapInsert bid (preds - 1) edges + Just _ -> NonDet.mapDelete bid edges _ -> edges @@ -384,13 +385,13 @@ callContinuation_maybe _ = Nothing -- Map over the CmmGraph, replacing each label with its mapping in the -- supplied LabelMap. -replaceLabels :: LabelMap BlockId -> CmmGraph -> CmmGraph +replaceLabels :: NonDet.LabelMap BlockId -> CmmGraph -> CmmGraph replaceLabels env g - | mapNull env = g + | NonDet.mapNull env = g | otherwise = replace_eid $ mapGraphNodes1 txnode g where replace_eid g = g {g_entry = lookup (g_entry g)} - lookup id = mapLookup id env `orElse` id + lookup id = NonDet.mapLookup id env `orElse` id txnode :: CmmNode e x -> CmmNode e x txnode (CmmBranch bid) = CmmBranch (lookup bid) @@ -409,21 +410,21 @@ replaceLabels env g exp (CmmStackSlot (Young id) i) = CmmStackSlot (Young (lookup id)) i exp e = e -mkCmmCondBranch :: CmmExpr -> Label -> Label -> Maybe Bool -> CmmNode O C +mkCmmCondBranch :: CmmExpr -> NonDet.Label -> NonDet.Label -> Maybe Bool -> CmmNode O C mkCmmCondBranch p t f l = if t == f then CmmBranch t else CmmCondBranch p t f l -- Build a map from a block to its set of predecessors. -predMap :: [CmmBlock] -> LabelMap Int -predMap blocks = foldr add_preds mapEmpty blocks +predMap :: [CmmBlock] -> NonDet.LabelMap Int +predMap blocks = foldr add_preds NonDet.mapEmpty blocks where add_preds block env = foldr add env (successors block) - where add lbl env = mapInsertWith (+) lbl 1 env + where add lbl env = NonDet.mapInsertWith (+) lbl 1 env -- Remove unreachable blocks from procs removeUnreachableBlocksProc :: Platform -> CmmDecl -> CmmDecl removeUnreachableBlocksProc _ proc@(CmmProc info lbl live g) - | used_blocks `lengthLessThan` mapSize (toBlockMap g) + | used_blocks `lengthLessThan` Det.mapSize (toBlockMap g) = CmmProc info' lbl live g' | otherwise = proc @@ -432,17 +433,17 @@ removeUnreachableBlocksProc _ proc@(CmmProc info lbl live g) info' = info { info_tbls = keep_used (info_tbls info) } -- Remove any info_tbls for unreachable - keep_used :: LabelMap CmmInfoTable -> LabelMap CmmInfoTable - keep_used bs = mapFoldlWithKey keep mapEmpty bs + keep_used :: Det.LabelMap CmmInfoTable -> Det.LabelMap CmmInfoTable + keep_used bs = Det.mapFoldlWithKey keep Det.mapEmpty bs - keep :: LabelMap CmmInfoTable -> Label -> CmmInfoTable -> LabelMap CmmInfoTable - keep env l i | l `setMember` used_lbls = mapInsert l i env + keep :: Det.LabelMap CmmInfoTable -> Det.Label -> CmmInfoTable -> Det.LabelMap CmmInfoTable + keep env l i | l `NonDet.setMember` used_lbls = Det.mapInsert l i env | otherwise = env used_blocks :: [CmmBlock] used_blocks = revPostorder g - used_lbls :: LabelSet - used_lbls = setFromList $ map entryLabel used_blocks + used_lbls :: NonDet.LabelSet + used_lbls = NonDet.setFromList $ map entryLabel used_blocks removeUnreachableBlocksProc platform data'@(CmmData _ _) = pprPanic "removeUnreachableBlocksProc: passed data declaration instead of procedure" (pdoc platform data') ===================================== compiler/GHC/Cmm/Dataflow/Graph.hs ===================================== @@ -20,16 +20,18 @@ module GHC.Cmm.Dataflow.Graph import GHC.Prelude import GHC.Utils.Misc -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label (Label) +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow.Block import Data.Kind -- | A (possibly empty) collection of closed/closed blocks -type Body n = LabelMap (Block n C C) +type Body n = Det.LabelMap (Block n C C) -- | @Body@ abstracted over @block@ -type Body' block (n :: Extensibility -> Extensibility -> Type) = LabelMap (block n C C) +type Body' block (n :: Extensibility -> Extensibility -> Type) = Det.LabelMap (block n C C) ------------------------------- -- | Gives access to the anchor points for @@ -47,18 +49,18 @@ instance NonLocal n => NonLocal (Block n) where emptyBody :: Body' block n -emptyBody = mapEmpty +emptyBody = Det.mapEmpty bodyList :: Body' block n -> [(Label,block n C C)] -bodyList body = mapToList body +bodyList body = Det.mapToList body bodyToBlockList :: Body n -> [Block n C C] -bodyToBlockList body = mapElems body +bodyToBlockList body = Det.mapElems body addBlock :: (NonLocal block, HasDebugCallStack) - => block C C -> LabelMap (block C C) -> LabelMap (block C C) -addBlock block body = mapAlter add lbl body + => block C C -> Det.LabelMap (block C C) -> Det.LabelMap (block C C) +addBlock block body = Det.mapAlter add lbl body where lbl = entryLabel block add Nothing = Just block @@ -105,21 +107,21 @@ mapGraphBlocks f = map where map :: Graph' block n e x -> Graph' block' n' e x map GNil = GNil map (GUnit b) = GUnit (f b) - map (GMany e b x) = GMany (fmap f e) (mapMap f b) (fmap f x) + map (GMany e b x) = GMany (fmap f e) (Det.mapMap f b) (fmap f x) -- ----------------------------------------------------------------------------- -- Extracting Labels from graphs labelsDefined :: forall block n e x . NonLocal (block n) => Graph' block n e x - -> LabelSet -labelsDefined GNil = setEmpty -labelsDefined (GUnit{}) = setEmpty -labelsDefined (GMany _ body x) = mapFoldlWithKey addEntry (exitLabel x) body - where addEntry :: forall a. LabelSet -> Label -> a -> LabelSet - addEntry labels label _ = setInsert label labels - exitLabel :: MaybeO x (block n C O) -> LabelSet - exitLabel NothingO = setEmpty - exitLabel (JustO b) = setSingleton (entryLabel b) + -> NonDet.LabelSet +labelsDefined GNil = NonDet.setEmpty +labelsDefined (GUnit{}) = NonDet.setEmpty +labelsDefined (GMany _ body x) = Det.mapFoldlWithKey addEntry (exitLabel x) body + where addEntry :: forall a. NonDet.LabelSet -> Label -> a -> NonDet.LabelSet + addEntry labels label _ = NonDet.setInsert label labels + exitLabel :: MaybeO x (block n C O) -> NonDet.LabelSet + exitLabel NothingO = NonDet.setEmpty + exitLabel (JustO b) = NonDet.setSingleton (entryLabel b) ---------------------------------------------------------------- @@ -148,8 +150,8 @@ labelsDefined (GMany _ body x) = mapFoldlWithKey addEntry (exitLabel x) body -- B and C before we analyze D. revPostorderFrom :: forall block. (NonLocal block) - => LabelMap (block C C) -> Label -> [block C C] -revPostorderFrom graph start = go start_worklist setEmpty [] + => Det.LabelMap (block C C) -> Label -> [block C C] +revPostorderFrom graph start = go start_worklist NonDet.setEmpty [] where start_worklist = lookup_for_descend start Nil @@ -165,22 +167,22 @@ revPostorderFrom graph start = go start_worklist setEmpty [] -- NOTE: We add blocks to the result list in postorder, but we *prepend* -- them (i.e., we use @(:)@), which means that the final list is in reverse -- postorder. - go :: DfsStack (block C C) -> LabelSet -> [block C C] -> [block C C] + go :: DfsStack (block C C) -> NonDet.LabelSet -> [block C C] -> [block C C] go Nil !_ !result = result go (ConsMark block rest) !wip_or_done !result = go rest wip_or_done (block : result) go (ConsTodo block rest) !wip_or_done !result - | entryLabel block `setMember` wip_or_done = go rest wip_or_done result + | entryLabel block `NonDet.setMember` wip_or_done = go rest wip_or_done result | otherwise = let new_worklist = foldr lookup_for_descend (ConsMark block rest) (successors block) - in go new_worklist (setInsert (entryLabel block) wip_or_done) result + in go new_worklist (NonDet.setInsert (entryLabel block) wip_or_done) result lookup_for_descend :: Label -> DfsStack (block C C) -> DfsStack (block C C) lookup_for_descend label wl - | Just b <- mapLookup label graph = ConsTodo b wl + | Just b <- Det.mapLookup label graph = ConsTodo b wl | otherwise = error $ "Label that doesn't have a block?! " ++ show label ===================================== compiler/GHC/Cmm/Dataflow/Label/NonDet.hs ===================================== @@ -97,6 +97,7 @@ import qualified GHC.Data.Word64Map.Strict as M import Data.List (foldl1') import GHC.Cmm.Dataflow.Label (Label(..), mkHooplLabel) +import GHC.Data.TrieMap (TrieMap(..)) ----------------------------------------------------------------------------- -- LabelSet @@ -296,13 +297,13 @@ instance Outputable a => Outputable (LabelMap a) where instance OutputableP env a => OutputableP env (LabelMap a) where pdoc env = pdoc env . nonDetMapToList --- instance TrieMap LabelMap where --- type Key LabelMap = Label --- emptyTM = mapEmpty --- lookupTM k m = mapLookup k m --- alterTM k f m = mapAlter f k m --- foldTM k m z = mapFoldr k z m -- TODO:ERROR? --- filterTM f m = mapFilter f m +instance TrieMap LabelMap where + type Key LabelMap = Label + emptyTM = mapEmpty + lookupTM k m = mapLookup k m + alterTM k f m = mapAlter f k m + foldTM = error "TrieMap: NonDet.LabelMap" + filterTM f m = mapFilter f m ----------------------------------------------------------------------------- -- FactBase ===================================== compiler/GHC/Cmm/DebugBlock.hs ===================================== @@ -51,20 +51,20 @@ import GHC.Utils.Misc ( partitionWith, seqList ) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import Data.Maybe import Data.List ( minimumBy, nubBy ) import Data.Ord ( comparing ) import qualified Data.Map as Map -import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- | Debug information about a block of code. Ticks scope over nested -- blocks. data DebugBlock = DebugBlock - { dblProcedure :: !Label -- ^ Entry label of containing proc - , dblLabel :: !Label -- ^ Hoopl label + { dblProcedure :: !NonDet.Label -- ^ Entry label of containing proc + , dblLabel :: !NonDet.Label -- ^ Hoopl label , dblCLabel :: !CLabel -- ^ Output label , dblHasInfoTbl :: !Bool -- ^ Has an info table? , dblParent :: !(Maybe DebugBlock) @@ -180,7 +180,7 @@ cmmDebugGen modLoc decls = map (blocksForScope Nothing) topScopes } where (CmmProc infos _entryLbl _ graph) = prc label = entryLabel block - info = mapLookup label infos + info = Det.mapLookup label infos blocks | top = seqList childs childs | otherwise = [] @@ -208,34 +208,34 @@ blockContexts decls = Map.map reverse $ foldr walkProc Map.empty decls -> Map.Map CmmTickScope [BlockContext] walkProc CmmData{} m = m walkProc prc@(CmmProc _ _ _ graph) m - | mapNull blocks = m + | Det.mapNull blocks = m | otherwise = snd $ walkBlock prc entry (emptyLbls, m) where blocks = toBlockMap graph entry = [mapFind (g_entry graph) blocks] - emptyLbls = setEmpty :: LabelSet + emptyLbls = NonDet.setEmpty :: NonDet.LabelSet walkBlock :: RawCmmDecl -> [Block CmmNode C C] - -> (LabelSet, Map.Map CmmTickScope [BlockContext]) - -> (LabelSet, Map.Map CmmTickScope [BlockContext]) + -> (NonDet.LabelSet, Map.Map CmmTickScope [BlockContext]) + -> (NonDet.LabelSet, Map.Map CmmTickScope [BlockContext]) walkBlock _ [] c = c walkBlock prc (block:blocks) (visited, m) - | lbl `setMember` visited + | lbl `NonDet.setMember` visited = walkBlock prc blocks (visited, m) | otherwise = walkBlock prc blocks $ walkBlock prc succs - (lbl `setInsert` visited, + (lbl `NonDet.setInsert` visited, insertMulti scope (block, prc) m) where CmmEntry lbl scope = firstNode block (CmmProc _ _ _ graph) = prc succs = map (flip mapFind (toBlockMap graph)) (successors (lastNode block)) - mapFind = mapFindWithDefault (error "contextTree: block not found!") + mapFind = Det.mapFindWithDefault (error "contextTree: block not found!") insertMulti :: Ord k => k -> a -> Map.Map k [a] -> Map.Map k [a] insertMulti k v = Map.insertWith (const (v:)) k [v] -cmmDebugLabels :: (BlockId -> Bool) -> (i -> Bool) -> GenCmmGroup d g (ListGraph i) -> [Label] +cmmDebugLabels :: (BlockId -> Bool) -> (i -> Bool) -> GenCmmGroup d g (ListGraph i) -> [NonDet.Label] cmmDebugLabels is_valid_label isMeta nats = seqList lbls lbls where -- Find order in which procedures will be generated by the -- back-end (that actually matters for DWARF generation). @@ -251,12 +251,12 @@ cmmDebugLabels is_valid_label isMeta nats = seqList lbls lbls -- | Sets position and unwind table fields in the debug block tree according to -- native generated code. -cmmDebugLink :: [Label] -> NonDet.LabelMap [UnwindPoint] +cmmDebugLink :: [NonDet.Label] -> NonDet.LabelMap [UnwindPoint] -> [DebugBlock] -> [DebugBlock] cmmDebugLink labels unwindPts blocks = mapMaybe link blocks - where blockPos :: LabelMap Int - blockPos = mapFromList $ flip zip [0..] labels - link block = case mapLookup (dblLabel block) blockPos of + where blockPos :: NonDet.LabelMap Int + blockPos = NonDet.mapFromList $ flip zip [0..] labels + link block = case NonDet.mapLookup (dblLabel block) blockPos of -- filter dead blocks: we generated debug infos from Cmm blocks but -- asm-shortcutting may remove some blocks later (#22792) Nothing -> Nothing @@ -267,9 +267,9 @@ cmmDebugLink labels unwindPts blocks = mapMaybe link blocks } -- | Converts debug blocks into a label map for easier lookups -debugToMap :: [DebugBlock] -> LabelMap DebugBlock -debugToMap = mapUnions . map go - where go b = mapInsert (dblLabel b) b $ mapUnions $ map go (dblBlocks b) +debugToMap :: [DebugBlock] -> NonDet.LabelMap DebugBlock +debugToMap = NonDet.mapUnions . map go + where go b = NonDet.mapInsert (dblLabel b) b $ NonDet.mapUnions $ map go (dblBlocks b) {- Note [What is this unwinding business?] ===================================== compiler/GHC/Cmm/Dominators.hs ===================================== @@ -32,7 +32,9 @@ import qualified GHC.CmmToAsm.CFG.Dominators as LT import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import GHC.Cmm.Dataflow.Label (Label) +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm import GHC.Utils.Outputable( Outputable(..), text, int, hcat, (<+>)) @@ -112,8 +114,8 @@ intersectDominators ds ds' = commonPrefix (revDoms ds []) (revDoms ds' []) Entry -- Invariant: Dominators, graph, and RP numberings include only *reachable* blocks. data GraphWithDominators node = GraphWithDominators { gwd_graph :: GenCmmGraph node - , gwd_dominators :: LabelMap DominatorSet - , gwd_rpnumbering :: LabelMap RPNum + , gwd_dominators :: NonDet.LabelMap DominatorSet + , gwd_rpnumbering :: NonDet.LabelMap RPNum } @@ -138,14 +140,14 @@ graphWithDominators g = GraphWithDominators (reachable rpblocks g) dmap rpmap rplabels :: Array Word64 Label rplabels = listArray bounds rplabels' - rpmap :: LabelMap RPNum - rpmap = mapFromList $ zipWith kvpair rpblocks [0..] + rpmap :: NonDet.LabelMap RPNum + rpmap = NonDet.mapFromList $ zipWith kvpair rpblocks [0..] where kvpair block i = (entryLabel block, RPNum i) labelIndex :: Label -> Word64 labelIndex = flip findLabelIn imap - where imap :: LabelMap Word64 - imap = mapFromList $ zip rplabels' [0..] + where imap :: NonDet.LabelMap Word64 + imap = NonDet.mapFromList $ zip rplabels' [0..] blockIndex = labelIndex . entryLabel bounds :: (Word64, Word64) @@ -167,18 +169,18 @@ graphWithDominators g = GraphWithDominators (reachable rpblocks g) dmap rpmap where d = idom_array ! i doms = tabulate bounds domSet - dmap = mapFromList $ zipWith (\lbl i -> (lbl, domSet i)) rplabels' [0..] + dmap = NonDet.mapFromList $ zipWith (\lbl i -> (lbl, domSet i)) rplabels' [0..] reachable :: NonLocal node => [Block node C C] -> GenCmmGraph node -> GenCmmGraph node reachable blocks g = g { g_graph = GMany NothingO blockmap NothingO } - where blockmap = mapFromList [(entryLabel b, b) | b <- blocks] + where blockmap = Det.mapFromList [(entryLabel b, b) | b <- blocks] -- | =Utility functions -- | Call `graphMap` to get the mapping from `Label` to `Block` that -- is embedded in every `CmmGraph`. -graphMap :: GenCmmGraph n -> LabelMap (Block n C C) +graphMap :: GenCmmGraph n -> Det.LabelMap (Block n C C) graphMap (CmmGraph { g_graph = GMany NothingO blockmap NothingO }) = blockmap -- | Use `gwdRPNumber` on the result of the dominator analysis to get @@ -187,8 +189,8 @@ graphMap (CmmGraph { g_graph = GMany NothingO blockmap NothingO }) = blockmap gwdRPNumber :: HasDebugCallStack => GraphWithDominators node -> Label -> RPNum gwdRPNumber g l = findLabelIn l (gwd_rpnumbering g) -findLabelIn :: HasDebugCallStack => Label -> LabelMap a -> a -findLabelIn lbl = mapFindWithDefault failed lbl +findLabelIn :: HasDebugCallStack => Label -> NonDet.LabelMap a -> a +findLabelIn lbl = NonDet.mapFindWithDefault failed lbl where failed = pprPanic "label not found in result of analysis" (ppr lbl) @@ -204,12 +206,12 @@ gwdDominatorsOf g lbl = findLabelIn lbl (gwd_dominators g) gwdDominatorTree :: GraphWithDominators node -> Tree.Tree Label gwdDominatorTree gwd = subtreeAt (g_entry (gwd_graph gwd)) where subtreeAt label = Tree.Node label $ map subtreeAt $ children label - children l = mapFindWithDefault [] l child_map - child_map :: LabelMap [Label] - child_map = mapFoldlWithKey addParent mapEmpty $ gwd_dominators gwd + children l = NonDet.mapFindWithDefault [] l child_map + child_map :: NonDet.LabelMap [Label] + child_map = NonDet.nonDetMapFoldlWithKey addParent NonDet.mapEmpty $ gwd_dominators gwd where addParent cm _ EntryNode = cm addParent cm lbl (ImmediateDominator p _) = - mapInsertWith (++) p [lbl] cm + NonDet.mapInsertWith (++) p [lbl] cm -- | Turn a function into an array. Inspired by SML's `Array.tabulate` ===================================== compiler/GHC/Cmm/Info.hs ===================================== @@ -40,7 +40,7 @@ import GHC.Runtime.Heap.Layout import GHC.Data.Bitmap import GHC.Data.Stream (Stream) import qualified GHC.Data.Stream as Stream -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Platform import GHC.Platform.Profile @@ -133,7 +133,7 @@ mkInfoTable profile proc@(CmmProc infos entry_lbl live blocks) = case topInfoTable proc of -- must be at most one -- no info table Nothing -> - return [CmmProc mapEmpty entry_lbl live blocks] + return [CmmProc Det.mapEmpty entry_lbl live blocks] Just info at CmmInfoTable { cit_lbl = info_lbl } -> do (top_decls, (std_info, extra_bits)) <- @@ -146,7 +146,7 @@ mkInfoTable profile proc@(CmmProc infos entry_lbl live blocks) -- point as first entry) and the entry code -- return (top_decls ++ - [CmmProc mapEmpty entry_lbl live blocks, + [CmmProc Det.mapEmpty entry_lbl live blocks, mkRODataLits info_lbl (CmmLabel entry_lbl : rel_std_info ++ rel_extra_bits)]) @@ -159,9 +159,9 @@ mkInfoTable profile proc@(CmmProc infos entry_lbl live blocks) | otherwise = do (top_declss, raw_infos) <- - unzip `fmap` mapM do_one_info (mapToList (info_tbls infos)) + unzip `fmap` mapM do_one_info (Det.mapToList (info_tbls infos)) return (concat top_declss ++ - [CmmProc (mapFromList raw_infos) entry_lbl live blocks]) + [CmmProc (Det.mapFromList raw_infos) entry_lbl live blocks]) where platform = profilePlatform profile ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -26,8 +26,8 @@ import GHC.Cmm.BlockId import GHC.Cmm.Config import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label -import GHC.Cmm.Dataflow.Label.NonDet (lookupFact) +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label.NonDet (lookupFact, Label) import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow import GHC.Unit.Module @@ -596,7 +596,7 @@ cafAnalData platform st = case st of -- cafAnal :: Platform - -> LabelSet -- ^ The blocks representing continuations, ie. those + -> NonDet.LabelSet -- ^ The blocks representing continuations, ie. those -- that will get RET info tables. These labels will -- get their own SRTs, so we don't aggregate CAFs from -- references to these labels, we just use the label. @@ -616,7 +616,7 @@ cafLattice = DataflowLattice Set.empty add in changedIf (Set.size new' > Set.size old) new' -cafTransfers :: Platform -> LabelSet -> Label -> CLabel -> TransferFun CAFSet +cafTransfers :: Platform -> NonDet.LabelSet -> Label -> CLabel -> TransferFun CAFSet cafTransfers platform contLbls entry topLbl block@(BlockCC eNode middle xNode) fBase = let joined :: CAFSet @@ -638,7 +638,7 @@ cafTransfers platform contLbls entry topLbl | s == entry = Just (addCafLabel platform topLbl Set.empty) -- If this is a continuation, we want to refer to the -- SRT for the continuation's info table - | s `setMember` contLbls + | s `NonDet.setMember` contLbls = Just (Set.singleton (mkCAFfyLabel platform (infoTblLbl s))) -- Otherwise, takes the CAF references from the destination | otherwise @@ -746,7 +746,7 @@ getLabelledBlocks platform decl = case decl of | not (isThunkRep (cit_rep info)) ] CmmProc top_info _ _ _ -> [ (BlockLabel blockId, caf_lbl) - | (blockId, info) <- mapToList (info_tbls top_info) + | (blockId, info) <- Det.mapToList (info_tbls top_info) , let rep = cit_rep info , not (isStaticRep rep) || not (isThunkRep rep) , let !caf_lbl = mkCAFfyLabel platform (cit_lbl info) @@ -813,7 +813,7 @@ getCAFs platform cafEnv = mapMaybe getCAFLabel getCAFLabel :: CmmDecl -> Maybe (Maybe Label, CAFfyLabel, Set CAFfyLabel) getCAFLabel (CmmProc top_info top_lbl _ g) - | Just info <- mapLookup (g_entry g) (info_tbls top_info) + | Just info <- Det.mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info , isStaticRep rep && isThunkRep rep , Just cafs <- NonDet.mapLookup (g_entry g) cafEnv @@ -839,7 +839,7 @@ getStaticFuns :: [CmmDecl] -> [(BlockId, CLabel)] getStaticFuns decls = [ (g_entry g, lbl) | CmmProc top_info _ _ g <- decls - , Just info <- [mapLookup (g_entry g) (info_tbls top_info)] + , Just info <- [Det.mapLookup (g_entry g) (info_tbls top_info)] , Just (id, _) <- [cit_clo info] , let rep = cit_rep info , isStaticRep rep && isFunRep rep @@ -911,7 +911,7 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do (proc_envs, procss) = unzip procs cafEnv = NonDet.mapUnions proc_envs decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss - staticFuns = mapFromList (getStaticFuns decls) + staticFuns = NonDet.mapFromList (getStaticFuns decls) platform = cmmPlatform cfg @@ -957,8 +957,8 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do -- Next, update the info tables with the SRTs let - srtFieldMap = mapFromList (concat pairs) - funSRTMap = mapFromList (concat funSRTs) + srtFieldMap = NonDet.mapFromList (concat pairs) + funSRTMap = NonDet.mapFromList (concat funSRTs) has_caf_refs' = anyCafRefs has_caf_refs decls' = concatMap (updInfoSRTs profile srtFieldMap funSRTMap has_caf_refs') decls @@ -990,7 +990,7 @@ doSRTs cfg moduleSRTInfo dus procs data_ = do -- | Build the SRT for a strongly-connected component of blocks. doSCC :: CmmConfig - -> LabelMap CLabel -- ^ which blocks are static function entry points + -> NonDet.LabelMap CLabel -- ^ which blocks are static function entry points -> DataCAFEnv -- ^ static data -> SCC (SomeLabel, CAFfyLabel, Set CAFfyLabel) -> StateT ModuleSRTInfo UniqDSM @@ -1042,7 +1042,7 @@ However, there are a couple of wrinkles to be aware of. -- | Build an SRT for a set of blocks oneSRT :: CmmConfig - -> LabelMap CLabel -- ^ which blocks are static function entry points + -> NonDet.LabelMap CLabel -- ^ which blocks are static function entry points -> [SomeLabel] -- ^ blocks in this set -> [CAFfyLabel] -- ^ labels for those blocks -> Bool -- ^ True <=> this SRT is for a CAF @@ -1070,7 +1070,7 @@ oneSRT cfg staticFuns lbls caf_lbls isCAF cafs static_data_env = do maybeFunClosure :: Maybe (CLabel, Label) otherFunLabels :: [CLabel] (maybeFunClosure, otherFunLabels) = - case [ (l,b) | b <- blockids, Just l <- [mapLookup b staticFuns] ] of + case [ (l,b) | b <- blockids, Just l <- [NonDet.mapLookup b staticFuns] ] of [] -> (Nothing, []) ((l,b):xs) -> (Just (l,b), map fst xs) @@ -1277,8 +1277,8 @@ buildSRT profile refs = do -- static closures, splicing in SRT fields as necessary. updInfoSRTs :: Profile - -> LabelMap CLabel -- ^ SRT labels for each block - -> LabelMap [SRTEntry] -- ^ SRTs to merge into FUN_STATIC closures + -> NonDet.LabelMap CLabel -- ^ SRT labels for each block + -> NonDet.LabelMap [SRTEntry] -- ^ SRTs to merge into FUN_STATIC closures -> CafInfo -- ^ Whether the CmmDecl's group has CAF references -> CmmDecl -> [CmmDeclSRTs] @@ -1296,10 +1296,10 @@ updInfoSRTs profile srt_env funSRTEnv caffy (CmmProc top_info top_l live g) | otherwise = [ proc ] where proc = CmmProc top_info { info_tbls = newTopInfo } top_l live g - newTopInfo = mapMapWithKey updInfoTbl (info_tbls top_info) + newTopInfo = Det.mapMapWithKey updInfoTbl (info_tbls top_info) updInfoTbl l info_tbl | l == g_entry g, Just (inf, _) <- maybeStaticClosure = inf - | otherwise = info_tbl { cit_srt = mapLookup l srt_env } + | otherwise = info_tbl { cit_srt = NonDet.mapLookup l srt_env } -- Generate static closures [FUN]. Note that this also generates -- static closures for thunks (CAFs), because it's easier to treat @@ -1307,15 +1307,15 @@ updInfoSRTs profile srt_env funSRTEnv caffy (CmmProc top_info top_l live g) maybeStaticClosure :: Maybe (CmmInfoTable, CmmDeclSRTs) maybeStaticClosure | Just info_tbl at CmmInfoTable{..} <- - mapLookup (g_entry g) (info_tbls top_info) + Det.mapLookup (g_entry g) (info_tbls top_info) , Just (id, ccs) <- cit_clo , isStaticRep cit_rep = let - (newInfo, srtEntries) = case mapLookup (g_entry g) funSRTEnv of + (newInfo, srtEntries) = case NonDet.mapLookup (g_entry g) funSRTEnv of Nothing -> -- if we don't add SRT entries to this closure, then we -- want to set the srt field in its info table as usual - (info_tbl { cit_srt = mapLookup (g_entry g) srt_env }, []) + (info_tbl { cit_srt = NonDet.mapLookup (g_entry g) srt_env }, []) Just srtEntries -> srtTrace "maybeStaticFun" (pdoc (profilePlatform profile) res) (info_tbl { cit_rep = new_rep }, res) where res = [ CmmLabel lbl | SRTEntry lbl <- srtEntries ] ===================================== compiler/GHC/Cmm/LayoutStack.hs ===================================== @@ -24,7 +24,7 @@ import GHC.Runtime.Heap.Layout import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Data.Maybe import GHC.Types.Unique.FM @@ -262,7 +262,7 @@ cmmLayoutStack cfg procpoints entry_args -- ----------------------------------------------------------------------------- layout :: CmmConfig - -> LabelSet -- proc points + -> NonDet.LabelSet -- proc points -> NonDet.LabelMap CmmLocalLive -- liveness -> BlockId -- entry -> ByteOff -- stack args on entry @@ -372,13 +372,13 @@ isGcJump _something_else = False -- unnecessarily pessimistic, but probably not in the code we -- generate. -collectContInfo :: [CmmBlock] -> (ByteOff, LabelMap ByteOff) +collectContInfo :: [CmmBlock] -> (ByteOff, NonDet.LabelMap ByteOff) collectContInfo blocks - = (maximum ret_offs, mapFromList (catMaybes mb_argss)) + = (maximum ret_offs, NonDet.mapFromList (catMaybes mb_argss)) where (mb_argss, ret_offs) = mapAndUnzip get_cont blocks - get_cont :: Block CmmNode x C -> (Maybe (Label, ByteOff), ByteOff) + get_cont :: Block CmmNode x C -> (Maybe (NonDet.Label, ByteOff), ByteOff) get_cont b = case lastNode b of CmmCall { cml_cont = Just l, .. } @@ -439,7 +439,7 @@ getStackLoc (Young l) n stackmaps = -- extra code that goes *after* the Sp adjustment. handleLastNode - :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> LabelMap ByteOff + :: CmmConfig -> ProcPointSet -> NonDet.LabelMap CmmLocalLive -> NonDet.LabelMap ByteOff -> NonDet.LabelMap StackMap -> StackMap -> CmmTickScope -> Block CmmNode O O -> CmmNode O C @@ -518,9 +518,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps handleBranches -- See Note [diamond proc point] | Just l <- futureContinuation middle - , (nub $ filter (`setMember` procpoints) $ successors last) == [l] + , (nub $ filter (`NonDet.setMember` procpoints) $ successors last) == [l] = do - let cont_args = mapFindWithDefault 0 l cont_info + let cont_args = NonDet.mapFindWithDefault 0 l cont_info (assigs, cont_stack) = prepareStack l cont_args (sm_ret_off stack0) out = NonDet.mapFromList [ (l', cont_stack) @@ -533,9 +533,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps | otherwise = do pps <- mapM handleBranch (successors last) - let lbl_map :: LabelMap Label - lbl_map = mapFromList [ (l,tmp) | (l,tmp,_,_) <- pps ] - fix_lbl l = mapFindWithDefault l l lbl_map + let lbl_map :: NonDet.LabelMap Det.Label + lbl_map = NonDet.mapFromList [ (l,tmp) | (l,tmp,_,_) <- pps ] + fix_lbl l = NonDet.mapFindWithDefault l l lbl_map return ( [] , 0 , mapSuccessors fix_lbl last @@ -556,9 +556,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps -- (b) if the successor is a proc point, save everything -- on the stack. - | l `setMember` procpoints + | l `NonDet.setMember` procpoints = do - let cont_args = mapFindWithDefault 0 l cont_info + let cont_args = NonDet.mapFindWithDefault 0 l cont_info (stack2, assigs) = setupStackFrame platform l liveness (sm_ret_off stack0) cont_args stack0 @@ -576,9 +576,9 @@ handleLastNode cfg procpoints liveness cont_info stackmaps is_live (r,_) = r `elemRegSet` live -makeFixupBlock :: CmmConfig -> ByteOff -> Label -> StackMap +makeFixupBlock :: CmmConfig -> ByteOff -> Det.Label -> StackMap -> CmmTickScope -> [CmmNode O O] - -> UniqDSM (Label, [CmmBlock]) + -> UniqDSM (Det.Label, [CmmBlock]) makeFixupBlock cfg sp0 l stack tscope assigs | null assigs && sp0 == sm_sp stack = return (l, []) | otherwise = do @@ -1019,7 +1019,7 @@ elimStackStores stackmap stackmaps area_off nodes setInfoTableStackMap :: Platform -> NonDet.LabelMap StackMap -> CmmDecl -> CmmDecl setInfoTableStackMap platform stackmaps (CmmProc top_info at TopInfo{..} l v g) - = CmmProc top_info{ info_tbls = mapMapWithKey fix_info info_tbls } l v g + = CmmProc top_info{ info_tbls = Det.mapMapWithKey fix_info info_tbls } l v g where fix_info lbl info_tbl at CmmInfoTable{ cit_rep = StackRep _ } = info_tbl { cit_rep = StackRep (get_liveness lbl) } @@ -1078,7 +1078,7 @@ insertReloadsAsNeeded platform procpoints final_stackmaps entry blocks = -- they're actually live. Furthermore, nothing is live at the entry -- to a proc point. (middle1, live_with_reloads) - | entry_label `setMember` procpoints + | entry_label `NonDet.setMember` procpoints = let reloads = insertReloads platform stackmap live_at_middle0 in (foldr blockCons middle0 reloads, emptyRegSet) | otherwise ===================================== compiler/GHC/Cmm/Node.hs ===================================== @@ -35,7 +35,9 @@ import GHC.Types.Basic (FunctionOrData(..)) import GHC.Platform import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import GHC.Cmm.Dataflow.Label (Label) import Data.Foldable (toList) import Data.Functor.Classes (liftCompare) import Data.Maybe @@ -47,7 +49,7 @@ import GHC.Utils.Constants (debugIsOn) ------------------------ -- CmmNode -#define ULabel {-# UNPACK #-} !Label +#define ULabel {-# UNPACK #-} !Det.Label data CmmNode e x where CmmEntry :: ULabel -> CmmTickScope -> CmmNode C O @@ -108,7 +110,7 @@ data CmmNode e x where CmmCall :: { -- A native call or tail call cml_target :: CmmExpr, -- never a CmmPrim to a CallishMachOp! - cml_cont :: Maybe Label, + cml_cont :: Maybe Det.Label, -- Label of continuation (Nothing for return or tail call) -- -- Note [Continuation BlockIds] @@ -797,11 +799,12 @@ mapCollectSuccessors f (CmmCondBranch p y n l) in (CmmCondBranch p bidt bidf l, [accf, acct]) mapCollectSuccessors f (CmmSwitch e ids) = let lbls = switchTargetsToList ids :: [Label] - lblMap = mapFromList $ zip lbls (map f lbls) :: LabelMap (Label, a) + res = map f lbls + lblMap = NonDet.mapFromList $ zip lbls res :: NonDet.LabelMap (Label, a) in ( CmmSwitch e (mapSwitchTargets - (\l -> fst $ mapFindWithDefault (error "impossible") l lblMap) ids) - , map snd (mapElems lblMap) + (\l -> fst $ NonDet.mapFindWithDefault (error "impossible") l lblMap) ids) + , map snd res ) mapCollectSuccessors _ n = (n, []) ===================================== compiler/GHC/Cmm/ProcPoint.hs ===================================== @@ -28,7 +28,8 @@ import GHC.Types.Unique.DSM import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import GHC.Cmm.Dataflow.Label (Label) import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet -- Compute a minimal set of proc points for a control-flow graph. @@ -116,7 +117,7 @@ if a proc-point does not exist anymore then we will get compiler panic. See #8205. -} -type ProcPointSet = LabelSet +type ProcPointSet = NonDet.LabelSet data Status = ReachedBy ProcPointSet -- set of proc points that directly reach the block @@ -124,9 +125,9 @@ data Status instance Outputable Status where ppr (ReachedBy ps) - | setNull ps = text "" + | NonDet.setNull ps = text "" | otherwise = text "reached by" <+> - (hsep $ punctuate comma $ map ppr $ setElems ps) + (hsep $ punctuate comma $ map ppr $ NonDet.nonDetSetElems ps) ppr ProcPoint = text "" -------------------------------------------------- @@ -143,9 +144,9 @@ procPointAnalysis procPoints cmmGraph@(CmmGraph {g_graph = graph}) = mkFactBase procPointLattice [ (id, ProcPoint) - | id <- setElems procPoints + | id <- NonDet.nonDetSetElems procPoints -- See Note [Non-existing proc-points] - , id `setMember` labelsInGraph + , id `NonDet.setMember` labelsInGraph ] labelsInGraph = labelsDefined graph @@ -153,7 +154,7 @@ procPointTransfer :: TransferFun Status procPointTransfer block facts = let label = entryLabel block !fact = case getFact procPointLattice label facts of - ProcPoint -> ReachedBy $! setSingleton label + ProcPoint -> ReachedBy $! NonDet.setSingleton label f -> f result = map (\id -> (id, fact)) (successors block) in mkFactBase procPointLattice result @@ -161,14 +162,14 @@ procPointTransfer block facts = procPointLattice :: DataflowLattice Status procPointLattice = DataflowLattice unreached add_to where - unreached = ReachedBy setEmpty + unreached = ReachedBy NonDet.setEmpty add_to (OldFact ProcPoint) _ = NotChanged ProcPoint add_to _ (NewFact ProcPoint) = Changed ProcPoint -- because of previous case add_to (OldFact (ReachedBy p)) (NewFact (ReachedBy p')) - | setSize union > setSize p = Changed (ReachedBy union) + | NonDet.setSize union > NonDet.setSize p = Changed (ReachedBy union) | otherwise = NotChanged (ReachedBy p) where - union = setUnion p' p + union = NonDet.setUnion p' p ---------------------------------------------------------------------- @@ -178,11 +179,11 @@ procPointLattice = DataflowLattice unreached add_to -- -- Extract the set of Continuation BlockIds, see Note [Continuation BlockIds]. callProcPoints :: CmmGraph -> ProcPointSet -callProcPoints g = foldlGraphBlocks add (setSingleton (g_entry g)) g - where add :: LabelSet -> CmmBlock -> LabelSet +callProcPoints g = foldlGraphBlocks add (NonDet.setSingleton (g_entry g)) g + where add :: NonDet.LabelSet -> CmmBlock -> NonDet.LabelSet add set b = case lastNode b of - CmmCall {cml_cont = Just k} -> setInsert k set - CmmForeignCall {succ=k} -> setInsert k set + CmmCall {cml_cont = Just k} -> NonDet.setInsert k set + CmmForeignCall {succ=k} -> NonDet.setInsert k set _ -> set minimalProcPointSet :: Platform -> ProcPointSet -> CmmGraph @@ -198,29 +199,29 @@ extendPPSet platform g blocks procPoints = let env = procPointAnalysis procPoints g add pps block = let id = entryLabel block in case NonDet.mapLookup id env of - Just ProcPoint -> setInsert id pps + Just ProcPoint -> NonDet.setInsert id pps _ -> pps - procPoints' = foldlGraphBlocks add setEmpty g + procPoints' = foldlGraphBlocks add NonDet.setEmpty g newPoints = mapMaybe ppSuccessor blocks newPoint = listToMaybe newPoints ppSuccessor b = let nreached id = case NonDet.mapLookup id env `orElse` pprPanic "no ppt" (ppr id <+> pdoc platform b) of ProcPoint -> 1 - ReachedBy ps -> setSize ps + ReachedBy ps -> NonDet.setSize ps block_procpoints = nreached (entryLabel b) -- Looking for a successor of b that is reached by -- more proc points than b and is not already a proc -- point. If found, it can become a proc point. - newId succ_id = not (setMember succ_id procPoints') && + newId succ_id = not (NonDet.setMember succ_id procPoints') && nreached succ_id > block_procpoints in listToMaybe $ filter newId $ successors b in case newPoint of Just id -> - if setMember id procPoints' + if NonDet.setMember id procPoints' then panic "added old proc pt" - else extendPPSet platform g blocks (setInsert id procPoints') + else extendPPSet platform g blocks (NonDet.setInsert id procPoints') Nothing -> return procPoints' @@ -243,17 +244,17 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do -- Build a map from procpoints to the blocks they reach let (CmmProc (TopInfo {info_tbls = info_tbls}) top_l _ g@(CmmGraph {g_entry=entry})) = cmmProc - let add graphEnv procId bid b = mapInsert procId graph' graphEnv + let add graphEnv procId bid b = NonDet.mapInsert procId graph' graphEnv where - graph' = mapInsert bid b graph - graph = mapLookup procId graphEnv `orElse` mapEmpty + graph' = Det.mapInsert bid b graph + graph = NonDet.mapLookup procId graphEnv `orElse` Det.mapEmpty - let add_block :: LabelMap (LabelMap CmmBlock) -> CmmBlock -> LabelMap (LabelMap CmmBlock) + let add_block :: NonDet.LabelMap (Det.LabelMap CmmBlock) -> CmmBlock -> NonDet.LabelMap (Det.LabelMap CmmBlock) add_block graphEnv b = case NonDet.mapLookup bid procMap of Just ProcPoint -> add graphEnv bid bid b Just (ReachedBy set) -> - case setElems set of + case NonDet.nonDetSetElems set of [] -> graphEnv [id] -> add graphEnv id bid b _ -> panic "Each block should be reachable from only one ProcPoint" @@ -265,35 +266,35 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do let liveness = cmmGlobalLiveness platform g let ppLiveness pp = filter isArgReg $ regSetToList $ expectJust "ppLiveness" $ NonDet.mapLookup pp liveness - graphEnv <- return $ foldlGraphBlocks add_block mapEmpty g + graphEnv <- return $ foldlGraphBlocks add_block NonDet.mapEmpty g -- Build a map from proc point BlockId to pairs of: -- * Labels for their new procedures -- * Labels for the info tables of their new procedures (only if -- the proc point is a callPP) -- Due to common blockification, we may overestimate the set of procpoints. - let add_label map pp = mapInsert pp lbls map - where lbls | pp == entry = (entry_label, fmap cit_lbl (mapLookup entry info_tbls)) - | otherwise = (block_lbl, guard (setMember pp callPPs) >> + let add_label map pp = NonDet.mapInsert pp lbls map + where lbls | pp == entry = (entry_label, fmap cit_lbl (Det.mapLookup entry info_tbls)) + | otherwise = (block_lbl, guard (NonDet.setMember pp callPPs) >> Just info_table_lbl) where block_lbl = blockLbl pp info_table_lbl = infoTblLbl pp - procLabels :: LabelMap (CLabel, Maybe CLabel) - procLabels = foldl' add_label mapEmpty - (filter (flip mapMember (toBlockMap g)) (setElems procPoints)) + procLabels :: NonDet.LabelMap (CLabel, Maybe CLabel) + procLabels = foldl' add_label NonDet.mapEmpty + (filter (flip Det.mapMember (toBlockMap g)) (NonDet.nonDetSetElems procPoints)) -- In each new graph, add blocks jumping off to the new procedures, -- and replace branches to procpoints with branches to the jump-off blocks - let add_jump_block :: (LabelMap Label, [CmmBlock]) + let add_jump_block :: (NonDet.LabelMap Label, [CmmBlock]) -> (Label, CLabel) - -> UniqDSM (LabelMap Label, [CmmBlock]) + -> UniqDSM (NonDet.LabelMap Label, [CmmBlock]) add_jump_block (env, bs) (pp, l) = do bid <- liftM mkBlockId getUniqueDSM let b = blockJoin (CmmEntry bid GlobalScope) emptyBlock jump live = ppLiveness pp jump = CmmCall (CmmLit (CmmLabel l)) Nothing live 0 0 0 - return (mapInsert pp bid env, b : bs) + return (NonDet.mapInsert pp bid env, b : bs) -- when jumping to a PP that has an info table, if -- tablesNextToCode is off we must jump to the entry @@ -306,7 +307,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do jump_label Nothing block_lbl = block_lbl let add_if_pp id rst = - case mapLookup id procLabels of + case NonDet.mapLookup id procLabels of Just (lbl, mb_info_lbl) -> (id, jump_label mb_info_lbl lbl) : rst Nothing -> rst @@ -318,25 +319,25 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do CmmSwitch _ ids -> foldr add_if_pp rst $ switchTargetsToList ids _ -> rst - let add_jumps :: LabelMap CmmGraph -> (Label, LabelMap CmmBlock) -> UniqDSM (LabelMap CmmGraph) + let add_jumps :: NonDet.LabelMap CmmGraph -> (Label, Det.LabelMap CmmBlock) -> UniqDSM (NonDet.LabelMap CmmGraph) add_jumps newGraphEnv (ppId, blockEnv) = do -- find which procpoints we currently branch to - let needed_jumps = mapFoldr add_if_branch_to_pp [] blockEnv + let needed_jumps = Det.mapFoldr add_if_branch_to_pp [] blockEnv (jumpEnv, jumpBlocks) <- - foldM add_jump_block (mapEmpty, []) needed_jumps + foldM add_jump_block (NonDet.mapEmpty, []) needed_jumps -- update the entry block - let b = expectJust "block in env" $ mapLookup ppId blockEnv - blockEnv' = mapInsert ppId b blockEnv + let b = expectJust "block in env" $ Det.mapLookup ppId blockEnv + blockEnv' = Det.mapInsert ppId b blockEnv -- replace branches to procpoints with branches to jumps blockEnv'' = toBlockMap $ replaceBranches jumpEnv $ ofBlockMap ppId blockEnv' -- add the jump blocks to the graph blockEnv''' = foldl' (flip addBlock) blockEnv'' jumpBlocks let g' = ofBlockMap ppId blockEnv''' -- pprTrace "g' pre jumps" (ppr g') $ do - return (mapInsert ppId g' newGraphEnv) + return (NonDet.mapInsert ppId g' newGraphEnv) - graphEnv <- foldM add_jumps mapEmpty $ mapToList graphEnv + graphEnv <- foldM add_jumps NonDet.mapEmpty $ NonDet.nonDetMapToList graphEnv let to_proc (bid, g) | bid == entry @@ -344,13 +345,13 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do stack_info = stack_info}) top_l live g' | otherwise - = case expectJust "pp label" $ mapLookup bid procLabels of + = case expectJust "pp label" $ NonDet.mapLookup bid procLabels of (lbl, Just info_lbl) - -> CmmProc (TopInfo { info_tbls = mapSingleton (g_entry g) (mkEmptyContInfoTable info_lbl) + -> CmmProc (TopInfo { info_tbls = Det.mapSingleton (g_entry g) (mkEmptyContInfoTable info_lbl) , stack_info=stack_info}) lbl live g' (lbl, Nothing) - -> CmmProc (TopInfo {info_tbls = mapEmpty, stack_info=stack_info}) + -> CmmProc (TopInfo {info_tbls = Det.mapEmpty, stack_info=stack_info}) lbl live g' where g' = replacePPIds g @@ -364,7 +365,7 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do replacePPIds g = {-# SCC "replacePPIds" #-} mapGraphNodes (id, mapExp repl, mapExp repl) g where repl e@(CmmLit (CmmBlock bid)) = - case mapLookup bid procLabels of + case NonDet.mapLookup bid procLabels of Just (_, Just info_lbl) -> CmmLit (CmmLabel info_lbl) _ -> e repl e = e @@ -373,22 +374,22 @@ splitAtProcPoints platform entry_label callPPs procPoints procMap cmmProc = do -- call sites. Here, we sort them in reverse order -- it gets -- reversed later. let add_block_num (i, map) block = - (i + 1, mapInsert (entryLabel block) i map) + (i + 1, NonDet.mapInsert (entryLabel block) i map) let (_, block_order) = - foldl' add_block_num (0::Int, mapEmpty :: LabelMap Int) + foldl' add_block_num (0::Int, NonDet.mapEmpty :: NonDet.LabelMap Int) (revPostorder g) let sort_fn (bid, _) (bid', _) = - compare (expectJust "block_order" $ mapLookup bid block_order) - (expectJust "block_order" $ mapLookup bid' block_order) + compare (expectJust "block_order" $ NonDet.mapLookup bid block_order) + (expectJust "block_order" $ NonDet.mapLookup bid' block_order) - return $ map to_proc $ sortBy sort_fn $ mapToList graphEnv + return $ map to_proc $ sortBy sort_fn $ NonDet.nonDetMapToList graphEnv -- Only called from GHC.Cmm.ProcPoint.splitAtProcPoints. NB. does a -- recursive lookup, see comment below. -replaceBranches :: LabelMap BlockId -> CmmGraph -> CmmGraph +replaceBranches :: NonDet.LabelMap BlockId -> CmmGraph -> CmmGraph replaceBranches env cmmg = {-# SCC "replaceBranches" #-} - ofBlockMap (g_entry cmmg) $ mapMap f $ toBlockMap cmmg + ofBlockMap (g_entry cmmg) $ Det.mapMap f $ toBlockMap cmmg where f block = replaceLastNode block $ last (lastNode block) @@ -401,7 +402,7 @@ replaceBranches env cmmg -- label will now be in a different CmmProc. Not only -- is this tidier, it stops CmmLint from complaining. last l@(CmmForeignCall {}) = l - lookup id = fmap lookup (mapLookup id env) `orElse` id + lookup id = fmap lookup (NonDet.mapLookup id env) `orElse` id -- XXX: this is a recursive lookup, it follows chains -- until the lookup returns Nothing, at which point we -- return the last BlockId @@ -413,9 +414,9 @@ attachContInfoTables :: ProcPointSet -> CmmDecl -> CmmDecl attachContInfoTables call_proc_points (CmmProc top_info top_l live g) = CmmProc top_info{info_tbls = info_tbls'} top_l live g where - info_tbls' = mapUnion (info_tbls top_info) $ - mapFromList [ (l, mkEmptyContInfoTable (infoTblLbl l)) - | l <- setElems call_proc_points + info_tbls' = Det.mapUnion (info_tbls top_info) $ + Det.mapFromList [ (l, mkEmptyContInfoTable (infoTblLbl l)) + | l <- NonDet.nonDetSetElems call_proc_points , l /= g_entry g ] attachContInfoTables _ other_decl = other_decl ===================================== compiler/GHC/Cmm/Reducibility.hs ===================================== @@ -43,7 +43,9 @@ import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dominators import GHC.Cmm.Dataflow.Graph hiding (addBlock) -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet +import GHC.Cmm.Dataflow.Label (Label) import GHC.Data.Graph.Collapse import GHC.Data.Graph.Inductive.Graph import GHC.Data.Graph.Inductive.PatriciaTree @@ -110,8 +112,8 @@ type CGraph = Gr CmmSuper () inflate :: Label -> CGraph -> CmmGraph inflate entry cg = CmmGraph entry graph where graph = GMany NothingO body NothingO - body :: LabelMap CmmBlock - body = foldl (\map block -> mapInsert (entryLabel block) block map) mapEmpty $ + body :: Det.LabelMap CmmBlock + body = foldl (\map block -> Det.mapInsert (entryLabel block) block map) Det.mapEmpty $ blocks super super = case labNodes cg of [(_, s)] -> s @@ -125,9 +127,9 @@ cgraphOfCmm g = foldl' addSuccEdges (mkGraph cnodes []) blocks where blocks = zip [0..] $ revPostorderFrom (graphMap g) (g_entry g) cnodes = [(k, super block) | (k, block) <- blocks] where super block = Nodes (entryLabel block) (Seq.singleton block) - labelNumber = \lbl -> fromJust $ mapLookup lbl numbers - where numbers :: LabelMap Int - numbers = mapFromList $ map swap blocks + labelNumber = \lbl -> fromJust $ NonDet.mapLookup lbl numbers + where numbers :: NonDet.LabelMap Int + numbers = NonDet.mapFromList $ map swap blocks swap (k, block) = (entryLabel block, k) addSuccEdges :: CGraph -> (Node, CmmBlock) -> CGraph addSuccEdges graph (k, block) = @@ -214,10 +216,10 @@ changeBlockLabels f block = blockJoin entry' middle exit' relabel :: CmmSuper -> UniqDSM CmmSuper relabel node = do - finite_map <- foldM addPair mapEmpty $ definedLabels node + finite_map <- foldM addPair NonDet.mapEmpty $ definedLabels node return $ changeLabels (labelChanger finite_map) node - where addPair :: LabelMap Label -> Label -> UniqDSM (LabelMap Label) + where addPair :: NonDet.LabelMap Label -> Label -> UniqDSM (NonDet.LabelMap Label) addPair map old = do new <- newBlockId - return $ mapInsert old new map - labelChanger :: LabelMap Label -> (Label -> Label) - labelChanger mapping = \lbl -> mapFindWithDefault lbl lbl mapping + return $ NonDet.mapInsert old new map + labelChanger :: NonDet.LabelMap Label -> (Label -> Label) + labelChanger mapping = \lbl -> NonDet.mapFindWithDefault lbl lbl mapping ===================================== compiler/GHC/Cmm/UniqueRenamer.hs ===================================== @@ -17,7 +17,7 @@ import GHC.Cmm import GHC.Cmm.CLabel import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Cmm.Switch -- import GHC.Cmm.Info.Build import GHC.Types.Unique @@ -122,8 +122,8 @@ instance UniqRenamable LocalReg where -- uniqRename (LocalReg uq t) = pure $ LocalReg uq t -- ROMES:TODO: This has unique r1, we're debugging. this may still be a source of non determinism. -instance UniqRenamable Label where - uniqRename lbl = mkHooplLabel . getKey <$> renameDetUniq (getUnique lbl) +instance UniqRenamable Det.Label where + uniqRename lbl = Det.mkHooplLabel . getKey <$> renameDetUniq (getUnique lbl) instance UniqRenamable CmmTickScope where -- ROMES:TODO: We may have to change this to get deterministic objects with ticks. @@ -191,8 +191,8 @@ instance UniqRenamable CmmLit where -- This is fine because LabelMap is backed by a deterministic UDFM instance UniqRenamable a {- for 'Body' and on 'RawCmmStatics' -} - => UniqRenamable (LabelMap a) where - uniqRename lm = mapFromListWith panicMapKeysNotInjective <$> traverse (\(l,x) -> (,) <$> uniqRename l <*> uniqRename x) (mapToList lm) + => UniqRenamable (Det.LabelMap a) where + uniqRename lm = Det.mapFromListWith panicMapKeysNotInjective <$> traverse (\(l,x) -> (,) <$> uniqRename l <*> uniqRename x) (Det.mapToList lm) instance UniqRenamable CmmGraph where uniqRename (CmmGraph e g) = CmmGraph <$> uniqRename e <*> uniqRename g ===================================== compiler/GHC/Cmm/Utils.hs ===================================== @@ -84,7 +84,8 @@ import GHC.Platform.Regs import Data.ByteString (ByteString) import qualified Data.ByteString as BS import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Dataflow.Block --------------------------------------------------- @@ -515,19 +516,19 @@ mkLiveness platform (reg:regs) modifyGraph :: (Graph n C C -> Graph n' C C) -> GenCmmGraph n -> GenCmmGraph n' modifyGraph f g = CmmGraph {g_entry=g_entry g, g_graph=f (g_graph g)} -ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph +ofBlockMap :: BlockId -> Det.LabelMap CmmBlock -> CmmGraph ofBlockMap entry bodyMap = CmmGraph {g_entry=entry, g_graph=GMany NothingO bodyMap NothingO} -- | like 'toBlockList', but the entry block always comes first toBlockListEntryFirst :: CmmGraph -> [CmmBlock] toBlockListEntryFirst g - | mapNull m = [] + | Det.mapNull m = [] | otherwise = entry_block : others where m = toBlockMap g entry_id = g_entry g - Just entry_block = mapLookup entry_id m - others = filter ((/= entry_id) . entryLabel) (mapElems m) + Just entry_block = Det.mapLookup entry_id m + others = filter ((/= entry_id) . entryLabel) (Det.mapElems m) -- | Like 'toBlockListEntryFirst', but we strive to ensure that we order blocks -- so that the false case of a conditional jumps to the next block in the output @@ -539,21 +540,21 @@ toBlockListEntryFirst g -- defined in "GHC.Cmm.Node". -GBM toBlockListEntryFirstFalseFallthrough :: CmmGraph -> [CmmBlock] toBlockListEntryFirstFalseFallthrough g - | mapNull m = [] - | otherwise = dfs setEmpty [entry_block] + | Det.mapNull m = [] + | otherwise = dfs NonDet.setEmpty [entry_block] where m = toBlockMap g entry_id = g_entry g - Just entry_block = mapLookup entry_id m + Just entry_block = Det.mapLookup entry_id m - dfs :: LabelSet -> [CmmBlock] -> [CmmBlock] + dfs :: NonDet.LabelSet -> [CmmBlock] -> [CmmBlock] dfs _ [] = [] dfs visited (block:bs) - | id `setMember` visited = dfs visited bs - | otherwise = block : dfs (setInsert id visited) bs' + | id `NonDet.setMember` visited = dfs visited bs + | otherwise = block : dfs (NonDet.setInsert id visited) bs' where id = entryLabel block bs' = foldr add_id bs (successors block) - add_id id bs = case mapLookup id m of + add_id id bs = case Det.mapLookup id m of Just b -> b : bs Nothing -> bs @@ -568,14 +569,14 @@ mapGraphNodes :: ( CmmNode C O -> CmmNode C O -> CmmGraph -> CmmGraph mapGraphNodes funs@(mf,_,_) g = ofBlockMap (entryLabel $ mf $ CmmEntry (g_entry g) GlobalScope) $ - mapMap (mapBlock3' funs) $ toBlockMap g + Det.mapMap (mapBlock3' funs) $ toBlockMap g mapGraphNodes1 :: (forall e x. CmmNode e x -> CmmNode e x) -> CmmGraph -> CmmGraph mapGraphNodes1 f = modifyGraph (mapGraph f) foldlGraphBlocks :: (a -> CmmBlock -> a) -> a -> CmmGraph -> a -foldlGraphBlocks k z g = mapFoldl k z $ toBlockMap g +foldlGraphBlocks k z g = Det.mapFoldl k z $ toBlockMap g ------------------------------------------------- -- Tick utilities ===================================== compiler/GHC/CmmToAsm.hs ===================================== @@ -95,7 +95,7 @@ import GHC.Cmm.DebugBlock import GHC.Cmm.BlockId import GHC.StgToCmm.CgUtils ( fixStgRegisters ) import GHC.Cmm -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.GenericOpt import GHC.Cmm.CLabel @@ -166,7 +166,7 @@ data NativeGenAcc statics instr -- required. , ngs_colorStats :: ![[Color.RegAllocStats statics instr]] , ngs_linearStats :: ![[Linear.RegAllocStats]] - , ngs_labels :: ![Label] + , ngs_labels :: ![NonDet.Label] , ngs_debug :: ![DebugBlock] , ngs_dwarfFiles :: !DwarfFiles , ngs_unwinds :: !(NonDet.LabelMap [UnwindPoint]) @@ -345,7 +345,7 @@ cmmNativeGens :: forall statics instr jumpDest. -> NCGConfig -> NcgImpl statics instr jumpDest -> BufHandle - -> LabelMap DebugBlock + -> NonDet.LabelMap DebugBlock -> DUniqSupply -> [RawCmmDecl] -> NativeGenAcc statics instr @@ -433,7 +433,7 @@ cmmNativeGen -> NcgImpl statics instr jumpDest -> DUniqSupply -> DwarfFiles - -> LabelMap DebugBlock + -> NonDet.LabelMap DebugBlock -> RawCmmDecl -- ^ the cmm to generate code for -> Int -- ^ sequence number of this top thing -> IO ( DUniqSupply @@ -660,7 +660,7 @@ cmmNativeGen logger ncgImpl us fileIds dbgMap cmm count {-# SCC "invertCondBranches" #-} map invert sequenced where - invertConds :: LabelMap RawCmmStatics -> [NatBasicBlock instr] + invertConds :: Det.LabelMap RawCmmStatics -> [NatBasicBlock instr] -> [NatBasicBlock instr] invertConds = invertCondBranches ncgImpl optimizedCFG invert top at CmmData {} = top @@ -700,18 +700,18 @@ maybeDumpCfg logger (Just cfg) msg proc_name checkLayout :: [NatCmmDecl statics instr] -> [NatCmmDecl statics instr] -> Bool checkLayout procsUnsequenced procsSequenced = - assertPpr (setNull diff) (text "Block sequencing dropped blocks:" <> ppr diff) + assertPpr (NonDet.setNull diff) (text "Block sequencing dropped blocks:" <> ppr diff) True where - blocks1 = foldl' (setUnion) setEmpty $ - map getBlockIds procsUnsequenced :: LabelSet - blocks2 = foldl' (setUnion) setEmpty $ + blocks1 = foldl' (NonDet.setUnion) NonDet.setEmpty $ + map getBlockIds procsUnsequenced :: NonDet.LabelSet + blocks2 = foldl' (NonDet.setUnion) NonDet.setEmpty $ map getBlockIds procsSequenced - diff = setDifference blocks1 blocks2 + diff = NonDet.setDifference blocks1 blocks2 - getBlockIds (CmmData _ _) = setEmpty + getBlockIds (CmmData _ _) = NonDet.setEmpty getBlockIds (CmmProc _ _ _ (ListGraph blocks)) = - setFromList $ map blockId blocks + NonDet.setFromList $ map blockId blocks -- | Compute unwinding tables for the blocks of a procedure computeUnwinding :: Instruction instr @@ -735,7 +735,7 @@ computeUnwinding _ ncgImpl (CmmProc _ _ _ (ListGraph blks)) = -- information at the beginning of every block means that there is no need -- to perform this sort of push-down. NonDet.mapFromList [ (blk_lbl, extractUnwindPoints ncgImpl instrs) - | BasicBlock blk_lbl instrs <- blks ] + | BasicBlock blk_lbl instrs <- blks ] -- | Build a doc for all the imports. -- @@ -842,8 +842,8 @@ shortcutBranches config ncgImpl tops weights build_mapping :: forall instr t d statics jumpDest. NcgImpl statics instr jumpDest - -> GenCmmDecl d (LabelMap t) (ListGraph instr) - -> (GenCmmDecl d (LabelMap t) (ListGraph instr) + -> GenCmmDecl d (Det.LabelMap t) (ListGraph instr) + -> (GenCmmDecl d (Det.LabelMap t) (ListGraph instr) ,NonDet.LabelMap jumpDest) build_mapping _ top@(CmmData _ _) = (top, NonDet.mapEmpty) build_mapping _ (CmmProc info lbl live (ListGraph [])) @@ -858,21 +858,21 @@ build_mapping ncgImpl (CmmProc info lbl live (ListGraph (head:blocks))) -- Don't completely eliminate loops here -- that can leave a dangling jump! shortcut_blocks :: [(BlockId, jumpDest)] (_, shortcut_blocks, others) = - foldl' split (setEmpty :: LabelSet, [], []) blocks + foldl' split (NonDet.setEmpty :: NonDet.LabelSet, [], []) blocks split (s, shortcut_blocks, others) b@(BasicBlock id [insn]) | Just jd <- canShortcut ncgImpl insn , Just dest <- getJumpDestBlockId ncgImpl jd , not (has_info id) - , (setMember dest s) || dest == id -- loop checks + , (NonDet.setMember dest s) || dest == id -- loop checks = (s, shortcut_blocks, b : others) split (s, shortcut_blocks, others) (BasicBlock id [insn]) | Just dest <- canShortcut ncgImpl insn , not (has_info id) - = (setInsert id s, (id,dest) : shortcut_blocks, others) + = (NonDet.setInsert id s, (id,dest) : shortcut_blocks, others) split (s, shortcut_blocks, others) other = (s, shortcut_blocks, other : others) -- do not eliminate blocks that have an info table - has_info l = mapMember l info + has_info l = Det.mapMember l info -- build a mapping from BlockId to JumpDest for shorting branches mapping = NonDet.mapFromList shortcut_blocks @@ -918,7 +918,7 @@ genMachCode :: NCGConfig -> (RawCmmDecl -> NatM [NatCmmDecl statics instr]) -> DwarfFiles - -> LabelMap DebugBlock + -> NonDet.LabelMap DebugBlock -> RawCmmDecl -> CFG -> UniqDSM ===================================== compiler/GHC/CmmToAsm/CFG.hs ===================================== @@ -48,7 +48,6 @@ import GHC.Cmm.BlockId import GHC.Cmm as Cmm import GHC.Cmm.Switch ---import GHC.Cmm.Dataflow.Label import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Cmm.Dataflow.Block ===================================== compiler/GHC/CmmToAsm/Monad.hs ===================================== @@ -55,7 +55,8 @@ import GHC.CmmToAsm.Config import GHC.CmmToAsm.Types import GHC.Cmm.BlockId -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.CLabel ( CLabel ) import GHC.Cmm.DebugBlock import GHC.Cmm.Expr (LocalReg (..), isWord64) @@ -112,14 +113,14 @@ data NcgImpl statics instr jumpDest = NcgImpl { -> UniqDSM (NatCmmDecl statics instr, [(BlockId,BlockId)]), -- ^ The list of block ids records the redirected jumps to allow us to update -- the CFG. - ncgMakeFarBranches :: Platform -> LabelMap RawCmmStatics -> [NatBasicBlock instr] + ncgMakeFarBranches :: Platform -> Det.LabelMap RawCmmStatics -> [NatBasicBlock instr] -> UniqDSM [NatBasicBlock instr], extractUnwindPoints :: [instr] -> [UnwindPoint], -- ^ given the instruction sequence of a block, produce a list of -- the block's 'UnwindPoint's -- See Note [What is this unwinding business?] in "GHC.Cmm.DebugBlock" -- and Note [Unwinding information in the NCG] in this module. - invertCondBranches :: Maybe CFG -> LabelMap RawCmmStatics -> [NatBasicBlock instr] + invertCondBranches :: Maybe CFG -> Det.LabelMap RawCmmStatics -> [NatBasicBlock instr] -> [NatBasicBlock instr] -- ^ Turn the sequence of @jcc l1; jmp l2@ into @jncc l2; \@ -- when possible. @@ -184,7 +185,7 @@ data NatM_State natm_pic :: Maybe Reg, natm_config :: NCGConfig, natm_fileid :: DwarfFiles, - natm_debug_map :: LabelMap DebugBlock, + natm_debug_map :: NonDet.LabelMap DebugBlock, natm_cfg :: CFG -- ^ Having a CFG with additional information is essential for some -- operations. However we can't reconstruct all information once we @@ -206,7 +207,7 @@ unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a mkNatM_State :: DUniqSupply -> Int -> NCGConfig -> - DwarfFiles -> LabelMap DebugBlock -> CFG -> NatM_State + DwarfFiles -> NonDet.LabelMap DebugBlock -> CFG -> NatM_State mkNatM_State us delta config = \dwf dbg cfg -> NatM_State @@ -364,5 +365,5 @@ getFileId f = NatM $ \st -> fids = addToUFM (natm_fileid st) f (f,n) in n `seq` fids `seq` (n, st { natm_fileid = fids }) -getDebugBlock :: Label -> NatM (Maybe DebugBlock) -getDebugBlock l = NatM $ \st -> (mapLookup l (natm_debug_map st), st) +getDebugBlock :: NonDet.Label -> NatM (Maybe DebugBlock) +getDebugBlock l = NatM $ \st -> (NonDet.mapLookup l (natm_debug_map st), st) ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -32,7 +32,7 @@ import GHC.CmmToAsm.Utils import GHC.CmmToAsm.Ppr import GHC.Cmm hiding (topInfoTable) -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Cmm.DebugBlock (pprUnwindTable) @@ -161,7 +161,7 @@ pprSizeDecl platform lbl then line (text "\t.size" <+> pprAsmLabel platform lbl <> text ", .-" <> pprAsmLabel platform lbl) else empty -pprBasicBlock :: IsDoc doc => NCGConfig -> LabelMap RawCmmStatics -> NatBasicBlock Instr -> doc +pprBasicBlock :: IsDoc doc => NCGConfig -> Det.LabelMap RawCmmStatics -> NatBasicBlock Instr -> doc pprBasicBlock config info_env (BasicBlock blockid instrs) = maybe_infotable $ pprLabel platform block_label $$ @@ -175,7 +175,7 @@ pprBasicBlock config info_env (BasicBlock blockid instrs) where block_label = blockLbl blockid platform = ncgPlatform config - maybe_infotable c = case mapLookup blockid info_env of + maybe_infotable c = case Det.mapLookup blockid info_env of Nothing -> c Just (CmmStaticsRaw infoLbl info) -> pprAlignForSection platform Text $$ ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -39,7 +39,7 @@ import GHC.Cmm.CLabel import GHC.Cmm hiding (pprBBlock, pprStatic) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Cmm.InitFini @@ -78,7 +78,7 @@ cmmToC platform tops = (vcat $ intersperse blankLine $ map (pprTop platform) top pprTop :: Platform -> RawCmmDecl -> SDoc pprTop platform = \case (CmmProc infos clbl _in_live_regs graph) -> - (case mapLookup (g_entry graph) infos of + (case Det.mapLookup (g_entry graph) infos of Nothing -> empty Just (CmmStaticsRaw info_clbl info_dat) -> pprDataExterns platform info_dat $$ ===================================== compiler/GHC/CmmToLlvm.hs ===================================== @@ -25,7 +25,7 @@ import GHC.CmmToLlvm.Version import GHC.StgToCmm.CgUtils ( fixStgRegisters ) import GHC.Cmm -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det import GHC.Utils.BufHandle import GHC.Driver.DynFlags @@ -135,7 +135,7 @@ llvmGroupLlvmGens cmm = do let split (CmmData s d' ) = return $ Just (s, d') split (CmmProc h l live g) = do -- Set function type - let l' = case mapLookup (g_entry g) h :: Maybe RawCmmStatics of + let l' = case Det.mapLookup (g_entry g) h :: Maybe RawCmmStatics of Nothing -> l Just (CmmStaticsRaw info_lbl _) -> info_lbl lml <- strCLabel_llvm l' ===================================== compiler/GHC/Wasm/ControlFlow/FromCmm.hs ===================================== @@ -17,7 +17,8 @@ import GHC.Cmm import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dominators import GHC.Cmm.Dataflow.Graph -import GHC.Cmm.Dataflow.Label +import qualified GHC.Cmm.Dataflow.Label as Det +import qualified GHC.Cmm.Dataflow.Label.NonDet as NonDet import GHC.Cmm.Reducibility import GHC.Cmm.Switch @@ -57,12 +58,12 @@ to be found at https://www.cs.tufts.edu/~nr/pubs/relooper.pdf. -- -- * Not at all. -data ControlFlow e = Unconditional Label - | Conditional e Label Label +data ControlFlow e = Unconditional NonDet.Label + | Conditional e NonDet.Label NonDet.Label | Switch { _scrutinee :: e , _range :: BrTableInterval - , _targets :: [Maybe Label] -- from 0 - , _defaultTarget :: Maybe Label + , _targets :: [Maybe NonDet.Label] -- from 0 + , _defaultTarget :: Maybe NonDet.Label } | TailCall e @@ -89,18 +90,18 @@ flowLeaving platform b = -- reaches a given label. data ContainingSyntax - = BlockFollowedBy Label - | LoopHeadedBy Label - | IfThenElse (Maybe Label) -- ^ Carries the label that follows `if...end`, if any + = BlockFollowedBy NonDet.Label + | LoopHeadedBy NonDet.Label + | IfThenElse (Maybe NonDet.Label) -- ^ Carries the label that follows `if...end`, if any -matchesFrame :: Label -> ContainingSyntax -> Bool +matchesFrame :: NonDet.Label -> ContainingSyntax -> Bool matchesFrame label (BlockFollowedBy l) = label == l matchesFrame label (LoopHeadedBy l) = label == l matchesFrame label (IfThenElse (Just l)) = label == l matchesFrame _ _ = False data Context = Context { enclosing :: [ContainingSyntax] - , fallthrough :: Maybe Label -- the label can + , fallthrough :: Maybe NonDet.Label -- the label can -- be reached just by "falling through" -- the hole } @@ -114,7 +115,7 @@ emptyContext :: Context emptyContext = Context [] Nothing inside :: ContainingSyntax -> Context -> Context -withFallthrough :: Context -> Label -> Context +withFallthrough :: Context -> NonDet.Label -> Context inside frame c = c { enclosing = frame : enclosing c } withFallthrough c l = c { fallthrough = Just l } @@ -140,8 +141,8 @@ emptyPost _ = False structuredControl :: forall expr stmt m . MonadUniqDSM m => Platform -- ^ needed for offset calculation - -> (Label -> CmmExpr -> m expr) -- ^ translator for expressions - -> (Label -> CmmActions -> m stmt) -- ^ translator for straight-line code + -> (NonDet.Label -> CmmExpr -> m expr) -- ^ translator for expressions + -> (NonDet.Label -> CmmActions -> m stmt) -- ^ translator for straight-line code -> CmmGraph -- ^ CFG to be translated -> m (WasmControl stmt expr '[] '[ 'I32]) structuredControl platform txExpr txBlock g' = do @@ -158,9 +159,9 @@ structuredControl platform txExpr txBlock g' = do doTree :: FT '[] post -> Tree.Tree CmmBlock -> Context -> m (WasmControl stmt expr '[] post) nodeWithin :: forall post . - FT '[] post -> CmmBlock -> [Tree.Tree CmmBlock] -> Maybe Label + FT '[] post -> CmmBlock -> [Tree.Tree CmmBlock] -> Maybe NonDet.Label -> Context -> m (WasmControl stmt expr '[] post) - doBranch :: FT '[] post -> Label -> Label -> Context -> m (WasmControl stmt expr '[] post) + doBranch :: FT '[] post -> NonDet.Label -> NonDet.Label -> Context -> m (WasmControl stmt expr '[] post) doTree fty (Tree.Node x children) context = let codeForX = nodeWithin fty x selectedChildren Nothing @@ -206,7 +207,7 @@ structuredControl platform txExpr txBlock g' = do <$~> range <$~> map switchIndex targets <$~> switchIndex default' - where switchIndex :: Maybe Label -> Int + where switchIndex :: Maybe NonDet.Label -> Int switchIndex Nothing = 0 -- arbitrary; GHC won't go here switchIndex (Just lbl) = index lbl (enclosing context) @@ -226,82 +227,82 @@ structuredControl platform txExpr txBlock g' = do ---- everything else is utility functions - treeEntryLabel :: Tree.Tree CmmBlock -> Label + treeEntryLabel :: Tree.Tree CmmBlock -> NonDet.Label treeEntryLabel = entryLabel . Tree.rootLabel - sortTree :: Tree.Tree Label -> Tree.Tree Label + sortTree :: Tree.Tree NonDet.Label -> Tree.Tree NonDet.Label -- Sort highest rpnum first sortTree (Tree.Node label children) = Tree.Node label $ sortBy (flip compare `on` (rpnum . Tree.rootLabel)) $ map sortTree children - subtreeAt :: Label -> Tree.Tree CmmBlock - blockLabeled :: Label -> CmmBlock - rpnum :: Label -> RPNum-- reverse postorder number of the labeled block - isMergeLabel :: Label -> Bool + subtreeAt :: NonDet.Label -> Tree.Tree CmmBlock + blockLabeled :: NonDet.Label -> CmmBlock + rpnum :: NonDet.Label -> RPNum-- reverse postorder number of the labeled block + isMergeLabel :: NonDet.Label -> Bool isMergeNode :: CmmBlock -> Bool isLoopHeader :: CmmBlock -> Bool-- identify loop headers -- all nodes whose immediate dominator is the given block. -- They are produced with the largest RP number first, -- so the largest RP number is pushed on the context first. - dominates :: Label -> Label -> Bool + dominates :: NonDet.Label -> NonDet.Label -> Bool -- Domination relation (not just immediate domination) - blockmap :: LabelMap CmmBlock + blockmap :: Det.LabelMap CmmBlock GMany NothingO blockmap NothingO = g_graph g - blockLabeled l = findLabelIn l blockmap + blockLabeled l = findLabelInDet l blockmap rpblocks :: [CmmBlock] rpblocks = revPostorderFrom blockmap (g_entry g) - foldEdges :: forall a . (Label -> Label -> a -> a) -> a -> a + foldEdges :: forall a . (NonDet.Label -> NonDet.Label -> a -> a) -> a -> a foldEdges f a = foldl (\a (from, to) -> f from to a) a [(entryLabel from, to) | from <- rpblocks, to <- successors from] - isMergeLabel l = setMember l mergeBlockLabels + isMergeLabel l = NonDet.setMember l mergeBlockLabels isMergeNode = isMergeLabel . entryLabel - isBackward :: Label -> Label -> Bool + isBackward :: NonDet.Label -> NonDet.Label -> Bool isBackward from to = rpnum to <= rpnum from -- self-edge counts as a backward edge subtreeAt label = findLabelIn label subtrees - subtrees :: LabelMap (Tree.Tree CmmBlock) - subtrees = addSubtree mapEmpty dominatorTree + subtrees :: NonDet.LabelMap (Tree.Tree CmmBlock) + subtrees = addSubtree NonDet.mapEmpty dominatorTree where addSubtree map t@(Tree.Node root children) = - foldl addSubtree (mapInsert (entryLabel root) t map) children + foldl addSubtree (NonDet.mapInsert (entryLabel root) t map) children - mergeBlockLabels :: LabelSet + mergeBlockLabels :: NonDet.LabelSet -- N.B. A block is a merge node if it is where control flow merges. -- That means it is entered by multiple control-flow edges, _except_ -- back edges don't count. There must be multiple paths that enter the -- block _without_ passing through the block itself. mergeBlockLabels = - setFromList [entryLabel n | n <- rpblocks, big (forwardPreds (entryLabel n))] + NonDet.setFromList [entryLabel n | n <- rpblocks, big (forwardPreds (entryLabel n))] where big [] = False big [_] = False big (_ : _ : _) = True - forwardPreds :: Label -> [Label] -- reachable predecessors of reachable blocks, + forwardPreds :: NonDet.Label -> [NonDet.Label] -- reachable predecessors of reachable blocks, -- via forward edges only - forwardPreds = \l -> mapFindWithDefault [] l predmap - where predmap :: LabelMap [Label] - predmap = foldEdges addForwardEdge mapEmpty + forwardPreds = \l -> NonDet.mapFindWithDefault [] l predmap + where predmap :: NonDet.LabelMap [NonDet.Label] + predmap = foldEdges addForwardEdge NonDet.mapEmpty addForwardEdge from to pm | isBackward from to = pm | otherwise = addToList (from :) to pm isLoopHeader = isHeaderLabel . entryLabel - isHeaderLabel = (`setMember` headers) -- loop headers - where headers :: LabelSet + isHeaderLabel = (`NonDet.setMember` headers) -- loop headers + where headers :: NonDet.LabelSet headers = foldMap headersPointedTo blockmap headersPointedTo block = - setFromList [label | label <- successors block, + NonDet.setFromList [label | label <- successors block, dominates label (entryLabel block)] - index :: Label -> [ContainingSyntax] -> Int + index :: NonDet.Label -> [ContainingSyntax] -> Int index _ [] = panic "destination label not in evaluation context" index label (frame : context) | label `matchesFrame` frame = 0 @@ -331,8 +332,8 @@ smartPlus platform e k = CmmMachOp (MO_Add width) [e, CmmLit (CmmInt (toInteger k) width)] where width = cmmExprWidth platform e -addToList :: ([a] -> [a]) -> Label -> LabelMap [a] -> LabelMap [a] -addToList consx = mapAlter add +addToList :: ([a] -> [a]) -> NonDet.Label -> NonDet.LabelMap [a] -> NonDet.LabelMap [a] +addToList consx = NonDet.mapAlter add where add Nothing = Just (consx []) add (Just xs) = Just (consx xs) @@ -344,8 +345,13 @@ instance Outputable ContainingSyntax where ppr (LoopHeadedBy l) = text "loop" <+> ppr l ppr (IfThenElse l) = text "if-then-else" <+> ppr l -findLabelIn :: HasDebugCallStack => Label -> LabelMap a -> a -findLabelIn lbl = mapFindWithDefault failed lbl +findLabelInDet :: HasDebugCallStack => Det.Label -> Det.LabelMap a -> a +findLabelInDet lbl = Det.mapFindWithDefault failed lbl + where failed = + pprPanic "label not found in control-flow graph" (ppr lbl) + +findLabelIn :: HasDebugCallStack => NonDet.Label -> NonDet.LabelMap a -> a +findLabelIn lbl = NonDet.mapFindWithDefault failed lbl where failed = pprPanic "label not found in control-flow graph" (ppr lbl) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fef3e4362b0a35f1ca17b13a29e8132e974af6c3 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fef3e4362b0a35f1ca17b13a29e8132e974af6c3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 11:00:54 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 07:00:54 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] reimplement lookup avoidance Message-ID: <66910ce63c81d_27caeb203ec18146088@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: 9cd5a0f7 by Torsten Schmits at 2024-07-12T13:00:40+02:00 reimplement lookup avoidance - - - - - 3 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -82,8 +83,8 @@ data LinkDepsOpts = LinkDepsOpts data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -109,7 +110,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -128,33 +128,24 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then oneshot_deps opts (filterOut isInteractiveModule mods) else make_deps - -- TODO this used to avoid some lookups, maybe we can move that to - -- oneshot_deps now - -- (mods_needed, links_got) = partitionWith split_mods mods_s - -- - -- split_mods mod = - -- let is_linked = lookupModuleEnv (objs_loaded pls) mod - -- <|> lookupModuleEnv (bcos_loaded pls) mod - -- in case is_linked of - -- Just linkable -> Right linkable - -- Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - (lnks, pkgs_s) <- partitionWithM dep_linkable deps - let - lnks_needed = concat lnks - pkgs_s' = mkUniqDSet pkgs_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s' `minusUDFM` pkgs_loaded pls - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - -- , ldAllLinkables = links_got ++ lnks_needed - , ldAllLinkables = lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s' - } + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts @@ -217,11 +208,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" - dep_linkable = \case - LinkModules mods -> Left <$> mapM get_linkable (eltsUDFM mods) - LinkLibrary uid -> pure (Right uid) - - get_linkable = \case + module_linkable = \case LinkHomeModule hmi -> pure (expectJust "getLinkDeps" (homeModLinkable hmi)) @@ -271,21 +258,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do adjust_ul _ l at LoadedBCOs{} = return l adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) -data LinkObjectModule = +data LinkModule = LinkHomeModule HomeModInfo | LinkObjectModule ModIface ModLocation | LinkByteCodeModule ModIface WholeCoreBindings -instance Outputable LinkObjectModule where +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where ppr = \case LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") LinkObjectModule iface _ -> ppr (mi_module iface) LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") data LinkDep = - LinkModules (UniqDFM ModuleName LinkObjectModule) + LinkModules (UniqDFM ModuleName LinkModule) | LinkLibrary UnitId @@ -433,6 +426,33 @@ link_boot_mod_error mod = text "module" <+> ppr mod <+> text "cannot be linked; it is only available as a boot module" +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod + {- Note [Using Byte Code rather than Object Code for Template Haskell] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9cd5a0f7b271ab9931e8b26703134a3c00c1b518 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9cd5a0f7b271ab9931e8b26703134a3c00c1b518 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 11:58:22 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 07:58:22 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/torsten.schmits/package-deps-bytecode-squashed Message-ID: <66911a5e8742a_27caeb278dab41483e@gitlab.mail> Torsten Schmits pushed new branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/torsten.schmits/package-deps-bytecode-squashed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 11:58:40 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 07:58:40 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/torsten.schmits/oneshot-bytecode-squashed Message-ID: <66911a701a832_27caeb27e9314148523@gitlab.mail> Torsten Schmits pushed new branch wip/torsten.schmits/oneshot-bytecode-squashed at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/torsten.schmits/oneshot-bytecode-squashed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 12:09:48 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 08:09:48 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] reimplement lookup avoidance Message-ID: <66911d0c507e8_27caeb299a26c151942@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: a9d81178 by Torsten Schmits at 2024-07-12T14:09:19+02:00 reimplement lookup avoidance - - - - - 3 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -82,8 +83,8 @@ data LinkDepsOpts = LinkDepsOpts data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -109,7 +110,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -118,43 +118,33 @@ get_link_deps -> [Module] -> IO LinkDeps get_link_deps opts pls maybe_normal_osuf span mods = do - -- 1. Find the dependent home-pkg-modules/packages from each iface - -- (omitting modules from the interactive package, which is already linked) - deps <- - -- Why two code paths here? There is a significant amount of repeated work - -- performed calculating transitive dependencies - -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) - if ldOneShotMode opts + -- 1. Find the dependent home-pkg-modules/packages from each iface + -- (omitting modules from the interactive package, which is already linked) + -- Why two code paths here? There is a significant amount of repeated work + -- performed calculating transitive dependencies + -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) + deps <- if ldOneShotMode opts then oneshot_deps opts (filterOut isInteractiveModule mods) else make_deps - -- TODO this used to avoid some lookups, maybe we can move that to - -- oneshot_deps now - -- (mods_needed, links_got) = partitionWith split_mods mods_s - -- - -- split_mods mod = - -- let is_linked = lookupModuleEnv (objs_loaded pls) mod - -- <|> lookupModuleEnv (bcos_loaded pls) mod - -- in case is_linked of - -- Just linkable -> Right linkable - -- Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - (lnks, pkgs_s) <- partitionWithM dep_linkable deps - let - lnks_needed = concat lnks - pkgs_s' = mkUniqDSet pkgs_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s' `minusUDFM` pkgs_loaded pls - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - -- , ldAllLinkables = links_got ++ lnks_needed - , ldAllLinkables = lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s' - } + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts @@ -217,11 +207,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" - dep_linkable = \case - LinkModules mods -> Left <$> mapM get_linkable (eltsUDFM mods) - LinkLibrary uid -> pure (Right uid) - - get_linkable = \case + module_linkable = \case LinkHomeModule hmi -> pure (expectJust "getLinkDeps" (homeModLinkable hmi)) @@ -271,21 +257,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do adjust_ul _ l at LoadedBCOs{} = return l adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) -data LinkObjectModule = +data LinkModule = LinkHomeModule HomeModInfo | LinkObjectModule ModIface ModLocation | LinkByteCodeModule ModIface WholeCoreBindings -instance Outputable LinkObjectModule where +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where ppr = \case LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") LinkObjectModule iface _ -> ppr (mi_module iface) LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") data LinkDep = - LinkModules (UniqDFM ModuleName LinkObjectModule) + LinkModules (UniqDFM ModuleName LinkModule) | LinkLibrary UnitId @@ -433,6 +425,33 @@ link_boot_mod_error mod = text "module" <+> ppr mod <+> text "cannot be linked; it is only available as a boot module" +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod + {- Note [Using Byte Code rather than Object Code for Template Haskell] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a9d811785554315d3a6d722ca31acba52079b908 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a9d811785554315d3a6d722ca31acba52079b908 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 12:48:52 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 08:48:52 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] Package deps bytecode linking Message-ID: <669126344623c_27caeb3077e4015329b@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: f14b10aa by Torsten Schmits at 2024-07-12T14:48:40+02:00 Package deps bytecode linking - - - - - 19 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/obj.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash - + testsuite/tests/th/cross-package/unit1 - + testsuite/tests/th/cross-package/unit2 Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -47,8 +48,10 @@ import GHC.Utils.Misc import GHC.Unit.Home import GHC.Data.Maybe -import Control.Monad import Control.Applicative +import Control.Monad +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) import qualified Data.Set as Set import qualified Data.Map as M @@ -58,8 +61,6 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock -import GHC.Driver.Flags -import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -70,6 +71,7 @@ data LinkDepsOpts = LinkDepsOpts , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldFinderCache :: !FinderCache -- ^ Finder cache , ldFinderOpts :: !FinderOpts -- ^ Finder options + , ldHugFinderOpts :: !(UnitEnvGraph FinderOpts) , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects , ldMsgOpts :: !(DiagnosticOpts IfaceMessage) -- ^ Options for diagnostics , ldWays :: !Ways -- ^ Enabled ways @@ -81,8 +83,8 @@ data LinkDepsOpts = LinkDepsOpts data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -108,7 +110,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -117,47 +118,48 @@ get_link_deps -> [Module] -> IO LinkDeps get_link_deps opts pls maybe_normal_osuf span mods = do - -- 1. Find the dependent home-pkg-modules/packages from each iface - -- (omitting modules from the interactive package, which is already linked) - (mods_s, pkgs_s) <- - -- Why two code paths here? There is a significant amount of repeated work - -- performed calculating transitive dependencies - -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) - if ldOneShotMode opts - then follow_deps (filterOut isInteractiveModule mods) - emptyUniqDSet emptyUniqDSet; - else do - (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods - return (catMaybes mmods, unionManyUniqDSets (init_pkg_set : pkgs)) - - let - -- 2. Exclude ones already linked - -- Main reason: avoid findModule calls in get_linkable - (mods_needed, links_got) = partitionWith split_mods mods_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s `minusUDFM` pkgs_loaded pls - - split_mods mod = - let is_linked = lookupModuleEnv (objs_loaded pls) mod - <|> lookupModuleEnv (bcos_loaded pls) mod - in case is_linked of - Just linkable -> Right linkable - Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM get_linkable mods_needed - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - , ldAllLinkables = links_got ++ lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s - } + -- 1. Find the dependent home-pkg-modules/packages from each iface + -- (omitting modules from the interactive package, which is already linked) + -- Why two code paths here? There is a significant amount of repeated work + -- performed calculating transitive dependencies + -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) + deps <- if ldOneShotMode opts + then oneshot_deps opts (filterOut isInteractiveModule mods) + else make_deps + + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts + make_deps = do + (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods + let + link_mods = + listToUDFM [(moduleName (mi_module (hm_iface m)), m) | m <- mmods] + link_libs = + uniqDSetToList (unionManyUniqDSets (init_pkg_set : pkgs)) + pure $ + LinkModules (LinkHomeModule <$> link_mods) : + (LinkLibrary <$> link_libs) + -- This code is used in `--make` mode to calculate the home package and unit dependencies -- for a set of modules. -- @@ -189,73 +191,14 @@ get_link_deps opts pls maybe_normal_osuf span mods = do get_mod_info (ModNodeKeyWithUid gwib uid) = case lookupHug (ue_home_unit_graph unit_env) uid (gwib_mod gwib) of - Just hmi -> - let iface = (hm_iface hmi) - mmod = case mi_hsc_src iface of - HsBootFile -> link_boot_mod_error (mi_module iface) - _ -> return $ Just (mi_module iface) - - in (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface),) <$> mmod + Just hmi -> do + let iface = hm_iface hmi + case mi_hsc_src iface of + HsBootFile -> throwProgramError opts $ link_boot_mod_error (mi_module iface) + _ -> pure (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface), hmi) Nothing -> throwProgramError opts $ text "getLinkDeps: Home module not loaded" <+> ppr (gwib_mod gwib) <+> ppr uid - - -- This code is used in one-shot mode to traverse downwards through the HPT - -- to find all link dependencies. - -- The ModIface contains the transitive closure of the module dependencies - -- within the current package, *except* for boot modules: if we encounter - -- a boot module, we have to find its real interface and discover the - -- dependencies of that. Hence we need to traverse the dependency - -- tree recursively. See bug #936, testcase ghci/prog007. - follow_deps :: [Module] -- modules to follow - -> UniqDSet Module -- accum. module dependencies - -> UniqDSet UnitId -- accum. package dependencies - -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs - = return (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod:mods) acc_mods acc_pkgs - = do - mb_iface <- ldLoadIface opts msg mod - iface <- case mb_iface of - Failed err -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> return iface - - when (mi_boot iface == IsBoot) $ link_boot_mod_error mod - - let - pkg = moduleUnit mod - deps = mi_deps iface - - pkg_deps = dep_direct_pkgs deps - (boot_deps, mod_deps) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ - \case - (_, GWIB m IsBoot) -> Left m - (_, GWIB m NotBoot) -> Right m - - mod_deps' = case ue_homeUnit unit_env of - Nothing -> [] - Just home_unit -> filter (not . (`elementOfUniqDSet` acc_mods)) (map (mkHomeModule home_unit) $ (boot_deps ++ mod_deps)) - acc_mods' = case ue_homeUnit unit_env of - Nothing -> acc_mods - Just home_unit -> addListToUniqDSet acc_mods (mod : map (mkHomeModule home_unit) mod_deps) - acc_pkgs' = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) - - case ue_homeUnit unit_env of - Just home_unit | isHomeUnit home_unit pkg -> follow_deps (mod_deps' ++ mods) - acc_mods' acc_pkgs' - _ -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" - - - - link_boot_mod_error :: Module -> IO a - link_boot_mod_error mod = throwProgramError opts $ - text "module" <+> ppr mod <+> - text "cannot be linked; it is only available as a boot module" - no_obj :: Outputable a => a -> IO b no_obj mod = dieWith opts span $ text "cannot find object file for module " <> @@ -264,6 +207,20 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" + module_linkable = \case + LinkHomeModule hmi -> + pure (expectJust "getLinkDeps" (homeModLinkable hmi)) + + LinkObjectModule iface loc -> do + let mod = mi_module iface + findObjectLinkableMaybe mod loc >>= \case + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + LinkByteCodeModule iface wcb -> do + details <- initModDetails (ldHscEnv opts) iface + t <- getCurrentTime + initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable @@ -272,73 +229,228 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable mod -- A home-package module - | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) - = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) - | otherwise - = do -- It's not in the HPT because we are in one shot mode, - -- so use the Finder to get a ModLocation... - case ue_homeUnit unit_env of - Nothing -> no_obj mod - Just home_unit -> do - - let fc = ldFinderCache opts - let fopts = ldFinderOpts opts - mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) - case mb_stuff of - Found loc mod -> found loc mod - _ -> no_obj (moduleName mod) - where - found loc mod - | prefer_bytecode = do - Succeeded iface <- ldLoadIface opts (text "makima") mod - case mi_extra_decls iface of - Just extra_decls -> do - details <- initModDetails hsc_env iface - t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] - _ -> fallback_no_bytecode loc mod - | otherwise = fallback_no_bytecode loc mod - - fallback_no_bytecode loc mod = do - mb_lnk <- findObjectLinkableMaybe mod loc - case mb_lnk of - Nothing -> no_obj mod - Just lnk -> adjust_linkable lnk - - prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags - - dflags = hsc_dflags hsc_env - - hsc_env = ldHscEnv opts - - adjust_linkable lnk - | Just new_osuf <- maybe_normal_osuf = do - new_uls <- mapM (adjust_ul new_osuf) - (linkableUnlinked lnk) - return lnk{ linkableUnlinked=new_uls } - | otherwise = - return lnk - - adjust_ul new_osuf (DotO file) = do - -- file may already has new_osuf suffix. One example - -- is when we load bytecode from whole core bindings, - -- then the corresponding foreign stub objects are - -- compiled as shared objects and file may already has - -- .dyn_o suffix. And it's okay as long as the file to - -- load is already there. - let new_file = file -<.> new_osuf - ok <- doesFileExist new_file - if (not ok) - then dieWith opts span $ - text "cannot find object file " - <> quotes (text new_file) $$ while_linking_expr - else return (DotO new_file) - adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) - adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) - adjust_ul _ l@(BCOs {}) = return l - adjust_ul _ l at LoadedBCOs{} = return l - adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + adjust_linkable lnk + | Just new_osuf <- maybe_normal_osuf = do + new_uls <- mapM (adjust_ul new_osuf) + (linkableUnlinked lnk) + return lnk{ linkableUnlinked=new_uls } + | otherwise = + return lnk + + adjust_ul new_osuf (DotO file) = do + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf + ok <- doesFileExist new_file + if (not ok) + then dieWith opts span $ + text "cannot find object file " + <> quotes (text new_file) $$ while_linking_expr + else return (DotO new_file) + adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) + adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) + adjust_ul _ l@(BCOs {}) = return l + adjust_ul _ l at LoadedBCOs{} = return l + adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + +data LinkModule = + LinkHomeModule HomeModInfo + | + LinkObjectModule ModIface ModLocation + | + LinkByteCodeModule ModIface WholeCoreBindings + +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where + ppr = \case + LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") + LinkObjectModule iface _ -> ppr (mi_module iface) + LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") + +data LinkDep = + LinkModules (UniqDFM ModuleName LinkModule) + | + LinkLibrary UnitId + +instance Outputable LinkDep where + ppr = \case + LinkModules mods -> text "modules:" <+> ppr (eltsUDFM mods) + LinkLibrary uid -> text "library:" <+> ppr uid + +data OneshotError = + NoLocation Module + | + NoInterface MissingInterfaceError + | + LinkBootModule Module + +-- This code is used in one-shot mode to traverse downwards through the HPT +-- to find all link dependencies. +-- The ModIface contains the transitive closure of the module dependencies +-- within the current package, *except* for boot modules: if we encounter +-- a boot module, we have to find its real interface and discover the +-- dependencies of that. Hence we need to traverse the dependency +-- tree recursively. See bug #936, testcase ghci/prog007. +oneshot_deps :: + LinkDepsOpts -> + -- | Modules whose imports to follow + [Module] -> + IO [LinkDep] +oneshot_deps opts mods = + runExceptT (oneshot_deps_loop opts mods emptyUDFM) >>= \case + Right a -> pure (eltsUDFM a) + Left err -> throwProgramError opts (message err) + where + message = \case + NoLocation mod -> + pprPanic "found iface but no location" (ppr mod) + NoInterface err -> + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + LinkBootModule mod -> + link_boot_mod_error mod + +oneshot_deps_loop :: + LinkDepsOpts -> + [Module] -> + UniqDFM UnitId LinkDep -> + ExceptT OneshotError IO (UniqDFM UnitId LinkDep) +oneshot_deps_loop _ [] acc = + pure acc +oneshot_deps_loop opts (mod : mods) acc = do + (new_acc, new_mods) <- process_module + oneshot_deps_loop opts (new_mods ++ mods) new_acc + where + process_module + | already_seen = pure (acc, []) + | is_home || bytecode = try_iface + | otherwise = add_library + + already_seen + | Just (LinkModules mods) <- mod_dep + = elemUDFM mod_name mods + | Just (LinkLibrary _) <- mod_dep + = True + | otherwise + = False + + try_iface = + liftIO (ldLoadIface opts load_reason mod) >>= \case + Failed err -> throwE (NoInterface err) + Succeeded iface -> + location >>= \case + InstalledFound loc _ -> with_iface loc iface + _ -> throwE (NoLocation mod) + + with_iface loc iface + | mi_boot iface == IsBoot + = throwE (LinkBootModule mod) + | bytecode + , Just core_bindings <- mi_extra_decls iface + , let wcb = WholeCoreBindings core_bindings mod loc + = pure (add_module iface (LinkByteCodeModule iface wcb)) + | is_home + = pure (add_module iface (LinkObjectModule iface loc)) + | otherwise + = add_library + + add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) + + add_module iface lmod = + (addListToUDFM with_mod (direct_pkgs iface), new_deps iface) + where + with_mod = alterUDFM (add_package_module lmod) acc mod_unit_id + + add_package_module lmod = \case + Just (LinkLibrary u) -> Just (LinkLibrary u) + Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) + Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + + direct_pkgs iface + | bytecode + = [] + | otherwise + = [(u, LinkLibrary u) | u <- Set.toList (dep_direct_pkgs (mi_deps iface))] + + new_deps iface + | bytecode + -- TODO How can we better determine the external deps? + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | is_home + = local + | otherwise + = [] + where + local = + [ + mkModule mod_unit m + -- TODO Somehow this just works, no idea what the deal was in the + -- old code with boot modules. + | (_, GWIB m _) <- Set.toList (dep_direct_mods (mi_deps iface)) + ] + + is_home + | Just home <- mb_home + = homeUnitAsUnit home == mod_unit + | otherwise + = False + + location = + liftIO $ + findExactModule (ldFinderCache opts) (ldFinderOpts opts) + (ldHugFinderOpts opts) (hsc_units (ldHscEnv opts)) mb_home + (toUnitId <$> mod) + + mod_dep = lookupUDFM acc mod_unit_id + mod_name = moduleName mod + mod_unit_id = moduleUnitId mod + mod_unit = moduleUnit mod + load_reason = + text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + bytecode = ldUseByteCode opts + mb_home = ue_homeUnit (ldUnitEnv opts) + +link_boot_mod_error :: Module -> SDoc +link_boot_mod_error mod = + text "module" <+> ppr mod <+> + text "cannot be linked; it is only available as a boot module" + +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod {- Note [Using Byte Code rather than Object Code for Template Haskell] ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 @@ -645,6 +645,7 @@ initLinkDepsOpts hsc_env = opts , ldPprOpts = initSDocContext dflags defaultUserStyle , ldFinderCache = hsc_FC hsc_env , ldFinderOpts = initFinderOpts dflags + , ldHugFinderOpts = initFinderOpts . homeUnitEnv_dflags <$> hsc_HUG hsc_env , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -0,0 +1,12 @@ +{-# language TemplateHaskell #-} + +module Main where + +import GHC.Prim +import CrossLocal (splc) + +a :: Int +a = $(splc) + +main :: IO () +main = putStrLn (show a) ===================================== testsuite/tests/th/cross-package/CrossDep.hs ===================================== @@ -0,0 +1,15 @@ +module CrossDep where + +data A = A Int + +used :: Int +used = 9681 + +dep :: A +dep = A used + +unused1 :: A +unused1 = A 1 + +unused2 :: A +unused2 = unused1 ===================================== testsuite/tests/th/cross-package/CrossDepApi.hs ===================================== @@ -0,0 +1,7 @@ +module CrossDepApi (A (A), dep) where + +import CrossDep (A (A)) +import qualified CrossDep + +dep :: A +dep = CrossDep.dep ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -0,0 +1,16 @@ +{-# language PackageImports #-} + +module CrossLocal where + +import GHC.Prim +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +-- just to be sure that the file isn't accidentally picked up locally +import "dep" CrossDepApi (dep, A (A)) +import {-# source #-} CrossNum (num) +import CrossObj (numo) + +splc :: ExpQ +splc = lift @_ @Int (num + d + numo) + where + A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs ===================================== @@ -0,0 +1,4 @@ +module CrossNum where + +num :: Int +num = 48332 ===================================== testsuite/tests/th/cross-package/CrossNum.hs-boot ===================================== @@ -0,0 +1,3 @@ +module CrossNum where + +num :: Int ===================================== testsuite/tests/th/cross-package/CrossObj.hs ===================================== @@ -0,0 +1,4 @@ +module CrossObj where + +numo :: Int +numo = 0 ===================================== testsuite/tests/th/cross-package/CrossPackage.stdout ===================================== @@ -0,0 +1 @@ +58013 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -0,0 +1,37 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# TODO it works even without -package obj, but it should complain about the package not being exposed +DB := -package-db db -package dep +BASIC := $(TEST_HC_OPTS) $(DB) -this-unit-id=cross -v0 +BC := -fprefer-byte-code -fbyte-code-and-object-code +ARGS := $(BASIC) $(BC) + +.PHONY: CrossPackageArchive +CrossPackageArchive: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageEmptyArchive +CrossPackageEmptyArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 2 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageNoArchive +CrossPackageNoArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageArchiveObjCode +CrossPackageArchiveObjCode: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(BASIC)" + +.PHONY: CrossPackageMultiUnit +CrossPackageMultiUnit: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + mkdir -p unit2-src/ + mv CrossLocal.hs CrossNum.hs CrossNum.hs-boot unit2-src/ + "$(TEST_HC)" $(TEST_HC_OPTS) $(ARGS) -unit @unit1 -unit @unit2 + ./Cross ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -0,0 +1,29 @@ +def cross_test(suf, files = []): + name = f'CrossPackage{suf}' + test( + name, + [ + extra_files([ + 'Cross.hs', + 'CrossLocal.hs', + 'CrossDep.hs', + 'CrossDepApi.hs', + 'CrossNum.hs', + 'CrossNum.hs-boot', + 'CrossObj.hs', + 'dep.conf', + 'obj.conf', + 'prep.bash', + 'run.bash', + ] + files), + use_specs({'stdout': 'CrossPackage.stdout'}), + ], + makefile_test, + [name], + ) + +cross_test('Archive') +cross_test('EmptyArchive') +cross_test('NoArchive') +cross_test('ArchiveObjCode') +cross_test('MultiUnit', ['unit1', 'unit2']) ===================================== testsuite/tests/th/cross-package/dep.conf ===================================== @@ -0,0 +1,8 @@ +name: dep +version: 1.0 +id: dep-1.0 +key: dep-1.0 +exposed: True +exposed-modules: CrossDepApi +import-dirs: ${pkgroot}/dep +library-dirs: ${pkgroot}/dep ===================================== testsuite/tests/th/cross-package/obj.conf ===================================== @@ -0,0 +1,8 @@ +name: obj +version: 1.0 +id: obj-1.0 +key: obj-1.0 +exposed: True +exposed-modules: CrossObj +import-dirs: ${pkgroot}/obj +library-dirs: ${pkgroot}/obj ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" +ghc_pkg_cmd="$3" +archive="$4" + +base="$PWD" +db="$base/db" +dep="$base/dep" +conf_dep="${dep}/dep.conf" +obj="$base/obj" +conf_obj="${obj}/obj.conf" + +ghc_pkg() +{ + eval "${ghc_pkg_cmd at Q} --no-user-package-db --package-db=${db at Q} $@" +} + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +mkdir -p "$dep" "$obj" "$db" +mv CrossDep.hs CrossDepApi.hs "$dep/" +cp dep.conf "$dep/" +mv CrossObj.hs "$obj/" +cp obj.conf "$obj/" + +ghc_pkg recache + +ghc "-package-db ${db at Q} -hidir ${dep at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${dep at Q}/CrossDep.hs ${dep at Q}/CrossDepApi.hs" + +ghc "-package-db ${db at Q} -hidir ${obj at Q} -O0 -this-unit-id obj-1.0 -c ${obj at Q}/CrossObj.hs" +$AR cqs "${obj}/libHSobj-1.0.a" "${obj}/CrossObj.o" +echo 'hs-libraries: HSobj-1.0' >> "$conf_obj" + +if [[ "$archive" == 1 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" "${dep}/CrossDep.o" "${dep}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +elif [[ "$archive" == 2 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +fi + +ghc_pkg -v0 register "${conf_dep at Q}" +ghc_pkg -v0 register "${conf_obj at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +ghc -c CrossNum.hs-boot CrossNum.hs CrossLocal.hs +ghc -c Cross.hs +ghc Cross.o -o Cross +./Cross ===================================== testsuite/tests/th/cross-package/unit1 ===================================== @@ -0,0 +1 @@ +-i -i. Cross -this-unit-id unit1 -package-id unit2 ===================================== testsuite/tests/th/cross-package/unit2 ===================================== @@ -0,0 +1 @@ +-i -i./unit2-src CrossLocal CrossNum -this-unit-id unit2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f14b10aa764bb20c4043d84c54a1bc1b8618ad93 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f14b10aa764bb20c4043d84c54a1bc1b8618ad93 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 14:26:37 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 10:26:37 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] re-add missing call to adjust_linkable for home modules Message-ID: <66913d1d3bf55_1abaf81247875276@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: d0630912 by Torsten Schmits at 2024-07-12T16:26:24+02:00 re-add missing call to adjust_linkable for home modules - - - - - 1 changed file: - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -209,7 +209,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do module_linkable = \case LinkHomeModule hmi -> - pure (expectJust "getLinkDeps" (homeModLinkable hmi)) + adjust_linkable (expectJust "getLinkDeps" (homeModLinkable hmi)) LinkObjectModule iface loc -> do let mod = mi_module iface View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d063091221590a893e4eb75968c5b7019132fe45 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d063091221590a893e4eb75968c5b7019132fe45 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 14:27:40 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 10:27:40 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] Package deps bytecode linking Message-ID: <66913d5ce1b41_1abaf87e99875463@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: ee58ce1f by Torsten Schmits at 2024-07-12T16:27:28+02:00 Package deps bytecode linking - - - - - 19 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/obj.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash - + testsuite/tests/th/cross-package/unit1 - + testsuite/tests/th/cross-package/unit2 Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -47,8 +48,10 @@ import GHC.Utils.Misc import GHC.Unit.Home import GHC.Data.Maybe -import Control.Monad import Control.Applicative +import Control.Monad +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) import qualified Data.Set as Set import qualified Data.Map as M @@ -58,8 +61,6 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock -import GHC.Driver.Flags -import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -70,6 +71,7 @@ data LinkDepsOpts = LinkDepsOpts , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldFinderCache :: !FinderCache -- ^ Finder cache , ldFinderOpts :: !FinderOpts -- ^ Finder options + , ldHugFinderOpts :: !(UnitEnvGraph FinderOpts) , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects , ldMsgOpts :: !(DiagnosticOpts IfaceMessage) -- ^ Options for diagnostics , ldWays :: !Ways -- ^ Enabled ways @@ -81,8 +83,8 @@ data LinkDepsOpts = LinkDepsOpts data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -108,7 +110,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -117,47 +118,48 @@ get_link_deps -> [Module] -> IO LinkDeps get_link_deps opts pls maybe_normal_osuf span mods = do - -- 1. Find the dependent home-pkg-modules/packages from each iface - -- (omitting modules from the interactive package, which is already linked) - (mods_s, pkgs_s) <- - -- Why two code paths here? There is a significant amount of repeated work - -- performed calculating transitive dependencies - -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) - if ldOneShotMode opts - then follow_deps (filterOut isInteractiveModule mods) - emptyUniqDSet emptyUniqDSet; - else do - (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods - return (catMaybes mmods, unionManyUniqDSets (init_pkg_set : pkgs)) - - let - -- 2. Exclude ones already linked - -- Main reason: avoid findModule calls in get_linkable - (mods_needed, links_got) = partitionWith split_mods mods_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s `minusUDFM` pkgs_loaded pls - - split_mods mod = - let is_linked = lookupModuleEnv (objs_loaded pls) mod - <|> lookupModuleEnv (bcos_loaded pls) mod - in case is_linked of - Just linkable -> Right linkable - Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM get_linkable mods_needed - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - , ldAllLinkables = links_got ++ lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s - } + -- 1. Find the dependent home-pkg-modules/packages from each iface + -- (omitting modules from the interactive package, which is already linked) + -- Why two code paths here? There is a significant amount of repeated work + -- performed calculating transitive dependencies + -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) + deps <- if ldOneShotMode opts + then oneshot_deps opts (filterOut isInteractiveModule mods) + else make_deps + + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts + make_deps = do + (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods + let + link_mods = + listToUDFM [(moduleName (mi_module (hm_iface m)), m) | m <- mmods] + link_libs = + uniqDSetToList (unionManyUniqDSets (init_pkg_set : pkgs)) + pure $ + LinkModules (LinkHomeModule <$> link_mods) : + (LinkLibrary <$> link_libs) + -- This code is used in `--make` mode to calculate the home package and unit dependencies -- for a set of modules. -- @@ -189,73 +191,14 @@ get_link_deps opts pls maybe_normal_osuf span mods = do get_mod_info (ModNodeKeyWithUid gwib uid) = case lookupHug (ue_home_unit_graph unit_env) uid (gwib_mod gwib) of - Just hmi -> - let iface = (hm_iface hmi) - mmod = case mi_hsc_src iface of - HsBootFile -> link_boot_mod_error (mi_module iface) - _ -> return $ Just (mi_module iface) - - in (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface),) <$> mmod + Just hmi -> do + let iface = hm_iface hmi + case mi_hsc_src iface of + HsBootFile -> throwProgramError opts $ link_boot_mod_error (mi_module iface) + _ -> pure (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface), hmi) Nothing -> throwProgramError opts $ text "getLinkDeps: Home module not loaded" <+> ppr (gwib_mod gwib) <+> ppr uid - - -- This code is used in one-shot mode to traverse downwards through the HPT - -- to find all link dependencies. - -- The ModIface contains the transitive closure of the module dependencies - -- within the current package, *except* for boot modules: if we encounter - -- a boot module, we have to find its real interface and discover the - -- dependencies of that. Hence we need to traverse the dependency - -- tree recursively. See bug #936, testcase ghci/prog007. - follow_deps :: [Module] -- modules to follow - -> UniqDSet Module -- accum. module dependencies - -> UniqDSet UnitId -- accum. package dependencies - -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs - = return (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod:mods) acc_mods acc_pkgs - = do - mb_iface <- ldLoadIface opts msg mod - iface <- case mb_iface of - Failed err -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> return iface - - when (mi_boot iface == IsBoot) $ link_boot_mod_error mod - - let - pkg = moduleUnit mod - deps = mi_deps iface - - pkg_deps = dep_direct_pkgs deps - (boot_deps, mod_deps) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ - \case - (_, GWIB m IsBoot) -> Left m - (_, GWIB m NotBoot) -> Right m - - mod_deps' = case ue_homeUnit unit_env of - Nothing -> [] - Just home_unit -> filter (not . (`elementOfUniqDSet` acc_mods)) (map (mkHomeModule home_unit) $ (boot_deps ++ mod_deps)) - acc_mods' = case ue_homeUnit unit_env of - Nothing -> acc_mods - Just home_unit -> addListToUniqDSet acc_mods (mod : map (mkHomeModule home_unit) mod_deps) - acc_pkgs' = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) - - case ue_homeUnit unit_env of - Just home_unit | isHomeUnit home_unit pkg -> follow_deps (mod_deps' ++ mods) - acc_mods' acc_pkgs' - _ -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" - - - - link_boot_mod_error :: Module -> IO a - link_boot_mod_error mod = throwProgramError opts $ - text "module" <+> ppr mod <+> - text "cannot be linked; it is only available as a boot module" - no_obj :: Outputable a => a -> IO b no_obj mod = dieWith opts span $ text "cannot find object file for module " <> @@ -264,6 +207,20 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" + module_linkable = \case + LinkHomeModule hmi -> + adjust_linkable (expectJust "getLinkDeps" (homeModLinkable hmi)) + + LinkObjectModule iface loc -> do + let mod = mi_module iface + findObjectLinkableMaybe mod loc >>= \case + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + LinkByteCodeModule iface wcb -> do + details <- initModDetails (ldHscEnv opts) iface + t <- getCurrentTime + initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable @@ -272,73 +229,228 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable mod -- A home-package module - | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) - = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) - | otherwise - = do -- It's not in the HPT because we are in one shot mode, - -- so use the Finder to get a ModLocation... - case ue_homeUnit unit_env of - Nothing -> no_obj mod - Just home_unit -> do - - let fc = ldFinderCache opts - let fopts = ldFinderOpts opts - mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) - case mb_stuff of - Found loc mod -> found loc mod - _ -> no_obj (moduleName mod) - where - found loc mod - | prefer_bytecode = do - Succeeded iface <- ldLoadIface opts (text "makima") mod - case mi_extra_decls iface of - Just extra_decls -> do - details <- initModDetails hsc_env iface - t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] - _ -> fallback_no_bytecode loc mod - | otherwise = fallback_no_bytecode loc mod - - fallback_no_bytecode loc mod = do - mb_lnk <- findObjectLinkableMaybe mod loc - case mb_lnk of - Nothing -> no_obj mod - Just lnk -> adjust_linkable lnk - - prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags - - dflags = hsc_dflags hsc_env - - hsc_env = ldHscEnv opts - - adjust_linkable lnk - | Just new_osuf <- maybe_normal_osuf = do - new_uls <- mapM (adjust_ul new_osuf) - (linkableUnlinked lnk) - return lnk{ linkableUnlinked=new_uls } - | otherwise = - return lnk - - adjust_ul new_osuf (DotO file) = do - -- file may already has new_osuf suffix. One example - -- is when we load bytecode from whole core bindings, - -- then the corresponding foreign stub objects are - -- compiled as shared objects and file may already has - -- .dyn_o suffix. And it's okay as long as the file to - -- load is already there. - let new_file = file -<.> new_osuf - ok <- doesFileExist new_file - if (not ok) - then dieWith opts span $ - text "cannot find object file " - <> quotes (text new_file) $$ while_linking_expr - else return (DotO new_file) - adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) - adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) - adjust_ul _ l@(BCOs {}) = return l - adjust_ul _ l at LoadedBCOs{} = return l - adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + adjust_linkable lnk + | Just new_osuf <- maybe_normal_osuf = do + new_uls <- mapM (adjust_ul new_osuf) + (linkableUnlinked lnk) + return lnk{ linkableUnlinked=new_uls } + | otherwise = + return lnk + + adjust_ul new_osuf (DotO file) = do + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf + ok <- doesFileExist new_file + if (not ok) + then dieWith opts span $ + text "cannot find object file " + <> quotes (text new_file) $$ while_linking_expr + else return (DotO new_file) + adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) + adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) + adjust_ul _ l@(BCOs {}) = return l + adjust_ul _ l at LoadedBCOs{} = return l + adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + +data LinkModule = + LinkHomeModule HomeModInfo + | + LinkObjectModule ModIface ModLocation + | + LinkByteCodeModule ModIface WholeCoreBindings + +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where + ppr = \case + LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") + LinkObjectModule iface _ -> ppr (mi_module iface) + LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") + +data LinkDep = + LinkModules (UniqDFM ModuleName LinkModule) + | + LinkLibrary UnitId + +instance Outputable LinkDep where + ppr = \case + LinkModules mods -> text "modules:" <+> ppr (eltsUDFM mods) + LinkLibrary uid -> text "library:" <+> ppr uid + +data OneshotError = + NoLocation Module + | + NoInterface MissingInterfaceError + | + LinkBootModule Module + +-- This code is used in one-shot mode to traverse downwards through the HPT +-- to find all link dependencies. +-- The ModIface contains the transitive closure of the module dependencies +-- within the current package, *except* for boot modules: if we encounter +-- a boot module, we have to find its real interface and discover the +-- dependencies of that. Hence we need to traverse the dependency +-- tree recursively. See bug #936, testcase ghci/prog007. +oneshot_deps :: + LinkDepsOpts -> + -- | Modules whose imports to follow + [Module] -> + IO [LinkDep] +oneshot_deps opts mods = + runExceptT (oneshot_deps_loop opts mods emptyUDFM) >>= \case + Right a -> pure (eltsUDFM a) + Left err -> throwProgramError opts (message err) + where + message = \case + NoLocation mod -> + pprPanic "found iface but no location" (ppr mod) + NoInterface err -> + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + LinkBootModule mod -> + link_boot_mod_error mod + +oneshot_deps_loop :: + LinkDepsOpts -> + [Module] -> + UniqDFM UnitId LinkDep -> + ExceptT OneshotError IO (UniqDFM UnitId LinkDep) +oneshot_deps_loop _ [] acc = + pure acc +oneshot_deps_loop opts (mod : mods) acc = do + (new_acc, new_mods) <- process_module + oneshot_deps_loop opts (new_mods ++ mods) new_acc + where + process_module + | already_seen = pure (acc, []) + | is_home || bytecode = try_iface + | otherwise = add_library + + already_seen + | Just (LinkModules mods) <- mod_dep + = elemUDFM mod_name mods + | Just (LinkLibrary _) <- mod_dep + = True + | otherwise + = False + + try_iface = + liftIO (ldLoadIface opts load_reason mod) >>= \case + Failed err -> throwE (NoInterface err) + Succeeded iface -> + location >>= \case + InstalledFound loc _ -> with_iface loc iface + _ -> throwE (NoLocation mod) + + with_iface loc iface + | mi_boot iface == IsBoot + = throwE (LinkBootModule mod) + | bytecode + , Just core_bindings <- mi_extra_decls iface + , let wcb = WholeCoreBindings core_bindings mod loc + = pure (add_module iface (LinkByteCodeModule iface wcb)) + | is_home + = pure (add_module iface (LinkObjectModule iface loc)) + | otherwise + = add_library + + add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) + + add_module iface lmod = + (addListToUDFM with_mod (direct_pkgs iface), new_deps iface) + where + with_mod = alterUDFM (add_package_module lmod) acc mod_unit_id + + add_package_module lmod = \case + Just (LinkLibrary u) -> Just (LinkLibrary u) + Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) + Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + + direct_pkgs iface + | bytecode + = [] + | otherwise + = [(u, LinkLibrary u) | u <- Set.toList (dep_direct_pkgs (mi_deps iface))] + + new_deps iface + | bytecode + -- TODO How can we better determine the external deps? + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | is_home + = local + | otherwise + = [] + where + local = + [ + mkModule mod_unit m + -- TODO Somehow this just works, no idea what the deal was in the + -- old code with boot modules. + | (_, GWIB m _) <- Set.toList (dep_direct_mods (mi_deps iface)) + ] + + is_home + | Just home <- mb_home + = homeUnitAsUnit home == mod_unit + | otherwise + = False + + location = + liftIO $ + findExactModule (ldFinderCache opts) (ldFinderOpts opts) + (ldHugFinderOpts opts) (hsc_units (ldHscEnv opts)) mb_home + (toUnitId <$> mod) + + mod_dep = lookupUDFM acc mod_unit_id + mod_name = moduleName mod + mod_unit_id = moduleUnitId mod + mod_unit = moduleUnit mod + load_reason = + text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + bytecode = ldUseByteCode opts + mb_home = ue_homeUnit (ldUnitEnv opts) + +link_boot_mod_error :: Module -> SDoc +link_boot_mod_error mod = + text "module" <+> ppr mod <+> + text "cannot be linked; it is only available as a boot module" + +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod {- Note [Using Byte Code rather than Object Code for Template Haskell] ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 @@ -645,6 +645,7 @@ initLinkDepsOpts hsc_env = opts , ldPprOpts = initSDocContext dflags defaultUserStyle , ldFinderCache = hsc_FC hsc_env , ldFinderOpts = initFinderOpts dflags + , ldHugFinderOpts = initFinderOpts . homeUnitEnv_dflags <$> hsc_HUG hsc_env , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -0,0 +1,12 @@ +{-# language TemplateHaskell #-} + +module Main where + +import GHC.Prim +import CrossLocal (splc) + +a :: Int +a = $(splc) + +main :: IO () +main = putStrLn (show a) ===================================== testsuite/tests/th/cross-package/CrossDep.hs ===================================== @@ -0,0 +1,15 @@ +module CrossDep where + +data A = A Int + +used :: Int +used = 9681 + +dep :: A +dep = A used + +unused1 :: A +unused1 = A 1 + +unused2 :: A +unused2 = unused1 ===================================== testsuite/tests/th/cross-package/CrossDepApi.hs ===================================== @@ -0,0 +1,7 @@ +module CrossDepApi (A (A), dep) where + +import CrossDep (A (A)) +import qualified CrossDep + +dep :: A +dep = CrossDep.dep ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -0,0 +1,16 @@ +{-# language PackageImports #-} + +module CrossLocal where + +import GHC.Prim +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +-- just to be sure that the file isn't accidentally picked up locally +import "dep" CrossDepApi (dep, A (A)) +import {-# source #-} CrossNum (num) +import CrossObj (numo) + +splc :: ExpQ +splc = lift @_ @Int (num + d + numo) + where + A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs ===================================== @@ -0,0 +1,4 @@ +module CrossNum where + +num :: Int +num = 48332 ===================================== testsuite/tests/th/cross-package/CrossNum.hs-boot ===================================== @@ -0,0 +1,3 @@ +module CrossNum where + +num :: Int ===================================== testsuite/tests/th/cross-package/CrossObj.hs ===================================== @@ -0,0 +1,4 @@ +module CrossObj where + +numo :: Int +numo = 0 ===================================== testsuite/tests/th/cross-package/CrossPackage.stdout ===================================== @@ -0,0 +1 @@ +58013 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -0,0 +1,37 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# TODO it works even without -package obj, but it should complain about the package not being exposed +DB := -package-db db -package dep +BASIC := $(TEST_HC_OPTS) $(DB) -this-unit-id=cross -v0 +BC := -fprefer-byte-code -fbyte-code-and-object-code +ARGS := $(BASIC) $(BC) + +.PHONY: CrossPackageArchive +CrossPackageArchive: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageEmptyArchive +CrossPackageEmptyArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 2 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageNoArchive +CrossPackageNoArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageArchiveObjCode +CrossPackageArchiveObjCode: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(BASIC)" + +.PHONY: CrossPackageMultiUnit +CrossPackageMultiUnit: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + mkdir -p unit2-src/ + mv CrossLocal.hs CrossNum.hs CrossNum.hs-boot unit2-src/ + "$(TEST_HC)" $(TEST_HC_OPTS) $(ARGS) -unit @unit1 -unit @unit2 + ./Cross ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -0,0 +1,29 @@ +def cross_test(suf, files = []): + name = f'CrossPackage{suf}' + test( + name, + [ + extra_files([ + 'Cross.hs', + 'CrossLocal.hs', + 'CrossDep.hs', + 'CrossDepApi.hs', + 'CrossNum.hs', + 'CrossNum.hs-boot', + 'CrossObj.hs', + 'dep.conf', + 'obj.conf', + 'prep.bash', + 'run.bash', + ] + files), + use_specs({'stdout': 'CrossPackage.stdout'}), + ], + makefile_test, + [name], + ) + +cross_test('Archive') +cross_test('EmptyArchive') +cross_test('NoArchive') +cross_test('ArchiveObjCode') +cross_test('MultiUnit', ['unit1', 'unit2']) ===================================== testsuite/tests/th/cross-package/dep.conf ===================================== @@ -0,0 +1,8 @@ +name: dep +version: 1.0 +id: dep-1.0 +key: dep-1.0 +exposed: True +exposed-modules: CrossDepApi +import-dirs: ${pkgroot}/dep +library-dirs: ${pkgroot}/dep ===================================== testsuite/tests/th/cross-package/obj.conf ===================================== @@ -0,0 +1,8 @@ +name: obj +version: 1.0 +id: obj-1.0 +key: obj-1.0 +exposed: True +exposed-modules: CrossObj +import-dirs: ${pkgroot}/obj +library-dirs: ${pkgroot}/obj ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" +ghc_pkg_cmd="$3" +archive="$4" + +base="$PWD" +db="$base/db" +dep="$base/dep" +conf_dep="${dep}/dep.conf" +obj="$base/obj" +conf_obj="${obj}/obj.conf" + +ghc_pkg() +{ + eval "${ghc_pkg_cmd at Q} --no-user-package-db --package-db=${db at Q} $@" +} + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +mkdir -p "$dep" "$obj" "$db" +mv CrossDep.hs CrossDepApi.hs "$dep/" +cp dep.conf "$dep/" +mv CrossObj.hs "$obj/" +cp obj.conf "$obj/" + +ghc_pkg recache + +ghc "-package-db ${db at Q} -hidir ${dep at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${dep at Q}/CrossDep.hs ${dep at Q}/CrossDepApi.hs" + +ghc "-package-db ${db at Q} -hidir ${obj at Q} -O0 -this-unit-id obj-1.0 -c ${obj at Q}/CrossObj.hs" +$AR cqs "${obj}/libHSobj-1.0.a" "${obj}/CrossObj.o" +echo 'hs-libraries: HSobj-1.0' >> "$conf_obj" + +if [[ "$archive" == 1 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" "${dep}/CrossDep.o" "${dep}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +elif [[ "$archive" == 2 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +fi + +ghc_pkg -v0 register "${conf_dep at Q}" +ghc_pkg -v0 register "${conf_obj at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +ghc -c CrossNum.hs-boot CrossNum.hs CrossLocal.hs +ghc -c Cross.hs +ghc Cross.o -o Cross +./Cross ===================================== testsuite/tests/th/cross-package/unit1 ===================================== @@ -0,0 +1 @@ +-i -i. Cross -this-unit-id unit1 -package-id unit2 ===================================== testsuite/tests/th/cross-package/unit2 ===================================== @@ -0,0 +1 @@ +-i -i./unit2-src CrossLocal CrossNum -this-unit-id unit2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ee58ce1f63e868462fab07da7ca7ce5b85e48672 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ee58ce1f63e868462fab07da7ca7ce5b85e48672 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 14:43:07 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 10:43:07 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] Package deps bytecode linking Message-ID: <669140fbd8340_1abafa4f8a87565@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 063136e9 by Torsten Schmits at 2024-07-12T16:42:54+02:00 Package deps bytecode linking - - - - - 19 changed files: - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/obj.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash - + testsuite/tests/th/cross-package/unit1 - + testsuite/tests/th/cross-package/unit2 Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -47,8 +48,9 @@ import GHC.Utils.Misc import GHC.Unit.Home import GHC.Data.Maybe -import Control.Monad import Control.Applicative +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) import qualified Data.Set as Set import qualified Data.Map as M @@ -58,8 +60,6 @@ import System.Directory import GHC.Driver.Env import {-# SOURCE #-} GHC.Driver.Main import Data.Time.Clock -import GHC.Driver.Flags -import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -70,6 +70,7 @@ data LinkDepsOpts = LinkDepsOpts , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldFinderCache :: !FinderCache -- ^ Finder cache , ldFinderOpts :: !FinderOpts -- ^ Finder options + , ldHugFinderOpts :: !(UnitEnvGraph FinderOpts) , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects , ldMsgOpts :: !(DiagnosticOpts IfaceMessage) -- ^ Options for diagnostics , ldWays :: !Ways -- ^ Enabled ways @@ -81,8 +82,8 @@ data LinkDepsOpts = LinkDepsOpts data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -108,7 +109,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -117,47 +117,48 @@ get_link_deps -> [Module] -> IO LinkDeps get_link_deps opts pls maybe_normal_osuf span mods = do - -- 1. Find the dependent home-pkg-modules/packages from each iface - -- (omitting modules from the interactive package, which is already linked) - (mods_s, pkgs_s) <- - -- Why two code paths here? There is a significant amount of repeated work - -- performed calculating transitive dependencies - -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) - if ldOneShotMode opts - then follow_deps (filterOut isInteractiveModule mods) - emptyUniqDSet emptyUniqDSet; - else do - (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods - return (catMaybes mmods, unionManyUniqDSets (init_pkg_set : pkgs)) - - let - -- 2. Exclude ones already linked - -- Main reason: avoid findModule calls in get_linkable - (mods_needed, links_got) = partitionWith split_mods mods_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s `minusUDFM` pkgs_loaded pls - - split_mods mod = - let is_linked = lookupModuleEnv (objs_loaded pls) mod - <|> lookupModuleEnv (bcos_loaded pls) mod - in case is_linked of - Just linkable -> Right linkable - Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM get_linkable mods_needed - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - , ldAllLinkables = links_got ++ lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s - } + -- 1. Find the dependent home-pkg-modules/packages from each iface + -- (omitting modules from the interactive package, which is already linked) + -- Why two code paths here? There is a significant amount of repeated work + -- performed calculating transitive dependencies + -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) + deps <- if ldOneShotMode opts + then oneshot_deps opts (filterOut isInteractiveModule mods) + else make_deps + + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts + make_deps = do + (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods + let + link_mods = + listToUDFM [(moduleName (mi_module (hm_iface m)), m) | m <- mmods] + link_libs = + uniqDSetToList (unionManyUniqDSets (init_pkg_set : pkgs)) + pure $ + LinkModules (LinkHomeModule <$> link_mods) : + (LinkLibrary <$> link_libs) + -- This code is used in `--make` mode to calculate the home package and unit dependencies -- for a set of modules. -- @@ -189,73 +190,14 @@ get_link_deps opts pls maybe_normal_osuf span mods = do get_mod_info (ModNodeKeyWithUid gwib uid) = case lookupHug (ue_home_unit_graph unit_env) uid (gwib_mod gwib) of - Just hmi -> - let iface = (hm_iface hmi) - mmod = case mi_hsc_src iface of - HsBootFile -> link_boot_mod_error (mi_module iface) - _ -> return $ Just (mi_module iface) - - in (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface),) <$> mmod + Just hmi -> do + let iface = hm_iface hmi + case mi_hsc_src iface of + HsBootFile -> throwProgramError opts $ link_boot_mod_error (mi_module iface) + _ -> pure (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface), hmi) Nothing -> throwProgramError opts $ text "getLinkDeps: Home module not loaded" <+> ppr (gwib_mod gwib) <+> ppr uid - - -- This code is used in one-shot mode to traverse downwards through the HPT - -- to find all link dependencies. - -- The ModIface contains the transitive closure of the module dependencies - -- within the current package, *except* for boot modules: if we encounter - -- a boot module, we have to find its real interface and discover the - -- dependencies of that. Hence we need to traverse the dependency - -- tree recursively. See bug #936, testcase ghci/prog007. - follow_deps :: [Module] -- modules to follow - -> UniqDSet Module -- accum. module dependencies - -> UniqDSet UnitId -- accum. package dependencies - -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs - = return (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod:mods) acc_mods acc_pkgs - = do - mb_iface <- ldLoadIface opts msg mod - iface <- case mb_iface of - Failed err -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> return iface - - when (mi_boot iface == IsBoot) $ link_boot_mod_error mod - - let - pkg = moduleUnit mod - deps = mi_deps iface - - pkg_deps = dep_direct_pkgs deps - (boot_deps, mod_deps) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ - \case - (_, GWIB m IsBoot) -> Left m - (_, GWIB m NotBoot) -> Right m - - mod_deps' = case ue_homeUnit unit_env of - Nothing -> [] - Just home_unit -> filter (not . (`elementOfUniqDSet` acc_mods)) (map (mkHomeModule home_unit) $ (boot_deps ++ mod_deps)) - acc_mods' = case ue_homeUnit unit_env of - Nothing -> acc_mods - Just home_unit -> addListToUniqDSet acc_mods (mod : map (mkHomeModule home_unit) mod_deps) - acc_pkgs' = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) - - case ue_homeUnit unit_env of - Just home_unit | isHomeUnit home_unit pkg -> follow_deps (mod_deps' ++ mods) - acc_mods' acc_pkgs' - _ -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" - - - - link_boot_mod_error :: Module -> IO a - link_boot_mod_error mod = throwProgramError opts $ - text "module" <+> ppr mod <+> - text "cannot be linked; it is only available as a boot module" - no_obj :: Outputable a => a -> IO b no_obj mod = dieWith opts span $ text "cannot find object file for module " <> @@ -264,6 +206,20 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" + module_linkable = \case + LinkHomeModule hmi -> + adjust_linkable (expectJust "getLinkDeps" (homeModLinkable hmi)) + + LinkObjectModule iface loc -> do + let mod = mi_module iface + findObjectLinkableMaybe mod loc >>= \case + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + LinkByteCodeModule iface wcb -> do + details <- initModDetails (ldHscEnv opts) iface + t <- getCurrentTime + initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable @@ -272,73 +228,228 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable mod -- A home-package module - | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) - = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) - | otherwise - = do -- It's not in the HPT because we are in one shot mode, - -- so use the Finder to get a ModLocation... - case ue_homeUnit unit_env of - Nothing -> no_obj mod - Just home_unit -> do - - let fc = ldFinderCache opts - let fopts = ldFinderOpts opts - mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) - case mb_stuff of - Found loc mod -> found loc mod - _ -> no_obj (moduleName mod) - where - found loc mod - | prefer_bytecode = do - Succeeded iface <- ldLoadIface opts (text "makima") mod - case mi_extra_decls iface of - Just extra_decls -> do - details <- initModDetails hsc_env iface - t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] - _ -> fallback_no_bytecode loc mod - | otherwise = fallback_no_bytecode loc mod - - fallback_no_bytecode loc mod = do - mb_lnk <- findObjectLinkableMaybe mod loc - case mb_lnk of - Nothing -> no_obj mod - Just lnk -> adjust_linkable lnk - - prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags - - dflags = hsc_dflags hsc_env - - hsc_env = ldHscEnv opts - - adjust_linkable lnk - | Just new_osuf <- maybe_normal_osuf = do - new_uls <- mapM (adjust_ul new_osuf) - (linkableUnlinked lnk) - return lnk{ linkableUnlinked=new_uls } - | otherwise = - return lnk - - adjust_ul new_osuf (DotO file) = do - -- file may already has new_osuf suffix. One example - -- is when we load bytecode from whole core bindings, - -- then the corresponding foreign stub objects are - -- compiled as shared objects and file may already has - -- .dyn_o suffix. And it's okay as long as the file to - -- load is already there. - let new_file = file -<.> new_osuf - ok <- doesFileExist new_file - if (not ok) - then dieWith opts span $ - text "cannot find object file " - <> quotes (text new_file) $$ while_linking_expr - else return (DotO new_file) - adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) - adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) - adjust_ul _ l@(BCOs {}) = return l - adjust_ul _ l at LoadedBCOs{} = return l - adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + adjust_linkable lnk + | Just new_osuf <- maybe_normal_osuf = do + new_uls <- mapM (adjust_ul new_osuf) + (linkableUnlinked lnk) + return lnk{ linkableUnlinked=new_uls } + | otherwise = + return lnk + + adjust_ul new_osuf (DotO file) = do + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf + ok <- doesFileExist new_file + if (not ok) + then dieWith opts span $ + text "cannot find object file " + <> quotes (text new_file) $$ while_linking_expr + else return (DotO new_file) + adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) + adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) + adjust_ul _ l@(BCOs {}) = return l + adjust_ul _ l at LoadedBCOs{} = return l + adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + +data LinkModule = + LinkHomeModule HomeModInfo + | + LinkObjectModule ModIface ModLocation + | + LinkByteCodeModule ModIface WholeCoreBindings + +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where + ppr = \case + LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") + LinkObjectModule iface _ -> ppr (mi_module iface) + LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") + +data LinkDep = + LinkModules (UniqDFM ModuleName LinkModule) + | + LinkLibrary UnitId + +instance Outputable LinkDep where + ppr = \case + LinkModules mods -> text "modules:" <+> ppr (eltsUDFM mods) + LinkLibrary uid -> text "library:" <+> ppr uid + +data OneshotError = + NoLocation Module + | + NoInterface MissingInterfaceError + | + LinkBootModule Module + +-- This code is used in one-shot mode to traverse downwards through the HPT +-- to find all link dependencies. +-- The ModIface contains the transitive closure of the module dependencies +-- within the current package, *except* for boot modules: if we encounter +-- a boot module, we have to find its real interface and discover the +-- dependencies of that. Hence we need to traverse the dependency +-- tree recursively. See bug #936, testcase ghci/prog007. +oneshot_deps :: + LinkDepsOpts -> + -- | Modules whose imports to follow + [Module] -> + IO [LinkDep] +oneshot_deps opts mods = + runExceptT (oneshot_deps_loop opts mods emptyUDFM) >>= \case + Right a -> pure (eltsUDFM a) + Left err -> throwProgramError opts (message err) + where + message = \case + NoLocation mod -> + pprPanic "found iface but no location" (ppr mod) + NoInterface err -> + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + LinkBootModule mod -> + link_boot_mod_error mod + +oneshot_deps_loop :: + LinkDepsOpts -> + [Module] -> + UniqDFM UnitId LinkDep -> + ExceptT OneshotError IO (UniqDFM UnitId LinkDep) +oneshot_deps_loop _ [] acc = + pure acc +oneshot_deps_loop opts (mod : mods) acc = do + (new_acc, new_mods) <- process_module + oneshot_deps_loop opts (new_mods ++ mods) new_acc + where + process_module + | already_seen = pure (acc, []) + | is_home || bytecode = try_iface + | otherwise = add_library + + already_seen + | Just (LinkModules mods) <- mod_dep + = elemUDFM mod_name mods + | Just (LinkLibrary _) <- mod_dep + = True + | otherwise + = False + + try_iface = + liftIO (ldLoadIface opts load_reason mod) >>= \case + Failed err -> throwE (NoInterface err) + Succeeded iface -> + location >>= \case + InstalledFound loc _ -> with_iface loc iface + _ -> throwE (NoLocation mod) + + with_iface loc iface + | mi_boot iface == IsBoot + = throwE (LinkBootModule mod) + | bytecode + , Just core_bindings <- mi_extra_decls iface + , let wcb = WholeCoreBindings core_bindings mod loc + = pure (add_module iface (LinkByteCodeModule iface wcb)) + | is_home + = pure (add_module iface (LinkObjectModule iface loc)) + | otherwise + = add_library + + add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) + + add_module iface lmod = + (addListToUDFM with_mod (direct_pkgs iface), new_deps iface) + where + with_mod = alterUDFM (add_package_module lmod) acc mod_unit_id + + add_package_module lmod = \case + Just (LinkLibrary u) -> Just (LinkLibrary u) + Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) + Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + + direct_pkgs iface + | bytecode + = [] + | otherwise + = [(u, LinkLibrary u) | u <- Set.toList (dep_direct_pkgs (mi_deps iface))] + + new_deps iface + | bytecode + -- TODO How can we better determine the external deps? + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | is_home + = local + | otherwise + = [] + where + local = + [ + mkModule mod_unit m + -- TODO Somehow this just works, no idea what the deal was in the + -- old code with boot modules. + | (_, GWIB m _) <- Set.toList (dep_direct_mods (mi_deps iface)) + ] + + is_home + | Just home <- mb_home + = homeUnitAsUnit home == mod_unit + | otherwise + = False + + location = + liftIO $ + findExactModule (ldFinderCache opts) (ldFinderOpts opts) + (ldHugFinderOpts opts) (hsc_units (ldHscEnv opts)) mb_home + (toUnitId <$> mod) + + mod_dep = lookupUDFM acc mod_unit_id + mod_name = moduleName mod + mod_unit_id = moduleUnitId mod + mod_unit = moduleUnit mod + load_reason = + text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + bytecode = ldUseByteCode opts + mb_home = ue_homeUnit (ldUnitEnv opts) + +link_boot_mod_error :: Module -> SDoc +link_boot_mod_error mod = + text "module" <+> ppr mod <+> + text "cannot be linked; it is only available as a boot module" + +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod {- Note [Using Byte Code rather than Object Code for Template Haskell] ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 @@ -645,6 +645,7 @@ initLinkDepsOpts hsc_env = opts , ldPprOpts = initSDocContext dflags defaultUserStyle , ldFinderCache = hsc_FC hsc_env , ldFinderOpts = initFinderOpts dflags + , ldHugFinderOpts = initFinderOpts . homeUnitEnv_dflags <$> hsc_HUG hsc_env , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -0,0 +1,12 @@ +{-# language TemplateHaskell #-} + +module Main where + +import GHC.Prim +import CrossLocal (splc) + +a :: Int +a = $(splc) + +main :: IO () +main = putStrLn (show a) ===================================== testsuite/tests/th/cross-package/CrossDep.hs ===================================== @@ -0,0 +1,15 @@ +module CrossDep where + +data A = A Int + +used :: Int +used = 9681 + +dep :: A +dep = A used + +unused1 :: A +unused1 = A 1 + +unused2 :: A +unused2 = unused1 ===================================== testsuite/tests/th/cross-package/CrossDepApi.hs ===================================== @@ -0,0 +1,7 @@ +module CrossDepApi (A (A), dep) where + +import CrossDep (A (A)) +import qualified CrossDep + +dep :: A +dep = CrossDep.dep ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -0,0 +1,16 @@ +{-# language PackageImports #-} + +module CrossLocal where + +import GHC.Prim +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +-- just to be sure that the file isn't accidentally picked up locally +import "dep" CrossDepApi (dep, A (A)) +import {-# source #-} CrossNum (num) +import CrossObj (numo) + +splc :: ExpQ +splc = lift @_ @Int (num + d + numo) + where + A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs ===================================== @@ -0,0 +1,4 @@ +module CrossNum where + +num :: Int +num = 48332 ===================================== testsuite/tests/th/cross-package/CrossNum.hs-boot ===================================== @@ -0,0 +1,3 @@ +module CrossNum where + +num :: Int ===================================== testsuite/tests/th/cross-package/CrossObj.hs ===================================== @@ -0,0 +1,4 @@ +module CrossObj where + +numo :: Int +numo = 0 ===================================== testsuite/tests/th/cross-package/CrossPackage.stdout ===================================== @@ -0,0 +1 @@ +58013 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -0,0 +1,37 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# TODO it works even without -package obj, but it should complain about the package not being exposed +DB := -package-db db -package dep +BASIC := $(TEST_HC_OPTS) $(DB) -this-unit-id=cross -v0 +BC := -fprefer-byte-code -fbyte-code-and-object-code +ARGS := $(BASIC) $(BC) + +.PHONY: CrossPackageArchive +CrossPackageArchive: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageEmptyArchive +CrossPackageEmptyArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 2 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageNoArchive +CrossPackageNoArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageArchiveObjCode +CrossPackageArchiveObjCode: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(BASIC)" + +.PHONY: CrossPackageMultiUnit +CrossPackageMultiUnit: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + mkdir -p unit2-src/ + mv CrossLocal.hs CrossNum.hs CrossNum.hs-boot unit2-src/ + "$(TEST_HC)" $(TEST_HC_OPTS) $(ARGS) -unit @unit1 -unit @unit2 + ./Cross ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -0,0 +1,29 @@ +def cross_test(suf, files = []): + name = f'CrossPackage{suf}' + test( + name, + [ + extra_files([ + 'Cross.hs', + 'CrossLocal.hs', + 'CrossDep.hs', + 'CrossDepApi.hs', + 'CrossNum.hs', + 'CrossNum.hs-boot', + 'CrossObj.hs', + 'dep.conf', + 'obj.conf', + 'prep.bash', + 'run.bash', + ] + files), + use_specs({'stdout': 'CrossPackage.stdout'}), + ], + makefile_test, + [name], + ) + +cross_test('Archive') +cross_test('EmptyArchive') +cross_test('NoArchive') +cross_test('ArchiveObjCode') +cross_test('MultiUnit', ['unit1', 'unit2']) ===================================== testsuite/tests/th/cross-package/dep.conf ===================================== @@ -0,0 +1,8 @@ +name: dep +version: 1.0 +id: dep-1.0 +key: dep-1.0 +exposed: True +exposed-modules: CrossDepApi +import-dirs: ${pkgroot}/dep +library-dirs: ${pkgroot}/dep ===================================== testsuite/tests/th/cross-package/obj.conf ===================================== @@ -0,0 +1,8 @@ +name: obj +version: 1.0 +id: obj-1.0 +key: obj-1.0 +exposed: True +exposed-modules: CrossObj +import-dirs: ${pkgroot}/obj +library-dirs: ${pkgroot}/obj ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" +ghc_pkg_cmd="$3" +archive="$4" + +base="$PWD" +db="$base/db" +dep="$base/dep" +conf_dep="${dep}/dep.conf" +obj="$base/obj" +conf_obj="${obj}/obj.conf" + +ghc_pkg() +{ + eval "${ghc_pkg_cmd at Q} --no-user-package-db --package-db=${db at Q} $@" +} + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +mkdir -p "$dep" "$obj" "$db" +mv CrossDep.hs CrossDepApi.hs "$dep/" +cp dep.conf "$dep/" +mv CrossObj.hs "$obj/" +cp obj.conf "$obj/" + +ghc_pkg recache + +ghc "-package-db ${db at Q} -hidir ${dep at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${dep at Q}/CrossDep.hs ${dep at Q}/CrossDepApi.hs" + +ghc "-package-db ${db at Q} -hidir ${obj at Q} -O0 -this-unit-id obj-1.0 -c ${obj at Q}/CrossObj.hs" +$AR cqs "${obj}/libHSobj-1.0.a" "${obj}/CrossObj.o" +echo 'hs-libraries: HSobj-1.0' >> "$conf_obj" + +if [[ "$archive" == 1 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" "${dep}/CrossDep.o" "${dep}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +elif [[ "$archive" == 2 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +fi + +ghc_pkg -v0 register "${conf_dep at Q}" +ghc_pkg -v0 register "${conf_obj at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +ghc -c CrossNum.hs-boot CrossNum.hs CrossLocal.hs +ghc -c Cross.hs +ghc Cross.o -o Cross +./Cross ===================================== testsuite/tests/th/cross-package/unit1 ===================================== @@ -0,0 +1 @@ +-i -i. Cross -this-unit-id unit1 -package-id unit2 ===================================== testsuite/tests/th/cross-package/unit2 ===================================== @@ -0,0 +1 @@ +-i -i./unit2-src CrossLocal CrossNum -this-unit-id unit2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/063136e957d557a18d4bb8a2e908caa72dbb56b9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/063136e957d557a18d4bb8a2e908caa72dbb56b9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 14:44:07 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 12 Jul 2024 10:44:07 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] re-add missing call to adjust_linkable for home modules Message-ID: <66914137c9494_1abafa80db875889@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: c5414555 by Torsten Schmits at 2024-07-12T16:44:02+02:00 re-add missing call to adjust_linkable for home modules - - - - - 1 changed file: - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -49,7 +49,6 @@ import GHC.Unit.Home import GHC.Data.Maybe import Control.Applicative -import Control.Monad import Control.Monad.IO.Class (MonadIO (liftIO)) import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) @@ -209,7 +208,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do module_linkable = \case LinkHomeModule hmi -> - pure (expectJust "getLinkDeps" (homeModLinkable hmi)) + adjust_linkable (expectJust "getLinkDeps" (homeModLinkable hmi)) LinkObjectModule iface loc -> do let mod = mi_module iface View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c54145559449d7b3032c5256ab19d1de650b8788 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c54145559449d7b3032c5256ab19d1de650b8788 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 14:54:38 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 12 Jul 2024 10:54:38 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 4 commits: Introduce DCmmDecl, start Message-ID: <669143ae31350_1abafc5268c760b9@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 718c8ccc by Matthew Pickering at 2024-07-12T13:10:36+01:00 Introduce DCmmDecl, start - - - - - 84213f41 by Matthew Pickering at 2024-07-12T15:18:11+01:00 Removing more maps - - - - - a7d695a1 by Matthew Pickering at 2024-07-12T15:42:54+01:00 Fix warnings - - - - - 7df9ddc8 by Matthew Pickering at 2024-07-12T15:54:29+01:00 tests - - - - - 30 changed files: - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CommonBlockElim.hs - compiler/GHC/Cmm/ContFlowOpt.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Graph.hs - compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Dominators.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Types.hs - compiler/GHC/CmmToAsm/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fef3e4362b0a35f1ca17b13a29e8132e974af6c3...7df9ddc856e8dea21d6fde607e7f1acc7c8a0f38 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fef3e4362b0a35f1ca17b13a29e8132e974af6c3...7df9ddc856e8dea21d6fde607e7f1acc7c8a0f38 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:41:14 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:41:14 -0400 Subject: [Git][ghc/ghc][master] Improve docs for NondecreasingIndentation Message-ID: <66914e9acddf4_1abaf13c45b491287@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - 1 changed file: - docs/users_guide/bugs.rst Changes: ===================================== docs/users_guide/bugs.rst ===================================== @@ -129,14 +129,21 @@ Context-free syntax expressions. Specifically, the restriction that "a nested context must be indented further to the right than the enclosing context" is relaxed to allow the nested context to be at the same level as the - enclosing context, if the enclosing context is a ``do`` expression. + enclosing context, if the nested context is a ``do`` expression. - For example, the following code is accepted by GHC: :: + For example, the following code, in which a ``do`` context is nested + within a case context, and the statement `feed animal` is indented by + the same amount as the case alt, is accepted by GHC: :: - main = do args <- getArgs - if null args then return [] else do - ps <- mapM process args - mapM print ps + main = case animal of + Wombat -> do + feed animal + + But this code, with the inverse nesting, is not: :: + + main = do + case animal of + Wombat -> feed animal This behaviour is controlled by the :extension:`NondecreasingIndentation` extension. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46ec0a8e11dea77254843ef8017dd19402374c75 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46ec0a8e11dea77254843ef8017dd19402374c75 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:41:55 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:41:55 -0400 Subject: [Git][ghc/ghc][master] compiler: Fingerprint -fwrite-if-simplified-core Message-ID: <66914ec3bca0c_1abaf155f2709637a@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 5 changed files: - compiler/GHC/Iface/Recomp/Flags.hs - + testsuite/tests/driver/recomp24656/A.hs - + testsuite/tests/driver/recomp24656/Makefile - + testsuite/tests/driver/recomp24656/all.T - + testsuite/tests/driver/recomp24656/recomp24656.stdout Changes: ===================================== compiler/GHC/Iface/Recomp/Flags.hs ===================================== @@ -83,7 +83,10 @@ fingerprintDynFlags hsc_env this_mod nameio = -- Other flags which affect code generation codegen = map (`gopt` dflags) (EnumSet.toList codeGenFlags) - flags = ((mainis, safeHs, lang, cpp, js, cmm), (paths, prof, ticky, codegen, debugLevel, callerCcFilters)) + -- Did we include core for all bindings? + fat_iface = gopt Opt_WriteIfSimplifiedCore dflags + + flags = ((mainis, safeHs, lang, cpp, js, cmm), (paths, prof, ticky, codegen, debugLevel, callerCcFilters, fat_iface)) in -- pprTrace "flags" (ppr flags) $ computeFingerprint nameio flags ===================================== testsuite/tests/driver/recomp24656/A.hs ===================================== @@ -0,0 +1,4 @@ +module A where + +foo :: Int +foo = 1 ===================================== testsuite/tests/driver/recomp24656/Makefile ===================================== @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +OBJSUFFIX = .o + +recomp24656: + $(RM) A.hi A$(OBJSUFFIX) + '$(TEST_HC)' $(TEST_HC_OPTS) A.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -fwrite-if-simplified-core A.hs + '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface A.hi | grep -A6 "extra decls" + ===================================== testsuite/tests/driver/recomp24656/all.T ===================================== @@ -0,0 +1,2 @@ +test('recomp24656', [extra_files(['A.hs'])], + makefile_test, []) ===================================== testsuite/tests/driver/recomp24656/recomp24656.stdout ===================================== @@ -0,0 +1,9 @@ +[1 of 1] Compiling A ( A.hs, A.o ) +[1 of 1] Compiling A ( A.hs, A.o ) [Flags changed] +extra decls: + $trModule = GHC.Types.Module $trModule2 $trModule4 + $trModule1 = "main"# + $trModule2 = GHC.Types.TrNameS $trModule1 + $trModule3 = "A"# + $trModule4 = GHC.Types.TrNameS $trModule3 + foo = GHC.Types.I# 1# View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dddc9dff0547733a10e7f505612ab9df3a7c21b6 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dddc9dff0547733a10e7f505612ab9df3a7c21b6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:42:43 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:42:43 -0400 Subject: [Git][ghc/ghc][master] 2 commits: Add support for building profiled dynamic way Message-ID: <66914ef357f42_1abaf17583d810136d@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - 30 changed files: - .gitmodules - compiler/GHC.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json - hadrian/bootstrap/plan-9_6_1.json - hadrian/bootstrap/plan-9_6_2.json - hadrian/bootstrap/plan-9_6_3.json - hadrian/bootstrap/plan-9_6_4.json - hadrian/bootstrap/plan-9_6_5.json - hadrian/bootstrap/plan-9_8_1.json - hadrian/bootstrap/plan-9_8_2.json - hadrian/bootstrap/plan-bootstrap-9_10_1.json - hadrian/bootstrap/plan-bootstrap-9_6_1.json - hadrian/bootstrap/plan-bootstrap-9_6_2.json - hadrian/bootstrap/plan-bootstrap-9_6_3.json - hadrian/bootstrap/plan-bootstrap-9_6_4.json - hadrian/bootstrap/plan-bootstrap-9_6_5.json - hadrian/bootstrap/plan-bootstrap-9_8_1.json - hadrian/bootstrap/plan-bootstrap-9_8_2.json - hadrian/bootstrap/src/Main.hs - hadrian/build-cabal - hadrian/cabal.project - hadrian/hadrian.cabal - hadrian/src/Context.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dddc9dff0547733a10e7f505612ab9df3a7c21b6...414a6950782c8e9dff02203e8e0f720653405011 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dddc9dff0547733a10e7f505612ab9df3a7c21b6...414a6950782c8e9dff02203e8e0f720653405011 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:43:27 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:43:27 -0400 Subject: [Git][ghc/ghc][master] ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Message-ID: <66914f1f6dc3c_1abaf192b6101055d5@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 3 changed files: - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -1607,9 +1607,20 @@ genCCall target dest_regs arg_regs = do PrimTarget MO_F32_Fabs | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> unaryFloatOp W32 (\d x -> unitOL $ FABS d x) arg_reg dest_reg + | otherwise -> panic "mal-formed MO_F32_Fabs" PrimTarget MO_F64_Fabs | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> unaryFloatOp W64 (\d x -> unitOL $ FABS d x) arg_reg dest_reg + | otherwise -> panic "mal-formed MO_F64_Fabs" + PrimTarget MO_F32_Sqrt + | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> + unaryFloatOp W32 (\d x -> unitOL $ FSQRT d x) arg_reg dest_reg + | otherwise -> panic "mal-formed MO_F32_Sqrt" + PrimTarget MO_F64_Sqrt + | [arg_reg] <- arg_regs, [dest_reg] <- dest_regs -> + unaryFloatOp W64 (\d x -> unitOL $ FSQRT d x) arg_reg dest_reg + | otherwise -> panic "mal-formed MO_F64_Sqrt" + PrimTarget (MO_S_Mul2 w) -- Life is easier when we're working with word sized operands, @@ -1864,7 +1875,25 @@ genCCall target dest_regs arg_regs = do , RBIT (r dst') (r dst') ] | otherwise -> unsupported (MO_BRev w) - + PrimTarget (MO_BSwap w) + | w == W64 || w == W32 + , [src] <- arg_regs + , [dst] <- dest_regs + -> do + (reg_a, _format_x, code_x) <- getSomeReg src + let dst_reg = getRegisterReg platform (CmmLocal dst) + return $ code_x `snocOL` REV (OpReg w dst_reg) (OpReg w reg_a) + | w == W16 + , [src] <- arg_regs + , [dst] <- dest_regs + -> do + (reg_a, _format_x, code_x) <- getSomeReg src + let dst' = getRegisterReg platform (CmmLocal dst) + r n = OpReg W32 n + -- Swaps the bytes in each 16bit word + -- TODO: Expose the 32 & 64 bit version of this? + return $ code_x `snocOL` REV16 (r dst') (r reg_a) + | otherwise -> unsupported (MO_BSwap w) -- or a possibly side-effecting machine operation -- mop :: CallishMachOp (see GHC.Cmm.MachOp) @@ -1894,8 +1923,6 @@ genCCall target dest_regs arg_regs = do MO_F64_Log1P -> mkCCall "log1p" MO_F64_Exp -> mkCCall "exp" MO_F64_ExpM1 -> mkCCall "expm1" - MO_F64_Fabs -> mkCCall "fabs" - MO_F64_Sqrt -> mkCCall "sqrt" -- 32 bit float ops MO_F32_Pwr -> mkCCall "powf" @@ -1916,8 +1943,6 @@ genCCall target dest_regs arg_regs = do MO_F32_Log1P -> mkCCall "log1pf" MO_F32_Exp -> mkCCall "expf" MO_F32_ExpM1 -> mkCCall "expm1f" - MO_F32_Fabs -> mkCCall "fabsf" - MO_F32_Sqrt -> mkCCall "sqrtf" -- 64-bit primops MO_I64_ToI -> mkCCall "hs_int64ToInt" @@ -1990,7 +2015,6 @@ genCCall target dest_regs arg_regs = do MO_PopCnt w -> mkCCall (popCntLabel w) MO_Pdep w -> mkCCall (pdepLabel w) MO_Pext w -> mkCCall (pextLabel w) - MO_BSwap w -> mkCCall (bSwapLabel w) -- -- Atomic read-modify-write. MO_AtomicRead w ord ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -102,6 +102,9 @@ regUsageOfInstr platform instr = case instr of UXTH dst src -> usage (regOp src, regOp dst) CLZ dst src -> usage (regOp src, regOp dst) RBIT dst src -> usage (regOp src, regOp dst) + REV dst src -> usage (regOp src, regOp dst) + -- REV32 dst src -> usage (regOp src, regOp dst) + REV16 dst src -> usage (regOp src, regOp dst) -- 3. Logical and Move Instructions ------------------------------------------ AND dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) ASR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) @@ -139,6 +142,7 @@ regUsageOfInstr platform instr = case instr of SCVTF dst src -> usage (regOp src, regOp dst) FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) + FSQRT dst src -> usage (regOp src, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -237,7 +241,11 @@ patchRegsOfInstr instr env = case instr of SXTH o1 o2 -> SXTH (patchOp o1) (patchOp o2) UXTH o1 o2 -> UXTH (patchOp o1) (patchOp o2) CLZ o1 o2 -> CLZ (patchOp o1) (patchOp o2) - RBIT o1 o2 -> RBIT (patchOp o1) (patchOp o2) + RBIT o1 o2 -> RBIT (patchOp o1) (patchOp o2) + REV o1 o2 -> REV (patchOp o1) (patchOp o2) + -- REV32 o1 o2 -> REV32 (patchOp o1) (patchOp o2) + REV16 o1 o2 -> REV16 (patchOp o1) (patchOp o2) + -- 3. Logical and Move Instructions ---------------------------------------- AND o1 o2 o3 -> AND (patchOp o1) (patchOp o2) (patchOp o3) @@ -277,6 +285,7 @@ patchRegsOfInstr instr env = case instr of SCVTF o1 o2 -> SCVTF (patchOp o1) (patchOp o2) FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) + FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -598,6 +607,12 @@ data Instr | UBFX Operand Operand Operand Operand -- rd = rn[i,j] | CLZ Operand Operand -- rd = countLeadingZeros(rn) | RBIT Operand Operand -- rd = reverseBits(rn) + | REV Operand Operand -- rd = reverseBytes(rn): (for 32 & 64 bit operands) + -- 0xAABBCCDD -> 0xDDCCBBAA + | REV16 Operand Operand -- rd = reverseBytes16(rn) + -- 0xAABB_CCDD -> xBBAA_DDCC + -- | REV32 Operand Operand -- rd = reverseBytes32(rn) - 64bit operands only! + -- -- 0xAABBCCDD_EEFFGGHH -> 0XDDCCBBAA_HHGGFFEE -- 3. Logical and Move Instructions ---------------------------------------- | AND Operand Operand Operand -- rd = rn & op2 @@ -642,6 +657,8 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float SQuare RooT + | FSQRT Operand Operand -- | Floating-point fused multiply-add instructions -- @@ -685,6 +702,9 @@ instrCon i = UBFX{} -> "UBFX" CLZ{} -> "CLZ" RBIT{} -> "RBIT" + REV{} -> "REV" + REV16{} -> "REV16" + -- REV32{} -> "REV32" AND{} -> "AND" ASR{} -> "ASR" EOR{} -> "EOR" @@ -712,6 +732,7 @@ instrCon i = SCVTF{} -> "SCVTF" FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" + FSQRT{} -> "FSQRT" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -398,6 +398,9 @@ pprInstr platform instr = case instr of UBFM o1 o2 o3 o4 -> op4 (text "\tubfm") o1 o2 o3 o4 CLZ o1 o2 -> op2 (text "\tclz") o1 o2 RBIT o1 o2 -> op2 (text "\trbit") o1 o2 + REV o1 o2 -> op2 (text "\trev") o1 o2 + REV16 o1 o2 -> op2 (text "\trev16") o1 o2 + -- REV32 o1 o2 -> op2 (text "\trev32") o1 o2 -- signed and unsigned bitfield extract SBFX o1 o2 o3 o4 -> op4 (text "\tsbfx") o1 o2 o3 o4 UBFX o1 o2 o3 o4 -> op4 (text "\tubfx") o1 o2 o3 o4 @@ -531,6 +534,7 @@ pprInstr platform instr = case instr of SCVTF o1 o2 -> op2 (text "\tscvtf") o1 o2 FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 + FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dee035bf618d75a18fe72dd3977434c0749a2156 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dee035bf618d75a18fe72dd3977434c0749a2156 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:44:08 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:44:08 -0400 Subject: [Git][ghc/ghc][master] 3 commits: Linker: use m32 allocator for sections when NEED_PLT (#24432) Message-ID: <66914f487b9f7_1abaf1b1af70108879@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 4 changed files: - rts/linker/Elf.c - rts/linker/M32Alloc.c - rts/linker/elf_plt.c - rts/linker/macho/plt.c Changes: ===================================== rts/linker/Elf.c ===================================== @@ -863,25 +863,23 @@ ocGetNames_ELF ( ObjectCode* oc ) unsigned nstubs = numberOfStubsForSection(oc, i); unsigned stub_space = STUB_SIZE * nstubs; + unsigned full_size = size+stub_space; - void * mem = mmapAnonForLinker(size+stub_space); + // use M32 allocator to avoid fragmentation and relocations impossible + // to fulfil (cf #24432) + bool executable = kind == SECTIONKIND_CODE_OR_RODATA; + m32_allocator *allocator = executable ? oc->rx_m32 : oc->rw_m32; - if( mem == MAP_FAILED ) { - barf("failed to mmap allocated memory to load section %d. " - "errno = %d", i, errno); - } + // Correctly align the section. This is particularly important for + // the alignment of .rodata.cstNN sections. + start = m32_alloc(allocator, full_size, align); + if (start == NULL) goto fail; + alloc = SECTION_M32; /* copy only the image part over; we don't want to copy data * into the stub part. */ - memcpy( mem, oc->image + offset, size ); - - alloc = SECTION_MMAP; - - mapped_offset = 0; - mapped_size = roundUpToPage(size+stub_space); - start = mem; - mapped_start = mem; + memcpy(start, oc->image + offset, size); #else if (USE_CONTIGUOUS_MMAP || RtsFlags.MiscFlags.linkerAlwaysPic) { // already mapped. @@ -918,7 +916,7 @@ ocGetNames_ELF ( ObjectCode* oc ) #if defined(NEED_PLT) oc->sections[i].info->nstubs = 0; - oc->sections[i].info->stub_offset = (uint8_t*)mem + size; + oc->sections[i].info->stub_offset = (uint8_t*)start + size; oc->sections[i].info->stub_size = stub_space; oc->sections[i].info->stubs = NULL; #else ===================================== rts/linker/M32Alloc.c ===================================== @@ -156,7 +156,10 @@ static bool is_okay_address(void *p) { int8_t *here = LINKER_LOAD_BASE; ssize_t displacement = (int8_t *) p - here; - return (displacement > -0x7fffffff) && (displacement < 0x7fffffff); + // if we assume -fPIC, we don't care where we load code. + // But we still want to use the m32 allocator to avoid fragmentation (#24432) + return RtsFlags.MiscFlags.linkerAlwaysPic + || ((displacement > -0x7fffffff) && (displacement < 0x7fffffff)); } enum m32_page_type { ===================================== rts/linker/elf_plt.c ===================================== @@ -56,8 +56,7 @@ makeStub(Section * section, s->target = *addr; s->flags = flags; s->next = NULL; - s->addr = (uint8_t *)section->info->stub_offset + 8 - + STUB_SIZE * section->info->nstubs; + s->addr = (uint8_t *)section->info->stub_offset + STUB_SIZE * section->info->nstubs; if((*_makeStub)(s)) return EXIT_FAILURE; ===================================== rts/linker/macho/plt.c ===================================== @@ -56,8 +56,7 @@ makeStub(Section * section, s->target = *addr; s->flags = flags; s->next = NULL; - s->addr = (uint8_t *)section->info->stub_offset + 8 - + STUB_SIZE * section->info->nstubs; + s->addr = (uint8_t *)section->info->stub_offset + STUB_SIZE * section->info->nstubs; if((*_makeStub)(s)) return EXIT_FAILURE; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dee035bf618d75a18fe72dd3977434c0749a2156...c34fef56367142fa55e9861092f64cc7b9946fa1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dee035bf618d75a18fe72dd3977434c0749a2156...c34fef56367142fa55e9861092f64cc7b9946fa1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:44:51 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:44:51 -0400 Subject: [Git][ghc/ghc][master] Make type-equality on synonyms a bit faster Message-ID: <66914f73c752e_1abaf1c604ac111934@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - 7 changed files: - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs Changes: ===================================== compiler/GHC/Core/Map/Type.hs ===================================== @@ -38,6 +38,7 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.TyCo.Rep +import GHC.Core.TyCon( isForgetfulSynTyCon ) import GHC.Core.TyCo.Compare( eqForAllVis ) import GHC.Data.TrieMap @@ -228,10 +229,11 @@ eqDeBruijnType env_t1@(D env1 t1) env_t2@(D env2 t2) = andEq TEQX e = hasCast e andEq TEQ e = e - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare - go (D _ (TyConApp tc1 [])) (D _ (TyConApp tc2 [])) - | tc1 == tc2 - = TEQ + -- See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare + go (D env1 (TyConApp tc1 tys1)) (D env2 (TyConApp tc2 tys2)) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) + = gos env1 env2 tys1 tys2 + go env_t@(D env t) env_t'@(D env' t') | Just new_t <- coreView t = go (D env new_t) env_t' | Just new_t' <- coreView t' = go env_t (D env' new_t') ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -138,35 +138,52 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing nullary type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form - TyConApp tc [] + TyConApp tc tys1 = TyConApp tc tys2 -where @tc@ is a type synonym. A naive way to perform this comparison these +where `tc` is a type synonym. A naive way to perform this comparison these would first expand the synonym and then compare the resulting expansions. -However, this is obviously wasteful and the RHS of @tc@ may be large; it is -much better to rather compare the TyCons directly. Consequently, before -expanding type synonyms in type comparisons we first look for a nullary -TyConApp and simply compare the TyCons if we find one. Of course, if we find -that the TyCons are *not* equal then we still need to perform the expansion as -their RHSs may still be equal. +However, this is obviously wasteful and the RHS of `tc` may be large. We'd +prefer to compare `tys1 = tys2`. When is that sound? Precisely when the +synonym is not /forgetful/; that is, all its type variables appear in its +RHS -- see `GHC.Core.TyCon.isForgetfulSynTyCon`. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be equal. + +This works fine for /equality/, but not for /comparison/. Consider + type S a b = (b, a) +Now consider + S Int Bool `compare` S Char Char +The ordering may depend on whether we expand the synonym or not, and we +don't want the result to depend on that. So for comparison we stick to +/nullary/ synonyms only, which is still useful. We perform this optimisation in a number of places: - * GHC.Core.Types.eqType - * GHC.Core.Types.nonDetCmpType - * GHC.Core.Unify.unify_ty - * GHC.Tc.Solver.Equality.can_eq_nc' - * TcUnify.uType + * GHC.Core.TyCo.Compare.eqType (works for non-nullary synonyms) + * GHC.Core.Map.TYpe.eqDeBruijnType (works for non-nullary synonyms) + * GHC.Core.Types.nonDetCmpType (nullary only) This optimisation is especially helpful for the ubiquitous GHC.Types.Type, since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. +Currently-missed opportunity (#25009): +* In the case of forgetful synonyms, we could still compare the args, pairwise, + and then compare the RHS's with a suitably extended RnEnv2. That would avoid + comparing the same arg repeatedly. e.g. + type S a b = (a,a) + Compare S y ~ S y + If we expand, we end up compare with itself twice. + + But since forgetful synonyms are rare, we have not tried this. + Note [Type comparisons using object pointer comparisons] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Quite often we substitute the type from a definition site into @@ -341,16 +358,26 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env = \ t1 t2 -> t1 `seq` t2 `seq` let go = generic_eq_type_x syn_flag mult_flag mb_env -- Abbreviation for recursive calls + + gos [] [] = True + gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 + gos _ _ = False + in case (t1,t2) of _ | 1# <- reallyUnsafePtrEquality# t1 t2 -> True -- See Note [Type comparisons using object pointer comparisons] - (TyConApp tc1 [], TyConApp tc2 []) | tc1 == tc2 -> True - -- See Note [Comparing nullary type synonyms] + (TyConApp tc1 tys1, TyConApp tc2 tys2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + -> gos tys1 tys2 _ | ExpandSynonyms <- syn_flag, Just t1' <- coreView t1 -> go t1' t2 | ExpandSynonyms <- syn_flag, Just t2' <- coreView t2 -> go t1 t2' + (TyConApp tc1 ts1, TyConApp tc2 ts2) + | tc1 == tc2 -> gos ts1 ts2 + | otherwise -> False + (TyVarTy tv1, TyVarTy tv2) -> case mb_env of Nothing -> tv1 == tv2 @@ -381,14 +408,6 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env | Just (s1, t1') <- tcSplitAppTyNoView_maybe t1 -> go s1 s2 && go t1' t2' - (TyConApp tc1 ts1, TyConApp tc2 ts2) - | tc1 == tc2 -> gos ts1 ts2 - | otherwise -> False - where - gos [] [] = True - gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 - gos _ _ = False - (ForAllTy (Bndr tv1 vis1) body1, ForAllTy (Bndr tv2 vis2) body2) -> case mb_env of Nothing -> generic_eq_type_x syn_flag mult_flag @@ -666,10 +685,11 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - -- See Note [Comparing nullary type synonyms] + go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 - = TEQ + = TEQ -- See Note [Comparing type synonyms] + go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -758,8 +778,10 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] - go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + + go env (TyConApp tc1 ts1) (TyConApp tc2 ts2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + = gos env (tyConBinders tc1) ts1 ts2 go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -841,7 +841,8 @@ data TyConDetails = -- are fine), again after expanding any -- nested synonyms - synIsForgetful :: Bool, -- True <= at least one argument is not mentioned + synIsForgetful :: Bool, -- See Note [Forgetful type synonyms] + -- True <= at least one argument is not mentioned -- in the RHS (or is mentioned only under -- forgetful synonyms) -- Test is conservative, so True does not guarantee @@ -2121,11 +2122,43 @@ isFamFreeTyCon (TyCon { tyConDetails = details }) -- True. Thus, False means that all bound variables appear on the RHS; -- True may not mean anything, as the test to set this flag is -- conservative. +-- +-- See Note [Forgetful type synonyms] isForgetfulSynTyCon :: TyCon -> Bool isForgetfulSynTyCon (TyCon { tyConDetails = details }) | SynonymTyCon { synIsForgetful = forget } <- details = forget | otherwise = False +{- Note [Forgetful type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A type synonyms is /forgetful/ if its RHS fails to mention one (or more) of its bound variables. + +Forgetfulness is conservative: + * A non-forgetful synonym /guarantees/ to mention all its bound variables in its RHS. + * It is always safe to classify a synonym as forgetful. + +Examples: + type R = Int -- Not forgetful + type S a = Int -- Forgetful + type T1 a = Int -> S a -- Forgetful + type T2 a = a -> S a -- Not forgetful + type T3 a = Int -> F a -- Not forgetful + where type family F a + +* R shows that nullary synonyms are not forgetful. + +* T2 shows that forgetfulness needs to account for uses of forgetful + synonyms. `a` appears on the RHS, but only under a forgetful S + +* T3 shows that non-forgetfulness is not the same as injectivity. T3 mentions its + bound variable on its RHS, but under a type family. So it is entirely possible + that T3 Int ~ T3 Bool + +* Since type synonyms are non-recursive, we don't need a fixpoint analysis to + determine forgetfulness. It's rather easy -- see `GHC.Core.Type.buildSynTyCon`, + which is a bit over-conservative for over-saturated synonyms. +-} + -- As for newtypes, it is in some contexts important to distinguish between -- closed synonyms and synonym families, as synonym families have no unique -- right hand side to which a synonym family application can expand. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon + -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,8 +3275,9 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing -nullary type synonyms] in "GHC.Core.Type". +applications (e.g. things like @TyConApp typeTyCon []@). See +* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" +* Note [Unifying type synonyms] in "GHC.Core.Unify" To accomplish these we use a number of tricks, implemented by mkTyConApp. ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1089,6 +1089,47 @@ of arity n: If we couldn't decompose in the previous step, we return SurelyApart. Afterwards, the rest of the code doesn't have to worry about type families. + +Note [Unifying type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the task of unifying two 'Type's of the form + + TyConApp tc [] ~ TyConApp tc [] + +where `tc` is a type synonym. A naive way to perform this comparison these +would first expand the synonym and then compare the resulting expansions. + +However, this is obviously wasteful and the RHS of `tc` may be large; it is +much better to rather compare the TyCons directly. Consequently, before +expanding type synonyms in type comparisons we first look for a nullary +TyConApp and simply compare the TyCons if we find one. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be unifiable. E.g + type T = S (a->a) + type S a = [a] +and consider + T Int ~ S (Int -> Int) + +We can't decompose non-nullary synonyms. E.g. + type R a = F a -- Where F is a type family +and consider + R (a->a) ~ R Int +We can't conclude that (a->) ~ Int. (There is a currently-missed opportunity +here; if we knew that R was /injective/, perhaps we could decompose.) + +We perform the nullary-type-synonym optimisation in a number of places: + + * GHC.Core.Unify.unify_ty + * GHC.Tc.Solver.Equality.can_eq_nc' + * GHC.Tc.Utils.Unify.uType + +This optimisation is especially helpful for the ubiquitous GHC.Types.Type, +since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications +whenever possible. See Note [Using synonyms to compress types] in +GHC.Core.Type for details. + +c.f. Note [Comparing type synonyms] in GHC.Core.TyCo.Compare -} -------------- unify_ty: the main workhorse ----------- @@ -1107,7 +1148,7 @@ unify_ty :: UMEnv -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare + -- See Note [Unifying type synonyms] | tc1 == tc2 = return () ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,7 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare +-- See Note [Unifying type synonyms] in GHC.Core.Unify can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2187,11 +2187,12 @@ uType env@(UE { u_role = role }) orig_ty1 orig_ty2 ; uType env orig_ty1 ty2 } Nothing -> uUnfilledVar env IsSwapped tv2 ty1 } - -- See Note [Expanding synonyms during unification] + -- See Note [Unifying type synonyms] in GHC.Core.Unify go ty1@(TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = return $ mkReflCo role ty1 + -- Now expand synonyms -- See Note [Expanding synonyms during unification] -- -- Also NB that we recurse to 'go' so that we don't push a @@ -2349,7 +2350,7 @@ We expand synonyms during unification, but: * The problem case immediately above can happen only with arguments to the tycon. So we check for nullary tycons *before* expanding. This is particularly helpful when checking (* ~ *), because * is - now a type synonym. + now a type synonym. See Note [Unifying type synonyms] in GHC.Core.Unify. Note [Deferred unification] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/280e4bf5ca62ec51eaeedd04b0db78b085257ab8 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/280e4bf5ca62ec51eaeedd04b0db78b085257ab8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:46:07 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:46:07 -0400 Subject: [Git][ghc/ghc][master] EPA: Bring back SrcSpan in EpaDelta Message-ID: <66914fbfc8b57_1abaf1fa4c44118495@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 12 changed files: - compiler/GHC/Hs/Dump.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Types/SrcLoc.hs - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/T14189.stderr - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== compiler/GHC/Hs/Dump.hs ===================================== @@ -147,9 +147,9 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0 epaAnchor :: EpaLocation -> SDoc epaAnchor (EpaSpan s) = parens $ text "EpaSpan" <+> srcSpan s - epaAnchor (EpaDelta d cs) = case ba of - NoBlankEpAnnotations -> parens $ text "EpaDelta" <+> deltaPos d <+> showAstData' cs - BlankEpAnnotations -> parens $ text "EpaDelta" <+> deltaPos d <+> text "blanked" + epaAnchor (EpaDelta s d cs) = case ba of + NoBlankEpAnnotations -> parens $ text "EpaDelta" <+> srcSpan s <+> deltaPos d <+> showAstData' cs + BlankEpAnnotations -> parens $ text "EpaDelta" <+> srcSpan s <+> deltaPos d <+> text "blanked" deltaPos :: DeltaPos -> SDoc deltaPos (SameLine c) = parens $ text "SameLine" <+> ppr c ===================================== compiler/GHC/Parser/Annotation.hs ===================================== @@ -459,12 +459,12 @@ type EpaLocation = EpaLocation' [LEpaComment] epaToNoCommentsLocation :: EpaLocation -> NoCommentsLocation epaToNoCommentsLocation (EpaSpan ss) = EpaSpan ss -epaToNoCommentsLocation (EpaDelta dp []) = EpaDelta dp NoComments -epaToNoCommentsLocation (EpaDelta _ _ ) = panic "epaToNoCommentsLocation" +epaToNoCommentsLocation (EpaDelta ss dp []) = EpaDelta ss dp NoComments +epaToNoCommentsLocation (EpaDelta _ _ _ ) = panic "epaToNoCommentsLocation" noCommentsToEpaLocation :: NoCommentsLocation -> EpaLocation noCommentsToEpaLocation (EpaSpan ss) = EpaSpan ss -noCommentsToEpaLocation (EpaDelta dp NoComments) = EpaDelta dp [] +noCommentsToEpaLocation (EpaDelta ss dp NoComments) = EpaDelta ss dp [] -- | Tokens embedded in the AST have an EpaLocation, unless they come from -- generated code (e.g. by TH). @@ -550,8 +550,8 @@ spanAsAnchor ss = EpaSpan ss realSpanAsAnchor :: RealSrcSpan -> (EpaLocation' a) realSpanAsAnchor s = EpaSpan (RealSrcSpan s Strict.Nothing) -noSpanAnchor :: (NoAnn a) => (EpaLocation' a) -noSpanAnchor = EpaDelta (SameLine 0) noAnn +noSpanAnchor :: (NoAnn a) => EpaLocation' a +noSpanAnchor = EpaDelta noSrcSpan (SameLine 0) noAnn -- --------------------------------------------------------------------- @@ -1044,7 +1044,7 @@ instance HasLoc (EpAnn a) where instance HasLoc EpaLocation where getHasLoc (EpaSpan l) = l - getHasLoc (EpaDelta _ _) = noSrcSpan + getHasLoc (EpaDelta l _ _) = l getHasLocList :: HasLoc a => [a] -> SrcSpan getHasLocList [] = noSrcSpan @@ -1088,7 +1088,7 @@ widenSpan s as = foldl combineSrcSpans s (go as) go [] = [] go (AddEpAnn _ (EpaSpan (RealSrcSpan s mb)):rest) = RealSrcSpan s mb : go rest go (AddEpAnn _ (EpaSpan _):rest) = go rest - go (AddEpAnn _ (EpaDelta _ _):rest) = go rest + go (AddEpAnn _ (EpaDelta _ _ _):rest) = go rest -- | The annotations need to all come after the anchor. Make sure -- this is the case. @@ -1132,7 +1132,7 @@ widenAnchor :: Anchor -> [AddEpAnn] -> Anchor widenAnchor (EpaSpan (RealSrcSpan s mb)) as = EpaSpan (RealSrcSpan (widenRealSpan s as) (liftA2 combineBufSpans mb (bufSpanFromAnns as))) widenAnchor (EpaSpan us) _ = EpaSpan us -widenAnchor a@(EpaDelta _ _) as = case (realSpanFromAnns as) of +widenAnchor a at EpaDelta{} as = case (realSpanFromAnns as) of Strict.Nothing -> a Strict.Just r -> EpaSpan (RealSrcSpan r Strict.Nothing) @@ -1140,7 +1140,7 @@ widenAnchorS :: Anchor -> SrcSpan -> Anchor widenAnchorS (EpaSpan (RealSrcSpan s mbe)) (RealSrcSpan r mbr) = EpaSpan (RealSrcSpan (combineRealSrcSpans s r) (liftA2 combineBufSpans mbe mbr)) widenAnchorS (EpaSpan us) _ = EpaSpan us -widenAnchorS (EpaDelta _ _) (RealSrcSpan r mb) = EpaSpan (RealSrcSpan r mb) +widenAnchorS EpaDelta{} (RealSrcSpan r mb) = EpaSpan (RealSrcSpan r mb) widenAnchorS anc _ = anc widenLocatedAn :: EpAnn an -> [AddEpAnn] -> EpAnn an @@ -1290,7 +1290,7 @@ instance Semigroup EpaLocation where EpaSpan s1 <> EpaSpan s2 = EpaSpan (combineSrcSpans s1 s2) EpaSpan s1 <> _ = EpaSpan s1 _ <> EpaSpan s2 = EpaSpan s2 - EpaDelta dp1 cs1 <> EpaDelta _dp2 cs2 = EpaDelta dp1 (cs1<>cs2) + EpaDelta s1 dp1 cs1 <> EpaDelta s2 _dp2 cs2 = EpaDelta (combineSrcSpans s1 s2) dp1 (cs1<>cs2) instance Semigroup EpAnnComments where EpaComments cs1 <> EpaComments cs2 = EpaComments (cs1 ++ cs2) @@ -1314,7 +1314,7 @@ instance Monoid (AnnSortKey tag) where -- --------------------------------------------------------------------- instance NoAnn EpaLocation where - noAnn = EpaDelta (SameLine 0) [] + noAnn = EpaDelta noSrcSpan (SameLine 0) [] instance NoAnn AnnKeywordId where noAnn = Annlarrowtail {- gotta pick one -} ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -482,7 +482,7 @@ valid_anchor _ = False -- If the decl list for where binds is empty, the anchor ends up -- invalid. In this case, use the parent one patch_anchor :: RealSrcSpan -> Anchor -> Anchor -patch_anchor r (EpaDelta _ _) = EpaSpan (RealSrcSpan r Strict.Nothing) +patch_anchor r EpaDelta{} = EpaSpan (RealSrcSpan r Strict.Nothing) patch_anchor r1 (EpaSpan (RealSrcSpan r0 mb)) = EpaSpan (RealSrcSpan r mb) where r = if srcSpanStartLine r0 < 0 then r1 else r0 @@ -976,7 +976,7 @@ checkTyVars pp_what equals_or_where tc tparms -- Return an AddEpAnn for use in widenLocatedAn. The AnnKeywordId is not used. for_widening :: HsBndrVis GhcPs -> AddEpAnn for_widening (HsBndrInvisible (EpTok loc)) = AddEpAnn AnnAnyclass loc - for_widening _ = AddEpAnn AnnAnyclass (EpaDelta (SameLine 0) []) + for_widening _ = AddEpAnn AnnAnyclass noAnn whereDots, equalsDots :: SDoc @@ -3277,7 +3277,7 @@ epTokenWidenR :: EpToken tok -> SrcSpan -> EpToken tok' epTokenWidenR NoEpTok _ = NoEpTok epTokenWidenR (EpTok l) (UnhelpfulSpan _) = EpTok l epTokenWidenR (EpTok (EpaSpan s1)) s2 = EpTok (EpaSpan (combineSrcSpans s1 s2)) -epTokenWidenR (EpTok (EpaDelta _ _)) _ = +epTokenWidenR (EpTok EpaDelta{}) _ = -- Never happens because the parser does not produce EpaDelta. panic "epTokenWidenR: EpaDelta" ===================================== compiler/GHC/Types/SrcLoc.hs ===================================== @@ -914,9 +914,12 @@ mkSrcSpanPs (PsSpan r b) = RealSrcSpan r (Strict.Just b) -- version, to provide a position for the item relative to the end of -- the previous item in the source. This is useful when editing an -- AST prior to exact printing the changed one. +-- The EpaDelta also contains the original @'SrcSpan'@ for use by +-- tools wanting to manipulate the AST after converting it using +-- ghc-exactprint' @'makeDeltaAst'@. data EpaLocation' a = EpaSpan !SrcSpan - | EpaDelta !DeltaPos !a + | EpaDelta !SrcSpan !DeltaPos !a deriving (Data,Eq,Show) type NoCommentsLocation = EpaLocation' NoComments @@ -957,7 +960,7 @@ instance Outputable NoComments where instance (Outputable a) => Outputable (EpaLocation' a) where ppr (EpaSpan r) = text "EpaSpan" <+> ppr r - ppr (EpaDelta d cs) = text "EpaDelta" <+> ppr d <+> ppr cs + ppr (EpaDelta s d cs) = text "EpaDelta" <+> ppr s <+> ppr d <+> ppr cs instance Outputable DeltaPos where ppr (SameLine c) = text "SameLine" <+> ppr c ===================================== testsuite/tests/parser/should_compile/DumpRenamedAst.stderr ===================================== @@ -74,10 +74,10 @@ [])) (GRHS (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (GrhsAnn (Nothing) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [] @@ -276,8 +276,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:13:11-16 }) @@ -370,8 +370,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:13:27-35 }) @@ -796,8 +796,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:19:23-36 }) @@ -899,8 +899,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:19:43-51 }) @@ -1012,8 +1012,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:20:11-33 }) @@ -1025,10 +1025,10 @@ (NoExtField) (HsForAllInvis (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) ((,) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) [])) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) [])) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [(L @@ -1350,8 +1350,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:22:26-28 }) @@ -1822,8 +1822,8 @@ (HsParTy (AnnParen AnnParens - (EpaDelta (SameLine 0) []) - (EpaDelta (SameLine 0) [])) + (EpaDelta { } (SameLine 0) []) + (EpaDelta { } (SameLine 0) [])) (L (EpAnn (EpaSpan { DumpRenamedAst.hs:24:18-26 }) @@ -2256,9 +2256,9 @@ (ImportDecl (XImportDeclPass (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (EpAnnImportDecl - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (Nothing) (Nothing) (Nothing) ===================================== testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr ===================================== @@ -1975,10 +1975,10 @@ [])) (GRHS (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (GrhsAnn (Nothing) - (AddEpAnn Annlarrowtail (EpaDelta (SameLine 0) []))) + (AddEpAnn Annlarrowtail (EpaDelta { } (SameLine 0) []))) (EpaComments [])) [] ===================================== testsuite/tests/parser/should_compile/T14189.stderr ===================================== @@ -217,9 +217,9 @@ (ImportDecl (XImportDeclPass (EpAnn - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (EpAnnImportDecl - (EpaDelta (SameLine 0) []) + (EpaDelta { } (SameLine 0) []) (Nothing) (Nothing) (Nothing) @@ -318,11 +318,13 @@ ,{Name: T14189.NT}])])]) (Nothing) (Just - (L + (L (EpAnn - (EpaSpan { T14189.hs:1:8-13 }) - (AnnListItem + (EpaSpan { T14189.hs:1:8-13 }) + (AnnListItem []) - (EpaComments + (EpaComments [])) {ModuleName: T14189})))) + + ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -406,8 +406,8 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do acceptSpan <- getAcceptSpan setAcceptSpan False case anchor' of - EpaDelta _ _ -> setAcceptSpan True - _ -> return () + EpaDelta _ _ _ -> setAcceptSpan True + _ -> return () p <- getPosP pe0 <- getPriorEndD debugM $ "enterAnn:starting:(anchor',p,pe,a) =" ++ show (showAst anchor', p, pe0, astId a) @@ -420,7 +420,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do CanUpdateAnchor -> pushAppliedComments _ -> return () case anchor' of - EpaDelta _ dcs -> do + EpaDelta _ _ dcs -> do debugM $ "enterAnn:Printing comments:" ++ showGhc (priorComments cs) mapM_ printOneComment (concatMap tokComment $ priorComments cs) debugM $ "enterAnn:Printing EpaDelta comments:" ++ showGhc dcs @@ -433,7 +433,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do priorCs <- cua canUpdateAnchor takeAppliedComments -- no pop -- ------------------------- case anchor' of - EpaDelta dp _ -> do + EpaDelta _ dp _ -> do debugM $ "enterAnn: EpaDelta:" ++ show dp -- Set the original anchor as prior end, so the rest of this AST -- fragment has a reference @@ -475,14 +475,14 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do off (ss2delta priorEndAfterComments curAnchor) debugM $ "enterAnn: (edp',off,priorEndAfterComments,curAnchor):" ++ show (edp',off,priorEndAfterComments,rs2range curAnchor) let edp'' = case anchor' of - EpaDelta dp _ -> dp + EpaDelta _ dp _ -> dp _ -> edp' -- --------------------------------------------- med <- getExtraDP setExtraDP Nothing let edp = case med of Nothing -> edp'' - Just (EpaDelta dp _) -> dp + Just (EpaDelta _ dp _) -> dp -- Replace original with desired one. Allows all -- list entry values to be DP (1,0) Just (EpaSpan (RealSrcSpan r _)) -> dp @@ -536,7 +536,7 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do debugM $ "enterAnn:done:(anchor,p,pe,a) =" ++ show (showAst anchor', p1, pe1, astId a') case anchor' of - EpaDelta _ _ -> return () + EpaDelta _ _ _ -> return () EpaSpan (RealSrcSpan rss _) -> do setAcceptSpan False setPriorEndD (snd $ rs2range rss) @@ -554,7 +554,8 @@ enterAnn (Entry anchor' trailing_anns cs flush canUpdateAnchor) a = do trailing' <- markTrailing trailing_anns -- Update original anchor, comments based on the printing process - let newAchor = EpaDelta edp [] + -- TODO:AZ: probably need to put something appropriate in instead of noSrcSpan + let newAchor = EpaDelta noSrcSpan edp [] let r = case canUpdateAnchor of CanUpdateAnchor -> setAnnotationAnchor a' newAchor trailing' (mkEpaComments (priorCs ++ postCs) []) CanUpdateAnchorOnly -> setAnnotationAnchor a' newAchor [] emptyComments @@ -653,8 +654,8 @@ printSourceText (NoSourceText) txt = printStringAdvance txt >> return () printSourceText (SourceText txt) _ = printStringAdvance (unpackFS txt) >> return () printSourceTextAA :: (Monad m, Monoid w) => SourceText -> String -> EP w m () -printSourceTextAA (NoSourceText) txt = printStringAtAA (EpaDelta (SameLine 0) []) txt >> return () -printSourceTextAA (SourceText txt) _ = printStringAtAA (EpaDelta (SameLine 0) []) (unpackFS txt) >> return () +printSourceTextAA (NoSourceText) txt = printStringAtAA noAnn txt >> return () +printSourceTextAA (SourceText txt) _ = printStringAtAA noAnn (unpackFS txt) >> return () -- --------------------------------------------------------------------- @@ -681,9 +682,9 @@ printStringAtRsC capture pa str = do NoCaptureComments -> return [] debugM $ "printStringAtRsC:cs'=" ++ show cs' debugM $ "printStringAtRsC:p'=" ++ showAst p' - debugM $ "printStringAtRsC: (EpaDelta p' [])=" ++ showAst (EpaDelta p' NoComments) - debugM $ "printStringAtRsC: (EpaDelta p' (map comment2LEpaComment cs'))=" ++ showAst (EpaDelta p' (map comment2LEpaComment cs')) - return (EpaDelta p' (map comment2LEpaComment cs')) + debugM $ "printStringAtRsC: (EpaDelta p' [])=" ++ showAst (EpaDelta noSrcSpan p' NoComments) + debugM $ "printStringAtRsC: (EpaDelta p' (map comment2LEpaComment cs'))=" ++ showAst (EpaDelta noSrcSpan p' (map comment2LEpaComment cs')) + return (EpaDelta noSrcSpan p' (map comment2LEpaComment cs')) printStringAtRs' :: (Monad m, Monoid w) => RealSrcSpan -> String -> EP w m () printStringAtRs' pa str = printStringAtRsC NoCaptureComments pa str >> return () @@ -695,7 +696,7 @@ printStringAtMLoc' :: (Monad m, Monoid w) printStringAtMLoc' (Just aa) s = Just <$> printStringAtAA aa s printStringAtMLoc' Nothing s = do printStringAtLsDelta (SameLine 1) s - return (Just (EpaDelta (SameLine 1) [])) + return (Just (EpaDelta noSrcSpan (SameLine 1) [])) printStringAtMLocL :: (Monad m, Monoid w) => EpAnn a -> Lens a (Maybe EpaLocation) -> String -> EP w m (EpAnn a) @@ -706,7 +707,7 @@ printStringAtMLocL (EpAnn anc an cs) l s = do go (Just aa) str = Just <$> printStringAtAA aa str go Nothing str = do printStringAtLsDelta (SameLine 1) str - return (Just (EpaDelta (SameLine 1) [])) + return (Just (EpaDelta noSrcSpan (SameLine 1) [])) printStringAtAA :: (Monad m, Monoid w) => EpaLocation -> String -> EP w m EpaLocation printStringAtAA el str = printStringAtAAC CaptureComments el str @@ -726,7 +727,7 @@ printStringAtAAC :: (Monad m, Monoid w) => CaptureComments -> EpaLocation -> String -> EP w m EpaLocation printStringAtAAC capture (EpaSpan (RealSrcSpan r _)) s = printStringAtRsC capture r s printStringAtAAC _capture (EpaSpan ss@(UnhelpfulSpan _)) _s = error $ "printStringAtAAC:ss=" ++ show ss -printStringAtAAC capture (EpaDelta d cs) s = do +printStringAtAAC capture (EpaDelta ss d cs) s = do mapM_ printOneComment $ concatMap tokComment cs pe1 <- getPriorEndD p1 <- getPosP @@ -739,7 +740,7 @@ printStringAtAAC capture (EpaDelta d cs) s = do CaptureComments -> takeAppliedComments NoCaptureComments -> return [] debugM $ "printStringAtAA:(pe1,pe2,p1,p2,cs')=" ++ show (pe1,pe2,p1,p2,cs') - return (EpaDelta d (map comment2LEpaComment cs')) + return (EpaDelta ss d (map comment2LEpaComment cs')) -- --------------------------------------------------------------------- @@ -1486,7 +1487,7 @@ printOneComment :: (Monad m, Monoid w) => Comment -> EP w m () printOneComment c@(Comment _str loc _r _mo) = do debugM $ "printOneComment:c=" ++ showGhc c dp <-case loc of - EpaDelta dp _ -> return dp + EpaDelta _ dp _ -> return dp EpaSpan (RealSrcSpan r _) -> do pe <- getPriorEndD debugM $ "printOneComment:pe=" ++ showGhc pe @@ -1496,7 +1497,7 @@ printOneComment c@(Comment _str loc _r _mo) = do EpaSpan (UnhelpfulSpan _) -> return (SameLine 0) mep <- getExtraDP dp' <- case mep of - Just (EpaDelta edp _) -> do + Just (EpaDelta _ edp _) -> do debugM $ "printOneComment:edp=" ++ show edp adjustDeltaForOffsetM edp _ -> return dp @@ -1513,7 +1514,7 @@ updateAndApplyComment (Comment str anc pp mo) dp = do where (r,c) = ss2posEnd pp dp'' = case anc of - EpaDelta dp1 _ -> dp1 + EpaDelta _ dp1 _ -> dp1 EpaSpan (RealSrcSpan la _) -> if r == 0 then (ss2delta (r,c+0) la) @@ -1527,12 +1528,12 @@ updateAndApplyComment (Comment str anc pp mo) dp = do _ -> dp'' op' = case dp' of SameLine n -> if n >= 0 - then EpaDelta dp' NoComments - else EpaDelta dp NoComments - _ -> EpaDelta dp' NoComments - anc' = if str == "" && op' == EpaDelta (SameLine 0) NoComments -- EOF comment - then EpaDelta dp NoComments - else EpaDelta dp NoComments + then EpaDelta noSrcSpan dp' NoComments + else EpaDelta noSrcSpan dp NoComments + _ -> EpaDelta noSrcSpan dp' NoComments + anc' = if str == "" && op' == EpaDelta noSrcSpan (SameLine 0) NoComments -- EOF comment + then EpaDelta noSrcSpan dp NoComments + else EpaDelta noSrcSpan dp NoComments -- --------------------------------------------------------------------- @@ -4265,11 +4266,11 @@ printUnicode anc n = do -- TODO: unicode support? "forall" -> if spanLength (anchor anc) == 1 then "∀" else "forall" s -> s - loc <- printStringAtAAC NoCaptureComments (EpaDelta (SameLine 0) []) str + loc <- printStringAtAAC NoCaptureComments (EpaDelta noSrcSpan (SameLine 0) []) str case loc of EpaSpan _ -> return anc - EpaDelta dp [] -> return $ EpaDelta dp [] - EpaDelta _ _cs -> error "printUnicode should not capture comments" + EpaDelta ss dp [] -> return $ EpaDelta ss dp [] + EpaDelta _ _ _cs -> error "printUnicode should not capture comments" markName :: (Monad m, Monoid w) ===================================== utils/check-exact/Main.hs ===================================== @@ -451,9 +451,9 @@ changeLetIn1 _libdir parsed [l2,_l1] = map wrapDecl decls decls' = concatMap decl2Bind [l2] (L _ e) = expr - a = EpAnn (EpaDelta (SameLine 1) []) noAnn emptyComments + a = EpAnn (EpaDelta noSrcSpan (SameLine 1) []) noAnn emptyComments expr' = L a e - tkIn' = EpTok (EpaDelta (DifferentLine 1 0) []) + tkIn' = EpTok (EpaDelta noSrcSpan (DifferentLine 1 0) []) in (HsLet (tkLet, tkIn') (HsValBinds x (ValBinds xv decls' sigs)) expr') @@ -525,7 +525,7 @@ changeLocalDecls libdir (L l p) = do os' = setEntryDP os (DifferentLine 2 0) let sortKey = captureOrderBinds decls let (EpAnn anc (AnnList (Just _) a b c dd) cs) = van - let van' = (EpAnn anc (AnnList (Just (EpaDelta (DifferentLine 1 5) [])) a b c dd) cs) + let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 5) [])) a b c dd) cs) -- let (EpAnn anc (AnnList (Just _) a b c dd) cs) = van -- let van' = (EpAnn anc (AnnList (Just (EpaDelta (DifferentLine 1 5) [])) a b c dd) cs) let binds' = (HsValBinds van' @@ -551,11 +551,11 @@ changeLocalDecls2 libdir (L l p) = do replaceLocalBinds :: LMatch GhcPs (LHsExpr GhcPs) -> Transform (LMatch GhcPs (LHsExpr GhcPs)) replaceLocalBinds (L lm (Match ma mln pats (GRHSs _ rhs EmptyLocalBinds{}))) = do - let anc = (EpaDelta (DifferentLine 1 3) []) - let anc2 = (EpaDelta (DifferentLine 1 5) []) + let anc = (EpaDelta noSrcSpan (DifferentLine 1 3) []) + let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 5) []) let an = EpAnn anc (AnnList (Just anc2) Nothing Nothing - [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] []) + [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] []) emptyComments let decls = [s,d] let sortKey = captureOrderBinds decls ===================================== utils/check-exact/Transform.hs ===================================== @@ -218,8 +218,8 @@ captureTypeSigSpacing (L l (SigD x (TypeSig (AnnSig dc rs') ns (HsWC xw ty)))) rd = case last ns of L (EpAnn anc' _ _) _ -> anchor anc' -- TODO MovedAnchor? dc' = case dca of - EpaSpan (RealSrcSpan r _) -> AddEpAnn kw (EpaDelta (ss2delta (ss2posEnd rd) r) []) - _ -> AddEpAnn kw dca + EpaSpan ss@(RealSrcSpan r _) -> AddEpAnn kw (EpaDelta ss (ss2delta (ss2posEnd rd) r) []) + _ -> AddEpAnn kw dca -- --------------------------------- @@ -228,10 +228,10 @@ captureTypeSigSpacing (L l (SigD x (TypeSig (AnnSig dc rs') ns (HsWC xw ty)))) (L (EpAnn anc0 a c) b) -> let anc' = case anc0 of - EpaDelta _ _ -> anc0 + EpaDelta _ _ _ -> anc0 _ -> case dca of - EpaSpan _ -> EpaDelta (SameLine 1) [] - EpaDelta _ cs0 -> EpaDelta (SameLine 1) cs0 + EpaSpan ss -> EpaDelta ss (SameLine 1) [] + EpaDelta ss _ cs0 -> EpaDelta ss (SameLine 1) cs0 in (L (EpAnn anc' a c) b) captureTypeSigSpacing s = s @@ -254,12 +254,12 @@ setEntryDPDecl d dp = setEntryDP d dp -- |Set the true entry 'DeltaPos' from the annotation for a given AST -- element. This is the 'DeltaPos' ignoring any comments. setEntryDP :: NoAnn t => LocatedAn t a -> DeltaPos -> LocatedAn t a -setEntryDP (L (EpAnn (EpaSpan (UnhelpfulSpan _)) an cs) a) dp - = L (EpAnn (EpaDelta dp []) an cs) a -setEntryDP (L (EpAnn (EpaSpan _) an (EpaComments [])) a) dp - = L (EpAnn (EpaDelta dp []) an (EpaComments [])) a -setEntryDP (L (EpAnn (EpaDelta d csd) an cs) a) dp - = L (EpAnn (EpaDelta d' csd') an cs') a +setEntryDP (L (EpAnn (EpaSpan ss@(UnhelpfulSpan _)) an cs) a) dp + = L (EpAnn (EpaDelta ss dp []) an cs) a +setEntryDP (L (EpAnn (EpaSpan ss) an (EpaComments [])) a) dp + = L (EpAnn (EpaDelta ss dp []) an (EpaComments [])) a +setEntryDP (L (EpAnn (EpaDelta ss d csd) an cs) a) dp + = L (EpAnn (EpaDelta ss d' csd') an cs') a where (d', csd', cs') = case cs of EpaComments (h:t) -> @@ -283,22 +283,22 @@ setEntryDP (L (EpAnn (EpaDelta d csd) an cs) a) dp in (dp0, c':t, EpaCommentsBalanced [] ts) go :: GenLocated NoCommentsLocation e -> (DeltaPos, GenLocated NoCommentsLocation e) - go (L (EpaDelta _ c0) c) = (d, L (EpaDelta dp c0) c) - go (L (EpaSpan _) c) = (d, L (EpaDelta dp NoComments) c) -setEntryDP (L (EpAnn (EpaSpan (RealSrcSpan r _)) an cs) a) dp + go (L (EpaDelta ss0 _ c0) c) = (d, L (EpaDelta ss0 dp c0) c) + go (L (EpaSpan ss0) c) = (d, L (EpaDelta ss0 dp NoComments) c) +setEntryDP (L (EpAnn (EpaSpan ss@(RealSrcSpan r _)) an cs) a) dp = case sortEpaComments (priorComments cs) of [] -> - L (EpAnn (EpaDelta dp []) an cs) a + L (EpAnn (EpaDelta ss dp []) an cs) a (L ca c:cs') -> - L (EpAnn (EpaDelta edp csd) an cs'') a + L (EpAnn (EpaDelta ss edp csd) an cs'') a where cs'' = setPriorComments cs [] - csd = L (EpaDelta dp NoComments) c:cs' + csd = L (EpaDelta ss dp NoComments) c:cs' lc = last $ (L ca c:cs') delta = case getLoc lc of EpaSpan (RealSrcSpan rr _) -> ss2delta (ss2pos rr) r EpaSpan _ -> (SameLine 0) - EpaDelta _dp _ -> DifferentLine 1 0 + EpaDelta _ _dp _ -> DifferentLine 1 0 line = getDeltaLine delta col = deltaColumn delta edp' = if line == 0 then SameLine col @@ -309,27 +309,27 @@ setEntryDP (L (EpAnn (EpaSpan (RealSrcSpan r _)) an cs) a) dp -- --------------------------------------------------------------------- getEntryDP :: LocatedAn t a -> DeltaPos -getEntryDP (L (EpAnn (EpaDelta dp _) _ _) _) = dp +getEntryDP (L (EpAnn (EpaDelta _ dp _) _ _) _) = dp getEntryDP _ = SameLine 1 -- --------------------------------------------------------------------- addEpaLocationDelta :: LayoutStartCol -> RealSrcSpan -> EpaLocation -> EpaLocation -addEpaLocationDelta _off _anc (EpaDelta d cs) = EpaDelta d cs -addEpaLocationDelta _off _anc (EpaSpan (UnhelpfulSpan _)) = EpaDelta (SameLine 0) [] -addEpaLocationDelta off anc (EpaSpan (RealSrcSpan r _)) - = EpaDelta (adjustDeltaForOffset off (ss2deltaEnd anc r)) [] +addEpaLocationDelta _off _anc (EpaDelta ss d cs) = EpaDelta ss d cs +addEpaLocationDelta _off _anc (EpaSpan ss@(UnhelpfulSpan _)) = EpaDelta ss (SameLine 0) [] +addEpaLocationDelta off anc (EpaSpan ss@(RealSrcSpan r _)) + = EpaDelta ss (adjustDeltaForOffset off (ss2deltaEnd anc r)) [] -- Set the entry DP for an element coming after an existing keyword annotation setEntryDPFromAnchor :: LayoutStartCol -> EpaLocation -> LocatedA t -> LocatedA t -setEntryDPFromAnchor _off (EpaDelta _ _) (L la a) = L la a +setEntryDPFromAnchor _off (EpaDelta _ _ _) (L la a) = L la a setEntryDPFromAnchor _off (EpaSpan (UnhelpfulSpan _)) (L la a) = L la a setEntryDPFromAnchor off (EpaSpan (RealSrcSpan anc _)) ll@(L la _) = setEntryDP ll dp' where dp' = case la of (EpAnn (EpaSpan (RealSrcSpan r' _)) _ _) -> adjustDeltaForOffset off (ss2deltaEnd anc r') (EpAnn (EpaSpan _) _ _) -> adjustDeltaForOffset off (SameLine 0) - (EpAnn (EpaDelta dp _) _ _) -> adjustDeltaForOffset off dp + (EpAnn (EpaDelta _ dp _) _ _) -> adjustDeltaForOffset off dp -- --------------------------------------------------------------------- @@ -559,7 +559,7 @@ balanceComments' la1 la2 = do trailingCommentsDeltas :: RealSrcSpan -> [LEpaComment] -> [(Int, LEpaComment)] trailingCommentsDeltas _ [] = [] -trailingCommentsDeltas r (la@(L (EpaDelta dp _) _):las) +trailingCommentsDeltas r (la@(L (EpaDelta _ dp _) _):las) = (getDeltaLine dp, la): trailingCommentsDeltas r las trailingCommentsDeltas r (la@(L l _):las) = deltaComment r la : trailingCommentsDeltas (anchor l) las @@ -576,7 +576,7 @@ priorCommentsDeltas r cs = go r (reverse $ sortEpaComments cs) where go :: RealSrcSpan -> [LEpaComment] -> [(Int, LEpaComment)] go _ [] = [] - go _ (la@(L l@(EpaDelta dp _) _):las) = (deltaLine dp, la) : go (anchor l) las + go _ (la@(L l@(EpaDelta _ dp _) _):las) = (deltaLine dp, la) : go (anchor l) las go rs' (la@(L l _):las) = deltaComment rs' la : go (anchor l) las deltaComment :: RealSrcSpan -> LEpaComment -> (Int, LEpaComment) @@ -705,7 +705,7 @@ anchorEof (L l m@(HsModule (XModulePs an _lo _ _) _mn _exps _imps _decls)) = L l -- | Create a @SrcSpanAnn@ with a @MovedAnchor@ operation using the -- given @DeltaPos at . noAnnSrcSpanDP :: (NoAnn ann) => DeltaPos -> EpAnn ann -noAnnSrcSpanDP dp = EpAnn (EpaDelta dp []) noAnn emptyComments +noAnnSrcSpanDP dp = EpAnn (EpaDelta noSrcSpan dp []) noAnn emptyComments noAnnSrcSpanDP0 :: (NoAnn ann) => EpAnn ann noAnnSrcSpanDP0 = noAnnSrcSpanDP (SameLine 0) @@ -717,13 +717,13 @@ noAnnSrcSpanDPn :: (NoAnn ann) => Int -> EpAnn ann noAnnSrcSpanDPn s = noAnnSrcSpanDP (SameLine s) d0 :: EpaLocation -d0 = EpaDelta (SameLine 0) [] +d0 = EpaDelta noSrcSpan (SameLine 0) [] d1 :: EpaLocation -d1 = EpaDelta (SameLine 1) [] +d1 = EpaDelta noSrcSpan (SameLine 1) [] dn :: Int -> EpaLocation -dn n = EpaDelta (SameLine n) [] +dn n = EpaDelta noSrcSpan (SameLine n) [] addComma :: SrcSpanAnnA -> SrcSpanAnnA addComma (EpAnn anc (AnnListItem as) cs) @@ -888,8 +888,8 @@ instance HasDecls (LocatedA (HsExpr GhcPs)) where off = case l of (EpaSpan (RealSrcSpan r _)) -> LayoutStartCol $ snd $ ss2pos r (EpaSpan (UnhelpfulSpan _)) -> LayoutStartCol 0 - (EpaDelta (SameLine _) _) -> LayoutStartCol 0 - (EpaDelta (DifferentLine _ c) _) -> LayoutStartCol c + (EpaDelta _ (SameLine _) _) -> LayoutStartCol 0 + (EpaDelta _ (DifferentLine _ c) _) -> LayoutStartCol c ex'' = setEntryDPFromAnchor off i ex newDecls'' = case newDecls of [] -> newDecls @@ -1095,7 +1095,7 @@ oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = do -- TODO: when we set DP (0,0) for the HsValBinds EpEpaLocation, change the AnnList anchor to have the correct DP too let (AnnList ancl o c _r t) = an let w = case ww of - WithWhere -> [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] + WithWhere -> [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] WithoutWhere -> [] (anc', ancl') <- do case ww of @@ -1108,10 +1108,10 @@ oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = do newWhereAnnotation :: (Monad m) => WithWhere -> TransformT m (EpAnn AnnList) newWhereAnnotation ww = do - let anc = EpaDelta (DifferentLine 1 3) [] - let anc2 = EpaDelta (DifferentLine 1 5) [] + let anc = EpaDelta noSrcSpan (DifferentLine 1 3) [] + let anc2 = EpaDelta noSrcSpan (DifferentLine 1 5) [] let w = case ww of - WithWhere -> [AddEpAnn AnnWhere (EpaDelta (SameLine 0) [])] + WithWhere -> [AddEpAnn AnnWhere (EpaDelta noSrcSpan (SameLine 0) [])] WithoutWhere -> [] let an = EpAnn anc (AnnList (Just anc2) Nothing Nothing w []) ===================================== utils/check-exact/Utils.hs ===================================== @@ -184,8 +184,8 @@ isPointSrcSpan ss = spanLength ss == 0 -- `MovedAnchor` operation based on the original location, only if it -- does not already have one. commentOrigDelta :: LEpaComment -> LEpaComment -commentOrigDelta (L (EpaSpan (RealSrcSpan la _)) (GHC.EpaComment t pp)) - = (L (EpaDelta dp NoComments) (GHC.EpaComment t pp)) +commentOrigDelta (L (EpaSpan ss@(RealSrcSpan la _)) (GHC.EpaComment t pp)) + = (L (EpaDelta ss dp NoComments) (GHC.EpaComment t pp)) `debug` ("commentOrigDelta: (la, pp, r,c, dp)=" ++ showAst (la, pp, r,c, dp)) where (r,c) = ss2posEnd pp @@ -330,10 +330,10 @@ sortEpaComments cs = sortBy cmp cs mkKWComment :: AnnKeywordId -> NoCommentsLocation -> Comment mkKWComment kw (EpaSpan (RealSrcSpan ss mb)) = Comment (keywordToString kw) (EpaSpan (RealSrcSpan ss mb)) ss (Just kw) -mkKWComment kw (EpaSpan (UnhelpfulSpan _)) - = Comment (keywordToString kw) (EpaDelta (SameLine 0) NoComments) placeholderRealSpan (Just kw) -mkKWComment kw (EpaDelta dp cs) - = Comment (keywordToString kw) (EpaDelta dp cs) placeholderRealSpan (Just kw) +mkKWComment kw (EpaSpan ss@(UnhelpfulSpan _)) + = Comment (keywordToString kw) (EpaDelta ss (SameLine 0) NoComments) placeholderRealSpan (Just kw) +mkKWComment kw (EpaDelta ss dp cs) + = Comment (keywordToString kw) (EpaDelta ss dp cs) placeholderRealSpan (Just kw) -- | Detects a comment which originates from a specific keyword. isKWComment :: Comment -> Bool @@ -434,11 +434,11 @@ To be absolutely sure, we make the delta versions use -ve values. hackSrcSpanToAnchor :: SrcSpan -> Anchor hackSrcSpanToAnchor (UnhelpfulSpan s) = error $ "hackSrcSpanToAnchor : UnhelpfulSpan:" ++ show s -hackSrcSpanToAnchor (RealSrcSpan r mb) +hackSrcSpanToAnchor ss@(RealSrcSpan r mb) = case mb of (Strict.Just (BufSpan (BufPos s) (BufPos e))) -> if s <= 0 && e <= 0 - then EpaDelta (deltaPos (-s) (-e)) [] + then EpaDelta ss (deltaPos (-s) (-e)) [] `debug` ("hackSrcSpanToAnchor: (r,s,e)=" ++ showAst (r,s,e) ) else EpaSpan (RealSrcSpan r mb) _ -> EpaSpan (RealSrcSpan r mb) ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -1046,7 +1046,7 @@ instance NFData NoComments where instance NFData a => NFData (EpaLocation' a) where rnf (EpaSpan ss) = rnf ss - rnf (EpaDelta dp lc) = dp `seq` lc `deepseq` () + rnf (EpaDelta ss dp lc) = ss `seq` dp `seq` lc `deepseq` () instance NFData EpAnnComments where rnf (EpaComments cs) = rnf cs View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb83c3479aaf17023faacbbca706e5de78f3277f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cb83c3479aaf17023faacbbca706e5de78f3277f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:47:00 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:47:00 -0400 Subject: [Git][ghc/ghc][master] 2 commits: Update alpine release job to 3.20 Message-ID: <66914ff4c4c7b_1abaf2169cc81285fe@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - 6 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - testsuite/tests/plugins/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: 2e2497036a91104be281a0eb24b37889aaf98341 + DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -117,6 +117,7 @@ data LinuxDistro | Centos7 | Alpine312 | Alpine318 + | Alpine320 | AlpineWasm | Rocky8 deriving (Eq) @@ -302,6 +303,7 @@ distroName Ubuntu2004 = "ubuntu20_04" distroName Centos7 = "centos7" distroName Alpine312 = "alpine3_12" distroName Alpine318 = "alpine3_18" +distroName Alpine320 = "alpine3_20" distroName AlpineWasm = "alpine3_18-wasm" distroName Rocky8 = "rocky8" @@ -452,6 +454,7 @@ alpineVariables = mconcat distroVariables :: LinuxDistro -> Variables distroVariables Alpine312 = alpineVariables distroVariables Alpine318 = alpineVariables +distroVariables Alpine320 = alpineVariables distroVariables Centos7 = mconcat [ "HADRIAN_ARGS" =: "--docs=no-sphinx" , "BROKEN_TESTS" =: "T22012" -- due to #23979 @@ -1015,7 +1018,7 @@ job_groups = -- Dynamically linked build, suitable for building your own static executables on alpine , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine318) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) ===================================== .gitlab/jobs.yaml ===================================== @@ -897,7 +897,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-validate": { + "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -908,7 +908,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-validate.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -918,14 +918,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -951,17 +951,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-validate", - "BROKEN_TESTS": "encoding004 T10458", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", - "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BUILD_FLAVOUR": "release+fully_static+text_simdutf", + "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CROSS_TARGET": "wasm32-wasi", + "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-validate", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -972,7 +972,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1014,18 +1014,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1036,7 +1036,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1078,18 +1078,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", "CROSS_TARGET": "wasm32-wasi", "HADRIAN_ARGS": "--docs=none", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": { + "nightly-x86_64-linux-alpine3_20-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1100,7 +1100,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz", + "ghc-x86_64-linux-alpine3_20-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1110,14 +1110,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-wasm-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18-wasm:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1143,13 +1143,13 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", - "BUILD_FLAVOUR": "release+fully_static+text_simdutf", - "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check", - "CROSS_TARGET": "wasm32-wasi", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-validate", + "BROKEN_TESTS": "encoding004 T10458", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf", + "TEST_ENV": "x86_64-linux-alpine3_20-validate", "XZ_OPT": "-9" } }, @@ -3343,7 +3343,7 @@ "XZ_OPT": "-9" } }, - "release-x86_64-linux-alpine3_18-release+no_split_sections": { + "release-x86_64-linux-alpine3_20-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -3354,7 +3354,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-x86_64-linux-alpine3_18-release+no_split_sections.tar.xz", + "ghc-x86_64-linux-alpine3_20-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -3364,14 +3364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-alpine3_18-$CACHE_REV", + "key": "x86_64-linux-alpine3_20-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_18:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_20:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -3397,7 +3397,7 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-release+no_split_sections", + "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_20-release+no_split_sections", "BROKEN_TESTS": "encoding004 T10458", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", @@ -3405,7 +3405,7 @@ "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--disable-ld-override --enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-alpine3_18-release+no_split_sections", + "TEST_ENV": "x86_64-linux-alpine3_20-release+no_split_sections", "XZ_OPT": "-9" } }, ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -34,7 +34,7 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-release+fully_static': 'x86_64-alpine3_12-linux-static', 'release-x86_64-linux-alpine3_12-release': 'x86_64-alpine3_12-linux', 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', - 'release-x86_64-linux-alpine3_18-release': 'x86_64-alpine3_18-linux', + 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -198,7 +198,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): darwin_arm64 = mk(darwin("aarch64")) windows = mk(windowsArtifact) alpine3_12 = mk(alpine("3_12")) - alpine3_18 = mk(alpine("3_18")) + alpine3_20 = mk(alpine("3_20")) alpine3_18_arm64 = mk(alpine("3_18", arch='aarch64')) deb9 = mk(debian(9, "x86_64")) deb10 = mk(debian(10, "x86_64")) @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 - , ">= 3.18": alpine3_18 + , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } } ===================================== testsuite/tests/plugins/all.T ===================================== @@ -11,11 +11,15 @@ setTestOpts([ when(opsys('mingw32'), multi_cpu_race), ]) -import itertools # Check the simple-plugin tests without # caring about the order of loading of interfaces def normalizeIfaces(unnormalized_str): + # Why is this not at the top-level? Probably a python bug which I didn't fancy + # investigating deeply. + # NameError: name 'itertools' is not defined. Did you forget to import 'itertools' + # if placed at the top-level + import itertools iface_plugin_prefix = "interfacePlugin: " grouped_plugins = itertools.groupby( unnormalized_str.split('\n'), View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb83c3479aaf17023faacbbca706e5de78f3277f...43aa99b8169fc6d8552844cd6fa0ce3cd4308185 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb83c3479aaf17023faacbbca706e5de78f3277f...43aa99b8169fc6d8552844cd6fa0ce3cd4308185 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:47:28 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:47:28 -0400 Subject: [Git][ghc/ghc][master] initialise mmap_32bit_base during RTS startup #24847 Message-ID: <6691501022267_1abaf22ceeb01287e@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 4 changed files: - rts/Linker.c - rts/RtsStartup.c - rts/linker/MMap.c - rts/linker/MMap.h Changes: ===================================== rts/Linker.c ===================================== @@ -501,11 +501,6 @@ initLinker_ (int retain_cafs) } # endif - if (RtsFlags.MiscFlags.linkerMemBase != 0) { - // User-override for mmap_32bit_base - mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; - } - #if defined(OBJFORMAT_PEi386) initLinker_PEi386(); #endif ===================================== rts/RtsStartup.c ===================================== @@ -11,6 +11,7 @@ #include "HsFFI.h" #include "sm/Storage.h" +#include "linker/MMap.h" #include "RtsFlags.h" #include "RtsUtils.h" #include "Prelude.h" @@ -342,6 +343,9 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config) /* Initialise the adjustors subsystem */ initAdjustors(); + /* Initialise mmapForLinker */ + initLinkerMMap(); + /* Initialise the stats department, phase 1 */ initStats1(); ===================================== rts/linker/MMap.c ===================================== @@ -40,6 +40,13 @@ void *mmap_32bit_base = LINKER_LOAD_BASE; +void initLinkerMMap(void) { + if (RtsFlags.MiscFlags.linkerMemBase != 0) { + // User-override for mmap_32bit_base + mmap_32bit_base = (void*)RtsFlags.MiscFlags.linkerMemBase; + } +} + static const char *memoryAccessDescription(MemoryAccess mode) { switch (mode) { ===================================== rts/linker/MMap.h ===================================== @@ -49,6 +49,8 @@ #define LINKER_LOAD_BASE ((void *) 0x40000000) #endif +void initLinkerMMap(void); + /** Access modes for mprotectForLinker */ typedef enum { MEM_NO_ACCESS, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3914028829a6e617c59f7d7b6b1fc969232ac6d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3914028829a6e617c59f7d7b6b1fc969232ac6d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 15:47:50 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 11:47:50 -0400 Subject: [Git][ghc/ghc][master] haddock: Only fetch supported languages and extensions once per Interface list Message-ID: <66915026475c3_1abaf22bab54128922@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 3 changed files: - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs - utils/haddock/haddock-api/src/Haddock/GhcUtils.hs Changes: ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -82,7 +82,7 @@ import Haddock.Version import Haddock.InterfaceFile import Haddock.Options import Haddock.Utils -import Haddock.GhcUtils (modifySessionDynFlags, setOutputDir) +import Haddock.GhcUtils (modifySessionDynFlags, setOutputDir, getSupportedLanguagesAndExtensions) -------------------------------------------------------------------------------- -- * Exception handling @@ -228,6 +228,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do , piPackageVersion = fromMaybe (makeVersion []) (optPackageVersion flags) } + languagesAndExtensions = getSupportedLanguagesAndExtensions ifaces -- Dump an "interface file" (.haddock file), if requested. forM_ (optDumpInterfaceFile flags) $ \path -> liftIO $ do @@ -238,7 +239,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do } -- Render the interfaces. - liftIO $ renderStep dflags parserOpts logger unit_state flags sinceQual qual packages ifaces + liftIO $ renderStep dflags languagesAndExtensions parserOpts logger unit_state flags sinceQual qual packages ifaces -- If we were not given any input files, error if documentation was -- requested @@ -251,7 +252,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do packages <- liftIO $ readInterfaceFiles name_cache (readIfaceArgs flags) noChecks -- Render even though there are no input files (usually contents/index). - liftIO $ renderStep dflags parserOpts logger unit_state flags sinceQual qual packages [] + liftIO $ renderStep dflags [] parserOpts logger unit_state flags sinceQual qual packages [] -- | Run the GHC action using a temporary output directory withTempOutputDir :: Ghc a -> Ghc a @@ -305,6 +306,8 @@ readPackagesAndProcessModules flags files = do renderStep :: DynFlags + -> [String] + -- ^ Supported languages and extensions based on architecture and OS -> ParserOpts -> Logger -> UnitState @@ -314,7 +317,7 @@ renderStep -> [(DocPaths, Visibility, FilePath, InterfaceFile)] -> [Interface] -> IO () -renderStep dflags parserOpts logger unit_state flags sinceQual nameQual pkgs interfaces = do +renderStep dflags languagesAndExtensions parserOpts logger unit_state flags sinceQual nameQual pkgs interfaces = do updateHTMLXRefs (map (\(docPath, _ifaceFilePath, _showModules, ifaceFile) -> ( case baseUrl flags of Nothing -> docPathsHtml docPath @@ -330,7 +333,7 @@ renderStep dflags parserOpts logger unit_state flags sinceQual nameQual pkgs int (DocPaths {docPathsSources=Just path}, _, _, ifile) <- pkgs iface <- ifInstalledIfaces ifile return (instMod iface, path) - render dflags parserOpts logger unit_state flags sinceQual nameQual interfaces installedIfaces extSrcMap + render dflags languagesAndExtensions parserOpts logger unit_state flags sinceQual nameQual interfaces installedIfaces extSrcMap where -- get package name from unit-id packageName :: Unit -> String @@ -342,6 +345,8 @@ renderStep dflags parserOpts logger unit_state flags sinceQual nameQual pkgs int -- | Render the interfaces with whatever backend is specified in the flags. render :: DynFlags + -> [String] + -- ^ Supported languages and extensions based on architecture and OS -> ParserOpts -> Logger -> UnitState @@ -352,7 +357,7 @@ render -> [(FilePath, PackageInterfaces)] -> Map Module FilePath -> IO () -render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages extSrcMap = do +render dflags languagesAndExtensions parserOpts logger unit_state flags sinceQual qual ifaces packages extSrcMap = do let packageInfo = PackageInfo { piPackageName = fromMaybe (PackageName mempty) $ optPackageName flags @@ -554,7 +559,7 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger "ppHyperlinkedSource" (const ()) $ do _ <- {-# SCC ppHyperlinkedSource #-} - ppHyperlinkedSource (verbosity flags) (isJust (optOneShot flags)) odir libDir opt_source_css pretty srcMap ifaces + ppHyperlinkedSource (verbosity flags) (isJust (optOneShot flags)) languagesAndExtensions odir libDir opt_source_css pretty srcMap ifaces return () ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker.hs ===================================== @@ -12,13 +12,12 @@ import Control.Monad (unless) import Data.Map as M import Data.Maybe import GHC.Data.FastString (mkFastString) -import GHC.Platform import GHC.Driver.Config.Diagnostic (initDiagOpts) -import GHC.Driver.Session (supportedLanguagesAndExtensions, safeImportsOn) -import GHC.Parser.Lexer as Lexer import qualified GHC.Driver.DynFlags as DynFlags +import GHC.Driver.Session (safeImportsOn) import GHC.Iface.Ext.Binary (hie_file_result, readHieFile) import GHC.Iface.Ext.Types (HieAST (..), HieASTs (..), HieFile (..), SourcedNodeInfo (..), pattern HiePath) +import GHC.Parser.Lexer as Lexer import GHC.Types.SrcLoc (mkRealSrcLoc, realSrcLocSpan, srcSpanFile) import GHC.Unit.Module (Module, moduleName) import qualified GHC.Utils.Outputable as Outputable @@ -43,6 +42,8 @@ ppHyperlinkedSource :: Verbosity -> Bool -- ^ In one-shot mode + -> [String] + -- ^ Supported languages and extensions based on architecture and OS -> FilePath -- ^ Output directory -> FilePath @@ -56,21 +57,29 @@ ppHyperlinkedSource -> [Interface] -- ^ Interfaces for which we create source -> IO () -ppHyperlinkedSource verbosity isOneShot outdir libdir mstyle pretty srcs' ifaces = do +ppHyperlinkedSource verbosity isOneShot languagesAndExtensions outdir libdir mstyle pretty srcs' ifaces = do createDirectoryIfMissing True srcdir unless isOneShot $ do let cssFile = fromMaybe (defaultCssFile libdir) mstyle copyFile cssFile $ srcdir srcCssFile copyFile (libdir "html" highlightScript) $ srcdir highlightScript - mapM_ (ppHyperlinkedModuleSource verbosity srcdir pretty srcs) ifaces + mapM_ (ppHyperlinkedModuleSource verbosity languagesAndExtensions srcdir pretty srcs) ifaces where srcdir = outdir hypSrcDir srcs = (srcs', M.mapKeys moduleName srcs') -- | Generate hyperlinked source for particular interface. -ppHyperlinkedModuleSource :: Verbosity -> FilePath -> Bool -> SrcMaps -> Interface -> IO () -ppHyperlinkedModuleSource verbosity srcdir pretty srcs iface = do +ppHyperlinkedModuleSource + :: Verbosity + -> [String] + -- ^ Supported languages and extensions based on architecture and OS + -> FilePath + -> Bool + -> SrcMaps + -> Interface + -> IO () +ppHyperlinkedModuleSource verbosity languagesAndExtensions srcdir pretty srcs iface = do -- Parse the GHC-produced HIE file nc <- freshNameCache HieFile @@ -114,13 +123,12 @@ ppHyperlinkedModuleSource verbosity srcdir pretty srcs iface = do writeUtf8File path . renderToString pretty . render' fullAst $ tokens where dflags = ifaceDynFlags iface - arch_os = platformArchOS (dflags.targetPlatform) sDocContext = DynFlags.initSDocContext dflags Outputable.defaultUserStyle parserOpts = Lexer.mkParserOpts (dflags.extensionFlags) (initDiagOpts dflags) - (supportedLanguagesAndExtensions arch_os) + languagesAndExtensions (safeImportsOn dflags) False -- lex Haddocks as comment tokens True -- produce comment tokens ===================================== utils/haddock/haddock-api/src/Haddock/GhcUtils.hs ===================================== @@ -36,7 +36,7 @@ import qualified Data.ByteString.Internal as BS import Data.Char (isSpace) import Data.Foldable (toList) import qualified Data.List as List -import Data.List.NonEmpty (NonEmpty) +import Data.List.NonEmpty (NonEmpty (..)) import Data.Maybe (fromMaybe, mapMaybe) import qualified Data.Set as Set import GHC @@ -49,6 +49,7 @@ import GHC.Data.StringBuffer (StringBuffer) import qualified GHC.Data.StringBuffer as S import GHC.Driver.Session import GHC.HsToCore.Docs hiding (sigNameNoLoc) +import GHC.Platform (Platform (..)) import GHC.Types.Name import GHC.Types.SrcLoc (advanceSrcLoc) import GHC.Types.Var @@ -66,7 +67,7 @@ import GHC.Utils.Outputable (Outputable, SDocContext, ppr) import qualified GHC.Utils.Outputable as Outputable import GHC.Utils.Panic (panic) -import Haddock.Types (DocName, DocNameI, XRecCond) +import Haddock.Types (DocName, DocNameI, Interface (..), XRecCond) moduleString :: Module -> String moduleString = moduleNameString . moduleName @@ -629,6 +630,14 @@ setOutputDir dir dynFlags = , dumpDir = Just dir } +getSupportedLanguagesAndExtensions + :: [Interface] + -> [String] +getSupportedLanguagesAndExtensions [] = [] +getSupportedLanguagesAndExtensions (iface : _) = do + let dflags = ifaceDynFlags iface + in supportedLanguagesAndExtensions dflags.targetPlatform.platformArchOS + ------------------------------------------------------------------------------- -- * 'StringBuffer' and 'ByteString' View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/86b8ecee8fcf273fbc7ca5ffabc24b43c070849b -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/86b8ecee8fcf273fbc7ca5ffabc24b43c070849b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 16:17:59 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 12 Jul 2024 12:17:59 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 15 commits: compiler: Fingerprint -fwrite-if-simplified-core Message-ID: <669157376a605_1abaf28cc2f4134567@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - cab8355d by sheaf at 2024-07-12T12:17:49-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - d03c7c18 by Matthew Pickering at 2024-07-12T12:17:49-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal - hadrian/bootstrap/plan-9_10_1.json The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c751c583e07a68876f00288686555b2925e6b664...d03c7c1805f6b4268047a6f020fbfb280280f5d4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c751c583e07a68876f00288686555b2925e6b664...d03c7c1805f6b4268047a6f020fbfb280280f5d4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 12 16:37:46 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 12 Jul 2024 12:37:46 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Wibbles Message-ID: <66915bda5475c_1abaf2c0890413955b@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: cbd0aa15 by Simon Peyton Jones at 2024-07-12T17:10:12+01:00 Wibbles - - - - - 493b80a9 by Simon Peyton Jones at 2024-07-12T17:37:12+01:00 Typo in coercionKind - - - - - 23 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/TyCo/FVs.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCo/Subst.hs - compiler/GHC/Core/TyCo/Tidy.hs - compiler/GHC/Core/Type.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/Data/Pair.hs - compiler/GHC/Iface/Rename.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Type.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/TyCl/Utils.hs - compiler/GHC/Tc/Utils/TcMType.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -33,7 +33,7 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Unify ( tcMatchTys ) import GHC.Data.Pair -import GHC.Core.TyCon ( TyCon, FamTyConFlav(..), mkFamilyTyCon +import GHC.Core.TyCon ( TyCon, FamTyConFlav(..), mkFamilyTyCon, tyConArity , Injectivity(..), isBuiltInSynFamTyCon_maybe ) import GHC.Core.Coercion.Axiom import GHC.Core.TyCo.Compare ( tcEqType ) @@ -64,7 +64,6 @@ import GHC.Builtin.Names ) import GHC.Data.FastString import GHC.Utils.Panic -import GHC.Utils.Misc import GHC.Utils.Outputable import Control.Monad ( guard ) @@ -141,28 +140,28 @@ There are a few steps to adding a built-in type family: tryInteractTopFam :: BuiltInSynFamily -> TyCon -> [Type] -> Type -> [(CoAxiomRule, TypeEqn)] tryInteractTopFam fam fam_tc tys r - = [(BuiltInFamInteract ax_rule, eqn) + = [(BuiltInFamInteract ax_rule, eqn_out) | ax_rule <- sfInteract fam - , Just eqn <- [bifint_proves ax_rule [eqn]] ] + , Just eqn_out <- [bifint_proves ax_rule eqn_in] ] where - eqn :: TypeEqn - eqn = Pair (mkTyConApp fam_tc tys) r + eqn_in :: TypeEqn + eqn_in = Pair (mkTyConApp fam_tc tys) r tryInteractInertFam :: BuiltInSynFamily -> TyCon -> [Type] -> [Type] -- F tys1 ~ F tys2 -> [(CoAxiomRule, TypeEqn)] tryInteractInertFam builtin_fam fam_tc tys1 tys2 - = [(BuiltInFamInteract ax_rule, eqn) + = [(BuiltInFamInteract ax_rule, eqn_out) | ax_rule <- sfInteract builtin_fam - , Just eqn <- [bifint_proves ax_rule [eqn]] ] + , Just eqn_out <- [bifint_proves ax_rule eqn_in] ] where - eqn = Pair (mkTyConApp fam_tc tys1) (mkTyConApp fam_tc tys2) + eqn_in = Pair (mkTyConApp fam_tc tys1) (mkTyConApp fam_tc tys2) tryMatchFam :: BuiltInSynFamily -> [Type] -> Maybe (BuiltInFamRewrite, [Type], Type) -- Does this reduce on the given arguments? -- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) --- That is: mkAxiomRuleCo ax (zipWith mkReflCo (coAxArgRuleRoles ax) ts) +-- That is: mkAxiomCo ax (zipWith mkReflCo (coAxArgRuleRoles ax) ts) -- :: F tys ~r rhs, tryMatchFam builtin_fam arg_tys = listToMaybe $ -- Pick first rule to match @@ -179,11 +178,11 @@ mkUnaryConstFoldAxiom :: TyCon -> String -> (a -> Maybe Type) -> BuiltInFamRewrite -- For the definitional axioms, like (3+4 --> 7) -mkUnaryConstFoldAxiom tc str isReqTy f +mkUnaryConstFoldAxiom fam_tc str isReqTy f = BIF_Rewrite { bifrw_name = fsLit str - , bifrw_arg_roles = [Nominal] - , bifrw_res_role = Nominal + , bifrw_fam_tc = fam_tc + , bifrw_arity = 1 , bifrw_match = \ts -> do { [t1] <- return ts ; t1' <- isReqTy t1 ; res <- f t1' @@ -191,7 +190,7 @@ mkUnaryConstFoldAxiom tc str isReqTy f , bifrw_proves = \cs -> do { [Pair s1 s2] <- return cs ; s2' <- isReqTy s2 ; z <- f s2' - ; return (mkTyConApp tc [s1] === z) } + ; return (mkTyConApp fam_tc [s1] === z) } } mkBinConstFoldAxiom :: TyCon -> String @@ -200,11 +199,11 @@ mkBinConstFoldAxiom :: TyCon -> String -> (a -> b -> Maybe Type) -> BuiltInFamRewrite -- For the definitional axioms, like (3+4 --> 7) -mkBinConstFoldAxiom tc str isReqTy1 isReqTy2 f +mkBinConstFoldAxiom fam_tc str isReqTy1 isReqTy2 f = BIF_Rewrite { bifrw_name = fsLit str - , bifrw_arg_roles = [Nominal, Nominal] - , bifrw_res_role = Nominal + , bifrw_fam_tc = fam_tc + , bifrw_arity = 2 , bifrw_match = \ts -> do { [t1,t2] <- return ts ; t1' <- isReqTy1 t1 ; t2' <- isReqTy2 t2 @@ -214,31 +213,35 @@ mkBinConstFoldAxiom tc str isReqTy1 isReqTy2 f ; s2' <- isReqTy1 s2 ; t2' <- isReqTy2 t2 ; z <- f s2' t2' - ; return (mkTyConApp tc [s1,t1] === z) } + ; return (mkTyConApp fam_tc [s1,t1] === z) } } mkRewriteAxiom :: TyCon -> String - -> [TyVar] -> [Type] -- LHS - -> Type -- RHS + -> [TyVar] -> [Type] -- LHS of axiom + -> Type -- RHS or axiom -> BuiltInFamRewrite -mkRewriteAxiom tc str tpl_tvs lhs_tys rhs_ty - = BIF_Rewrite - { bifrw_name = fsLit str - , bifrw_arg_roles = [Nominal | _ <- tpl_tvs] - , bifrw_res_role = Nominal - , bifrw_match = match_fn - , bifrw_proves = inst_fn } +mkRewriteAxiom fam_tc str tpl_tvs lhs_tys rhs_ty + = assertPpr (tyConArity fam_tc == length lhs_tys) (text str <+> ppr lhs_tys) $ + BIF_Rewrite + { bifrw_name = fsLit str + , bifrw_fam_tc = fam_tc + , bifrw_arity = bif_arity + , bifrw_match = match_fn + , bifrw_proves = inst_fn } where + bif_arity = length tpl_tvs + match_fn :: [Type] -> Maybe ([Type],Type) match_fn arg_tys - = case tcMatchTys lhs_tys arg_tys of + = assertPpr (tyConArity fam_tc == length arg_tys) (text str <+> ppr arg_tys) $ + case tcMatchTys lhs_tys arg_tys of Nothing -> Nothing Just subst -> Just (substTyVars subst tpl_tvs, substTy subst rhs_ty) inst_fn :: [TypeEqn] -> Maybe TypeEqn inst_fn inst_eqns - = assertPpr (inst_eqns `equalLength` tpl_tvs) (text str $$ ppr inst_eqns) $ - Just (mkTyConApp tc (substTys (zipTCvSubst tpl_tvs tys1) lhs_tys) + = assertPpr (length inst_eqns == bif_arity) (text str $$ ppr inst_eqns) $ + Just (mkTyConApp fam_tc (substTys (zipTCvSubst tpl_tvs tys1) lhs_tys) === substTy (zipTCvSubst tpl_tvs tys2) rhs_ty) where @@ -251,12 +254,10 @@ mkTopUnaryFamDeduction :: String -> TyCon mkTopUnaryFamDeduction str fam_tc f = BIF_Interact { bifint_name = fsLit str - , bifint_arg_roles = [Nominal] - , bifint_res_role = Nominal - , bifint_proves = \cs -> do { [Pair lhs rhs] <- return cs - ; (tc, [a]) <- splitTyConApp_maybe lhs - ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) - ; f a rhs } } + , bifint_proves = \(Pair lhs rhs) + -> do { (tc, [a]) <- splitTyConApp_maybe lhs + ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) + ; f a rhs } } mkTopBinFamDeduction :: String -> TyCon -> (Type -> Type -> Type -> Maybe TypeEqn) @@ -265,42 +266,32 @@ mkTopBinFamDeduction :: String -> TyCon mkTopBinFamDeduction str fam_tc f = BIF_Interact { bifint_name = fsLit str - , bifint_arg_roles = [Nominal] - , bifint_res_role = Nominal - , bifint_proves = \cs -> do { [Pair lhs rhs] <- return cs - ; (tc, [a,b]) <- splitTyConApp_maybe lhs - ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) - ; f a b rhs } } + , bifint_proves = \(Pair lhs rhs) -> + do { (tc, [a,b]) <- splitTyConApp_maybe lhs + ; massertPpr (tc == fam_tc) (ppr tc $$ ppr fam_tc) + ; f a b rhs } } mkUnaryBIF :: String -> TyCon -> BuiltInFamInteract mkUnaryBIF str fam_tc - = BIF_Interact { bifint_name = fsLit str - , bifint_arg_roles = [Nominal] - , bifint_res_role = Nominal - , bifint_proves = proves } + = BIF_Interact { bifint_name = fsLit str + , bifint_proves = proves } where - proves cs - | [Pair lhs rhs] <- cs -- Expect one coercion argument + proves (Pair lhs rhs) = do { (tc2, [x2]) <- splitTyConApp_maybe rhs ; guard (tc2 == fam_tc) ; (tc1, [x1]) <- splitTyConApp_maybe lhs ; massertPpr (tc1 == fam_tc) (ppr tc1 $$ ppr fam_tc) ; return (Pair x1 x2) } - | otherwise - = Nothing mkBinBIF :: String -> TyCon -> WhichArg -> WhichArg -> (Type -> Bool) -- The guard on the equal args, if any -> BuiltInFamInteract mkBinBIF str fam_tc eq1 eq2 check_me - = BIF_Interact { bifint_name = fsLit str - , bifint_arg_roles = [Nominal] - , bifint_res_role = Nominal - , bifint_proves = proves } + = BIF_Interact { bifint_name = fsLit str + , bifint_proves = proves } where - proves cs - | [Pair lhs rhs] <- cs -- Expect one coercion argument + proves (Pair lhs rhs) = do { (tc2, [x2,y2]) <- splitTyConApp_maybe rhs ; guard (tc2 == fam_tc) ; (tc1, [x1,y1]) <- splitTyConApp_maybe lhs @@ -310,8 +301,6 @@ mkBinBIF str fam_tc eq1 eq2 check_me (ArgX,ArgY) -> do_it x1 y2 x2 y1 (ArgY,ArgX) -> do_it y1 x2 y2 x1 (ArgY,ArgY) -> do_it y1 y2 x1 x2 } - | otherwise - = Nothing do_it a1 a2 b1 b2 = do { same a1 a2; guard (check_me a1); return (Pair b1 b2) } ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -45,7 +45,7 @@ module GHC.Core.Coercion ( mkPhantomCo, mkHoleCo, mkUnivCo, mkSubCo, mkProofIrrelCo, - downgradeRole, mkAxiomRuleCo, + downgradeRole, mkAxiomCo, mkGReflRightCo, mkGReflLeftCo, mkCoherenceLeftCo, mkCoherenceRightCo, mkKindCo, castCoercionKind, castCoercionKind1, castCoercionKind2, @@ -1029,10 +1029,10 @@ mkAxInstCo :: Role -- Only called with BranchedAxiom or UnbranchedAxiom mkAxInstCo role axr tys cos | arity == n_tys = downgradeRole role ax_role $ - AxiomRuleCo axr (rtys `chkAppend` cos) + AxiomCo axr (rtys `chkAppend` cos) | otherwise = assert (arity < n_tys) $ downgradeRole role ax_role $ - mkAppCos (AxiomRuleCo axr (ax_args `chkAppend` cos)) + mkAppCos (AxiomCo axr (ax_args `chkAppend` cos)) leftover_args where (ax_role, branch) = case coAxiomRuleBranch_maybe axr of @@ -1045,8 +1045,8 @@ mkAxInstCo role axr tys cos (ax_args, leftover_args) = splitAt arity rtys -- worker function -mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion -mkAxiomRuleCo = AxiomRuleCo +mkAxiomCo :: CoAxiomRule -> [Coercion] -> Coercion +mkAxiomCo = AxiomCo -- to be used only with unbranched axioms mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched @@ -1452,7 +1452,6 @@ setNominalRole_maybe r co setNominalRole_maybe_helper co@(UnivCo { uco_prov = prov }) | case prov of PhantomProv {} -> False -- should always be phantom ProofIrrelProv {} -> True -- it's always safe - BuiltinProv {} -> True -- always nominal PluginProv {} -> False -- who knows? This choice is conservative. = Just $ co { uco_role = Nominal } setNominalRole_maybe_helper _ = Nothing @@ -1571,10 +1570,12 @@ promoteCoercion co = case co of -- We can get Type~Constraint or Constraint~Type -- from FunCo {} :: (a -> (b::Type)) ~ (a -=> (b'::Constraint)) - CoVarCo {} -> mkKindCo co - HoleCo {} -> mkKindCo co - AxiomRuleCo {} -> mkKindCo co - UnivCo {} -> mkKindCo co + CoVarCo {} -> mkKindCo co + HoleCo {} -> mkKindCo co + AxiomCo {} -> mkKindCo co + UnivCo {} -> mkKindCo co -- We could instead return the (single) `uco_deps` coercion in + -- the `ProofIrrelProv` and `PhantomProv` cases, but it doesn't + -- quite seem worth doing. SymCo g -> mkSymCo (promoteCoercion g) @@ -2383,28 +2384,28 @@ seqMCo MRefl = () seqMCo (MCo co) = seqCo co seqCo :: Coercion -> () -seqCo (Refl ty) = seqType ty -seqCo (GRefl r ty mco) = r `seq` seqType ty `seq` seqMCo mco -seqCo (TyConAppCo r tc cos) = r `seq` tc `seq` seqCos cos -seqCo (AppCo co1 co2) = seqCo co1 `seq` seqCo co2 -seqCo (ForAllCo tv visL visR k co) = seqType (varType tv) `seq` - rnf visL `seq` rnf visR `seq` - seqCo k `seq` seqCo co -seqCo (FunCo r af1 af2 w co1 co2) = r `seq` af1 `seq` af2 `seq` - seqCo w `seq` seqCo co1 `seq` seqCo co2 -seqCo (CoVarCo cv) = cv `seq` () -seqCo (HoleCo h) = coHoleCoVar h `seq` () +seqCo (Refl ty) = seqType ty +seqCo (GRefl r ty mco) = r `seq` seqType ty `seq` seqMCo mco +seqCo (TyConAppCo r tc cos) = r `seq` tc `seq` seqCos cos +seqCo (AppCo co1 co2) = seqCo co1 `seq` seqCo co2 +seqCo (CoVarCo cv) = cv `seq` () +seqCo (HoleCo h) = coHoleCoVar h `seq` () +seqCo (SymCo co) = seqCo co +seqCo (TransCo co1 co2) = seqCo co1 `seq` seqCo co2 +seqCo (SelCo n co) = n `seq` seqCo co +seqCo (LRCo lr co) = lr `seq` seqCo co +seqCo (InstCo co arg) = seqCo co `seq` seqCo arg +seqCo (KindCo co) = seqCo co +seqCo (SubCo co) = seqCo co +seqCo (AxiomCo _ cs) = seqCos cs +seqCo (ForAllCo tv visL visR k co) + = seqType (varType tv) `seq` rnf visL `seq` rnf visR `seq` + seqCo k `seq` seqCo co +seqCo (FunCo r af1 af2 w co1 co2) + = r `seq` af1 `seq` af2 `seq` seqCo w `seq` seqCo co1 `seq` seqCo co2 seqCo (UnivCo { uco_prov = p, uco_role = r , uco_lty = t1, uco_rty = t2, uco_deps = deps }) = p `seq` r `seq` seqType t1 `seq` seqType t2 `seq` seqCos deps -seqCo (SymCo co) = seqCo co -seqCo (TransCo co1 co2) = seqCo co1 `seq` seqCo co2 -seqCo (SelCo n co) = n `seq` seqCo co -seqCo (LRCo lr co) = lr `seq` seqCo co -seqCo (InstCo co arg) = seqCo co `seq` seqCo arg -seqCo (KindCo co) = seqCo co -seqCo (SubCo co) = seqCo co -seqCo (AxiomRuleCo _ cs) = seqCos cs seqCos :: [Coercion] -> () seqCos [] = () @@ -2446,8 +2447,8 @@ coercionRKind co = coercion_lr_kind CRight co coercion_lr_kind :: HasDebugCallStack => LeftOrRight -> Coercion -> Type {-# INLINE coercion_lr_kind #-} -coercion_lr_kind which co - = go co +coercion_lr_kind which orig_co + = go orig_co where go (Refl ty) = ty go (GRefl _ ty MRefl) = ty @@ -2463,13 +2464,15 @@ coercion_lr_kind which co go (KindCo co) = typeKind (go co) go (SubCo co) = go co go (SelCo d co) = selectFromType d (go co) - go (AxiomRuleCo ax cos) = go_ax ax cos + go (AxiomCo ax cos) = go_ax ax cos go (UnivCo { uco_lty = lty, uco_rty = rty}) = pickLR which (lty, rty) - go (FunCo { fco_afl = af, fco_mult = mult, fco_arg = arg, fco_res = res}) + go (FunCo { fco_afl = afl, fco_afr = afr, fco_mult = mult + , fco_arg = arg, fco_res = res}) = -- See Note [FunCo] - FunTy { ft_af = af, ft_mult = go mult, ft_arg = go arg, ft_res = go res } + FunTy { ft_af = pickLR which (afl, afr), ft_mult = go mult + , ft_arg = go arg, ft_res = go res } go co@(ForAllCo { fco_tcv = tv1, fco_visL = visL, fco_visR = visR , fco_kind = k_co, fco_body = co1 }) @@ -2493,15 +2496,17 @@ coercion_lr_kind which co go_app co args = piResultTys (go co) args ------------- - go_ax (BuiltInFamRewrite bif) cos = go_bif (bifrw_proves bif) cos - go_ax (BuiltInFamInteract bif) cos = go_bif (bifint_proves bif) cos - go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos - go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos + go_ax (BuiltInFamRewrite bif) cos = check_bif_res (bifrw_proves bif (map coercionKind cos)) + go_ax (BuiltInFamInteract bif) [co] = check_bif_res (bifint_proves bif (coercionKind co)) + go_ax (BuiltInFamInteract {}) _ = crash + go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos + go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos ------------- - go_bif proves cos = case proves (map coercionKind cos) of - Nothing -> pprPanic "coercionKind" (ppr cos) - Just (Pair lty rty) -> pickLR which (lty, rty) + check_bif_res (Just (Pair lhs rhs)) = pickLR which (lhs,rhs) + check_bif_res Nothing = crash + + crash = pprPanic "coercionKind" (ppr orig_co) ------------- go_branch :: CoAxiom br -> CoAxBranch -> [Coercion] -> Type @@ -2569,16 +2574,13 @@ coercion_lr_kind which co -- when other_co is not a ForAllCo = substTy subst (go other_co) -{- - -Note [Nested ForAllCos] -~~~~~~~~~~~~~~~~~~~~~~~ - -Suppose we need `coercionKind (ForAllCo a1 (ForAllCo a2 ... (ForAllCo an -co)...) )`. We do not want to perform `n` single-type-variable -substitutions over the kind of `co`; rather we want to do one substitution -which substitutes for all of `a1`, `a2` ... simultaneously. If we do one -at a time we get the performance hole reported in #11735. +{- Note [Nested ForAllCos] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Suppose we need `coercionKind (ForAllCo a1 (ForAllCo a2 ... (ForAllCo an co)...) )`. +We do not want to perform `n` single-type-variable substitutions over the kind +of `co`; rather we want to do one substitution which substitutes for all of +`a1`, `a2` ... simultaneously. If we do one at a time we get the performance +hole reported in #11735. Solution: gather up the type variables for nested `ForAllCos`, and substitute for them all at once. Remarkably, for #11735 this single @@ -2606,7 +2608,7 @@ coercionRole = go go (InstCo co _) = go co go (KindCo {}) = Nominal go (SubCo _) = Representational - go (AxiomRuleCo ax _) = coAxiomRuleRole ax + go (AxiomCo ax _) = coAxiomRuleRole ax {- Note [Nested InstCos] ===================================== compiler/GHC/Core/Coercion.hs-boot ===================================== @@ -33,7 +33,7 @@ mkNomReflCo :: Type -> Coercion mkKindCo :: Coercion -> Coercion mkSubCo :: HasDebugCallStack => Coercion -> Coercion mkProofIrrelCo :: Role -> Coercion -> Coercion -> Coercion -> Coercion -mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion +mkAxiomCo :: CoAxiomRule -> [Coercion] -> Coercion funRole :: Role -> FunSel -> Role ===================================== compiler/GHC/Core/Coercion/Axiom.hs ===================================== @@ -81,7 +81,7 @@ axF :: { F [Int] ~ Bool ; forall (k :: *) (a :: k -> *) (b :: k). F (a b) ~ Char } -The axiom is used with the AxiomRuleCo constructor of Coercion. If we wish +The axiom is used with the AxiomCo constructor of Coercion. If we wish to have a coercion showing that F (Maybe Int) ~ Char, it will look like axF[2] <*> :: F (Maybe Int) ~ Char @@ -574,23 +574,23 @@ CoAxiomRules come in two flavours: (ax1) 3+4 ----> 7 (ax2) s+0 ----> s The evidence looks like - AxiomRuleCo ax1 [3,4] :: 3+4 ~ 7 - AxiomRuleCo ax2 [s] :: s+0 ~ s - The arguments in the AxiomRuleCo are the /instantiating types/, or - more generally cocerions, see Note [Coercion axioms applied to coercions] + AxiomCo ax1 [3,4] :: 3+4 ~ 7 + AxiomCo ax2 [s] :: s+0 ~ s + The arguments in the AxiomCo are the /instantiating types/, or + more generally coercions (see Note [Coercion axioms applied to coercions] in GHC.Core.TyCo.Rep). * BuiltInFamInteract: provides evidence for the consequences of one or two other coercions. For example - (ax3) g1: a+b ~ 0 ---> a~0 - (ax4) g2: a+b ~ 0 ---> b~0 + (ax3) g1: a+b ~ 0 ---> a~0 + (ax4) g2: a+b ~ 0 ---> b~0 (ax5) g3: a+b1~r1, g4 : a+b2~r ---> b1~b2 - The arguments to the AxiomRuleCo are the full coercions + The arguments to the AxiomCo are the full coercions (not types, right from the get-go). So then: - AxiomRuleCo ax3 [g1] :: a ~ 0 - AxiomRuleCo ax2 [g2] :: b ~ 0 - AxiomRuleCo ax3 [g3,g4] :: b1 ~ b2 + AxiomCo ax3 [g1] :: a ~ 0 + AxiomCo ax4 [g2] :: b ~ 0 + AxiomCo ax5 [g3,g4] :: b1 ~ b2 -} @@ -609,14 +609,14 @@ instance Eq CoAxiomRule where _ == _ = False coAxiomRuleRole :: CoAxiomRule -> Role -coAxiomRuleRole (BuiltInFamRewrite bif) = bifrw_res_role bif -coAxiomRuleRole (BuiltInFamInteract bif) = bifint_res_role bif -coAxiomRuleRole (UnbranchedAxiom ax) = coAxiomRole ax -coAxiomRuleRole (BranchedAxiom ax _) = coAxiomRole ax +coAxiomRuleRole (BuiltInFamRewrite {}) = Nominal +coAxiomRuleRole (BuiltInFamInteract {}) = Nominal +coAxiomRuleRole (UnbranchedAxiom ax) = coAxiomRole ax +coAxiomRuleRole (BranchedAxiom ax _) = coAxiomRole ax coAxiomRuleArgRoles :: CoAxiomRule -> [Role] -coAxiomRuleArgRoles (BuiltInFamRewrite bif) = bifrw_arg_roles bif -coAxiomRuleArgRoles (BuiltInFamInteract bif) = bifint_arg_roles bif +coAxiomRuleArgRoles (BuiltInFamRewrite bif) = replicate (bifrw_arity bif) Nominal +coAxiomRuleArgRoles (BuiltInFamInteract {}) = [Nominal] coAxiomRuleArgRoles (UnbranchedAxiom ax) = coAxBranchRoles (coAxiomSingleBranch ax) coAxiomRuleArgRoles (BranchedAxiom ax i) = coAxBranchRoles (coAxiomNthBranch ax i) @@ -636,11 +636,6 @@ instance Data.Data CoAxiomRule where gunfold _ _ = error "gunfold" dataTypeOf _ = mkNoRepType "CoAxiomRule" ---instance Ord CoAxiomRule where --- -- we compare lexically to avoid non-deterministic output when sets of rules --- -- are printed --- compare x y = lexicalCompareFS (coaxrName x) (coaxrName y) - instance Outputable CoAxiomRule where ppr (BuiltInFamRewrite bif) = ppr (bifrw_name bif) ppr (BuiltInFamInteract bif) = ppr (bifint_name bif) @@ -659,40 +654,47 @@ type TypeEqn = Pair Type -- Type checking of built-in families data BuiltInSynFamily = BuiltInSynFamily - { sfMatchFam :: [BuiltInFamRewrite] - - , sfInteract:: [BuiltInFamInteract] + { sfMatchFam :: [BuiltInFamRewrite] + , sfInteract :: [BuiltInFamInteract] -- If given these type arguments and RHS, returns the equalities that -- are guaranteed to hold. That is, if -- (ar, Pair s1 s2) is an element of (sfInteract tys ty) -- then AxiomRule ar [co :: F tys ~ ty] :: s1~s2 } -data BuiltInFamInteract +data BuiltInFamInteract -- Argument and result role are always Nominal = BIF_Interact - { bifint_name :: FastString - , bifint_arg_roles :: [Role] -- roles of parameter equations - , bifint_res_role :: Role -- role of resulting equation - , bifint_proves :: [TypeEqn] -> Maybe TypeEqn + { bifint_name :: FastString + , bifint_proves :: TypeEqn -> Maybe TypeEqn -- ^ Returns @Nothing@ when it doesn't like -- the supplied arguments. When this happens in a coercion -- that means that the coercion is ill-formed, and Core Lint -- checks for that. } -data BuiltInFamRewrite +data BuiltInFamRewrite -- Argument roles and result role are always Nominal = BIF_Rewrite - { bifrw_name :: FastString - , bifrw_arg_roles :: [Role] -- roles of parameter equations - , bifrw_res_role :: Role -- role of resulting equation + { bifrw_name :: FastString + , bifrw_fam_tc :: TyCon -- Needed for tyConsOfType + + , bifrw_arity :: Arity -- Number of type arguments needed + -- to instantiate this axiom - , bifrw_match :: [Type] -> Maybe ([Type], Type) -- Instantiating types and result type + , bifrw_match :: [Type] -> Maybe ([Type], Type) -- coaxrMatch: does this reduce on the given arguments? - -- If it does, returns (CoAxiomRule, types to instantiate the rule at, rhs type) - -- That is: mkAxiomRuleCo ax (zipWith mkReflCo coAxiomRuleArgRoles ts) - -- :: F tys ~coaxrRole rhs, + -- If it does, returns (types to instantiate the rule at, rhs type) + -- That is: mkAxiomCo ax (zipWith mkReflCo coAxiomRuleArgRoles ts) + -- :: F tys ~N rhs, , bifrw_proves :: [TypeEqn] -> Maybe TypeEqn } + -- length(inst_tys) = bifrw_arity + + -- INVARIANT: bifrw_match and bifrw_proves are related as follows: + -- If Just (inst_tys, res_ty) = bifrw_match ax arg_tys + -- then * length arg_tys = tyConArity fam_tc + -- * length inst_tys = bifrw_arity + -- * bifrw_proves (map mkNomReflCo inst_tys) = Just (mkNomReflCo res_ty) + -- Provides default implementations that do nothing. trivialBuiltInFamily :: BuiltInSynFamily ===================================== compiler/GHC/Core/Coercion/Opt.hs ===================================== @@ -355,7 +355,7 @@ opt_co4 env sym rep r (CoVarCo cv) opt_co4 _ _ _ _ (HoleCo h) = pprPanic "opt_univ fell into a hole" (ppr h) -opt_co4 env sym rep r (AxiomRuleCo con cos) +opt_co4 env sym rep r (AxiomCo con cos) -- Do *not* push sym inside top-level axioms -- e.g. if g is a top-level axiom -- g a : f a ~ a @@ -365,9 +365,9 @@ opt_co4 env sym rep r (AxiomRuleCo con cos) wrapSym sym $ -- some sub-cos might be P: use opt_co2 -- See Note [Optimising coercion optimisation] - AxiomRuleCo con (zipWith (opt_co2 env False) - (coAxiomRuleArgRoles con) - cos) + AxiomCo con (zipWith (opt_co2 env False) + (coAxiomRuleArgRoles con) + cos) -- Note that the_co does *not* have sym pushed into it opt_co4 env sym rep r (UnivCo { uco_prov = prov, uco_lty = t1 @@ -833,8 +833,8 @@ opt_trans_rule is co1 co2 -- If we put TrPushSymAxR first, we'll get -- (axN ty ; sym (axN ty)) :: N ty ~ N ty -- Obviously Refl -- --> axN (sym (axN ty)) :: N ty ~ N ty -- Very stupid - | Just (sym1, axr1, cos1) <- isAxiomRuleCo_maybe co1 - , Just (sym2, axr2, cos2) <- isAxiomRuleCo_maybe co2 + | Just (sym1, axr1, cos1) <- isAxiomCo_maybe co1 + , Just (sym2, axr2, cos2) <- isAxiomCo_maybe co2 , axr1 == axr2 , sym1 == not sym2 , Just (tc, role, branch) <- coAxiomRuleBranch_maybe axr1 @@ -853,31 +853,31 @@ opt_trans_rule is co1 co2 -- See Note [Push transitivity inside axioms] and -- Note [Push transitivity inside newtype axioms only] -- TrPushSymAxR - | Just (sym, axr, cos1) <- isAxiomRuleCo_maybe co1 + | Just (sym, axr, cos1) <- isAxiomCo_maybe co1 , True <- sym , Just cos2 <- matchNewtypeBranch sym axr co2 - , let newAxInst = AxiomRuleCo axr (opt_transList is (map mkSymCo cos2) cos1) + , let newAxInst = AxiomCo axr (opt_transList is (map mkSymCo cos2) cos1) = fireTransRule "TrPushSymAxR" co1 co2 $ SymCo newAxInst -- TrPushAxR - | Just (sym, axr, cos1) <- isAxiomRuleCo_maybe co1 + | Just (sym, axr, cos1) <- isAxiomCo_maybe co1 , False <- sym , Just cos2 <- matchNewtypeBranch sym axr co2 - , let newAxInst = AxiomRuleCo axr (opt_transList is cos1 cos2) + , let newAxInst = AxiomCo axr (opt_transList is cos1 cos2) = fireTransRule "TrPushAxR" co1 co2 newAxInst -- TrPushSymAxL - | Just (sym, axr, cos2) <- isAxiomRuleCo_maybe co2 + | Just (sym, axr, cos2) <- isAxiomCo_maybe co2 , True <- sym , Just cos1 <- matchNewtypeBranch (not sym) axr co1 - , let newAxInst = AxiomRuleCo axr (opt_transList is cos2 (map mkSymCo cos1)) + , let newAxInst = AxiomCo axr (opt_transList is cos2 (map mkSymCo cos1)) = fireTransRule "TrPushSymAxL" co1 co2 $ SymCo newAxInst -- TrPushAxL - | Just (sym, axr, cos2) <- isAxiomRuleCo_maybe co2 + | Just (sym, axr, cos2) <- isAxiomCo_maybe co2 , False <- sym , Just cos1 <- matchNewtypeBranch (not sym) axr co1 - , let newAxInst = AxiomRuleCo axr (opt_transList is cos1 cos2) + , let newAxInst = AxiomCo axr (opt_transList is cos1 cos2) = fireTransRule "TrPushAxL" co1 co2 newAxInst @@ -1132,13 +1132,13 @@ chooseRole True _ = Representational chooseRole _ r = r ----------- -isAxiomRuleCo_maybe :: Coercion -> Maybe (SymFlag, CoAxiomRule, [Coercion]) +isAxiomCo_maybe :: Coercion -> Maybe (SymFlag, CoAxiomRule, [Coercion]) -- We don't expect to see nested SymCo; and that lets us write a simple, -- non-recursive function. (If we see a nested SymCo we'll just fail, -- which is ok.) -isAxiomRuleCo_maybe (SymCo (AxiomRuleCo ax cos)) = Just (True, ax, cos) -isAxiomRuleCo_maybe (AxiomRuleCo ax cos) = Just (False, ax, cos) -isAxiomRuleCo_maybe _ = Nothing +isAxiomCo_maybe (SymCo (AxiomCo ax cos)) = Just (True, ax, cos) +isAxiomCo_maybe (AxiomCo ax cos) = Just (False, ax, cos) +isAxiomCo_maybe _ = Nothing matchNewtypeBranch :: Bool -- True = match LHS, False = match RHS -> CoAxiomRule ===================================== compiler/GHC/Core/FVs.hs ===================================== @@ -394,9 +394,10 @@ orphNamesOfCo (FunCo { fco_mult = co_mult, fco_arg = co1, fco_res = co2 }) `unionNameSet` orphNamesOfCo co1 `unionNameSet` orphNamesOfCo co2 orphNamesOfCo (CoVarCo _) = emptyNameSet -orphNamesOfCo (AxiomRuleCo con cos) = orphNamesOfAxRule con `unionNameSet` orphNamesOfCos cos -orphNamesOfCo (UnivCo { uco_lty = t1, uco_rty = t2 }) +orphNamesOfCo (AxiomCo con cos) = orphNamesOfAxRule con `unionNameSet` orphNamesOfCos cos +orphNamesOfCo (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = cos }) = orphNamesOfType t1 `unionNameSet` orphNamesOfType t2 + `unionNameSet` orphNamesOfCos cos orphNamesOfCo (SymCo co) = orphNamesOfCo co orphNamesOfCo (TransCo co1 co2) = orphNamesOfCo co1 `unionNameSet` orphNamesOfCo co2 orphNamesOfCo (SelCo _ co) = orphNamesOfCo co @@ -410,8 +411,8 @@ orphNamesOfCos :: [Coercion] -> NameSet orphNamesOfCos = orphNamesOfThings orphNamesOfCo orphNamesOfAxRule :: CoAxiomRule -> NameSet -orphNamesOfAxRule (BuiltInFamRewrite {}) = emptyNameSet -orphNamesOfAxRule (BuiltInFamInteract {}) = emptyNameSet +orphNamesOfAxRule (BuiltInFamRewrite bif) = unitNameSet (tyConName (bifrw_fam_tc bif)) +orphNamesOfAxRule (BuiltInFamInteract {}) = emptyNameSet -- A free-floating axiom orphNamesOfAxRule (UnbranchedAxiom ax) = orphNamesOfCoAx ax orphNamesOfAxRule (BranchedAxiom ax _) = orphNamesOfCoAx ax ===================================== compiler/GHC/Core/FamInstEnv.hs ===================================== @@ -1198,9 +1198,7 @@ reduceTyFamApp_maybe envs role tc tys | Just builtin_fam <- isBuiltInSynFamTyCon_maybe tc , Just (rewrite,ts,ty) <- tryMatchFam builtin_fam tys - , role == bifrw_res_role rewrite - = let co = mkAxiomRuleCo (BuiltInFamRewrite rewrite) - (zipWith mkReflCo (bifrw_arg_roles rewrite) ts) + = let co = mkAxiomCo (BuiltInFamRewrite rewrite) (map mkNomReflCo ts) in Just $ mkReduction co ty | otherwise ===================================== compiler/GHC/Core/Lint.hs ===================================== @@ -2611,18 +2611,21 @@ lintCoercion (InstCo co arg) ; _ -> failWithL (text "Bad argument of inst") }}} -lintCoercion this_co@(AxiomRuleCo ax cos) +lintCoercion this_co@(AxiomCo ax cos) = do { cos' <- mapM lintCoercion cos ; let arg_kinds :: [Pair Type] = map coercionKind cos' ; lint_roles 0 (coAxiomRuleArgRoles ax) cos' ; lint_ax ax arg_kinds - ; return (AxiomRuleCo ax cos') } + ; return (AxiomCo ax cos') } where lint_ax :: CoAxiomRule -> [Pair Type] -> LintM () lint_ax (BuiltInFamRewrite bif) prs = checkL (isJust (bifrw_proves bif prs)) bad_bif lint_ax (BuiltInFamInteract bif) prs - = checkL (isJust (bifint_proves bif prs)) bad_bif + = checkL (case prs of + [pr] -> isJust (bifint_proves bif pr) + _ -> False) + bad_bif lint_ax (UnbranchedAxiom ax) prs = lintBranch this_co (coAxiomTyCon ax) (coAxiomSingleBranch ax) prs lint_ax (BranchedAxiom ax ind) prs ===================================== compiler/GHC/Core/TyCo/FVs.hs ===================================== @@ -62,7 +62,7 @@ import GHC.Builtin.Types.Prim( funTyFlagTyCon ) import Data.Monoid as DM ( Any(..) ) import GHC.Core.TyCo.Rep import GHC.Core.TyCon -import GHC.Core.Coercion.Axiom( CoAxiomRule(..), coAxiomTyCon ) +import GHC.Core.Coercion.Axiom( CoAxiomRule(..), BuiltInFamRewrite(..), coAxiomTyCon ) import GHC.Utils.FV import GHC.Types.Var @@ -668,7 +668,7 @@ tyCoFVsOfCo (CoVarCo v) fv_cand in_scope acc tyCoFVsOfCo (HoleCo h) fv_cand in_scope acc = tyCoFVsOfCoVar (coHoleCoVar h) fv_cand in_scope acc -- See Note [CoercionHoles and coercion free variables] -tyCoFVsOfCo (AxiomRuleCo _ cs) fv_cand in_scope acc = tyCoFVsOfCos cs fv_cand in_scope acc +tyCoFVsOfCo (AxiomCo _ cs) fv_cand in_scope acc = tyCoFVsOfCos cs fv_cand in_scope acc tyCoFVsOfCo (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps}) fv_cand in_scope acc = (tyCoFVsOfCos deps `unionFV` tyCoFVsOfType t1 `unionFV` tyCoFVsOfType t2) fv_cand in_scope acc @@ -716,7 +716,7 @@ almost_devoid_co_var_of_co (FunCo { fco_mult = w, fco_arg = co1, fco_res = co2 } && almost_devoid_co_var_of_co co2 cv almost_devoid_co_var_of_co (CoVarCo v) cv = v /= cv almost_devoid_co_var_of_co (HoleCo h) cv = (coHoleCoVar h) /= cv -almost_devoid_co_var_of_co (AxiomRuleCo _ cs) cv +almost_devoid_co_var_of_co (AxiomCo _ cs) cv = almost_devoid_co_var_of_cos cs cv almost_devoid_co_var_of_co (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) cv = almost_devoid_co_var_of_cos deps cv @@ -1126,8 +1126,9 @@ tyConsOfType ty = go_co kind_co `unionUniqSets` go_co co go_co (FunCo { fco_mult = m, fco_arg = a, fco_res = r }) = go_co m `unionUniqSets` go_co a `unionUniqSets` go_co r - go_co (AxiomRuleCo ax args) = go_ax ax `unionUniqSets` go_cos args - go_co (UnivCo { uco_lty = t1, uco_rty = t2 }) = go t1 `unionUniqSets` go t2 + go_co (AxiomCo ax args) = go_ax ax `unionUniqSets` go_cos args + go_co (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = cos }) + = go t1 `unionUniqSets` go t2 `unionUniqSets` go_cos cos go_co (CoVarCo {}) = emptyUniqSet go_co (HoleCo {}) = emptyUniqSet go_co (SymCo co) = go_co co @@ -1145,10 +1146,10 @@ tyConsOfType ty go_tc tc = unitUniqSet tc - go_ax (UnbranchedAxiom ax) = go_tc $ coAxiomTyCon ax - go_ax (BranchedAxiom ax _) = go_tc $ coAxiomTyCon ax - go_ax (BuiltInFamRewrite {}) = emptyUniqSet - go_ax (BuiltInFamInteract {}) = emptyUniqSet + go_ax (UnbranchedAxiom ax) = go_tc $ coAxiomTyCon ax + go_ax (BranchedAxiom ax _) = go_tc $ coAxiomTyCon ax + go_ax (BuiltInFamRewrite bif) = go_tc $ bifrw_fam_tc bif + go_ax (BuiltInFamInteract {}) = emptyUniqSet -- A free-floating axiom tyConsOfTypes :: [Type] -> UniqSet TyCon tyConsOfTypes tys = foldr (unionUniqSets . tyConsOfType) emptyUniqSet tys @@ -1303,6 +1304,23 @@ occCheckExpand vs_to_avoid ty go_co cxt (AppCo co arg) = do { co' <- go_co cxt co ; arg' <- go_co cxt arg ; return (AppCo co' arg') } + go_co cxt (SymCo co) = do { co' <- go_co cxt co + ; return (SymCo co') } + go_co cxt (TransCo co1 co2) = do { co1' <- go_co cxt co1 + ; co2' <- go_co cxt co2 + ; return (TransCo co1' co2') } + go_co cxt (SelCo n co) = do { co' <- go_co cxt co + ; return (SelCo n co') } + go_co cxt (LRCo lr co) = do { co' <- go_co cxt co + ; return (LRCo lr co') } + go_co cxt (InstCo co arg) = do { co' <- go_co cxt co + ; arg' <- go_co cxt arg + ; return (InstCo co' arg') } + go_co cxt (KindCo co) = do { co' <- go_co cxt co + ; return (KindCo co') } + go_co cxt (SubCo co) = do { co' <- go_co cxt co + ; return (SubCo co') } + go_co cxt@(as, env) co@(ForAllCo { fco_tcv = tv, fco_kind = kind_co, fco_body = body_co }) = do { kind_co' <- go_co cxt kind_co ; let tv' = setVarType tv $ @@ -1311,6 +1329,7 @@ occCheckExpand vs_to_avoid ty as' = as `delVarSet` tv ; body' <- go_co (as', env') body_co ; return (co { fco_tcv = tv', fco_kind = kind_co', fco_body = body' }) } + go_co cxt co@(FunCo { fco_mult = w, fco_arg = co1 ,fco_res = co2 }) = do { co1' <- go_co cxt co1 ; co2' <- go_co cxt co2 @@ -1326,26 +1345,11 @@ occCheckExpand vs_to_avoid ty | bad_var_occ as (ch_co_var h) = Nothing | otherwise = return co - go_co cxt (AxiomRuleCo ax cs) = do { cs' <- mapM (go_co cxt) cs - ; return (AxiomRuleCo ax cs') } - go_co cxt co@(UnivCo { uco_lty = ty1, uco_rty = ty2 }) - = do { ty1' <- go cxt ty1 - ; ty2' <- go cxt ty2 - ; return (co { uco_lty = ty1', uco_rty = ty2' }) } - go_co cxt (SymCo co) = do { co' <- go_co cxt co - ; return (SymCo co') } - go_co cxt (TransCo co1 co2) = do { co1' <- go_co cxt co1 - ; co2' <- go_co cxt co2 - ; return (TransCo co1' co2') } - go_co cxt (SelCo n co) = do { co' <- go_co cxt co - ; return (SelCo n co') } - go_co cxt (LRCo lr co) = do { co' <- go_co cxt co - ; return (LRCo lr co') } - go_co cxt (InstCo co arg) = do { co' <- go_co cxt co - ; arg' <- go_co cxt arg - ; return (InstCo co' arg') } - go_co cxt (KindCo co) = do { co' <- go_co cxt co - ; return (KindCo co') } - go_co cxt (SubCo co) = do { co' <- go_co cxt co - ; return (SubCo co') } + go_co cxt (AxiomCo ax cs) = do { cs' <- mapM (go_co cxt) cs + ; return (AxiomCo ax cs') } + go_co cxt co@(UnivCo { uco_lty = ty1, uco_rty = ty2, uco_deps = cos }) + = do { ty1' <- go cxt ty1 + ; ty2' <- go cxt ty2 + ; cos' <- mapM (go_co cxt) cos + ; return (co { uco_lty = ty1', uco_rty = ty2', uco_deps = cos' }) } ===================================== compiler/GHC/Core/TyCo/Rep.hs ===================================== @@ -907,7 +907,7 @@ data Coercion | CoVarCo CoVar -- :: _ -> (N or R) -- result role depends on the tycon of the variable's type - | AxiomRuleCo CoAxiomRule [Coercion] + | AxiomCo CoAxiomRule [Coercion] -- The coercion arguments always *precisely* saturate -- arity of (that branch of) the CoAxiom. If there are -- any left over, we use AppCo. @@ -1533,7 +1533,7 @@ is entirely separate, but they all share the need to represent these fields: , uco_deps :: [Coercion] -- Coercions on which it depends Here, - * uco_role, uco_lty, uco_rty express the type of the coercoin + * uco_role, uco_lty, uco_rty express the type of the coercion * uco_prov says where it came from * uco_deps specifies the coercions on which this proof (which is not explicity given) depends. See @@ -1560,15 +1560,10 @@ data UnivCoProvenance -- ^ From a plugin, which asserts that this coercion is sound. -- The string and the variable set are for the use by the plugin. - | BuiltinProv -- The proof comes form GHC's knowledge of arithmetic - -- or strings; e.g. from (co : a+b ~ 0) we can deduce that - -- (a ~ 0) and (b ~ 0), with a BuiltinProv proof. - deriving (Eq, Ord, Data.Data) -- Why Ord? See Note [Ord instance of IfaceType] in GHC.Iface.Type instance Outputable UnivCoProvenance where - ppr BuiltinProv = text "(builtin)" ppr PhantomProv = text "(phantom)" ppr ProofIrrelProv = text "(proof irrel)" ppr (PluginProv str) = parens (text "plugin" <+> brackets (text str)) @@ -1577,17 +1572,15 @@ instance NFData UnivCoProvenance where rnf p = p `seq` () instance Binary UnivCoProvenance where - put_ bh BuiltinProv = putByte bh 1 - put_ bh PhantomProv = putByte bh 2 - put_ bh ProofIrrelProv = putByte bh 3 - put_ bh (PluginProv a) = putByte bh 4 >> put_ bh a + put_ bh PhantomProv = putByte bh 1 + put_ bh ProofIrrelProv = putByte bh 2 + put_ bh (PluginProv a) = putByte bh 3 >> put_ bh a get bh = do tag <- getByte bh case tag of - 1 -> return BuiltinProv - 2 -> return PhantomProv - 3 -> return ProofIrrelProv - 4 -> do a <- get bh + 1 -> return PhantomProv + 2 -> return ProofIrrelProv + 3 -> do a <- get bh return $ PluginProv a _ -> panic ("get UnivCoProvenance " ++ show tag) @@ -1614,7 +1607,7 @@ A ProofIrrelProv is a coercion between coercions. For example: In core, we get G :: * -> * - MkG :: forall (a :: *). (a ~ Bool) -> G a + MkG :: forall (a :: *). (a ~# Bool) -> G a Now, consider 'MkG -- that is, MkG used in a type -- and suppose we want a proof that ('MkG a1 co1) ~ ('MkG a2 co2). This will have to be @@ -1631,8 +1624,8 @@ Note that Here, co3 = UnivCo ProofIrrelProv Nominal (CoercionTy co1) (CoercionTy co2) [co5] where - co5 :: (a1 ~ Bool) ~ (a2 ~ Bool) - co5 = TyConAppCo Nominal (~#) [<*>, <*>, co4, ] + co5 :: (a1 ~# Bool) ~# (a2 ~# Bool) + co5 = TyConAppCo Nominal (~#) [, , co4, ] Note [The importance of tracking UnivCo dependencies] @@ -1961,7 +1954,7 @@ foldTyCo (TyCoFolder { tcf_view = view go_co env (TyConAppCo _ _ args) = go_cos env args go_co env (AppCo c1 c2) = go_co env c1 `mappend` go_co env c2 go_co env (CoVarCo cv) = covar env cv - go_co env (AxiomRuleCo _ cos) = go_cos env cos + go_co env (AxiomCo _ cos) = go_cos env cos go_co env (HoleCo hole) = cohole env hole go_co env (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) = go_ty env t1 `mappend` go_ty env t2 @@ -2033,7 +2026,7 @@ coercionSize (FunCo _ _ _ w c1 c2) = 1 + coercionSize c1 + coercionSize c2 + coercionSize w coercionSize (CoVarCo _) = 1 coercionSize (HoleCo _) = 1 -coercionSize (AxiomRuleCo _ cs) = 1 + sum (map coercionSize cs) +coercionSize (AxiomCo _ cs) = 1 + sum (map coercionSize cs) coercionSize (UnivCo { uco_lty = t1, uco_rty = t2 }) = 1 + typeSize t1 + typeSize t2 coercionSize (SymCo co) = 1 + coercionSize co coercionSize (TransCo co1 co2) = 1 + coercionSize co1 + coercionSize co2 ===================================== compiler/GHC/Core/TyCo/Subst.hs ===================================== @@ -57,7 +57,7 @@ import {-# SOURCE #-} GHC.Core.Coercion ( mkCoVarCo, mkKindCo, mkSelCo, mkTransCo , mkNomReflCo, mkSubCo, mkSymCo , mkFunCo2, mkForAllCo, mkUnivCo - , mkAxiomRuleCo, mkAppCo, mkGReflCo + , mkAxiomCo, mkAppCo, mkGReflCo , mkInstCo, mkLRCo, mkTyConAppCo , mkCoercionType , coercionKind, coercionLKind, coVarTypesRole ) @@ -879,7 +879,7 @@ subst_co subst co go (Refl ty) = mkNomReflCo $! (go_ty ty) go (GRefl r ty mco) = (mkGReflCo r $! (go_ty ty)) $! (go_mco mco) go (TyConAppCo r tc args)= mkTyConAppCo r tc $! go_cos args - go (AxiomRuleCo con cos) = mkAxiomRuleCo con $! go_cos cos + go (AxiomCo con cos) = mkAxiomCo con $! go_cos cos go (AppCo co arg) = (mkAppCo $! go co) $! go arg go (ForAllCo tv visL visR kind_co co) = case substForAllCoBndrUnchecked subst tv kind_co of ===================================== compiler/GHC/Core/TyCo/Tidy.hs ===================================== @@ -342,7 +342,7 @@ tidyCo env co go (FunCo r afl afr w co1 co2) = ((FunCo r afl afr $! go w) $! go co1) $! go co2 go (CoVarCo cv) = CoVarCo $! go_cv cv go (HoleCo h) = HoleCo $! go_hole h - go (AxiomRuleCo ax cos) = AxiomRuleCo ax $ strictMap go cos + go (AxiomCo ax cos) = AxiomCo ax $ strictMap go cos go co@(UnivCo { uco_lty = t1, uco_rty = t2 }) = co { uco_lty = tidyType env t1, uco_rty = tidyType env t2 } -- Don't bother to tidy the uco_deps field ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -274,7 +274,7 @@ import GHC.Core.Coercion.Axiom import {-# SOURCE #-} GHC.Core.Coercion ( mkNomReflCo, mkGReflCo, mkReflCo , mkTyConAppCo, mkAppCo - , mkForAllCo, mkFunCo2, mkAxiomRuleCo, mkUnivCo + , mkForAllCo, mkFunCo2, mkAxiomCo, mkUnivCo , mkSymCo, mkTransCo, mkSelCo, mkLRCo, mkInstCo , mkKindCo, mkSubCo, mkFunCo, funRole , decomposePiCos, coercionKind @@ -556,8 +556,8 @@ expandTypeSynonyms ty = mkFunCo2 r afl afr (go_co subst w) (go_co subst co1) (go_co subst co2) go_co subst (CoVarCo cv) = substCoVar subst cv - go_co subst (AxiomRuleCo ax cs) - = mkAxiomRuleCo ax (map (go_co subst) cs) + go_co subst (AxiomCo ax cs) + = mkAxiomCo ax (map (go_co subst) cs) go_co subst co@(UnivCo { uco_lty = lty, uco_rty = rty }) = co { uco_lty = go subst lty, uco_rty = go subst rty } go_co subst (SymCo co) @@ -974,7 +974,7 @@ mapTyCoX (TyCoMapper { tcm_tyvar = tyvar <*> go_ty env t1 <*> go_ty env t2 go_co !env (SymCo co) = mkSymCo <$> go_co env co go_co !env (TransCo c1 c2) = mkTransCo <$> go_co env c1 <*> go_co env c2 - go_co !env (AxiomRuleCo r cos) = mkAxiomRuleCo r <$> go_cos env cos + go_co !env (AxiomCo r cos) = mkAxiomCo r <$> go_cos env cos go_co !env (SelCo i co) = mkSelCo i <$> go_co env co go_co !env (LRCo lr co) = mkLRCo lr <$> go_co env co go_co !env (InstCo co arg) = mkInstCo <$> go_co env co <*> go_co env arg ===================================== compiler/GHC/CoreToIface.hs ===================================== @@ -284,19 +284,19 @@ toIfaceCoercionX fr co go (GRefl r ty mco) = IfaceGReflCo r (toIfaceTypeX fr ty) (go_mco mco) go (CoVarCo cv) -- See Note [Free TyVars and CoVars in IfaceType] in GHC.Iface.Type - | cv `elemVarSet` fr = IfaceFreeCoVar cv - | otherwise = IfaceCoVarCo (toIfaceCoVar cv) - go (HoleCo h) = IfaceHoleCo (coHoleCoVar h) - - go (AppCo co1 co2) = IfaceAppCo (go co1) (go co2) - go (SymCo co) = IfaceSymCo (go co) - go (TransCo co1 co2) = IfaceTransCo (go co1) (go co2) - go (SelCo d co) = IfaceSelCo d (go co) - go (LRCo lr co) = IfaceLRCo lr (go co) - go (InstCo co arg) = IfaceInstCo (go co) (go arg) - go (KindCo c) = IfaceKindCo (go c) - go (SubCo co) = IfaceSubCo (go co) - go (AxiomRuleCo co cs) = IfaceAxiomRuleCo (toIfaceAxiomRule co) (map go cs) + | cv `elemVarSet` fr = IfaceFreeCoVar cv + | otherwise = IfaceCoVarCo (toIfaceCoVar cv) + go (HoleCo h) = IfaceHoleCo (coHoleCoVar h) + + go (AppCo co1 co2) = IfaceAppCo (go co1) (go co2) + go (SymCo co) = IfaceSymCo (go co) + go (TransCo co1 co2) = IfaceTransCo (go co1) (go co2) + go (SelCo d co) = IfaceSelCo d (go co) + go (LRCo lr co) = IfaceLRCo lr (go co) + go (InstCo co arg) = IfaceInstCo (go co) (go arg) + go (KindCo c) = IfaceKindCo (go c) + go (SubCo co) = IfaceSubCo (go co) + go (AxiomCo ax cs) = IfaceAxiomCo (toIfaceAxiomRule ax) (map go cs) go (UnivCo { uco_prov = p, uco_role = r, uco_lty = t1, uco_rty = t2, uco_deps = deps }) = IfaceUnivCo p r (toIfaceTypeX fr t1) (toIfaceTypeX fr t2) (map go deps) ===================================== compiler/GHC/Data/Pair.hs ===================================== @@ -64,3 +64,5 @@ unzipPairs [] = ([], []) unzipPairs (Pair a b : prs) = (a:as, b:bs) where !(as,bs) = unzipPairs prs + -- This makes the unzip work eagerly, building no thunks at + -- the cost of doing all the work up-front. ===================================== compiler/GHC/Iface/Rename.hs ===================================== @@ -675,15 +675,13 @@ rnIfaceCo (IfaceInstCo c1 c2) = IfaceInstCo <$> rnIfaceCo c1 <*> rnIfa rnIfaceCo (IfaceSelCo d c) = IfaceSelCo d <$> rnIfaceCo c rnIfaceCo (IfaceLRCo lr c) = IfaceLRCo lr <$> rnIfaceCo c rnIfaceCo (IfaceSubCo c) = IfaceSubCo <$> rnIfaceCo c -rnIfaceCo (IfaceAxiomRuleCo ax cos) = IfaceAxiomRuleCo ax <$> mapM rnIfaceCo cos +rnIfaceCo (IfaceAxiomCo ax cos) = IfaceAxiomCo ax <$> mapM rnIfaceCo cos rnIfaceCo (IfaceKindCo c) = IfaceKindCo <$> rnIfaceCo c rnIfaceCo (IfaceForAllCo bndr visL visR co1 co2) = (\bndr' co1' co2' -> IfaceForAllCo bndr' visL visR co1' co2') <$> rnIfaceBndr bndr <*> rnIfaceCo co1 <*> rnIfaceCo co2 rnIfaceCo (IfaceUnivCo s r t1 t2 deps) = IfaceUnivCo s r <$> rnIfaceType t1 <*> rnIfaceType t2 <*> mapM rnIfaceCo deps - -- Renaming affects only type constructors, not coercion variables, - -- so no need to recurse into the free-var fields rnIfaceTyCon :: Rename IfaceTyCon rnIfaceTyCon (IfaceTyCon n info) ===================================== compiler/GHC/Iface/Syntax.hs ===================================== @@ -1781,10 +1781,8 @@ freeNamesIfCoercion (IfaceForAllCo _tcv _visL _visR kind_co co) freeNamesIfCoercion (IfaceFreeCoVar _) = emptyNameSet freeNamesIfCoercion (IfaceCoVarCo _) = emptyNameSet freeNamesIfCoercion (IfaceHoleCo _) = emptyNameSet -freeNamesIfCoercion (IfaceUnivCo _ _ t1 t2 _) - = freeNamesIfType t1 &&& freeNamesIfType t2 - -- Ignoring uco_deps field, which are all local, - -- and don't contribute to dependency analysis +freeNamesIfCoercion (IfaceUnivCo _ _ t1 t2 cos) + = freeNamesIfType t1 &&& freeNamesIfType t2 &&& fnList freeNamesIfCoercion cos freeNamesIfCoercion (IfaceSymCo c) = freeNamesIfCoercion c freeNamesIfCoercion (IfaceTransCo c1 c2) @@ -1799,7 +1797,7 @@ freeNamesIfCoercion (IfaceKindCo c) = freeNamesIfCoercion c freeNamesIfCoercion (IfaceSubCo co) = freeNamesIfCoercion co -freeNamesIfCoercion (IfaceAxiomRuleCo ax cos) +freeNamesIfCoercion (IfaceAxiomCo ax cos) = fnAxRule ax &&& fnList freeNamesIfCoercion cos fnAxRule :: IfaceAxiomRule -> NameSet ===================================== compiler/GHC/Iface/Type.hs ===================================== @@ -476,7 +476,7 @@ data IfaceCoercion | IfaceAppCo IfaceCoercion IfaceCoercion | IfaceForAllCo IfaceBndr !ForAllTyFlag !ForAllTyFlag IfaceCoercion IfaceCoercion | IfaceCoVarCo IfLclName - | IfaceAxiomRuleCo IfaceAxiomRule [IfaceCoercion] + | IfaceAxiomCo IfaceAxiomRule [IfaceCoercion] -- ^ There are only a fixed number of CoAxiomRules, so it suffices -- to use an IfaceLclName to distinguish them. -- See Note [Adding built-in type families] in GHC.Builtin.Types.Literals @@ -711,7 +711,7 @@ substIfaceType env ty go_co (IfaceInstCo c1 c2) = IfaceInstCo (go_co c1) (go_co c2) go_co (IfaceKindCo co) = IfaceKindCo (go_co co) go_co (IfaceSubCo co) = IfaceSubCo (go_co co) - go_co (IfaceAxiomRuleCo n cos) = IfaceAxiomRuleCo n (go_cos cos) + go_co (IfaceAxiomCo n cos) = IfaceAxiomCo n (go_cos cos) go_cos = map go_co @@ -2013,7 +2013,7 @@ ppr_co ctxt_prec (IfaceInstCo co ty) text "Inst" <+> sep [ pprParendIfaceCoercion co , pprParendIfaceCoercion ty ] -ppr_co ctxt_prec (IfaceAxiomRuleCo ax cos) +ppr_co ctxt_prec (IfaceAxiomCo ax cos) = ppr_special_co ctxt_prec (pprIfAxRule ax) cos ppr_co ctxt_prec (IfaceSymCo co) = ppr_special_co ctxt_prec (text "Sym") [co] @@ -2399,7 +2399,7 @@ instance Binary IfaceCoercion where put_ bh (IfaceSubCo a) = do putByte bh 16 put_ bh a - put_ bh (IfaceAxiomRuleCo a b) = do + put_ bh (IfaceAxiomCo a b) = do putByte bh 17 put_ bh a put_ bh b @@ -2465,7 +2465,7 @@ instance Binary IfaceCoercion where return $ IfaceSubCo a 17-> do a <- get bh b <- get bh - return $ IfaceAxiomRuleCo a b + return $ IfaceAxiomCo a b _ -> panic ("get IfaceCoercion " ++ show tag) instance Binary IfaceAxiomRule where @@ -2516,7 +2516,7 @@ instance NFData IfaceCoercion where IfaceAppCo f1 f2 -> rnf f1 `seq` rnf f2 IfaceForAllCo f1 f2 f3 f4 f5 -> rnf f1 `seq` rnf f2 `seq` rnf f3 `seq` rnf f4 `seq` rnf f5 IfaceCoVarCo f1 -> rnf f1 - IfaceAxiomRuleCo f1 f2 -> rnf f1 `seq` rnf f2 + IfaceAxiomCo f1 f2 -> rnf f1 `seq` rnf f2 IfaceUnivCo f1 f2 f3 f4 deps -> rnf f1 `seq` f2 `seq` rnf f3 `seq` rnf f4 `seq` rnf deps IfaceSymCo f1 -> rnf f1 IfaceTransCo f1 f2 -> rnf f1 `seq` rnf f2 ===================================== compiler/GHC/IfaceToCore.hs ===================================== @@ -1485,8 +1485,8 @@ tcIfaceCo = go go (IfaceLRCo lr c) = LRCo lr <$> go c go (IfaceKindCo c) = KindCo <$> go c go (IfaceSubCo c) = SubCo <$> go c - go (IfaceAxiomRuleCo ax cos) = AxiomRuleCo <$> tcIfaceCoAxiomRule ax - <*> mapM go cos + go (IfaceAxiomCo ax cos) = AxiomCo <$> tcIfaceAxiomRule ax + <*> mapM go cos go (IfaceFreeCoVar c) = pprPanic "tcIfaceCo:IfaceFreeCoVar" (ppr c) go (IfaceHoleCo c) = pprPanic "tcIfaceCo:IfaceHoleCo" (ppr c) @@ -2020,18 +2020,18 @@ tcIfaceTyCon (IfaceTyCon name _info) AConLike (RealDataCon dc) -> return (promoteDataCon dc) _ -> pprPanic "tcIfaceTyCon" (ppr thing) } -tcIfaceCoAxiomRule :: IfaceAxiomRule -> IfL CoAxiomRule +tcIfaceAxiomRule :: IfaceAxiomRule -> IfL CoAxiomRule -- Unlike CoAxioms, which arise from user 'type instance' declarations, -- there are a fixed set of CoAxiomRules: -- - axioms for type-level literals (Nat and Symbol), -- enumerated in typeNatCoAxiomRules -tcIfaceCoAxiomRule (IfaceAR_X n) +tcIfaceAxiomRule (IfaceAR_X n) | Just axr <- lookupUFM typeNatCoAxiomRules (ifLclNameFS n) = return axr | otherwise - = pprPanic "tcIfaceCoAxiomRule" (ppr n) -tcIfaceCoAxiomRule (IfaceAR_U name) = do { ax <- tcIfaceUnbranchedAxiom name; return (UnbranchedAxiom ax) } -tcIfaceCoAxiomRule (IfaceAR_B name i) = do { ax <- tcIfaceBranchedAxiom name; return (BranchedAxiom ax i) } + = pprPanic "tcIfaceAxiomRule" (ppr n) +tcIfaceAxiomRule (IfaceAR_U name) = do { ax <- tcIfaceUnbranchedAxiom name; return (UnbranchedAxiom ax) } +tcIfaceAxiomRule (IfaceAR_B name i) = do { ax <- tcIfaceBranchedAxiom name; return (BranchedAxiom ax i) } tcIfaceUnbranchedAxiom :: IfExtName -> IfL (CoAxiom Unbranched) tcIfaceUnbranchedAxiom name ===================================== compiler/GHC/Tc/Solver/Dict.hs ===================================== @@ -1405,7 +1405,7 @@ parameters, is that we simply produce new Wanted equalities. So for example where 'cv' is currently unused. However, this new item can perhaps be spontaneously solved to become given and react with d2, discharging it in favour of a new constraint d2' thus: - [W[ d2' : D Int Bool + [W] d2' : D Int Bool d2 := d2' |> D Int cv Now d2' can be discharged from d1 ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -2969,7 +2969,7 @@ improveGivenTopFunEqs fam_tc args ev rhs_ty ; emitNewGivens (ctEvLoc ev) $ [ (Nominal, new_co) | (ax, _) <- tryInteractTopFam ops fam_tc args rhs_ty - , let new_co = mkAxiomRuleCo ax [given_co] ] + , let new_co = mkAxiomCo ax [given_co] ] ; return False } -- False: no unifications | otherwise = return False @@ -3124,7 +3124,7 @@ improveGivenLocalFunEqs funeqs_for_tc fam_tc work_args work_ev work_rhs -- this that matters. where inert_co = ctEvCoercion inert_ev - mk_ax_co (ax,_) = (Nominal, mkAxiomRuleCo ax [combined_co]) + mk_ax_co (ax,_) = (Nominal, mkAxiomCo ax [combined_co]) where combined_co = given_co `mkTransCo` mkSymCo inert_co -- given_co :: F work_args ~ rhs ===================================== compiler/GHC/Tc/TyCl/Utils.hs ===================================== @@ -142,7 +142,7 @@ synonymTyConsOfType ty = go_co m `plusNameEnv` go_co a `plusNameEnv` go_co r go_co (CoVarCo _) = emptyNameEnv go_co (HoleCo {}) = emptyNameEnv - go_co (AxiomRuleCo _ cs) = go_co_s cs + go_co (AxiomCo _ cs) = go_co_s cs go_co (UnivCo { uco_lty = t1, uco_rty = t2}) = go t1 `plusNameEnv` go t2 go_co (SymCo co) = go_co co ===================================== compiler/GHC/Tc/Utils/TcMType.hs ===================================== @@ -1563,7 +1563,7 @@ collect_cand_qtvs_co orig_ty cur_lvl bound = go_co go_co dv (TyConAppCo _ _ cos) = foldlM go_co dv cos go_co dv (AppCo co1 co2) = foldlM go_co dv [co1, co2] go_co dv (FunCo _ _ _ w co1 co2) = foldlM go_co dv [w, co1, co2] - go_co dv (AxiomRuleCo _ cos) = foldlM go_co dv cos + go_co dv (AxiomCo _ cos) = foldlM go_co dv cos go_co dv (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = deps }) = do { dv1 <- collect_cand_qtvs orig_ty True cur_lvl bound dv t1 ; dv2 <- collect_cand_qtvs orig_ty True cur_lvl bound dv1 t2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51db59f2f029cfc526b6ee6d7668c30ec10f7d74...493b80a991313bd3bf7c86d6831a06766cd58dc7 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51db59f2f029cfc526b6ee6d7668c30ec10f7d74...493b80a991313bd3bf7c86d6831a06766cd58dc7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 13 09:59:19 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 13 Jul 2024 05:59:19 -0400 Subject: [Git][ghc/ghc][master] Testsuite: use py-cpuinfo to compute CPU features Message-ID: <66924ff74d9d_1c9b33595e28c20171@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 2 changed files: - testsuite/driver/cpu_features.py - + testsuite/driver/cpuinfo.py Changes: ===================================== testsuite/driver/cpu_features.py ===================================== @@ -9,7 +9,7 @@ SUPPORTED_CPU_FEATURES = { # x86: 'sse', 'sse2', 'sse3', 'ssse3', 'sse4_1', 'sse4_2', - 'avx1', 'avx2', + 'avx', 'avx2', 'fma', 'popcnt', 'bmi1', 'bmi2' } @@ -17,50 +17,16 @@ SUPPORTED_CPU_FEATURES = { cpu_feature_cache = None def get_cpu_features(): - # we're testing a cross ghc, don't attempt to detect host cpu - # configuration - if config.target_wrapper is not None: - return {} - - if config.os in ['mingw32', 'linux'] and os.path.exists('/proc/cpuinfo'): - with open('/proc/cpuinfo') as x: - f = x.read() - flags = re.search(r'flags\s*:\s*.*$', f, re.M) - if flags is None: - print('get_cpu_features: failed to find cpu features') - return {} - flags = set(flags.group(0).split()) - if 'pni' in flags: - flags.add('sse3') - flags.remove('pni') - return flags - - elif config.os == 'darwin': - # we hardcode the sysctl path, otherwise we rely on /usr/sbin being in - # path. - out = subprocess.check_output(['/usr/sbin/sysctl', 'hw']).decode('UTF-8') - features = set() - def check_feature(darwin_name, our_name=None): - if re.search(r'hw\.optional.%s:\s*1' % darwin_name, out) is not None: - features.add(darwin_name if our_name is None else our_name) - - for feature in SUPPORTED_CPU_FEATURES: - check_feature(feature) - - # A few annoying cases - check_feature('avx1_0', 'avx1') - check_feature('avx2_0', 'avx2') + try: + # This import might fail, e.g. if "ctypes" is not available, + # in which case we report the empty set of features. + import cpuinfo + info = cpuinfo.get_cpu_info() + features = info.get('flags', []) return features - - elif config.arch in [ 'powerpc', 'powerpc64' ]: - # Hardcode support for 'fma' on PowerPC - return [ 'fma' ] - - else: - # TODO: Add {Open,Free}BSD support + except: print('get_cpu_features: Lacking support for your platform') - - return {} + return [] def have_cpu_feature(feature): """ ===================================== testsuite/driver/cpuinfo.py ===================================== @@ -0,0 +1,2842 @@ +#!/usr/bin/env python + +# This file is used in GHC's testsuite driver to determine the CPU features +# available when running the testsuite. +# +# It is taken from https://github.com/workhorsy/py-cpuinfo, +# commit f3f0fec58335b9699b9b294267c15f516045b1fe. + +# Copyright (c) 2014-2022 Matthew Brennan Jones +# Py-cpuinfo gets CPU info with pure Python +# It uses the MIT License +# It is hosted at: https://github.com/workhorsy/py-cpuinfo +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +CPUINFO_VERSION = (9, 0, 0) +CPUINFO_VERSION_STRING = '.'.join([str(n) for n in CPUINFO_VERSION]) + +import os, sys +import platform +import multiprocessing +import ctypes + + +CAN_CALL_CPUID_IN_SUBPROCESS = True + +g_trace = None + + +class Trace: + def __init__(self, is_active, is_stored_in_string): + self._is_active = is_active + if not self._is_active: + return + + from datetime import datetime + from io import StringIO + + if is_stored_in_string: + self._output = StringIO() + else: + date = datetime.now().strftime("%Y-%m-%d_%H-%M-%S-%f") + self._output = open('cpuinfo_trace_{0}.trace'.format(date), 'w') + + self._stdout = StringIO() + self._stderr = StringIO() + self._err = None + + def header(self, msg): + if not self._is_active: return + + from inspect import stack + frame = stack()[1] + file = frame[1] + line = frame[2] + self._output.write("{0} ({1} {2})\n".format(msg, file, line)) + self._output.flush() + + def success(self): + if not self._is_active: return + + from inspect import stack + frame = stack()[1] + file = frame[1] + line = frame[2] + + self._output.write("Success ... ({0} {1})\n\n".format(file, line)) + self._output.flush() + + def fail(self, msg): + if not self._is_active: return + + from inspect import stack + frame = stack()[1] + file = frame[1] + line = frame[2] + + if isinstance(msg, str): + msg = ''.join(['\t' + line for line in msg.split('\n')]) + '\n' + + self._output.write(msg) + self._output.write("Failed ... ({0} {1})\n\n".format(file, line)) + self._output.flush() + elif isinstance(msg, Exception): + from traceback import format_exc + err_string = format_exc() + self._output.write("\tFailed ... ({0} {1})\n".format(file, line)) + self._output.write(''.join(['\t\t{0}\n'.format(n) for n in err_string.split('\n')]) + '\n') + self._output.flush() + + def command_header(self, msg): + if not self._is_active: return + + from inspect import stack + frame = stack()[3] + file = frame[1] + line = frame[2] + self._output.write("\t{0} ({1} {2})\n".format(msg, file, line)) + self._output.flush() + + def command_output(self, msg, output): + if not self._is_active: return + + self._output.write("\t\t{0}\n".format(msg)) + self._output.write(''.join(['\t\t\t{0}\n'.format(n) for n in output.split('\n')]) + '\n') + self._output.flush() + + def keys(self, keys, info, new_info): + if not self._is_active: return + + from inspect import stack + frame = stack()[2] + file = frame[1] + line = frame[2] + + # List updated keys + self._output.write("\tChanged keys ({0} {1})\n".format(file, line)) + changed_keys = [key for key in keys if key in info and key in new_info and info[key] != new_info[key]] + if changed_keys: + for key in changed_keys: + self._output.write('\t\t{0}: {1} to {2}\n'.format(key, info[key], new_info[key])) + else: + self._output.write('\t\tNone\n') + + # List new keys + self._output.write("\tNew keys ({0} {1})\n".format(file, line)) + new_keys = [key for key in keys if key in new_info and key not in info] + if new_keys: + for key in new_keys: + self._output.write('\t\t{0}: {1}\n'.format(key, new_info[key])) + else: + self._output.write('\t\tNone\n') + + self._output.write('\n') + self._output.flush() + + def write(self, msg): + if not self._is_active: return + + self._output.write(msg + '\n') + self._output.flush() + + def to_dict(self, info, is_fail): + return { + 'output' : self._output.getvalue(), + 'stdout' : self._stdout.getvalue(), + 'stderr' : self._stderr.getvalue(), + 'info' : info, + 'err' : self._err, + 'is_fail' : is_fail + } + +class DataSource: + bits = platform.architecture()[0] + cpu_count = multiprocessing.cpu_count() + is_windows = platform.system().lower() == 'windows' + arch_string_raw = platform.machine() + uname_string_raw = platform.uname()[5] + can_cpuid = True + + @staticmethod + def has_proc_cpuinfo(): + return os.path.exists('/proc/cpuinfo') + + @staticmethod + def has_dmesg(): + return len(_program_paths('dmesg')) > 0 + + @staticmethod + def has_var_run_dmesg_boot(): + uname = platform.system().strip().strip('"').strip("'").strip().lower() + return 'linux' in uname and os.path.exists('/var/run/dmesg.boot') + + @staticmethod + def has_cpufreq_info(): + return len(_program_paths('cpufreq-info')) > 0 + + @staticmethod + def has_sestatus(): + return len(_program_paths('sestatus')) > 0 + + @staticmethod + def has_sysctl(): + return len(_program_paths('sysctl')) > 0 + + @staticmethod + def has_isainfo(): + return len(_program_paths('isainfo')) > 0 + + @staticmethod + def has_kstat(): + return len(_program_paths('kstat')) > 0 + + @staticmethod + def has_sysinfo(): + uname = platform.system().strip().strip('"').strip("'").strip().lower() + is_beos = 'beos' in uname or 'haiku' in uname + return is_beos and len(_program_paths('sysinfo')) > 0 + + @staticmethod + def has_lscpu(): + return len(_program_paths('lscpu')) > 0 + + @staticmethod + def has_ibm_pa_features(): + return len(_program_paths('lsprop')) > 0 + + @staticmethod + def has_wmic(): + returncode, output = _run_and_get_stdout(['wmic', 'os', 'get', 'Version']) + return returncode == 0 and len(output) > 0 + + @staticmethod + def cat_proc_cpuinfo(): + return _run_and_get_stdout(['cat', '/proc/cpuinfo']) + + @staticmethod + def cpufreq_info(): + return _run_and_get_stdout(['cpufreq-info']) + + @staticmethod + def sestatus_b(): + return _run_and_get_stdout(['sestatus', '-b']) + + @staticmethod + def dmesg_a(): + return _run_and_get_stdout(['dmesg', '-a']) + + @staticmethod + def cat_var_run_dmesg_boot(): + return _run_and_get_stdout(['cat', '/var/run/dmesg.boot']) + + @staticmethod + def sysctl_machdep_cpu_hw_cpufrequency(): + return _run_and_get_stdout(['sysctl', 'machdep.cpu', 'hw.cpufrequency']) + + @staticmethod + def isainfo_vb(): + return _run_and_get_stdout(['isainfo', '-vb']) + + @staticmethod + def kstat_m_cpu_info(): + return _run_and_get_stdout(['kstat', '-m', 'cpu_info']) + + @staticmethod + def sysinfo_cpu(): + return _run_and_get_stdout(['sysinfo', '-cpu']) + + @staticmethod + def lscpu(): + return _run_and_get_stdout(['lscpu']) + + @staticmethod + def ibm_pa_features(): + import glob + + ibm_features = glob.glob('/proc/device-tree/cpus/*/ibm,pa-features') + if ibm_features: + return _run_and_get_stdout(['lsprop', ibm_features[0]]) + + @staticmethod + def wmic_cpu(): + return _run_and_get_stdout(['wmic', 'cpu', 'get', 'Name,CurrentClockSpeed,L2CacheSize,L3CacheSize,Description,Caption,Manufacturer', '/format:list']) + + @staticmethod + def winreg_processor_brand(): + processor_brand = _read_windows_registry_key(r"Hardware\Description\System\CentralProcessor\0", "ProcessorNameString") + return processor_brand.strip() + + @staticmethod + def winreg_vendor_id_raw(): + vendor_id_raw = _read_windows_registry_key(r"Hardware\Description\System\CentralProcessor\0", "VendorIdentifier") + return vendor_id_raw + + @staticmethod + def winreg_arch_string_raw(): + arch_string_raw = _read_windows_registry_key(r"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "PROCESSOR_ARCHITECTURE") + return arch_string_raw + + @staticmethod + def winreg_hz_actual(): + hz_actual = _read_windows_registry_key(r"Hardware\Description\System\CentralProcessor\0", "~Mhz") + hz_actual = _to_decimal_string(hz_actual) + return hz_actual + + @staticmethod + def winreg_feature_bits(): + feature_bits = _read_windows_registry_key(r"Hardware\Description\System\CentralProcessor\0", "FeatureSet") + return feature_bits + + +def _program_paths(program_name): + paths = [] + exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep)) + for p in os.environ['PATH'].split(os.pathsep): + p = os.path.join(p, program_name) + if os.access(p, os.X_OK): + paths.append(p) + for e in exts: + pext = p + e + if os.access(pext, os.X_OK): + paths.append(pext) + return paths + +def _run_and_get_stdout(command, pipe_command=None): + from subprocess import Popen, PIPE + + g_trace.command_header('Running command "' + ' '.join(command) + '" ...') + + # Run the command normally + if not pipe_command: + p1 = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE) + # Run the command and pipe it into another command + else: + p2 = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE) + p1 = Popen(pipe_command, stdin=p2.stdout, stdout=PIPE, stderr=PIPE) + p2.stdout.close() + + # Get the stdout and stderr + stdout_output, stderr_output = p1.communicate() + stdout_output = stdout_output.decode(encoding='UTF-8') + stderr_output = stderr_output.decode(encoding='UTF-8') + + # Send the result to the logger + g_trace.command_output('return code:', str(p1.returncode)) + g_trace.command_output('stdout:', stdout_output) + + # Return the return code and stdout + return p1.returncode, stdout_output + +def _read_windows_registry_key(key_name, field_name): + g_trace.command_header('Reading Registry key "{0}" field "{1}" ...'.format(key_name, field_name)) + + try: + import winreg + except ImportError: + pass + + key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_name) + value = winreg.QueryValueEx(key, field_name)[0] + winreg.CloseKey(key) + g_trace.command_output('value:', str(value)) + return value + +# Make sure we are running on a supported system +def _check_arch(): + arch, bits = _parse_arch(DataSource.arch_string_raw) + if not arch in ['ARM_7', 'ARM_8', + 'LOONG_32', 'LOONG_64', + 'MIPS_32', 'MIPS_64', + 'PPC_32', 'PPC_64', + 'RISCV_32', 'RISCV_64', + 'SPARC_32', 'SPARC_64', + 'S390X', + 'X86_32', 'X86_64']: + raise Exception("py-cpuinfo currently only works on X86 " + "and some ARM/LoongArch/MIPS/PPC/RISCV/SPARC/S390X CPUs.") + +def _obj_to_b64(thing): + import pickle + import base64 + + a = thing + b = pickle.dumps(a) + c = base64.b64encode(b) + d = c.decode('utf8') + return d + +def _b64_to_obj(thing): + import pickle + import base64 + + try: + a = base64.b64decode(thing) + b = pickle.loads(a) + return b + except Exception: + return {} + +def _utf_to_str(input): + if isinstance(input, list): + return [_utf_to_str(element) for element in input] + elif isinstance(input, dict): + return {_utf_to_str(key): _utf_to_str(value) + for key, value in input.items()} + else: + return input + +def _copy_new_fields(info, new_info): + keys = [ + 'vendor_id_raw', 'hardware_raw', 'brand_raw', 'hz_advertised_friendly', 'hz_actual_friendly', + 'hz_advertised', 'hz_actual', 'arch', 'bits', 'count', + 'arch_string_raw', 'uname_string_raw', + 'l2_cache_size', 'l2_cache_line_size', 'l2_cache_associativity', + 'stepping', 'model', 'family', + 'processor_type', 'flags', + 'l3_cache_size', 'l1_data_cache_size', 'l1_instruction_cache_size' + ] + + g_trace.keys(keys, info, new_info) + + # Update the keys with new values + for key in keys: + if new_info.get(key, None) and not info.get(key, None): + info[key] = new_info[key] + elif key == 'flags' and new_info.get('flags'): + for f in new_info['flags']: + if f not in info['flags']: info['flags'].append(f) + info['flags'].sort() + +def _get_field_actual(cant_be_number, raw_string, field_names): + for line in raw_string.splitlines(): + for field_name in field_names: + field_name = field_name.lower() + if ':' in line: + left, right = line.split(':', 1) + left = left.strip().lower() + right = right.strip() + if left == field_name and len(right) > 0: + if cant_be_number: + if not right.isdigit(): + return right + else: + return right + + return None + +def _get_field(cant_be_number, raw_string, convert_to, default_value, *field_names): + retval = _get_field_actual(cant_be_number, raw_string, field_names) + + # Convert the return value + if retval and convert_to: + try: + retval = convert_to(retval) + except Exception: + retval = default_value + + # Return the default if there is no return value + if retval is None: + retval = default_value + + return retval + +def _to_decimal_string(ticks): + try: + # Convert to string + ticks = '{0}'.format(ticks) + # Sometimes ',' is used as a decimal separator + ticks = ticks.replace(',', '.') + + # Strip off non numbers and decimal places + ticks = "".join(n for n in ticks if n.isdigit() or n=='.').strip() + if ticks == '': + ticks = '0' + + # Add decimal if missing + if '.' not in ticks: + ticks = '{0}.0'.format(ticks) + + # Remove trailing zeros + ticks = ticks.rstrip('0') + + # Add one trailing zero for empty right side + if ticks.endswith('.'): + ticks = '{0}0'.format(ticks) + + # Make sure the number can be converted to a float + ticks = float(ticks) + ticks = '{0}'.format(ticks) + return ticks + except Exception: + return '0.0' + +def _hz_short_to_full(ticks, scale): + try: + # Make sure the number can be converted to a float + ticks = float(ticks) + ticks = '{0}'.format(ticks) + + # Scale the numbers + hz = ticks.lstrip('0') + old_index = hz.index('.') + hz = hz.replace('.', '') + hz = hz.ljust(scale + old_index+1, '0') + new_index = old_index + scale + hz = '{0}.{1}'.format(hz[:new_index], hz[new_index:]) + left, right = hz.split('.') + left, right = int(left), int(right) + return (left, right) + except Exception: + return (0, 0) + +def _hz_friendly_to_full(hz_string): + try: + hz_string = hz_string.strip().lower() + hz, scale = (None, None) + + if hz_string.endswith('ghz'): + scale = 9 + elif hz_string.endswith('mhz'): + scale = 6 + elif hz_string.endswith('hz'): + scale = 0 + + hz = "".join(n for n in hz_string if n.isdigit() or n=='.').strip() + if not '.' in hz: + hz += '.0' + + hz, scale = _hz_short_to_full(hz, scale) + + return (hz, scale) + except Exception: + return (0, 0) + +def _hz_short_to_friendly(ticks, scale): + try: + # Get the raw Hz as a string + left, right = _hz_short_to_full(ticks, scale) + result = '{0}.{1}'.format(left, right) + + # Get the location of the dot, and remove said dot + dot_index = result.index('.') + result = result.replace('.', '') + + # Get the Hz symbol and scale + symbol = "Hz" + scale = 0 + if dot_index > 9: + symbol = "GHz" + scale = 9 + elif dot_index > 6: + symbol = "MHz" + scale = 6 + elif dot_index > 3: + symbol = "KHz" + scale = 3 + + # Get the Hz with the dot at the new scaled point + result = '{0}.{1}'.format(result[:-scale-1], result[-scale-1:]) + + # Format the ticks to have 4 numbers after the decimal + # and remove any superfluous zeroes. + result = '{0:.4f} {1}'.format(float(result), symbol) + result = result.rstrip('0') + return result + except Exception: + return '0.0000 Hz' + +def _to_friendly_bytes(input): + import re + + if not input: + return input + input = "{0}".format(input) + + formats = { + r"^[0-9]+B$" : 'B', + r"^[0-9]+K$" : 'KB', + r"^[0-9]+M$" : 'MB', + r"^[0-9]+G$" : 'GB' + } + + for pattern, friendly_size in formats.items(): + if re.match(pattern, input): + return "{0} {1}".format(input[ : -1].strip(), friendly_size) + + return input + +def _friendly_bytes_to_int(friendly_bytes): + input = friendly_bytes.lower() + + formats = [ + {'gib' : 1024 * 1024 * 1024}, + {'mib' : 1024 * 1024}, + {'kib' : 1024}, + + {'gb' : 1024 * 1024 * 1024}, + {'mb' : 1024 * 1024}, + {'kb' : 1024}, + + {'g' : 1024 * 1024 * 1024}, + {'m' : 1024 * 1024}, + {'k' : 1024}, + {'b' : 1}, + ] + + try: + for entry in formats: + pattern = list(entry.keys())[0] + multiplier = list(entry.values())[0] + if input.endswith(pattern): + return int(input.split(pattern)[0].strip()) * multiplier + + except Exception as err: + pass + + return friendly_bytes + +def _parse_cpu_brand_string(cpu_string): + # Just return 0 if the processor brand does not have the Hz + if not 'hz' in cpu_string.lower(): + return ('0.0', 0) + + hz = cpu_string.lower() + scale = 0 + + if hz.endswith('mhz'): + scale = 6 + elif hz.endswith('ghz'): + scale = 9 + if '@' in hz: + hz = hz.split('@')[1] + else: + hz = hz.rsplit(None, 1)[1] + + hz = hz.rstrip('mhz').rstrip('ghz').strip() + hz = _to_decimal_string(hz) + + return (hz, scale) + +def _parse_cpu_brand_string_dx(cpu_string): + import re + + # Find all the strings inside brackets () + starts = [m.start() for m in re.finditer(r"\(", cpu_string)] + ends = [m.start() for m in re.finditer(r"\)", cpu_string)] + insides = {k: v for k, v in zip(starts, ends)} + insides = [cpu_string[start+1 : end] for start, end in insides.items()] + + # Find all the fields + vendor_id, stepping, model, family = (None, None, None, None) + for inside in insides: + for pair in inside.split(','): + pair = [n.strip() for n in pair.split(':')] + if len(pair) > 1: + name, value = pair[0], pair[1] + if name == 'origin': + vendor_id = value.strip('"') + elif name == 'stepping': + stepping = int(value.lstrip('0x'), 16) + elif name == 'model': + model = int(value.lstrip('0x'), 16) + elif name in ['fam', 'family']: + family = int(value.lstrip('0x'), 16) + + # Find the Processor Brand + # Strip off extra strings in brackets at end + brand = cpu_string.strip() + is_working = True + while is_working: + is_working = False + for inside in insides: + full = "({0})".format(inside) + if brand.endswith(full): + brand = brand[ :-len(full)].strip() + is_working = True + + # Find the Hz in the brand string + hz_brand, scale = _parse_cpu_brand_string(brand) + + # Find Hz inside brackets () after the brand string + if hz_brand == '0.0': + for inside in insides: + hz = inside + for entry in ['GHz', 'MHz', 'Hz']: + if entry in hz: + hz = "CPU @ " + hz[ : hz.find(entry) + len(entry)] + hz_brand, scale = _parse_cpu_brand_string(hz) + break + + return (hz_brand, scale, brand, vendor_id, stepping, model, family) + +def _parse_dmesg_output(output): + try: + # Get all the dmesg lines that might contain a CPU string + lines = output.split(' CPU0:')[1:] + \ + output.split(' CPU1:')[1:] + \ + output.split(' CPU:')[1:] + \ + output.split('\nCPU0:')[1:] + \ + output.split('\nCPU1:')[1:] + \ + output.split('\nCPU:')[1:] + lines = [l.split('\n')[0].strip() for l in lines] + + # Convert the lines to CPU strings + cpu_strings = [_parse_cpu_brand_string_dx(l) for l in lines] + + # Find the CPU string that has the most fields + best_string = None + highest_count = 0 + for cpu_string in cpu_strings: + count = sum([n is not None for n in cpu_string]) + if count > highest_count: + highest_count = count + best_string = cpu_string + + # If no CPU string was found, return {} + if not best_string: + return {} + + hz_actual, scale, processor_brand, vendor_id, stepping, model, family = best_string + + # Origin + if ' Origin=' in output: + fields = output[output.find(' Origin=') : ].split('\n')[0] + fields = fields.strip().split() + fields = [n.strip().split('=') for n in fields] + fields = [{n[0].strip().lower() : n[1].strip()} for n in fields] + + for field in fields: + name = list(field.keys())[0] + value = list(field.values())[0] + + if name == 'origin': + vendor_id = value.strip('"') + elif name == 'stepping': + stepping = int(value.lstrip('0x'), 16) + elif name == 'model': + model = int(value.lstrip('0x'), 16) + elif name in ['fam', 'family']: + family = int(value.lstrip('0x'), 16) + + # Features + flag_lines = [] + for category in [' Features=', ' Features2=', ' AMD Features=', ' AMD Features2=']: + if category in output: + flag_lines.append(output.split(category)[1].split('\n')[0]) + + flags = [] + for line in flag_lines: + line = line.split('<')[1].split('>')[0].lower() + for flag in line.split(','): + flags.append(flag) + flags.sort() + + # Convert from GHz/MHz string to Hz + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + + # If advertised hz not found, use the actual hz + if hz_advertised == '0.0': + scale = 6 + hz_advertised = _to_decimal_string(hz_actual) + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + 'flags' : flags + } + + if hz_advertised and hz_advertised != '0.0': + info['hz_advertised_friendly'] = _hz_short_to_friendly(hz_advertised, scale) + info['hz_actual_friendly'] = _hz_short_to_friendly(hz_actual, scale) + + if hz_advertised and hz_advertised != '0.0': + info['hz_advertised'] = _hz_short_to_full(hz_advertised, scale) + info['hz_actual'] = _hz_short_to_full(hz_actual, scale) + + return {k: v for k, v in info.items() if v} + except Exception as err: + g_trace.fail(err) + #raise + + return {} + +def _parse_arch(arch_string_raw): + import re + + arch, bits = None, None + arch_string_raw = arch_string_raw.lower() + + # X86 + if re.match(r'^i\d86$|^x86$|^x86_32$|^i86pc$|^ia32$|^ia-32$|^bepc$', arch_string_raw): + arch = 'X86_32' + bits = 32 + elif re.match(r'^x64$|^x86_64$|^x86_64t$|^i686-64$|^amd64$|^ia64$|^ia-64$', arch_string_raw): + arch = 'X86_64' + bits = 64 + # ARM + elif re.match(r'^armv8-a|aarch64|arm64$', arch_string_raw): + arch = 'ARM_8' + bits = 64 + elif re.match(r'^armv7$|^armv7[a-z]$|^armv7-[a-z]$|^armv6[a-z]$', arch_string_raw): + arch = 'ARM_7' + bits = 32 + elif re.match(r'^armv8$|^armv8[a-z]$|^armv8-[a-z]$', arch_string_raw): + arch = 'ARM_8' + bits = 32 + # PPC + elif re.match(r'^ppc32$|^prep$|^pmac$|^powermac$', arch_string_raw): + arch = 'PPC_32' + bits = 32 + elif re.match(r'^powerpc$|^ppc64$|^ppc64le$', arch_string_raw): + arch = 'PPC_64' + bits = 64 + # SPARC + elif re.match(r'^sparc32$|^sparc$', arch_string_raw): + arch = 'SPARC_32' + bits = 32 + elif re.match(r'^sparc64$|^sun4u$|^sun4v$', arch_string_raw): + arch = 'SPARC_64' + bits = 64 + # S390X + elif re.match(r'^s390x$', arch_string_raw): + arch = 'S390X' + bits = 64 + # MIPS + elif re.match(r'^mips$', arch_string_raw): + arch = 'MIPS_32' + bits = 32 + elif re.match(r'^mips64$', arch_string_raw): + arch = 'MIPS_64' + bits = 64 + # RISCV + elif re.match(r'^riscv$|^riscv32$|^riscv32be$', arch_string_raw): + arch = 'RISCV_32' + bits = 32 + elif re.match(r'^riscv64$|^riscv64be$', arch_string_raw): + arch = 'RISCV_64' + bits = 64 + # LoongArch + elif re.match(r'^loongarch32$', arch_string_raw): + arch = 'LOONG_32' + bits = 32 + elif re.match(r'^loongarch64$', arch_string_raw): + arch = 'LOONG_64' + bits = 64 + + return (arch, bits) + +def _is_bit_set(reg, bit): + mask = 1 << bit + is_set = reg & mask > 0 + return is_set + + +def _is_selinux_enforcing(trace): + # Just return if the SE Linux Status Tool is not installed + if not DataSource.has_sestatus(): + trace.fail('Failed to find sestatus.') + return False + + # Run the sestatus, and just return if it failed to run + returncode, output = DataSource.sestatus_b() + if returncode != 0: + trace.fail('Failed to run sestatus. Skipping ...') + return False + + # Figure out if explicitly in enforcing mode + for line in output.splitlines(): + line = line.strip().lower() + if line.startswith("current mode:"): + if line.endswith("enforcing"): + return True + else: + return False + + # Figure out if we can execute heap and execute memory + can_selinux_exec_heap = False + can_selinux_exec_memory = False + for line in output.splitlines(): + line = line.strip().lower() + if line.startswith("allow_execheap") and line.endswith("on"): + can_selinux_exec_heap = True + elif line.startswith("allow_execmem") and line.endswith("on"): + can_selinux_exec_memory = True + + trace.command_output('can_selinux_exec_heap:', can_selinux_exec_heap) + trace.command_output('can_selinux_exec_memory:', can_selinux_exec_memory) + + return (not can_selinux_exec_heap or not can_selinux_exec_memory) + +def _filter_dict_keys_with_empty_values(info, acceptable_values = {}): + filtered_info = {} + for key in info: + value = info[key] + + # Keep if value is acceptable + if key in acceptable_values: + if acceptable_values[key] == value: + filtered_info[key] = value + continue + + # Filter out None, 0, "", (), {}, [] + if not value: + continue + + # Filter out (0, 0) + if value == (0, 0): + continue + + # Filter out -1 + if value == -1: + continue + + # Filter out strings that start with "0.0" + if type(value) == str and value.startswith('0.0'): + continue + + filtered_info[key] = value + + return filtered_info + +class ASM: + def __init__(self, restype=None, argtypes=(), machine_code=[]): + self.restype = restype + self.argtypes = argtypes + self.machine_code = machine_code + self.prochandle = None + self.mm = None + self.func = None + self.address = None + self.size = 0 + + def compile(self): + machine_code = bytes.join(b'', self.machine_code) + self.size = ctypes.c_size_t(len(machine_code)) + + if DataSource.is_windows: + # Allocate a memory segment the size of the machine code, and make it executable + size = len(machine_code) + # Alloc at least 1 page to ensure we own all pages that we want to change protection on + if size < 0x1000: size = 0x1000 + MEM_COMMIT = ctypes.c_ulong(0x1000) + PAGE_READWRITE = ctypes.c_ulong(0x4) + pfnVirtualAlloc = ctypes.windll.kernel32.VirtualAlloc + pfnVirtualAlloc.restype = ctypes.c_void_p + self.address = pfnVirtualAlloc(None, ctypes.c_size_t(size), MEM_COMMIT, PAGE_READWRITE) + if not self.address: + raise Exception("Failed to VirtualAlloc") + + # Copy the machine code into the memory segment + memmove = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_size_t)(ctypes._memmove_addr) + if memmove(self.address, machine_code, size) < 0: + raise Exception("Failed to memmove") + + # Enable execute permissions + PAGE_EXECUTE = ctypes.c_ulong(0x10) + old_protect = ctypes.c_ulong(0) + pfnVirtualProtect = ctypes.windll.kernel32.VirtualProtect + res = pfnVirtualProtect(ctypes.c_void_p(self.address), ctypes.c_size_t(size), PAGE_EXECUTE, ctypes.byref(old_protect)) + if not res: + raise Exception("Failed VirtualProtect") + + # Flush Instruction Cache + # First, get process Handle + if not self.prochandle: + pfnGetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess + pfnGetCurrentProcess.restype = ctypes.c_void_p + self.prochandle = ctypes.c_void_p(pfnGetCurrentProcess()) + # Actually flush cache + res = ctypes.windll.kernel32.FlushInstructionCache(self.prochandle, ctypes.c_void_p(self.address), ctypes.c_size_t(size)) + if not res: + raise Exception("Failed FlushInstructionCache") + else: + from mmap import mmap, MAP_PRIVATE, MAP_ANONYMOUS, PROT_WRITE, PROT_READ, PROT_EXEC + + # Allocate a private and executable memory segment the size of the machine code + machine_code = bytes.join(b'', self.machine_code) + self.size = len(machine_code) + self.mm = mmap(-1, self.size, flags=MAP_PRIVATE | MAP_ANONYMOUS, prot=PROT_WRITE | PROT_READ | PROT_EXEC) + + # Copy the machine code into the memory segment + self.mm.write(machine_code) + self.address = ctypes.addressof(ctypes.c_int.from_buffer(self.mm)) + + # Cast the memory segment into a function + functype = ctypes.CFUNCTYPE(self.restype, *self.argtypes) + self.func = functype(self.address) + + def run(self): + # Call the machine code like a function + retval = self.func() + + return retval + + def free(self): + # Free the function memory segment + if DataSource.is_windows: + MEM_RELEASE = ctypes.c_ulong(0x8000) + ctypes.windll.kernel32.VirtualFree(ctypes.c_void_p(self.address), ctypes.c_size_t(0), MEM_RELEASE) + else: + self.mm.close() + + self.prochandle = None + self.mm = None + self.func = None + self.address = None + self.size = 0 + + +class CPUID: + def __init__(self, trace=None): + if trace is None: + trace = Trace(False, False) + + # Figure out if SE Linux is on and in enforcing mode + self.is_selinux_enforcing = _is_selinux_enforcing(trace) + + def _asm_func(self, restype=None, argtypes=(), machine_code=[]): + asm = ASM(restype, argtypes, machine_code) + asm.compile() + return asm + + def _run_asm(self, *machine_code): + asm = ASM(ctypes.c_uint32, (), machine_code) + asm.compile() + retval = asm.run() + asm.free() + return retval + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID + def get_vendor_id(self): + # EBX + ebx = self._run_asm( + b"\x31\xC0", # xor eax,eax + b"\x0F\xA2" # cpuid + b"\x89\xD8" # mov ax,bx + b"\xC3" # ret + ) + + # ECX + ecx = self._run_asm( + b"\x31\xC0", # xor eax,eax + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + # EDX + edx = self._run_asm( + b"\x31\xC0", # xor eax,eax + b"\x0f\xa2" # cpuid + b"\x89\xD0" # mov ax,dx + b"\xC3" # ret + ) + + # Each 4bits is a ascii letter in the name + vendor_id = [] + for reg in [ebx, edx, ecx]: + for n in [0, 8, 16, 24]: + vendor_id.append(chr((reg >> n) & 0xFF)) + vendor_id = ''.join(vendor_id) + + return vendor_id + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits + def get_info(self): + # EAX + eax = self._run_asm( + b"\xB8\x01\x00\x00\x00", # mov eax,0x1" + b"\x0f\xa2" # cpuid + b"\xC3" # ret + ) + + # Get the CPU info + stepping_id = (eax >> 0) & 0xF # 4 bits + model = (eax >> 4) & 0xF # 4 bits + family_id = (eax >> 8) & 0xF # 4 bits + processor_type = (eax >> 12) & 0x3 # 2 bits + extended_model_id = (eax >> 16) & 0xF # 4 bits + extended_family_id = (eax >> 20) & 0xFF # 8 bits + family = 0 + + if family_id in [15]: + family = extended_family_id + family_id + else: + family = family_id + + if family_id in [6, 15]: + model = (extended_model_id << 4) + model + + return { + 'stepping' : stepping_id, + 'model' : model, + 'family' : family, + 'processor_type' : processor_type + } + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D80000000h:_Get_Highest_Extended_Function_Supported + def get_max_extension_support(self): + # Check for extension support + max_extension_support = self._run_asm( + b"\xB8\x00\x00\x00\x80" # mov ax,0x80000000 + b"\x0f\xa2" # cpuid + b"\xC3" # ret + ) + + return max_extension_support + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits + def get_flags(self, max_extension_support): + # EDX + edx = self._run_asm( + b"\xB8\x01\x00\x00\x00", # mov eax,0x1" + b"\x0f\xa2" # cpuid + b"\x89\xD0" # mov ax,dx + b"\xC3" # ret + ) + + # ECX + ecx = self._run_asm( + b"\xB8\x01\x00\x00\x00", # mov eax,0x1" + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + # Get the CPU flags + flags = { + 'fpu' : _is_bit_set(edx, 0), + 'vme' : _is_bit_set(edx, 1), + 'de' : _is_bit_set(edx, 2), + 'pse' : _is_bit_set(edx, 3), + 'tsc' : _is_bit_set(edx, 4), + 'msr' : _is_bit_set(edx, 5), + 'pae' : _is_bit_set(edx, 6), + 'mce' : _is_bit_set(edx, 7), + 'cx8' : _is_bit_set(edx, 8), + 'apic' : _is_bit_set(edx, 9), + #'reserved1' : _is_bit_set(edx, 10), + 'sep' : _is_bit_set(edx, 11), + 'mtrr' : _is_bit_set(edx, 12), + 'pge' : _is_bit_set(edx, 13), + 'mca' : _is_bit_set(edx, 14), + 'cmov' : _is_bit_set(edx, 15), + 'pat' : _is_bit_set(edx, 16), + 'pse36' : _is_bit_set(edx, 17), + 'pn' : _is_bit_set(edx, 18), + 'clflush' : _is_bit_set(edx, 19), + #'reserved2' : _is_bit_set(edx, 20), + 'dts' : _is_bit_set(edx, 21), + 'acpi' : _is_bit_set(edx, 22), + 'mmx' : _is_bit_set(edx, 23), + 'fxsr' : _is_bit_set(edx, 24), + 'sse' : _is_bit_set(edx, 25), + 'sse2' : _is_bit_set(edx, 26), + 'ss' : _is_bit_set(edx, 27), + 'ht' : _is_bit_set(edx, 28), + 'tm' : _is_bit_set(edx, 29), + 'ia64' : _is_bit_set(edx, 30), + 'pbe' : _is_bit_set(edx, 31), + + 'pni' : _is_bit_set(ecx, 0), + 'pclmulqdq' : _is_bit_set(ecx, 1), + 'dtes64' : _is_bit_set(ecx, 2), + 'monitor' : _is_bit_set(ecx, 3), + 'ds_cpl' : _is_bit_set(ecx, 4), + 'vmx' : _is_bit_set(ecx, 5), + 'smx' : _is_bit_set(ecx, 6), + 'est' : _is_bit_set(ecx, 7), + 'tm2' : _is_bit_set(ecx, 8), + 'ssse3' : _is_bit_set(ecx, 9), + 'cid' : _is_bit_set(ecx, 10), + #'reserved3' : _is_bit_set(ecx, 11), + 'fma' : _is_bit_set(ecx, 12), + 'cx16' : _is_bit_set(ecx, 13), + 'xtpr' : _is_bit_set(ecx, 14), + 'pdcm' : _is_bit_set(ecx, 15), + #'reserved4' : _is_bit_set(ecx, 16), + 'pcid' : _is_bit_set(ecx, 17), + 'dca' : _is_bit_set(ecx, 18), + 'sse4_1' : _is_bit_set(ecx, 19), + 'sse4_2' : _is_bit_set(ecx, 20), + 'x2apic' : _is_bit_set(ecx, 21), + 'movbe' : _is_bit_set(ecx, 22), + 'popcnt' : _is_bit_set(ecx, 23), + 'tscdeadline' : _is_bit_set(ecx, 24), + 'aes' : _is_bit_set(ecx, 25), + 'xsave' : _is_bit_set(ecx, 26), + 'osxsave' : _is_bit_set(ecx, 27), + 'avx' : _is_bit_set(ecx, 28), + 'f16c' : _is_bit_set(ecx, 29), + 'rdrnd' : _is_bit_set(ecx, 30), + 'hypervisor' : _is_bit_set(ecx, 31) + } + + # Get a list of only the flags that are true + flags = [k for k, v in flags.items() if v] + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D7.2C_ECX.3D0:_Extended_Features + if max_extension_support >= 7: + # EBX + ebx = self._run_asm( + b"\x31\xC9", # xor ecx,ecx + b"\xB8\x07\x00\x00\x00" # mov eax,7 + b"\x0f\xa2" # cpuid + b"\x89\xD8" # mov ax,bx + b"\xC3" # ret + ) + + # ECX + ecx = self._run_asm( + b"\x31\xC9", # xor ecx,ecx + b"\xB8\x07\x00\x00\x00" # mov eax,7 + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + # Get the extended CPU flags + extended_flags = { + #'fsgsbase' : _is_bit_set(ebx, 0), + #'IA32_TSC_ADJUST' : _is_bit_set(ebx, 1), + 'sgx' : _is_bit_set(ebx, 2), + 'bmi1' : _is_bit_set(ebx, 3), + 'hle' : _is_bit_set(ebx, 4), + 'avx2' : _is_bit_set(ebx, 5), + #'reserved' : _is_bit_set(ebx, 6), + 'smep' : _is_bit_set(ebx, 7), + 'bmi2' : _is_bit_set(ebx, 8), + 'erms' : _is_bit_set(ebx, 9), + 'invpcid' : _is_bit_set(ebx, 10), + 'rtm' : _is_bit_set(ebx, 11), + 'pqm' : _is_bit_set(ebx, 12), + #'FPU CS and FPU DS deprecated' : _is_bit_set(ebx, 13), + 'mpx' : _is_bit_set(ebx, 14), + 'pqe' : _is_bit_set(ebx, 15), + 'avx512f' : _is_bit_set(ebx, 16), + 'avx512dq' : _is_bit_set(ebx, 17), + 'rdseed' : _is_bit_set(ebx, 18), + 'adx' : _is_bit_set(ebx, 19), + 'smap' : _is_bit_set(ebx, 20), + 'avx512ifma' : _is_bit_set(ebx, 21), + 'pcommit' : _is_bit_set(ebx, 22), + 'clflushopt' : _is_bit_set(ebx, 23), + 'clwb' : _is_bit_set(ebx, 24), + 'intel_pt' : _is_bit_set(ebx, 25), + 'avx512pf' : _is_bit_set(ebx, 26), + 'avx512er' : _is_bit_set(ebx, 27), + 'avx512cd' : _is_bit_set(ebx, 28), + 'sha' : _is_bit_set(ebx, 29), + 'avx512bw' : _is_bit_set(ebx, 30), + 'avx512vl' : _is_bit_set(ebx, 31), + + 'prefetchwt1' : _is_bit_set(ecx, 0), + 'avx512vbmi' : _is_bit_set(ecx, 1), + 'umip' : _is_bit_set(ecx, 2), + 'pku' : _is_bit_set(ecx, 3), + 'ospke' : _is_bit_set(ecx, 4), + #'reserved' : _is_bit_set(ecx, 5), + 'avx512vbmi2' : _is_bit_set(ecx, 6), + #'reserved' : _is_bit_set(ecx, 7), + 'gfni' : _is_bit_set(ecx, 8), + 'vaes' : _is_bit_set(ecx, 9), + 'vpclmulqdq' : _is_bit_set(ecx, 10), + 'avx512vnni' : _is_bit_set(ecx, 11), + 'avx512bitalg' : _is_bit_set(ecx, 12), + #'reserved' : _is_bit_set(ecx, 13), + 'avx512vpopcntdq' : _is_bit_set(ecx, 14), + #'reserved' : _is_bit_set(ecx, 15), + #'reserved' : _is_bit_set(ecx, 16), + #'mpx0' : _is_bit_set(ecx, 17), + #'mpx1' : _is_bit_set(ecx, 18), + #'mpx2' : _is_bit_set(ecx, 19), + #'mpx3' : _is_bit_set(ecx, 20), + #'mpx4' : _is_bit_set(ecx, 21), + 'rdpid' : _is_bit_set(ecx, 22), + #'reserved' : _is_bit_set(ecx, 23), + #'reserved' : _is_bit_set(ecx, 24), + #'reserved' : _is_bit_set(ecx, 25), + #'reserved' : _is_bit_set(ecx, 26), + #'reserved' : _is_bit_set(ecx, 27), + #'reserved' : _is_bit_set(ecx, 28), + #'reserved' : _is_bit_set(ecx, 29), + 'sgx_lc' : _is_bit_set(ecx, 30), + #'reserved' : _is_bit_set(ecx, 31) + } + + # Get a list of only the flags that are true + extended_flags = [k for k, v in extended_flags.items() if v] + flags += extended_flags + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D80000001h:_Extended_Processor_Info_and_Feature_Bits + if max_extension_support >= 0x80000001: + # EBX + ebx = self._run_asm( + b"\xB8\x01\x00\x00\x80" # mov ax,0x80000001 + b"\x0f\xa2" # cpuid + b"\x89\xD8" # mov ax,bx + b"\xC3" # ret + ) + + # ECX + ecx = self._run_asm( + b"\xB8\x01\x00\x00\x80" # mov ax,0x80000001 + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + # Get the extended CPU flags + extended_flags = { + 'fpu' : _is_bit_set(ebx, 0), + 'vme' : _is_bit_set(ebx, 1), + 'de' : _is_bit_set(ebx, 2), + 'pse' : _is_bit_set(ebx, 3), + 'tsc' : _is_bit_set(ebx, 4), + 'msr' : _is_bit_set(ebx, 5), + 'pae' : _is_bit_set(ebx, 6), + 'mce' : _is_bit_set(ebx, 7), + 'cx8' : _is_bit_set(ebx, 8), + 'apic' : _is_bit_set(ebx, 9), + #'reserved' : _is_bit_set(ebx, 10), + 'syscall' : _is_bit_set(ebx, 11), + 'mtrr' : _is_bit_set(ebx, 12), + 'pge' : _is_bit_set(ebx, 13), + 'mca' : _is_bit_set(ebx, 14), + 'cmov' : _is_bit_set(ebx, 15), + 'pat' : _is_bit_set(ebx, 16), + 'pse36' : _is_bit_set(ebx, 17), + #'reserved' : _is_bit_set(ebx, 18), + 'mp' : _is_bit_set(ebx, 19), + 'nx' : _is_bit_set(ebx, 20), + #'reserved' : _is_bit_set(ebx, 21), + 'mmxext' : _is_bit_set(ebx, 22), + 'mmx' : _is_bit_set(ebx, 23), + 'fxsr' : _is_bit_set(ebx, 24), + 'fxsr_opt' : _is_bit_set(ebx, 25), + 'pdpe1gp' : _is_bit_set(ebx, 26), + 'rdtscp' : _is_bit_set(ebx, 27), + #'reserved' : _is_bit_set(ebx, 28), + 'lm' : _is_bit_set(ebx, 29), + '3dnowext' : _is_bit_set(ebx, 30), + '3dnow' : _is_bit_set(ebx, 31), + + 'lahf_lm' : _is_bit_set(ecx, 0), + 'cmp_legacy' : _is_bit_set(ecx, 1), + 'svm' : _is_bit_set(ecx, 2), + 'extapic' : _is_bit_set(ecx, 3), + 'cr8_legacy' : _is_bit_set(ecx, 4), + 'abm' : _is_bit_set(ecx, 5), + 'sse4a' : _is_bit_set(ecx, 6), + 'misalignsse' : _is_bit_set(ecx, 7), + '3dnowprefetch' : _is_bit_set(ecx, 8), + 'osvw' : _is_bit_set(ecx, 9), + 'ibs' : _is_bit_set(ecx, 10), + 'xop' : _is_bit_set(ecx, 11), + 'skinit' : _is_bit_set(ecx, 12), + 'wdt' : _is_bit_set(ecx, 13), + #'reserved' : _is_bit_set(ecx, 14), + 'lwp' : _is_bit_set(ecx, 15), + 'fma4' : _is_bit_set(ecx, 16), + 'tce' : _is_bit_set(ecx, 17), + #'reserved' : _is_bit_set(ecx, 18), + 'nodeid_msr' : _is_bit_set(ecx, 19), + #'reserved' : _is_bit_set(ecx, 20), + 'tbm' : _is_bit_set(ecx, 21), + 'topoext' : _is_bit_set(ecx, 22), + 'perfctr_core' : _is_bit_set(ecx, 23), + 'perfctr_nb' : _is_bit_set(ecx, 24), + #'reserved' : _is_bit_set(ecx, 25), + 'dbx' : _is_bit_set(ecx, 26), + 'perftsc' : _is_bit_set(ecx, 27), + 'pci_l2i' : _is_bit_set(ecx, 28), + #'reserved' : _is_bit_set(ecx, 29), + #'reserved' : _is_bit_set(ecx, 30), + #'reserved' : _is_bit_set(ecx, 31) + } + + # Get a list of only the flags that are true + extended_flags = [k for k, v in extended_flags.items() if v] + flags += extended_flags + + flags.sort() + return flags + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D80000002h.2C80000003h.2C80000004h:_Processor_Brand_String + def get_processor_brand(self, max_extension_support): + processor_brand = "" + + # Processor brand string + if max_extension_support >= 0x80000004: + instructions = [ + b"\xB8\x02\x00\x00\x80", # mov ax,0x80000002 + b"\xB8\x03\x00\x00\x80", # mov ax,0x80000003 + b"\xB8\x04\x00\x00\x80" # mov ax,0x80000004 + ] + for instruction in instructions: + # EAX + eax = self._run_asm( + instruction, # mov ax,0x8000000? + b"\x0f\xa2" # cpuid + b"\x89\xC0" # mov ax,ax + b"\xC3" # ret + ) + + # EBX + ebx = self._run_asm( + instruction, # mov ax,0x8000000? + b"\x0f\xa2" # cpuid + b"\x89\xD8" # mov ax,bx + b"\xC3" # ret + ) + + # ECX + ecx = self._run_asm( + instruction, # mov ax,0x8000000? + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + # EDX + edx = self._run_asm( + instruction, # mov ax,0x8000000? + b"\x0f\xa2" # cpuid + b"\x89\xD0" # mov ax,dx + b"\xC3" # ret + ) + + # Combine each of the 4 bytes in each register into the string + for reg in [eax, ebx, ecx, edx]: + for n in [0, 8, 16, 24]: + processor_brand += chr((reg >> n) & 0xFF) + + # Strip off any trailing NULL terminators and white space + processor_brand = processor_brand.strip("\0").strip() + + return processor_brand + + # http://en.wikipedia.org/wiki/CPUID#EAX.3D80000006h:_Extended_L2_Cache_Features + def get_cache(self, max_extension_support): + cache_info = {} + + # Just return if the cache feature is not supported + if max_extension_support < 0x80000006: + return cache_info + + # ECX + ecx = self._run_asm( + b"\xB8\x06\x00\x00\x80" # mov ax,0x80000006 + b"\x0f\xa2" # cpuid + b"\x89\xC8" # mov ax,cx + b"\xC3" # ret + ) + + cache_info = { + 'size_b' : (ecx & 0xFF) * 1024, + 'associativity' : (ecx >> 12) & 0xF, + 'line_size_b' : (ecx >> 16) & 0xFFFF + } + + return cache_info + + def get_ticks_func(self): + retval = None + + if DataSource.bits == '32bit': + # Works on x86_32 + restype = None + argtypes = (ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)) + get_ticks_x86_32 = self._asm_func(restype, argtypes, + [ + b"\x55", # push bp + b"\x89\xE5", # mov bp,sp + b"\x31\xC0", # xor ax,ax + b"\x0F\xA2", # cpuid + b"\x0F\x31", # rdtsc + b"\x8B\x5D\x08", # mov bx,[di+0x8] + b"\x8B\x4D\x0C", # mov cx,[di+0xc] + b"\x89\x13", # mov [bp+di],dx + b"\x89\x01", # mov [bx+di],ax + b"\x5D", # pop bp + b"\xC3" # ret + ] + ) + + # Monkey patch func to combine high and low args into one return + old_func = get_ticks_x86_32.func + def new_func(): + # Pass two uint32s into function + high = ctypes.c_uint32(0) + low = ctypes.c_uint32(0) + old_func(ctypes.byref(high), ctypes.byref(low)) + + # Shift the two uint32s into one uint64 + retval = ((high.value << 32) & 0xFFFFFFFF00000000) | low.value + return retval + get_ticks_x86_32.func = new_func + + retval = get_ticks_x86_32 + elif DataSource.bits == '64bit': + # Works on x86_64 + restype = ctypes.c_uint64 + argtypes = () + get_ticks_x86_64 = self._asm_func(restype, argtypes, + [ + b"\x48", # dec ax + b"\x31\xC0", # xor ax,ax + b"\x0F\xA2", # cpuid + b"\x0F\x31", # rdtsc + b"\x48", # dec ax + b"\xC1\xE2\x20", # shl dx,byte 0x20 + b"\x48", # dec ax + b"\x09\xD0", # or ax,dx + b"\xC3", # ret + ] + ) + + retval = get_ticks_x86_64 + return retval + + def get_raw_hz(self): + from time import sleep + + ticks_fn = self.get_ticks_func() + + start = ticks_fn.func() + sleep(1) + end = ticks_fn.func() + + ticks = (end - start) + ticks_fn.free() + + return ticks + +def _get_cpu_info_from_cpuid_actual(): + ''' + Warning! This function has the potential to crash the Python runtime. + Do not call it directly. Use the _get_cpu_info_from_cpuid function instead. + It will safely call this function in another process. + ''' + + from io import StringIO + + trace = Trace(True, True) + info = {} + + # Pipe stdout and stderr to strings + sys.stdout = trace._stdout + sys.stderr = trace._stderr + + try: + # Get the CPU arch and bits + arch, bits = _parse_arch(DataSource.arch_string_raw) + + # Return none if this is not an X86 CPU + if not arch in ['X86_32', 'X86_64']: + trace.fail('Not running on X86_32 or X86_64. Skipping ...') + return trace.to_dict(info, True) + + # Return none if SE Linux is in enforcing mode + cpuid = CPUID(trace) + if cpuid.is_selinux_enforcing: + trace.fail('SELinux is enforcing. Skipping ...') + return trace.to_dict(info, True) + + # Get the cpu info from the CPUID register + max_extension_support = cpuid.get_max_extension_support() + cache_info = cpuid.get_cache(max_extension_support) + info = cpuid.get_info() + + processor_brand = cpuid.get_processor_brand(max_extension_support) + + # Get the Hz and scale + hz_actual = cpuid.get_raw_hz() + hz_actual = _to_decimal_string(hz_actual) + + # Get the Hz and scale + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + info = { + 'vendor_id_raw' : cpuid.get_vendor_id(), + 'hardware_raw' : '', + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, 0), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, 0), + + 'l2_cache_size' : cache_info['size_b'], + 'l2_cache_line_size' : cache_info['line_size_b'], + 'l2_cache_associativity' : cache_info['associativity'], + + 'stepping' : info['stepping'], + 'model' : info['model'], + 'family' : info['family'], + 'processor_type' : info['processor_type'], + 'flags' : cpuid.get_flags(max_extension_support) + } + + info = _filter_dict_keys_with_empty_values(info) + trace.success() + except Exception as err: + from traceback import format_exc + err_string = format_exc() + trace._err = ''.join(['\t\t{0}\n'.format(n) for n in err_string.split('\n')]) + '\n' + return trace.to_dict(info, True) + + return trace.to_dict(info, False) + +def _get_cpu_info_from_cpuid_subprocess_wrapper(queue): + orig_stdout = sys.stdout + orig_stderr = sys.stderr + + output = _get_cpu_info_from_cpuid_actual() + + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + queue.put(_obj_to_b64(output)) + +def _get_cpu_info_from_cpuid(): + ''' + Returns the CPU info gathered by querying the X86 cpuid register in a new process. + Returns {} on non X86 cpus. + Returns {} if SELinux is in enforcing mode. + ''' + + g_trace.header('Tying to get info from CPUID ...') + + from multiprocessing import Process, Queue + + # Return {} if can't cpuid + if not DataSource.can_cpuid: + g_trace.fail('Can\'t CPUID. Skipping ...') + return {} + + # Get the CPU arch and bits + arch, bits = _parse_arch(DataSource.arch_string_raw) + + # Return {} if this is not an X86 CPU + if not arch in ['X86_32', 'X86_64']: + g_trace.fail('Not running on X86_32 or X86_64. Skipping ...') + return {} + + try: + if CAN_CALL_CPUID_IN_SUBPROCESS: + # Start running the function in a subprocess + queue = Queue() + p = Process(target=_get_cpu_info_from_cpuid_subprocess_wrapper, args=(queue,)) + p.start() + + # Wait for the process to end, while it is still alive + while p.is_alive(): + p.join(0) + + # Return {} if it failed + if p.exitcode != 0: + g_trace.fail('Failed to run CPUID in process. Skipping ...') + return {} + + # Return {} if no results + if queue.empty(): + g_trace.fail('Failed to get anything from CPUID process. Skipping ...') + return {} + # Return the result, only if there is something to read + else: + output = _b64_to_obj(queue.get()) + import pprint + pp = pprint.PrettyPrinter(indent=4) + #pp.pprint(output) + + if 'output' in output and output['output']: + g_trace.write(output['output']) + + if 'stdout' in output and output['stdout']: + sys.stdout.write('{0}\n'.format(output['stdout'])) + sys.stdout.flush() + + if 'stderr' in output and output['stderr']: + sys.stderr.write('{0}\n'.format(output['stderr'])) + sys.stderr.flush() + + if 'is_fail' not in output: + g_trace.fail('Failed to get is_fail from CPUID process. Skipping ...') + return {} + + # Fail if there was an exception + if 'err' in output and output['err']: + g_trace.fail('Failed to run CPUID in process. Skipping ...') + g_trace.write(output['err']) + g_trace.write('Failed ...') + return {} + + if 'is_fail' in output and output['is_fail']: + g_trace.write('Failed ...') + return {} + + if 'info' not in output or not output['info']: + g_trace.fail('Failed to get return info from CPUID process. Skipping ...') + return {} + + return output['info'] + else: + # FIXME: This should write the values like in the above call to actual + orig_stdout = sys.stdout + orig_stderr = sys.stderr + + output = _get_cpu_info_from_cpuid_actual() + + sys.stdout = orig_stdout + sys.stderr = orig_stderr + + g_trace.success() + return output['info'] + except Exception as err: + g_trace.fail(err) + + # Return {} if everything failed + return {} + +def _get_cpu_info_from_proc_cpuinfo(): + ''' + Returns the CPU info gathered from /proc/cpuinfo. + Returns {} if /proc/cpuinfo is not found. + ''' + + g_trace.header('Tying to get info from /proc/cpuinfo ...') + + try: + # Just return {} if there is no cpuinfo + if not DataSource.has_proc_cpuinfo(): + g_trace.fail('Failed to find /proc/cpuinfo. Skipping ...') + return {} + + returncode, output = DataSource.cat_proc_cpuinfo() + if returncode != 0: + g_trace.fail('Failed to run cat /proc/cpuinfo. Skipping ...') + return {} + + # Various fields + vendor_id = _get_field(False, output, None, '', 'vendor_id', 'vendor id', 'vendor') + processor_brand = _get_field(True, output, None, None, 'model name', 'cpu', 'processor', 'uarch') + cache_size = _get_field(False, output, None, '', 'cache size') + stepping = _get_field(False, output, int, -1, 'stepping') + model = _get_field(False, output, int, -1, 'model') + family = _get_field(False, output, int, -1, 'cpu family') + hardware = _get_field(False, output, None, '', 'Hardware') + + # Flags + flags = _get_field(False, output, None, None, 'flags', 'Features', 'ASEs implemented') + if flags: + flags = flags.split() + flags.sort() + + # Check for other cache format + if not cache_size: + try: + for i in range(0, 10): + name = "cache{0}".format(i) + value = _get_field(False, output, None, None, name) + if value: + value = [entry.split('=') for entry in value.split(' ')] + value = dict(value) + if 'level' in value and value['level'] == '3' and 'size' in value: + cache_size = value['size'] + break + except Exception: + pass + + # Convert from MHz string to Hz + hz_actual = _get_field(False, output, None, '', 'cpu MHz', 'cpu speed', 'clock', 'cpu MHz dynamic', 'cpu MHz static') + hz_actual = hz_actual.lower().rstrip('mhz').strip() + hz_actual = _to_decimal_string(hz_actual) + + # Convert from GHz/MHz string to Hz + hz_advertised, scale = (None, 0) + try: + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + except Exception: + pass + + info = { + 'hardware_raw' : hardware, + 'brand_raw' : processor_brand, + + 'l3_cache_size' : _friendly_bytes_to_int(cache_size), + 'flags' : flags, + 'vendor_id_raw' : vendor_id, + 'stepping' : stepping, + 'model' : model, + 'family' : family, + } + + # Make the Hz the same for actual and advertised if missing any + if not hz_advertised or hz_advertised == '0.0': + hz_advertised = hz_actual + scale = 6 + elif not hz_actual or hz_actual == '0.0': + hz_actual = hz_advertised + + # Add the Hz if there is one + if _hz_short_to_full(hz_advertised, scale) > (0, 0): + info['hz_advertised_friendly'] = _hz_short_to_friendly(hz_advertised, scale) + info['hz_advertised'] = _hz_short_to_full(hz_advertised, scale) + if _hz_short_to_full(hz_actual, scale) > (0, 0): + info['hz_actual_friendly'] = _hz_short_to_friendly(hz_actual, 6) + info['hz_actual'] = _hz_short_to_full(hz_actual, 6) + + info = _filter_dict_keys_with_empty_values(info, {'stepping':0, 'model':0, 'family':0}) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_cpufreq_info(): + ''' + Returns the CPU info gathered from cpufreq-info. + Returns {} if cpufreq-info is not found. + ''' + + g_trace.header('Tying to get info from cpufreq-info ...') + + try: + hz_brand, scale = '0.0', 0 + + if not DataSource.has_cpufreq_info(): + g_trace.fail('Failed to find cpufreq-info. Skipping ...') + return {} + + returncode, output = DataSource.cpufreq_info() + if returncode != 0: + g_trace.fail('Failed to run cpufreq-info. Skipping ...') + return {} + + hz_brand = output.split('current CPU frequency is')[1].split('\n')[0] + i = hz_brand.find('Hz') + assert(i != -1) + hz_brand = hz_brand[0 : i+2].strip().lower() + + if hz_brand.endswith('mhz'): + scale = 6 + elif hz_brand.endswith('ghz'): + scale = 9 + hz_brand = hz_brand.rstrip('mhz').rstrip('ghz').strip() + hz_brand = _to_decimal_string(hz_brand) + + info = { + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_brand, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_brand, scale), + 'hz_advertised' : _hz_short_to_full(hz_brand, scale), + 'hz_actual' : _hz_short_to_full(hz_brand, scale), + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_lscpu(): + ''' + Returns the CPU info gathered from lscpu. + Returns {} if lscpu is not found. + ''' + + g_trace.header('Tying to get info from lscpu ...') + + try: + if not DataSource.has_lscpu(): + g_trace.fail('Failed to find lscpu. Skipping ...') + return {} + + returncode, output = DataSource.lscpu() + if returncode != 0: + g_trace.fail('Failed to run lscpu. Skipping ...') + return {} + + info = {} + + new_hz = _get_field(False, output, None, None, 'CPU max MHz', 'CPU MHz') + if new_hz: + new_hz = _to_decimal_string(new_hz) + scale = 6 + info['hz_advertised_friendly'] = _hz_short_to_friendly(new_hz, scale) + info['hz_actual_friendly'] = _hz_short_to_friendly(new_hz, scale) + info['hz_advertised'] = _hz_short_to_full(new_hz, scale) + info['hz_actual'] = _hz_short_to_full(new_hz, scale) + + new_hz = _get_field(False, output, None, None, 'CPU dynamic MHz', 'CPU static MHz') + if new_hz: + new_hz = _to_decimal_string(new_hz) + scale = 6 + info['hz_advertised_friendly'] = _hz_short_to_friendly(new_hz, scale) + info['hz_actual_friendly'] = _hz_short_to_friendly(new_hz, scale) + info['hz_advertised'] = _hz_short_to_full(new_hz, scale) + info['hz_actual'] = _hz_short_to_full(new_hz, scale) + + vendor_id = _get_field(False, output, None, None, 'Vendor ID') + if vendor_id: + info['vendor_id_raw'] = vendor_id + + brand = _get_field(False, output, None, None, 'Model name') + if brand: + info['brand_raw'] = brand + else: + brand = _get_field(False, output, None, None, 'Model') + if brand and not brand.isdigit(): + info['brand_raw'] = brand + + family = _get_field(False, output, None, None, 'CPU family') + if family and family.isdigit(): + info['family'] = int(family) + + stepping = _get_field(False, output, None, None, 'Stepping') + if stepping and stepping.isdigit(): + info['stepping'] = int(stepping) + + model = _get_field(False, output, None, None, 'Model') + if model and model.isdigit(): + info['model'] = int(model) + + l1_data_cache_size = _get_field(False, output, None, None, 'L1d cache') + if l1_data_cache_size: + l1_data_cache_size = l1_data_cache_size.split('(')[0].strip() + info['l1_data_cache_size'] = _friendly_bytes_to_int(l1_data_cache_size) + + l1_instruction_cache_size = _get_field(False, output, None, None, 'L1i cache') + if l1_instruction_cache_size: + l1_instruction_cache_size = l1_instruction_cache_size.split('(')[0].strip() + info['l1_instruction_cache_size'] = _friendly_bytes_to_int(l1_instruction_cache_size) + + l2_cache_size = _get_field(False, output, None, None, 'L2 cache', 'L2d cache') + if l2_cache_size: + l2_cache_size = l2_cache_size.split('(')[0].strip() + info['l2_cache_size'] = _friendly_bytes_to_int(l2_cache_size) + + l3_cache_size = _get_field(False, output, None, None, 'L3 cache') + if l3_cache_size: + l3_cache_size = l3_cache_size.split('(')[0].strip() + info['l3_cache_size'] = _friendly_bytes_to_int(l3_cache_size) + + # Flags + flags = _get_field(False, output, None, None, 'flags', 'Features', 'ASEs implemented') + if flags: + flags = flags.split() + flags.sort() + info['flags'] = flags + + info = _filter_dict_keys_with_empty_values(info, {'stepping':0, 'model':0, 'family':0}) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_dmesg(): + ''' + Returns the CPU info gathered from dmesg. + Returns {} if dmesg is not found or does not have the desired info. + ''' + + g_trace.header('Tying to get info from the dmesg ...') + + # Just return {} if this arch has an unreliable dmesg log + arch, bits = _parse_arch(DataSource.arch_string_raw) + if arch in ['S390X']: + g_trace.fail('Running on S390X. Skipping ...') + return {} + + # Just return {} if there is no dmesg + if not DataSource.has_dmesg(): + g_trace.fail('Failed to find dmesg. Skipping ...') + return {} + + # If dmesg fails return {} + returncode, output = DataSource.dmesg_a() + if output is None or returncode != 0: + g_trace.fail('Failed to run \"dmesg -a\". Skipping ...') + return {} + + info = _parse_dmesg_output(output) + g_trace.success() + return info + + +# https://openpowerfoundation.org/wp-content/uploads/2016/05/LoPAPR_DRAFT_v11_24March2016_cmt1.pdf +# page 767 +def _get_cpu_info_from_ibm_pa_features(): + ''' + Returns the CPU info gathered from lsprop /proc/device-tree/cpus/*/ibm,pa-features + Returns {} if lsprop is not found or ibm,pa-features does not have the desired info. + ''' + + g_trace.header('Tying to get info from lsprop ...') + + try: + # Just return {} if there is no lsprop + if not DataSource.has_ibm_pa_features(): + g_trace.fail('Failed to find lsprop. Skipping ...') + return {} + + # If ibm,pa-features fails return {} + returncode, output = DataSource.ibm_pa_features() + if output is None or returncode != 0: + g_trace.fail('Failed to glob /proc/device-tree/cpus/*/ibm,pa-features. Skipping ...') + return {} + + # Filter out invalid characters from output + value = output.split("ibm,pa-features")[1].lower() + value = [s for s in value if s in list('0123456789abcfed')] + value = ''.join(value) + + # Get data converted to Uint32 chunks + left = int(value[0 : 8], 16) + right = int(value[8 : 16], 16) + + # Get the CPU flags + flags = { + # Byte 0 + 'mmu' : _is_bit_set(left, 0), + 'fpu' : _is_bit_set(left, 1), + 'slb' : _is_bit_set(left, 2), + 'run' : _is_bit_set(left, 3), + #'reserved' : _is_bit_set(left, 4), + 'dabr' : _is_bit_set(left, 5), + 'ne' : _is_bit_set(left, 6), + 'wtr' : _is_bit_set(left, 7), + + # Byte 1 + 'mcr' : _is_bit_set(left, 8), + 'dsisr' : _is_bit_set(left, 9), + 'lp' : _is_bit_set(left, 10), + 'ri' : _is_bit_set(left, 11), + 'dabrx' : _is_bit_set(left, 12), + 'sprg3' : _is_bit_set(left, 13), + 'rislb' : _is_bit_set(left, 14), + 'pp' : _is_bit_set(left, 15), + + # Byte 2 + 'vpm' : _is_bit_set(left, 16), + 'dss_2.05' : _is_bit_set(left, 17), + #'reserved' : _is_bit_set(left, 18), + 'dar' : _is_bit_set(left, 19), + #'reserved' : _is_bit_set(left, 20), + 'ppr' : _is_bit_set(left, 21), + 'dss_2.02' : _is_bit_set(left, 22), + 'dss_2.06' : _is_bit_set(left, 23), + + # Byte 3 + 'lsd_in_dscr' : _is_bit_set(left, 24), + 'ugr_in_dscr' : _is_bit_set(left, 25), + #'reserved' : _is_bit_set(left, 26), + #'reserved' : _is_bit_set(left, 27), + #'reserved' : _is_bit_set(left, 28), + #'reserved' : _is_bit_set(left, 29), + #'reserved' : _is_bit_set(left, 30), + #'reserved' : _is_bit_set(left, 31), + + # Byte 4 + 'sso_2.06' : _is_bit_set(right, 0), + #'reserved' : _is_bit_set(right, 1), + #'reserved' : _is_bit_set(right, 2), + #'reserved' : _is_bit_set(right, 3), + #'reserved' : _is_bit_set(right, 4), + #'reserved' : _is_bit_set(right, 5), + #'reserved' : _is_bit_set(right, 6), + #'reserved' : _is_bit_set(right, 7), + + # Byte 5 + 'le' : _is_bit_set(right, 8), + 'cfar' : _is_bit_set(right, 9), + 'eb' : _is_bit_set(right, 10), + 'lsq_2.07' : _is_bit_set(right, 11), + #'reserved' : _is_bit_set(right, 12), + #'reserved' : _is_bit_set(right, 13), + #'reserved' : _is_bit_set(right, 14), + #'reserved' : _is_bit_set(right, 15), + + # Byte 6 + 'dss_2.07' : _is_bit_set(right, 16), + #'reserved' : _is_bit_set(right, 17), + #'reserved' : _is_bit_set(right, 18), + #'reserved' : _is_bit_set(right, 19), + #'reserved' : _is_bit_set(right, 20), + #'reserved' : _is_bit_set(right, 21), + #'reserved' : _is_bit_set(right, 22), + #'reserved' : _is_bit_set(right, 23), + + # Byte 7 + #'reserved' : _is_bit_set(right, 24), + #'reserved' : _is_bit_set(right, 25), + #'reserved' : _is_bit_set(right, 26), + #'reserved' : _is_bit_set(right, 27), + #'reserved' : _is_bit_set(right, 28), + #'reserved' : _is_bit_set(right, 29), + #'reserved' : _is_bit_set(right, 30), + #'reserved' : _is_bit_set(right, 31), + } + + # Get a list of only the flags that are true + flags = [k for k, v in flags.items() if v] + flags.sort() + + info = { + 'flags' : flags + } + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + return {} + + +def _get_cpu_info_from_cat_var_run_dmesg_boot(): + ''' + Returns the CPU info gathered from /var/run/dmesg.boot. + Returns {} if dmesg is not found or does not have the desired info. + ''' + + g_trace.header('Tying to get info from the /var/run/dmesg.boot log ...') + + # Just return {} if there is no /var/run/dmesg.boot + if not DataSource.has_var_run_dmesg_boot(): + g_trace.fail('Failed to find /var/run/dmesg.boot file. Skipping ...') + return {} + + # If dmesg.boot fails return {} + returncode, output = DataSource.cat_var_run_dmesg_boot() + if output is None or returncode != 0: + g_trace.fail('Failed to run \"cat /var/run/dmesg.boot\". Skipping ...') + return {} + + info = _parse_dmesg_output(output) + g_trace.success() + return info + + +def _get_cpu_info_from_sysctl(): + ''' + Returns the CPU info gathered from sysctl. + Returns {} if sysctl is not found. + ''' + + g_trace.header('Tying to get info from sysctl ...') + + try: + # Just return {} if there is no sysctl + if not DataSource.has_sysctl(): + g_trace.fail('Failed to find sysctl. Skipping ...') + return {} + + # If sysctl fails return {} + returncode, output = DataSource.sysctl_machdep_cpu_hw_cpufrequency() + if output is None or returncode != 0: + g_trace.fail('Failed to run \"sysctl machdep.cpu hw.cpufrequency\". Skipping ...') + return {} + + # Various fields + vendor_id = _get_field(False, output, None, None, 'machdep.cpu.vendor') + processor_brand = _get_field(True, output, None, None, 'machdep.cpu.brand_string') + cache_size = _get_field(False, output, int, 0, 'machdep.cpu.cache.size') + stepping = _get_field(False, output, int, 0, 'machdep.cpu.stepping') + model = _get_field(False, output, int, 0, 'machdep.cpu.model') + family = _get_field(False, output, int, 0, 'machdep.cpu.family') + + # Flags + flags = _get_field(False, output, None, '', 'machdep.cpu.features').lower().split() + flags.extend(_get_field(False, output, None, '', 'machdep.cpu.leaf7_features').lower().split()) + flags.extend(_get_field(False, output, None, '', 'machdep.cpu.extfeatures').lower().split()) + flags.sort() + + # Convert from GHz/MHz string to Hz + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + hz_actual = _get_field(False, output, None, None, 'hw.cpufrequency') + hz_actual = _to_decimal_string(hz_actual) + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, 0), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, 0), + + 'l2_cache_size' : int(cache_size) * 1024, + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + 'flags' : flags + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + return {} + + +def _get_cpu_info_from_sysinfo(): + ''' + Returns the CPU info gathered from sysinfo. + Returns {} if sysinfo is not found. + ''' + + info = _get_cpu_info_from_sysinfo_v1() + info.update(_get_cpu_info_from_sysinfo_v2()) + return info + +def _get_cpu_info_from_sysinfo_v1(): + ''' + Returns the CPU info gathered from sysinfo. + Returns {} if sysinfo is not found. + ''' + + g_trace.header('Tying to get info from sysinfo version 1 ...') + + try: + # Just return {} if there is no sysinfo + if not DataSource.has_sysinfo(): + g_trace.fail('Failed to find sysinfo. Skipping ...') + return {} + + # If sysinfo fails return {} + returncode, output = DataSource.sysinfo_cpu() + if output is None or returncode != 0: + g_trace.fail('Failed to run \"sysinfo -cpu\". Skipping ...') + return {} + + # Various fields + vendor_id = '' #_get_field(False, output, None, None, 'CPU #0: ') + processor_brand = output.split('CPU #0: "')[1].split('"\n')[0].strip() + cache_size = '' #_get_field(False, output, None, None, 'machdep.cpu.cache.size') + stepping = int(output.split(', stepping ')[1].split(',')[0].strip()) + model = int(output.split(', model ')[1].split(',')[0].strip()) + family = int(output.split(', family ')[1].split(',')[0].strip()) + + # Flags + flags = [] + for line in output.split('\n'): + if line.startswith('\t\t'): + for flag in line.strip().lower().split(): + flags.append(flag) + flags.sort() + + # Convert from GHz/MHz string to Hz + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + hz_actual = hz_advertised + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, scale), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, scale), + + 'l2_cache_size' : _to_friendly_bytes(cache_size), + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + 'flags' : flags + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_sysinfo_v2(): + ''' + Returns the CPU info gathered from sysinfo. + Returns {} if sysinfo is not found. + ''' + + g_trace.header('Tying to get info from sysinfo version 2 ...') + + try: + # Just return {} if there is no sysinfo + if not DataSource.has_sysinfo(): + g_trace.fail('Failed to find sysinfo. Skipping ...') + return {} + + # If sysinfo fails return {} + returncode, output = DataSource.sysinfo_cpu() + if output is None or returncode != 0: + g_trace.fail('Failed to run \"sysinfo -cpu\". Skipping ...') + return {} + + # Various fields + vendor_id = '' #_get_field(False, output, None, None, 'CPU #0: ') + processor_brand = output.split('CPU #0: "')[1].split('"\n')[0].strip() + cache_size = '' #_get_field(False, output, None, None, 'machdep.cpu.cache.size') + signature = output.split('Signature:')[1].split('\n')[0].strip() + # + stepping = int(signature.split('stepping ')[1].split(',')[0].strip()) + model = int(signature.split('model ')[1].split(',')[0].strip()) + family = int(signature.split('family ')[1].split(',')[0].strip()) + + # Flags + def get_subsection_flags(output): + retval = [] + for line in output.split('\n')[1:]: + if not line.startswith(' ') and not line.startswith(' '): break + for entry in line.strip().lower().split(' '): + retval.append(entry) + return retval + + flags = get_subsection_flags(output.split('Features: ')[1]) + \ + get_subsection_flags(output.split('Extended Features (0x00000001): ')[1]) + \ + get_subsection_flags(output.split('Extended Features (0x80000001): ')[1]) + flags.sort() + + # Convert from GHz/MHz string to Hz + lines = [n for n in output.split('\n') if n] + raw_hz = lines[0].split('running at ')[1].strip().lower() + hz_advertised = raw_hz.rstrip('mhz').rstrip('ghz').strip() + hz_advertised = _to_decimal_string(hz_advertised) + hz_actual = hz_advertised + + scale = 0 + if raw_hz.endswith('mhz'): + scale = 6 + elif raw_hz.endswith('ghz'): + scale = 9 + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, scale), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, scale), + + 'l2_cache_size' : _to_friendly_bytes(cache_size), + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + 'flags' : flags + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_wmic(): + ''' + Returns the CPU info gathered from WMI. + Returns {} if not on Windows, or wmic is not installed. + ''' + g_trace.header('Tying to get info from wmic ...') + + try: + # Just return {} if not Windows or there is no wmic + if not DataSource.is_windows or not DataSource.has_wmic(): + g_trace.fail('Failed to find WMIC, or not on Windows. Skipping ...') + return {} + + returncode, output = DataSource.wmic_cpu() + if output is None or returncode != 0: + g_trace.fail('Failed to run wmic. Skipping ...') + return {} + + # Break the list into key values pairs + value = output.split("\n") + value = [s.rstrip().split('=') for s in value if '=' in s] + value = {k: v for k, v in value if v} + + # Get the advertised MHz + processor_brand = value.get('Name') + hz_advertised, scale_advertised = _parse_cpu_brand_string(processor_brand) + + # Get the actual MHz + hz_actual = value.get('CurrentClockSpeed') + scale_actual = 6 + if hz_actual: + hz_actual = _to_decimal_string(hz_actual) + + # Get cache sizes + l2_cache_size = value.get('L2CacheSize') # NOTE: L2CacheSize is in kilobytes + if l2_cache_size: + l2_cache_size = int(l2_cache_size) * 1024 + + l3_cache_size = value.get('L3CacheSize') # NOTE: L3CacheSize is in kilobytes + if l3_cache_size: + l3_cache_size = int(l3_cache_size) * 1024 + + # Get family, model, and stepping + family, model, stepping = '', '', '' + description = value.get('Description') or value.get('Caption') + entries = description.split(' ') + + if 'Family' in entries and entries.index('Family') < len(entries)-1: + i = entries.index('Family') + family = int(entries[i + 1]) + + if 'Model' in entries and entries.index('Model') < len(entries)-1: + i = entries.index('Model') + model = int(entries[i + 1]) + + if 'Stepping' in entries and entries.index('Stepping') < len(entries)-1: + i = entries.index('Stepping') + stepping = int(entries[i + 1]) + + info = { + 'vendor_id_raw' : value.get('Manufacturer'), + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale_advertised), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, scale_actual), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale_advertised), + 'hz_actual' : _hz_short_to_full(hz_actual, scale_actual), + + 'l2_cache_size' : l2_cache_size, + 'l3_cache_size' : l3_cache_size, + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + #raise # NOTE: To have this throw on error, uncomment this line + return {} + +def _get_cpu_info_from_registry(): + ''' + Returns the CPU info gathered from the Windows Registry. + Returns {} if not on Windows. + ''' + + g_trace.header('Tying to get info from Windows registry ...') + + try: + # Just return {} if not on Windows + if not DataSource.is_windows: + g_trace.fail('Not running on Windows. Skipping ...') + return {} + + # Get the CPU name + processor_brand = DataSource.winreg_processor_brand().strip() + + # Get the CPU vendor id + vendor_id = DataSource.winreg_vendor_id_raw() + + # Get the CPU arch and bits + arch_string_raw = DataSource.winreg_arch_string_raw() + arch, bits = _parse_arch(arch_string_raw) + + # Get the actual CPU Hz + hz_actual = DataSource.winreg_hz_actual() + hz_actual = _to_decimal_string(hz_actual) + + # Get the advertised CPU Hz + hz_advertised, scale = _parse_cpu_brand_string(processor_brand) + + # If advertised hz not found, use the actual hz + if hz_advertised == '0.0': + scale = 6 + hz_advertised = _to_decimal_string(hz_actual) + + # Get the CPU features + feature_bits = DataSource.winreg_feature_bits() + + def is_set(bit): + mask = 0x80000000 >> bit + retval = mask & feature_bits > 0 + return retval + + # http://en.wikipedia.org/wiki/CPUID + # http://unix.stackexchange.com/questions/43539/what-do-the-flags-in-proc-cpuinfo-mean + # http://www.lohninger.com/helpcsuite/public_constants_cpuid.htm + flags = { + 'fpu' : is_set(0), # Floating Point Unit + 'vme' : is_set(1), # V86 Mode Extensions + 'de' : is_set(2), # Debug Extensions - I/O breakpoints supported + 'pse' : is_set(3), # Page Size Extensions (4 MB pages supported) + 'tsc' : is_set(4), # Time Stamp Counter and RDTSC instruction are available + 'msr' : is_set(5), # Model Specific Registers + 'pae' : is_set(6), # Physical Address Extensions (36 bit address, 2MB pages) + 'mce' : is_set(7), # Machine Check Exception supported + 'cx8' : is_set(8), # Compare Exchange Eight Byte instruction available + 'apic' : is_set(9), # Local APIC present (multiprocessor operation support) + 'sepamd' : is_set(10), # Fast system calls (AMD only) + 'sep' : is_set(11), # Fast system calls + 'mtrr' : is_set(12), # Memory Type Range Registers + 'pge' : is_set(13), # Page Global Enable + 'mca' : is_set(14), # Machine Check Architecture + 'cmov' : is_set(15), # Conditional MOVe instructions + 'pat' : is_set(16), # Page Attribute Table + 'pse36' : is_set(17), # 36 bit Page Size Extensions + 'serial' : is_set(18), # Processor Serial Number + 'clflush' : is_set(19), # Cache Flush + #'reserved1' : is_set(20), # reserved + 'dts' : is_set(21), # Debug Trace Store + 'acpi' : is_set(22), # ACPI support + 'mmx' : is_set(23), # MultiMedia Extensions + 'fxsr' : is_set(24), # FXSAVE and FXRSTOR instructions + 'sse' : is_set(25), # SSE instructions + 'sse2' : is_set(26), # SSE2 (WNI) instructions + 'ss' : is_set(27), # self snoop + #'reserved2' : is_set(28), # reserved + 'tm' : is_set(29), # Automatic clock control + 'ia64' : is_set(30), # IA64 instructions + '3dnow' : is_set(31) # 3DNow! instructions available + } + + # Get a list of only the flags that are true + flags = [k for k, v in flags.items() if v] + flags.sort() + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, 6), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, 6), + + 'flags' : flags + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + return {} + +def _get_cpu_info_from_kstat(): + ''' + Returns the CPU info gathered from isainfo and kstat. + Returns {} if isainfo or kstat are not found. + ''' + + g_trace.header('Tying to get info from kstat ...') + + try: + # Just return {} if there is no isainfo or kstat + if not DataSource.has_isainfo() or not DataSource.has_kstat(): + g_trace.fail('Failed to find isinfo or kstat. Skipping ...') + return {} + + # If isainfo fails return {} + returncode, flag_output = DataSource.isainfo_vb() + if flag_output is None or returncode != 0: + g_trace.fail('Failed to run \"isainfo -vb\". Skipping ...') + return {} + + # If kstat fails return {} + returncode, kstat = DataSource.kstat_m_cpu_info() + if kstat is None or returncode != 0: + g_trace.fail('Failed to run \"kstat -m cpu_info\". Skipping ...') + return {} + + # Various fields + vendor_id = kstat.split('\tvendor_id ')[1].split('\n')[0].strip() + processor_brand = kstat.split('\tbrand ')[1].split('\n')[0].strip() + stepping = int(kstat.split('\tstepping ')[1].split('\n')[0].strip()) + model = int(kstat.split('\tmodel ')[1].split('\n')[0].strip()) + family = int(kstat.split('\tfamily ')[1].split('\n')[0].strip()) + + # Flags + flags = flag_output.strip().split('\n')[-1].strip().lower().split() + flags.sort() + + # Convert from GHz/MHz string to Hz + scale = 6 + hz_advertised = kstat.split('\tclock_MHz ')[1].split('\n')[0].strip() + hz_advertised = _to_decimal_string(hz_advertised) + + # Convert from GHz/MHz string to Hz + hz_actual = kstat.split('\tcurrent_clock_Hz ')[1].split('\n')[0].strip() + hz_actual = _to_decimal_string(hz_actual) + + info = { + 'vendor_id_raw' : vendor_id, + 'brand_raw' : processor_brand, + + 'hz_advertised_friendly' : _hz_short_to_friendly(hz_advertised, scale), + 'hz_actual_friendly' : _hz_short_to_friendly(hz_actual, 0), + 'hz_advertised' : _hz_short_to_full(hz_advertised, scale), + 'hz_actual' : _hz_short_to_full(hz_actual, 0), + + 'stepping' : stepping, + 'model' : model, + 'family' : family, + 'flags' : flags + } + + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + return {} + +def _get_cpu_info_from_platform_uname(): + + g_trace.header('Tying to get info from platform.uname ...') + + try: + uname = DataSource.uname_string_raw.split(',')[0] + + family, model, stepping = (None, None, None) + entries = uname.split(' ') + + if 'Family' in entries and entries.index('Family') < len(entries)-1: + i = entries.index('Family') + family = int(entries[i + 1]) + + if 'Model' in entries and entries.index('Model') < len(entries)-1: + i = entries.index('Model') + model = int(entries[i + 1]) + + if 'Stepping' in entries and entries.index('Stepping') < len(entries)-1: + i = entries.index('Stepping') + stepping = int(entries[i + 1]) + + info = { + 'family' : family, + 'model' : model, + 'stepping' : stepping + } + info = _filter_dict_keys_with_empty_values(info) + g_trace.success() + return info + except Exception as err: + g_trace.fail(err) + return {} + +def _get_cpu_info_internal(): + ''' + Returns the CPU info by using the best sources of information for your OS. + Returns {} if nothing is found. + ''' + + g_trace.write('!' * 80) + + # Get the CPU arch and bits + arch, bits = _parse_arch(DataSource.arch_string_raw) + + friendly_maxsize = { 2**31-1: '32 bit', 2**63-1: '64 bit' }.get(sys.maxsize) or 'unknown bits' + friendly_version = "{0}.{1}.{2}.{3}.{4}".format(*sys.version_info) + PYTHON_VERSION = "{0} ({1})".format(friendly_version, friendly_maxsize) + + info = { + 'python_version' : PYTHON_VERSION, + 'cpuinfo_version' : CPUINFO_VERSION, + 'cpuinfo_version_string' : CPUINFO_VERSION_STRING, + 'arch' : arch, + 'bits' : bits, + 'count' : DataSource.cpu_count, + 'arch_string_raw' : DataSource.arch_string_raw, + } + + g_trace.write("python_version: {0}".format(info['python_version'])) + g_trace.write("cpuinfo_version: {0}".format(info['cpuinfo_version'])) + g_trace.write("arch: {0}".format(info['arch'])) + g_trace.write("bits: {0}".format(info['bits'])) + g_trace.write("count: {0}".format(info['count'])) + g_trace.write("arch_string_raw: {0}".format(info['arch_string_raw'])) + + # Try the Windows wmic + _copy_new_fields(info, _get_cpu_info_from_wmic()) + + # Try the Windows registry + _copy_new_fields(info, _get_cpu_info_from_registry()) + + # Try /proc/cpuinfo + _copy_new_fields(info, _get_cpu_info_from_proc_cpuinfo()) + + # Try cpufreq-info + _copy_new_fields(info, _get_cpu_info_from_cpufreq_info()) + + # Try LSCPU + _copy_new_fields(info, _get_cpu_info_from_lscpu()) + + # Try sysctl + _copy_new_fields(info, _get_cpu_info_from_sysctl()) + + # Try kstat + _copy_new_fields(info, _get_cpu_info_from_kstat()) + + # Try dmesg + _copy_new_fields(info, _get_cpu_info_from_dmesg()) + + # Try /var/run/dmesg.boot + _copy_new_fields(info, _get_cpu_info_from_cat_var_run_dmesg_boot()) + + # Try lsprop ibm,pa-features + _copy_new_fields(info, _get_cpu_info_from_ibm_pa_features()) + + # Try sysinfo + _copy_new_fields(info, _get_cpu_info_from_sysinfo()) + + # Try querying the CPU cpuid register + # FIXME: This should print stdout and stderr to trace log + _copy_new_fields(info, _get_cpu_info_from_cpuid()) + + # Try platform.uname + _copy_new_fields(info, _get_cpu_info_from_platform_uname()) + + g_trace.write('!' * 80) + + return info + +def get_cpu_info_json(): + ''' + Returns the CPU info by using the best sources of information for your OS. + Returns the result in a json string + ''' + + import json + + output = None + + # If running under pyinstaller, run normally + if getattr(sys, 'frozen', False): + info = _get_cpu_info_internal() + output = json.dumps(info) + output = "{0}".format(output) + # if not running under pyinstaller, run in another process. + # This is done because multiprocesing has a design flaw that + # causes non main programs to run multiple times on Windows. + else: + from subprocess import Popen, PIPE + + command = [sys.executable, __file__, '--json'] + p1 = Popen(command, stdout=PIPE, stderr=PIPE, stdin=PIPE) + output = p1.communicate()[0] + + if p1.returncode != 0: + return "{}" + + output = output.decode(encoding='UTF-8') + + return output + +def get_cpu_info(): + ''' + Returns the CPU info by using the best sources of information for your OS. + Returns the result in a dict + ''' + + import json + + output = get_cpu_info_json() + + # Convert JSON to Python with non unicode strings + output = json.loads(output, object_hook = _utf_to_str) + + return output + +def main(): + from argparse import ArgumentParser + import json + + # Parse args + parser = ArgumentParser(description='Gets CPU info with pure Python') + parser.add_argument('--json', action='store_true', help='Return the info in JSON format') + parser.add_argument('--version', action='store_true', help='Return the version of py-cpuinfo') + parser.add_argument('--trace', action='store_true', help='Traces code paths used to find CPU info to file') + args = parser.parse_args() + + global g_trace + g_trace = Trace(args.trace, False) + + try: + _check_arch() + except Exception as err: + sys.stderr.write(str(err) + "\n") + sys.exit(1) + + info = _get_cpu_info_internal() + + if not info: + sys.stderr.write("Failed to find cpu info\n") + sys.exit(1) + + if args.json: + print(json.dumps(info)) + elif args.version: + print(CPUINFO_VERSION_STRING) + else: + print('Python Version: {0}'.format(info.get('python_version', ''))) + print('Cpuinfo Version: {0}'.format(info.get('cpuinfo_version_string', ''))) + print('Vendor ID Raw: {0}'.format(info.get('vendor_id_raw', ''))) + print('Hardware Raw: {0}'.format(info.get('hardware_raw', ''))) + print('Brand Raw: {0}'.format(info.get('brand_raw', ''))) + print('Hz Advertised Friendly: {0}'.format(info.get('hz_advertised_friendly', ''))) + print('Hz Actual Friendly: {0}'.format(info.get('hz_actual_friendly', ''))) + print('Hz Advertised: {0}'.format(info.get('hz_advertised', ''))) + print('Hz Actual: {0}'.format(info.get('hz_actual', ''))) + print('Arch: {0}'.format(info.get('arch', ''))) + print('Bits: {0}'.format(info.get('bits', ''))) + print('Count: {0}'.format(info.get('count', ''))) + print('Arch String Raw: {0}'.format(info.get('arch_string_raw', ''))) + print('L1 Data Cache Size: {0}'.format(info.get('l1_data_cache_size', ''))) + print('L1 Instruction Cache Size: {0}'.format(info.get('l1_instruction_cache_size', ''))) + print('L2 Cache Size: {0}'.format(info.get('l2_cache_size', ''))) + print('L2 Cache Line Size: {0}'.format(info.get('l2_cache_line_size', ''))) + print('L2 Cache Associativity: {0}'.format(info.get('l2_cache_associativity', ''))) + print('L3 Cache Size: {0}'.format(info.get('l3_cache_size', ''))) + print('Stepping: {0}'.format(info.get('stepping', ''))) + print('Model: {0}'.format(info.get('model', ''))) + print('Family: {0}'.format(info.get('family', ''))) + print('Processor Type: {0}'.format(info.get('processor_type', ''))) + print('Flags: {0}'.format(', '.join(info.get('flags', '')))) + + +if __name__ == '__main__': + main() +else: + g_trace = Trace(False, False) + _check_arch() View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4f85366ffd1068592d49431fc0d14ccf987271dd -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4f85366ffd1068592d49431fc0d14ccf987271dd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 13 09:59:59 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 13 Jul 2024 05:59:59 -0400 Subject: [Git][ghc/ghc][master] testsuite: Replace $CC with $TEST_CC Message-ID: <6692501fa5781_1c9b335c760f0249ca@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 4 changed files: - testsuite/tests/rts/Makefile - testsuite/tests/rts/all.T - testsuite/tests/rts/linker/Makefile - testsuite/tests/rts/linker/T11223/Makefile Changes: ===================================== testsuite/tests/rts/Makefile ===================================== @@ -23,8 +23,8 @@ T4059: ./T4059 exec_signals-prep: - $(CC) -o exec_signals_child exec_signals_child.c - $(CC) -o exec_signals_prepare exec_signals_prepare.c + $(TEST_CC) -o exec_signals_child exec_signals_child.c + $(TEST_CC) -o exec_signals_prepare exec_signals_prepare.c .PHONY: T4850 T4850: ===================================== testsuite/tests/rts/all.T ===================================== @@ -221,7 +221,12 @@ test('exec_signals', [when(opsys('mingw32'), skip), pre_cmd('$MAKE -s --no-print-directory exec_signals-prep'), cmd_prefix('./exec_signals_prepare'), - req_process], + req_process, + req_c], # C compiler is used to build exec_signals_prepare/child programs. + # With the JS backend, it fails because these programs are + # compiled with Emscipten and they can't be directly executed + # (permission denied error); they must be loaded in nodejs (or + # compiled with the host CC compiler). compile_and_run, ['']) test('return_mem_to_os', normal, compile_and_run, ['']) ===================================== testsuite/tests/rts/linker/Makefile ===================================== @@ -69,7 +69,7 @@ linker_unload_native: $(RM) Test.o Test.hi Test.a Test.so Test2.so "$(TEST_HC)" $(TEST_HC_OPTS) -c Test.hs -v0 -dynamic -fPIC -o Test.a # only libraries without DT_NEEDED are supported - "$(CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ + "$(TEST_CC)" -shared -Wl,-Bsymbolic -nostdlib -o Test.so -Wl,-nostdlib \ -Wl,--whole-archive Test.a cp Test.so Test2.so ===================================== testsuite/tests/rts/linker/T11223/Makefile ===================================== @@ -11,44 +11,44 @@ CC=$(TEST_CC) .PHONY: t_11223_simple_link t_11223_simple_link: $(RM) -f foo_simple.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_simple.o + "$(TEST_CC)" -c foo.c -o foo_simple.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs .PHONY: t_11223_simple_link_lib t_11223_simple_link_lib: $(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a - "$(CC)" -c foo.c -o foo_lib.o + "$(TEST_CC)" -c foo.c -o foo_lib.o "$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)" .PHONY: t_11223_simple_duplicate t_11223_simple_duplicate: $(RM) -f foo_dup.o bar_dup.o foo.hi foo.o - "$(CC)" -c foo.c -o foo_dup.o - "$(CC)" -c bar.c -o bar_dup.o + "$(TEST_CC)" -c foo.c -o foo_dup.o + "$(TEST_CC)" -c bar.c -o bar_dup.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs .PHONY: t_11223_simple_duplicate_lib t_11223_simple_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libfoo_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)" .PHONY: t_11223_simple_unused_duplicate_lib t_11223_simple_unused_duplicate_lib: $(RM) -f foo_dup_lib.o bar_dup_lib.o foo.hi foo.o libbar_dup_lib.a - "$(CC)" -c foo.c -o foo_dup_lib.o - "$(CC)" -c bar.c -o bar_dup_lib.o + "$(TEST_CC)" -c foo.c -o foo_dup_lib.o + "$(TEST_CC)" -c bar.c -o bar_dup_lib.o "$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)" .PHONY: t_11223_link_order_a_b_succeed t_11223_link_order_a_b_succeed: $(RM) -f foo_link_lib_1.o bar_link_lib_1.o foo.hi foo.o libbar_link_lib_1.a libfoo_link_lib_1.a - "$(CC)" -c foo.c -o foo_link_lib_1.o - "$(CC)" -c bar.c -o bar_link_lib_1.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_1.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_1.o "$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null "$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)" @@ -56,8 +56,8 @@ t_11223_link_order_a_b_succeed: .PHONY: t_11223_link_order_b_a_succeed t_11223_link_order_b_a_succeed: $(RM) -f foo_link_lib_2.o bar_link_lib_2.o foo.hi foo.o libbar_link_lib_2.a libfoo_link_lib_2.a - "$(CC)" -c foo.c -o foo_link_lib_2.o - "$(CC)" -c bar.c -o bar_link_lib_2.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_2.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_2.o "$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null "$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)" @@ -65,8 +65,8 @@ t_11223_link_order_b_a_succeed: .PHONY: t_11223_link_order_a_b_2_fail t_11223_link_order_a_b_2_fail: $(RM) -f foo_link_lib_3.o bar_link_lib_3.o foo.hi foo.o libbar_link_lib_3.a libfoo_link_lib_3.a - "$(CC)" -c foo.c -o foo_link_lib_3.o - "$(CC)" -c bar.c -o bar_link_lib_3.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_3.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_3.o "$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null "$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)" @@ -74,8 +74,8 @@ t_11223_link_order_a_b_2_fail: .PHONY: t_11223_link_order_b_a_2_succeed t_11223_link_order_b_a_2_succeed: $(RM) -f foo_link_lib_4.o bar_link_lib_4.o foo.hi foo.o libbar_link_lib_4.a libfoo_link_lib_4.a - "$(CC)" -c foo.c -o foo_link_lib_4.o - "$(CC)" -c bar.c -o bar_link_lib_4.o + "$(TEST_CC)" -c foo.c -o foo_link_lib_4.o + "$(TEST_CC)" -c bar.c -o bar_link_lib_4.o "$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null "$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)" @@ -87,40 +87,40 @@ t_11223_link_order_b_a_2_succeed: .PHONY: t_11223_weak_only_link_fail t_11223_weak_only_link_fail: $(RM) -f power_w1.o power.hi power.o - "$(CC)" -c power.c -DWEAK -o power_w1.o + "$(TEST_CC)" -c power.c -DWEAK -o power_w1.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o .PHONY: t_11223_weak_only_link_succeed t_11223_weak_only_link_succeed: $(RM) -f power_w2.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o power_w2.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o power_w2.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o .PHONY: t_11223_weak_both_link_order_a_b_succeed t_11223_weak_both_link_order_a_b_succeed: $(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o - "$(CC)" -c power.c -DWEAK -o fast_power_w3.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w3.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w3.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o .PHONY: t_11223_weak_both_link_order_b_a_succeed t_11223_weak_both_link_order_b_a_succeed: $(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o - "$(CC)" -c power.c -DWEAK -o fast_power_w4.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w4.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w4.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o .PHONY: t_11223_weak_single_link_order_a_b_succeed t_11223_weak_single_link_order_a_b_succeed: $(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o - "$(CC)" -c power_slow.c -o slow_power_w5.o - "$(CC)" -c power.c -DWEAK -o fast_power_w5.o + "$(TEST_CC)" -c power_slow.c -o slow_power_w5.o + "$(TEST_CC)" -c power.c -DWEAK -o fast_power_w5.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o .PHONY: t_11223_weak_single_link_order_b_a_succeed t_11223_weak_single_link_order_b_a_succeed: $(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o - "$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o - "$(CC)" -c power.c -o fast_power_w6.o + "$(TEST_CC)" -c power_slow.c -DWEAK -o slow_power_w6.o + "$(TEST_CC)" -c power.c -o fast_power_w6.o echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41f1354dafe35aa6023d6c2553793208afa3fc31 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41f1354dafe35aa6023d6c2553793208afa3fc31 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 14 15:49:43 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Sun, 14 Jul 2024 11:49:43 -0400 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] 102 commits: base: Add inits1 and tails1 to Data.List Message-ID: <6693f3976a605_29b57c1d5d0449539b@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - fbd0eba0 by Adriaan Leijnse at 2024-07-14T16:46:55+01:00 Remove HsUnboundVar, replace with HsHole, HsUnboundVarRn/Tc - - - - - e0859cce by Adriaan Leijnse at 2024-07-14T16:46:59+01:00 Fix hard_hole_fits test expected stderr output for HsHole - - - - - 2e49e7e6 by Adriaan Leijnse at 2024-07-14T16:46:59+01:00 Add missing closing parenthesis in Note - - - - - 4fc3d354 by Adriaan Leijnse at 2024-07-14T16:48:44+01:00 Use dataConCantHappen for missing XHole cases - - - - - dcc92ae5 by Adriaan Leijnse at 2024-07-14T16:49:19+01:00 Keep annotated location in HsHole instead of full RdrName - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc6000cc6068e0a453b278032e15a721cec70d78...dcc92ae5112324f72b430f3d93af094062137f2f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc6000cc6068e0a453b278032e15a721cec70d78...dcc92ae5112324f72b430f3d93af094062137f2f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 14 20:21:25 2024 From: gitlab at gitlab.haskell.org (Adriaan Leijnse (@aidylns)) Date: Sun, 14 Jul 2024 16:21:25 -0400 Subject: [Git][ghc/ghc][wip/aidylns/ttg-remove-hsunboundvar-via-hshole] Add Note [Holes in expressions], still need to solve TODOs wrt Hole notes. Message-ID: <66943345cb82c_29b57c41a3fc0103865@gitlab.mail> Adriaan Leijnse pushed to branch wip/aidylns/ttg-remove-hsunboundvar-via-hshole at Glasgow Haskell Compiler / GHC Commits: 6176837b by Adriaan Leijnse at 2024-07-14T21:20:36+01:00 Add Note [Holes in expressions], still need to solve TODOs wrt Hole notes. - - - - - 2 changed files: - compiler/GHC/Tc/Types/Constraint.hs - compiler/Language/Haskell/Syntax/Expr.hs Changes: ===================================== compiler/GHC/Tc/Types/Constraint.hs ===================================== @@ -672,7 +672,10 @@ type to an ill-kinded one. Note [Holes] ~~~~~~~~~~~~ -This Note explains how GHC tracks *holes*. + +-- TODO: rewrite this note wrt the existens of Note [Holes in expressions] in Language.Haskell.Syntax.Expr + +This Note explains how GHC tracks *holes* in the type checker. A hole represents one of two conditions: - A missing bit of an expression. Example: foo x = x + _ ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -563,8 +563,11 @@ data HsExpr p -- Used with RequiredTypeArguments, e.g. fn (type (Int -> Bool)) | HsEmbTy (XEmbTy p) (LHsWcType (NoGhcTc p)) - -- See Note [Holes]. Holes in types or expressions. + + -- | Holes in expressions. + -- See Note [Holes in Expressions]. | HsHole (XHole p) + | XExpr !(XXExpr p) -- Note [Trees That Grow] in Language.Haskell.Syntax.Extension for the -- general idea, and Note [Rebindable syntax and XXExprGhcRn] in GHC.Hs.Expr @@ -763,6 +766,83 @@ exactly what we want: treat [] as a datacon when -XNoOverloadedLists, and as an empty ExplicitList when -XOverloadedLists. See also #13680, which requested [] @Int to work. + +Note [Holes in expressions] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- TODO: de-duplicate wrt [Holes] in GHC.Tc.Types.Constraint, refer to this note +-- & both [Holes] at HsUnboundVarRn/Tc definitions. + +This Note explains how GHC tracks "holes" in expressions. It does not +deal with holes in types, and partial type signatures. + +A hole represents a missing bit of an expression. Example: + foo x = x && _ +GHC then emits a diagnostic, describing the bit that is left out: + Foo.hs:5:14: error: [GHC-88464] + • Found hole: _ :: Bool + • In the second argument of ‘(&&)’, namely ‘_’ + In the expression: x && _ + +The same mechanism is used to give diagnostics for out-of-scope +variables: + foo x = x && _ +gives diagnostic + Foo.hs:5:14: error: [GHC-88464] + Variable not in scope: y :: Bool + +Here is how holes are represented in expressions: + +* If the user wrote "_": + Parser HsHole + Renamer XExpr (HsUnboundVarRn "_") + Typechecker XExpr (HsUnboundVarTc ref "_") + +* If the user wrote "x", where `x` is not in scope + Parser HsVar "x" + Renamer XExpr (HsUnboundVarRn "x") + Typechecker XExpr (HsUnboundVarTc ref "x") + +In both cases (ref::HoleExprRef) contains + - The type of the hole. + - A ref-cell that is filled in (by the typechecker) with an + error thunk. With -fdefer-type errors we use this as the + value of the hole. + - A Unique (see Note [Uniques and Tags]). + +Typechecking holes + +* When the typechecker encounters a `HsUnboundVarRn`, it returns + a `HsUnboundVarTc`, but also emits a `DelayedError` into the `WantedConstraints`. + +* This DelayedError later triggers the error reporting, and the filling-in of + the error thunk, in GHC.Tc.Errors. + +* The user has the option of deferring errors until runtime with + `-fdefer-type-errors`. In this case, the hole carries evidence in its + `HoleExprRef`; is an erroring expression that prints an error and crashes at + runtime. + +Desugaring holes + +* During desugaring, the `(HsExpr (HsUnboundVarTc ref "x"))` is desugared by + reading the ref-cell to find the error thunk evidence term, put there by the + constraint solver. + +Wrinkles: + +* Prior to fixing #17812, we used to invent an Id to hold the erroring + expression, and then bind it during type-checking. But this does not support + representation-polymorphic out-of-scope identifiers. See + typecheck/should_compile/T17812. We thus use the mutable-CoreExpr approach + described above. + +* You might think that the type in the HoleExprRef is the same as the type of the + hole. However, because the hole type (hole_ty) is rewritten with respect to + givens, this might not be the case. That is, the hole_ty is always (~) to the + type of the HoleExprRef, but they might not be `eqType`. We need the type of the generated + evidence to match what is expected in the context of the hole, and so we must + store these types separately. -} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6176837b243ccf2189a44cee07ace28c84c61a3e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6176837b243ccf2189a44cee07ace28c84c61a3e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 08:46:27 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 04:46:27 -0400 Subject: [Git][ghc/ghc][wip/refactor_ci_groups] 17 commits: Improve docs for NondecreasingIndentation Message-ID: <6694e1e3accdc_309ef33021e3c29997@gitlab.mail> Matthew Pickering pushed to branch wip/refactor_ci_groups at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - bf0f4603 by Matthew Pickering at 2024-07-15T09:45:38+01:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - docs/users_guide/bugs.rst - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/17429c6c472f229e2b1a7523f49eacc2e3250512...bf0f4603a417640f9df4f8f1696bc0f574b7e16e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/17429c6c472f229e2b1a7523f49eacc2e3250512...bf0f4603a417640f9df4f8f1696bc0f574b7e16e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 08:56:51 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Mon, 15 Jul 2024 04:56:51 -0400 Subject: [Git][ghc/ghc][wip/haddock-iface-fixes] haddock: Keep track of instance source locations in `InstalledInterface` and use this to add Message-ID: <6694e453365f9_309ef3322dbcc319be@gitlab.mail> Zubin pushed to branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC Commits: e543027d by Zubin Duggal at 2024-07-15T14:24:19+05:30 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 5 changed files: - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -433,16 +433,17 @@ render dflags parserOpts logger unit_state flags sinceQual qual ifaces packages = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap + pkgSrcLMap = Map.map (hypSrcModuleUrlToLineFormat . hypSrcPkgUrlToModuleFormat) + $ Map.mapKeys moduleUnit extSrcMap -- These urls have a template for the module %M and the line %L - -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey - = Map.singleton k hypSrcModuleLineUrlFormat + = Map.insert k hypSrcModuleLineUrlFormat pkgSrcLMap | Just path <- srcLEntity , Just k <- pkgKey - = Map.singleton k path - | otherwise = Map.empty + = Map.insert k path pkgSrcLMap + | otherwise = pkgSrcLMap sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs ===================================== @@ -14,6 +14,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleNameUrlFormat , hypSrcModuleLineUrlFormat , hypSrcModuleUrlToNameFormat + , hypSrcModuleUrlToLineFormat , hypSrcPkgUrlToModuleFormat , spliceURL , spliceURL' @@ -86,6 +87,9 @@ hypSrcModuleLineUrlFormat = hypSrcModuleUrlFormat ++ "#" ++ lineFormat hypSrcModuleUrlToNameFormat :: String -> String hypSrcModuleUrlToNameFormat url = url ++ "#" ++ nameFormat +hypSrcModuleUrlToLineFormat :: String -> String +hypSrcModuleUrlToLineFormat url = url ++ "#" ++ lineFormat + hypSrcPkgUrlToModuleFormat :: String -> String hypSrcPkgUrlToModuleFormat url = url moduleFormat ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -143,10 +143,11 @@ attachInstances expInfo ifaces instIfaceMap isOneShot = do attach (cls_insts, fam_insts, inst_map) iface = do let getInstDoc = findInstDoc iface ifaceMap instIfaceMap getFixity = findFixity iface ifaceMap instIfaceMap + getInstLocIface name = Map.lookup name . instInstanceLocMap =<< Map.lookup (nameModule name) instIfaceMap newItems <- mapM - (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity) + (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity getInstLocIface) (ifaceExportItems iface) let orphanInstances = attachOrphanInstances expInfo getInstDoc (ifaceInstances iface) fam_insts return $ @@ -184,9 +185,11 @@ attachToExportItem -- ^ how to lookup the doc of an instance -> (Name -> Maybe Fixity) -- ^ how to lookup a fixity + -> (Name -> Maybe RealSrcSpan) + -- ^ how to lookup definition spans for instances -> ExportItem GhcRn -> Ghc (ExportItem GhcRn) -attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export = +attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity getInstLocIface export = case attachFixities export of ExportDecl e@(ExportD{expDDecl = L eSpan (TyClD _ d)}) -> do insts <- @@ -267,12 +270,17 @@ attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export -- spanName: attach the location to the name that is the same file as the instance location spanName s (InstHead{ihdClsName = clsn}) (L instL instn) = - let s1 = getSrcSpan s + let s1 = let orig_span = getSrcSpan s + in if isGoodSrcSpan orig_span + then orig_span + else case getInstLocIface s of + Nothing -> orig_span + Just rs -> RealSrcSpan rs mempty sn = if srcSpanFileName_maybe s1 == srcSpanFileName_maybe instL then instn else clsn - in L (getSrcSpan s) sn + in L s1 sn -- spanName on Either spanNameE s (Left e) _ = L (getSrcSpan s) (Left e) spanNameE s (Right ok) linst = ===================================== utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs ===================================== @@ -36,6 +36,7 @@ module Haddock.InterfaceFile , binaryInterfaceVersionCompatibility ) where +import Data.Coerce (coerce) import Data.Function ((&)) import Data.IORef import Data.Map (Map) @@ -367,6 +368,7 @@ instance Binary InstalledInterface where opts fixMap warnMap + locMap ) = do put_ bh modu put_ bh is_sig @@ -378,6 +380,7 @@ instance Binary InstalledInterface where put_ bh opts put_ bh fixMap put_ bh warnMap + put_ bh (coerce @_ @(Map Name BinSpan) locMap) get bh = do modu <- get bh @@ -390,6 +393,7 @@ instance Binary InstalledInterface where opts <- get bh fixMap <- get bh warnMap <- get bh + locMap <- get bh return ( InstalledInterface modu @@ -403,6 +407,7 @@ instance Binary InstalledInterface where opts fixMap warnMap + (coerce @(Map Name BinSpan) locMap) ) instance Binary DocOption where ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -48,16 +48,18 @@ import Control.Monad.Catch import Control.Monad.State.Strict import Data.Data (Data) import Data.Map (Map) +import qualified Data.Map as Map import qualified Data.Set as Set import GHC import qualified GHC.Data.Strict as Strict import GHC.Driver.Session (Language) import qualified GHC.LanguageExtensions as LangExt +import GHC.Core.InstEnv (is_dfun_name) import GHC.Types.Fixity (Fixity (..)) import GHC.Types.Name (stableNameCmp) import GHC.Types.Name.Occurrence import GHC.Types.Name.Reader (RdrName (..)) -import GHC.Types.SrcLoc (BufPos (..), BufSpan (..)) +import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan) import GHC.Types.Var (Specificity) import GHC.Utils.Outputable @@ -167,6 +169,7 @@ data InstalledInterface = InstalledInterface -- ^ Haddock options for this module (prune, ignore-exports, etc). , instFixMap :: Map Name Fixity , instWarningMap :: WarningMap + , instInstanceLocMap :: Map Name RealSrcSpan } -- | Convert an 'Interface' to an 'InstalledInterface' @@ -184,6 +187,7 @@ toInstalledIface interface = , instFixMap = interface.ifaceFixMap , instDefMeths = interface.ifaceDefMeths , instWarningMap = interface.ifaceWarningMap + , instInstanceLocMap = Map.fromList [(inst_name, loc) | i <- interface.ifaceInstances, let inst_name = is_dfun_name i, Just loc <- [srcSpanToRealSrcSpan (nameSrcSpan inst_name)]] } -- | A monad in which we create Haddock interfaces. Not to be confused with View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e543027da1ec3e4471f222afd6349063d8760d53 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e543027da1ec3e4471f222afd6349063d8760d53 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 09:10:50 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Mon, 15 Jul 2024 05:10:50 -0400 Subject: [Git][ghc/ghc][wip/haddock-iface-fixes] 18 commits: Improve docs for NondecreasingIndentation Message-ID: <6694e79aef7e0_309ef334f7e983739d@gitlab.mail> Zubin pushed to branch wip/haddock-iface-fixes at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 32e17342 by Zubin Duggal at 2024-07-15T09:10:45+00:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - 97d7a2bb by Zubin Duggal at 2024-07-15T09:10:45+00:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/SrcLoc.hs - docs/users_guide/bugs.rst - hadrian/bootstrap/bootstrap.py - hadrian/bootstrap/generate_bootstrap_plans - hadrian/bootstrap/hadrian-bootstrap-gen.cabal The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e543027da1ec3e4471f222afd6349063d8760d53...97d7a2bbc33073954d6bfc803b620846f3a4193f -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e543027da1ec3e4471f222afd6349063d8760d53...97d7a2bbc33073954d6bfc803b620846f3a4193f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 09:30:41 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 05:30:41 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Testsuite: use py-cpuinfo to compute CPU features Message-ID: <6694ec4166e6a_3a46a52044a0132f3@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 6afdc244 by sheaf at 2024-07-15T05:30:19-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 1a08e69c by Zubin Duggal at 2024-07-15T05:30:22-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 30 changed files: - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Types/CompleteMatch.hs - compiler/GHC/Types/GREInfo.hs - compiler/GHC/Types/Name/Reader.hs - compiler/GHC/Types/TyThing.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d03c7c1805f6b4268047a6f020fbfb280280f5d4...1a08e69c97d3bfb07c17b4fe5249c80dd085f70d -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d03c7c1805f6b4268047a6f020fbfb280280f5d4...1a08e69c97d3bfb07c17b4fe5249c80dd085f70d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 12:05:50 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 08:05:50 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 3 commits: Fix tests Message-ID: <6695109e75447_3a46a5153bbe032843@gitlab.mail> Matthew Pickering pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 62bad3b2 by Matthew Pickering at 2024-07-12T16:41:57+01:00 Fix tests - - - - - d02420d0 by Matthew Pickering at 2024-07-15T11:00:46+01:00 undo - - - - - a1eaee52 by Matthew Pickering at 2024-07-15T11:12:09+01:00 undo - - - - - 29 changed files: - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/BlockId.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/CommonBlockElim.hs - compiler/GHC/Cmm/ContFlowOpt.hs - compiler/GHC/Cmm/Dataflow.hs - compiler/GHC/Cmm/Dataflow/Graph.hs - compiler/GHC/Cmm/Dataflow/Label.hs - − compiler/GHC/Cmm/Dataflow/Label/NonDet.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Dominators.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Pipeline.hs - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reducibility.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/ThreadSanitizer.hs - compiler/GHC/Cmm/UniqueRenamer.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7df9ddc856e8dea21d6fde607e7f1acc7c8a0f38...a1eaee52f5ef7229abcf136e5fd33189cadc82f6 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7df9ddc856e8dea21d6fde607e7f1acc7c8a0f38...a1eaee52f5ef7229abcf136e5fd33189cadc82f6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 12:31:11 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 08:31:11 -0400 Subject: [Git][ghc/ghc][master] isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <6695168feb649_3a46a51ae6db043014@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 30 changed files: - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Types/CompleteMatch.hs - compiler/GHC/Types/GREInfo.hs - compiler/GHC/Types/Name/Reader.hs - compiler/GHC/Types/TyThing.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/572fbc4458106d81c9fc1ef253db883d830de0f5 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/572fbc4458106d81c9fc1ef253db883d830de0f5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 12:31:51 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 08:31:51 -0400 Subject: [Git][ghc/ghc][master] haddock: Handle non-hs files, so that haddock can generate documentation for modules with Message-ID: <669516b770949_3a46a51c75c6c4833f@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 7 changed files: - testsuite/tests/haddock/haddock_testsuite/Makefile - testsuite/tests/haddock/haddock_testsuite/all.T - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/A.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/B.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/F.hs - + testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/arith.c - utils/haddock/haddock-api/src/Haddock/Interface.hs Changes: ===================================== testsuite/tests/haddock/haddock_testsuite/Makefile ===================================== @@ -72,3 +72,7 @@ hypsrcTest: $(ACCEPT) \ --ghc-path='$(TEST_HC)' \ --haddock-path='$(HADDOCK)' \ + +.PHONY: haddockForeignTest +haddockForeignTest: + '$(HADDOCK)' A.hs B.hs F.hs arith.c ===================================== testsuite/tests/haddock/haddock_testsuite/all.T ===================================== @@ -19,3 +19,8 @@ test('haddockHypsrcTest', [ignore_stdout, ignore_stderr, req_haddock], makefile_test, ['hypsrcTest ' + accept]) + +test('haddockForeignTest', + [ignore_stdout, ignore_stderr, req_haddock, extra_files(['./haddock-th-foreign-repro/A.hs', './haddock-th-foreign-repro/B.hs', './haddock-th-foreign-repro/F.hs', './haddock-th-foreign-repro/arith.c'])], + makefile_test, + ['haddockForeignTest']) ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/A.hs ===================================== @@ -0,0 +1,8 @@ +module A where + +import Language.Haskell.TH +import F + + +foo :: Exp +foo = LitE (StringL "foo") ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/B.hs ===================================== @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +module B where + +import A + +$([d| bar = $(return foo) |]) ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/F.hs ===================================== @@ -0,0 +1,4 @@ +{-# LANGUAGE ForeignFunctionInterface #-} +module F where + +foreign import ccall "some_c_function" c_some_c_function :: IO () ===================================== testsuite/tests/haddock/haddock_testsuite/haddock-th-foreign-repro/arith.c ===================================== @@ -0,0 +1 @@ +void some_c_function(void) {} ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE TupleSections #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface @@ -58,6 +59,8 @@ import GHC.Core.InstEnv import qualified GHC.Driver.DynFlags as DynFlags import qualified GHC.Utils.Outputable as Outputable import GHC.Driver.Session hiding (verbosity) +import GHC.Driver.Phases +import GHC.Driver.Pipeline (compileFile) import GHC.HsToCore.Docs (getMainDeclBinder) import GHC.Iface.Load (loadSysInterface) import GHC.IfaceToCore (tcIfaceInst, tcIfaceFamInst) @@ -73,6 +76,7 @@ import GHC.Unit.Module.ModIface (mi_semantic_module, mi_boot) import GHC.Unit.Module.ModSummary (isBootSummary) import GHC.Utils.Outputable (Outputable, (<+>), pprModuleName, text) import GHC.Utils.Error (withTiming) +import GHC.Utils.Monad (mapMaybeM) #if defined(mingw32_HOST_OS) import System.IO @@ -165,7 +169,15 @@ createIfaces -> Ghc [Interface] -- ^ Resulting interfaces createIfaces verbosity modules flags instIfaceMap = do - targets <- mapM (\filePath -> guessTarget filePath Nothing Nothing) modules + let (hs_srcs, non_hs_srcs) = List.partition isHaskellishTarget $ map (,Nothing) modules + hsc_env <- getSession + o_files <- mapMaybeM (\x -> liftIO $ compileFile hsc_env NoStop x) + non_hs_srcs + dflags <- getSessionDynFlags + let dflags' = dflags { ldInputs = map (FileOption "") o_files + ++ ldInputs dflags } + _ <- setSessionDynFlags dflags' + targets <- mapM (\(filePath, _) -> guessTarget filePath Nothing Nothing) hs_srcs setTargets targets (_errs, modGraph) <- depanalE [] False View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84dadea9df46f11e2847a324d8c3ae0af936f5fd -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84dadea9df46f11e2847a324d8c3ae0af936f5fd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 12:56:38 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 08:56:38 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/deb10-migration Message-ID: <66951c8628f35_3a46a520f1b60571f5@gitlab.mail> Matthew Pickering pushed new branch wip/deb10-migration at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/deb10-migration You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 12:59:22 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 08:59:22 -0400 Subject: [Git][ghc/ghc][wip/deb10-migration] ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <66951d2a44ec3_3a46a521af534592c@gitlab.mail> Matthew Pickering pushed to branch wip/deb10-migration at Glasgow Haskell Compiler / GHC Commits: 723d628c by Matthew Pickering at 2024-07-15T13:58:50+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 5 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 3e47825761c87506a12d4897fe251f2d9a4a3d12 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/723d628c967f2f8932b94a2200dcbad7ffd96e5a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/723d628c967f2f8932b94a2200dcbad7ffd96e5a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 13:02:29 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 09:02:29 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <66951de53f83c_3a46a522c92a8609cf@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 6ceb6824 by Zubin Duggal at 2024-07-15T09:02:24-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b22c3f95 by Zubin Duggal at 2024-07-15T09:02:24-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - be9c116f by Matthew Pickering at 2024-07-15T09:02:24-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Utils/Monad.hs - compiler/GHC/Types/CompleteMatch.hs - compiler/GHC/Types/GREInfo.hs - compiler/GHC/Types/Name/Reader.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1a08e69c97d3bfb07c17b4fe5249c80dd085f70d...be9c116f88f0d6e66bf7901da8a5329f491d69cb -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1a08e69c97d3bfb07c17b4fe5249c80dd085f70d...be9c116f88f0d6e66bf7901da8a5329f491d69cb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 13:18:44 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 15 Jul 2024 09:18:44 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 19 commits: Improve docs for NondecreasingIndentation Message-ID: <669521b470f75_3a46a526311ac666a4@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0115a150 by Apoorv Ingle at 2024-07-15T08:12:11-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/65d08ae5badb849c5e9774e9045dbc34a472534c...0115a150c1615712f408b3ab24367cc16d9029d9 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/65d08ae5badb849c5e9774e9045dbc34a472534c...0115a150c1615712f408b3ab24367cc16d9029d9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 13:44:49 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 09:44:49 -0400 Subject: [Git][ghc/ghc][wip/deb10-migration] ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <669527d1d57f5_3a46a52af86a46791e@gitlab.mail> Matthew Pickering pushed to branch wip/deb10-migration at Glasgow Haskell Compiler / GHC Commits: 5c0379d5 by Matthew Pickering at 2024-07-15T14:44:19+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 5 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 3e47825761c87506a12d4897fe251f2d9a4a3d12 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = @@ -1151,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5c0379d53377a89dd3cc597a8174e9c55f41ede6 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5c0379d53377a89dd3cc597a8174e9c55f41ede6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 14:19:20 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 15 Jul 2024 10:19:20 -0400 Subject: [Git][ghc/ghc][wip/andreask/aarch64_reg_graph] 28 commits: AArch64: Simplify stmtToInstrs type Message-ID: <66952fe81a913_3a46a52fde09c7264@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/aarch64_reg_graph at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - d6b31835 by Andreas Klebinger at 2024-07-15T16:13:44+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/222c6336f1517e1650721b940339e2e90129acc1...d6b318359d603d00c1738f29d696d234a3ce7c97 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/222c6336f1517e1650721b940339e2e90129acc1...d6b318359d603d00c1738f29d696d234a3ce7c97 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 14:55:03 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 15 Jul 2024 10:55:03 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Make ApplicativeDo work with HsExpansions Message-ID: <66953847c8233_3a46a535f052076583@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 8b41cec3 by Apoorv Ingle at 2024-07-15T09:19:57-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 28 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -475,9 +475,12 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) +-- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ Optional statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -490,8 +493,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded + -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +521,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_doTcApp = doTcApp}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour -- ^ source statement do flavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and --- expanded expression an associate with a provided location +-- expanded expression and associate it with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +607,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +855,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +902,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1013,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1065,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1585,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1626,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1686,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,7 +1708,7 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the @@ -1733,7 +1749,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1768,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1814,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1834,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1862,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -194,8 +194,8 @@ but several have a little bit of special treatment: (return (f x)))) See Note [Expanding HsDo with XXExprGhcRn] in `Ghc.Tc.Gen.Do` for more details. - To understand why is this done in the typechecker and not in the renamer. - See Note [Doing XXExprGhcRn in the Renamer vs Typechecker] + To understand why is this done in the typechecker and not in the renamer + see Note [Doing XXExprGhcRn in the Renamer vs Typechecker] Note [Overloaded labels] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1964,15 +1964,10 @@ ApplicativeDo touches a few phases in the compiler: don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match - -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -2222,12 +2217,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -649,10 +649,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -845,6 +845,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; return (mkScaled mult_ty arg_nu) } + -- Is the argument supposed to instantiate a forall? -- -- In other words, given a function application `fn arg`, @@ -897,23 +898,29 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of - VACall fun arg_no _ | not in_generated_code + VACall{} + | XExpr (ExpandedThingRn o _ _) <- arg + , isHsThingRnStmt o || isHsThingRnPat o + -> thing_inside + + VACall fun arg_no _ + | not in_generated_code -> do setSrcSpanA arg_loc $ addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1051,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2259,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType @@ -52,66 +52,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav False expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -120,29 +107,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr doFlavour Nothing pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -162,12 +149,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -183,35 +170,115 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (((body <$> e1) <*> e2) ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) + , is_body_stmt = is_body_stmt + }) = + do let xx_expr = mkExpandedStmtAt addPop rhs_loc stmt doFlavour False rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = rebuild_stmt is_body_stmt rhs_loc rhs pat + do_arg (ApplicativeArgMany _ stmts ret@(L ret_loc _) pat ctxt) = + do { xx_expr <- expand_do_stmts False ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret] + ; traceTc "do_arg" (text "ManyArg" <+> vcat [ppr stmts, text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + + + rebuild_stmt is_body_stmt rhs_loc rhs pat = if is_body_stmt + then (L rhs_loc (BodyStmt NoExtField (L rhs_loc rhs) NoSyntaxExprRn NoSyntaxExprRn)) + else (L rhs_loc (BindStmt xbsn pat (L rhs_loc rhs))) + xbsn :: XBindStmtRn + xbsn = XBindStmtRn NoSyntaxExprRn Nothing + + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM - ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) pat + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> wrapGenSpan (mkExpandedStmt s doFlav False + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -219,22 +286,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -303,12 +370,29 @@ They capture the essence of statement expansions as implemented in `expand_do_st (5) DO【 s 】 = s + (4) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [ApplicativeDo] in GHC.Rename.Expr (dsDo) + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (7) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,32 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty + | OrigStmt ls@(L loc s at LetStmt{}) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc s) flav <- o + , not doTcApp + = setSrcSpanA loc $ + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty + + | OrigStmt ls@(L loc _) flav <- o + , doTcApp + = setSrcSpanA loc $ + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,25 +325,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise + go (XExpr (ExpandedThingRn o e _)) ctxt args = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,17 +555,20 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = + do traceTc "addHeadCtxt stmt" (ppr stmt) + setSrcSpanA loc $ + addStmtCtxt stmt flav $ thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt fun_loc" (ppr fun_ctxt) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just stmt)) _ _ -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1252,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1267,8 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L l e)) -> popErrCtxt $ setSrcSpanA l $ addExprCtxt e $ thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -77,7 +77,6 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -352,22 +351,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -998,18 +989,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1065,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,22 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In a stmt of a 'do' block: return $ MkT fa - In the expression: - do return () - MkT fa <- runf - return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,11 +63,17 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) + • In a stmt of a 'do' block: x4 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -67,11 +81,20 @@ ado002.hs:24:11: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +102,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8b41cec365c19792007b0334d1b52ee4146946d1 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8b41cec365c19792007b0334d1b52ee4146946d1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 15:20:49 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 11:20:49 -0400 Subject: [Git][ghc/ghc][wip/deb10-migration] ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <66953e4fab6b7_3a46a539fca38797bd@gitlab.mail> Matthew Pickering pushed to branch wip/deb10-migration at Glasgow Haskell Compiler / GHC Commits: da4474bf by Matthew Pickering at 2024-07-15T16:16:14+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 5 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: fbd0bdef751930d962cd3de605cfcc9d267cfbb4 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = @@ -1151,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da4474bfe93b22e41321cb4d44afae1e7186a39a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/da4474bfe93b22e41321cb4d44afae1e7186a39a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 15:22:50 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 15 Jul 2024 11:22:50 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/find_so Message-ID: <66953ecaca0ab_3a46a53b3d9108011d@gitlab.mail> Matthew Pickering pushed new branch wip/find_so at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/find_so You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 16:13:08 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 12:13:08 -0400 Subject: [Git][ghc/ghc][master] 2 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <66954a94198c0_1303a27a288029289@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 7 changed files: - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -438,16 +438,17 @@ render dflags languagesAndExtensions parserOpts logger unit_state flags sinceQua = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap + pkgSrcLMap = Map.map (hypSrcModuleUrlToLineFormat . hypSrcPkgUrlToModuleFormat) + $ Map.mapKeys moduleUnit extSrcMap -- These urls have a template for the module %M and the line %L - -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey - = Map.singleton k hypSrcModuleLineUrlFormat + = Map.insert k hypSrcModuleLineUrlFormat pkgSrcLMap | Just path <- srcLEntity , Just k <- pkgKey - = Map.singleton k path - | otherwise = Map.empty + = Map.insert k path pkgSrcLMap + | otherwise = pkgSrcLMap sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs ===================================== @@ -14,6 +14,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleNameUrlFormat , hypSrcModuleLineUrlFormat , hypSrcModuleUrlToNameFormat + , hypSrcModuleUrlToLineFormat , hypSrcPkgUrlToModuleFormat , spliceURL , spliceURL' @@ -86,6 +87,9 @@ hypSrcModuleLineUrlFormat = hypSrcModuleUrlFormat ++ "#" ++ lineFormat hypSrcModuleUrlToNameFormat :: String -> String hypSrcModuleUrlToNameFormat url = url ++ "#" ++ nameFormat +hypSrcModuleUrlToLineFormat :: String -> String +hypSrcModuleUrlToLineFormat url = url ++ "#" ++ lineFormat + hypSrcPkgUrlToModuleFormat :: String -> String hypSrcPkgUrlToModuleFormat url = url moduleFormat ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -240,25 +240,28 @@ createIfaces verbosity modules flags instIfaceMap = do -- Visit modules in that order sortedMods = concatMap go $ topSortModuleGraph False modGraph Nothing out verbosity normal "Haddock coverage:" - (ifaces, _) <- foldM f ([], Map.empty) sortedMods + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) + (ifaces, _, _) <- foldM f ([], Map.empty, inst_warning_map) sortedMods return (reverse ifaces) where - f (ifaces, ifaceMap) modSummary = do + f (ifaces, ifaceMap, warningMap) modSummary = do x <- {-# SCC processModule #-} withTimingM "processModule" (const ()) $ do - processModule verbosity modSummary flags ifaceMap instIfaceMap + processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap return $ case x of Just iface -> ( iface:ifaces - , Map.insert (ifaceMod iface) iface ifaceMap ) + , Map.insert (ifaceMod iface) iface ifaceMap + , Map.union (ifaceWarningMap iface) warningMap) Nothing -> ( ifaces - , ifaceMap ) -- Boot modules don't generate ifaces. + , ifaceMap + , warningMap ) -- Boot modules don't generate ifaces. dropErr :: MaybeErr e a -> Maybe a dropErr (Succeeded a) = Just a dropErr (Failed _) = Nothing -processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface) -processModule verbosity modSummary flags ifaceMap instIfaceMap = do +processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> WarningMap -> Ghc (Maybe Interface) +processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modSummary) ++ "..." hsc_env <- getSession @@ -281,7 +284,7 @@ processModule verbosity modSummary flags ifaceMap instIfaceMap = do {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts + createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts warningMap let (haddockable, haddocked) = @@ -387,13 +390,13 @@ createOneShotIface verbosity flags instIfaceMap moduleNameStr = do let hieFilePath = case res of Found ml _ -> ml_hie_file ml _ -> throwE "createOneShotIface: module not found" - + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) !interface <- do logger <- getLogger {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts + createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts inst_warning_map pure [interface] ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -143,10 +143,11 @@ attachInstances expInfo ifaces instIfaceMap isOneShot = do attach (cls_insts, fam_insts, inst_map) iface = do let getInstDoc = findInstDoc iface ifaceMap instIfaceMap getFixity = findFixity iface ifaceMap instIfaceMap + getInstLocIface name = Map.lookup name . instInstanceLocMap =<< Map.lookup (nameModule name) instIfaceMap newItems <- mapM - (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity) + (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity getInstLocIface) (ifaceExportItems iface) let orphanInstances = attachOrphanInstances expInfo getInstDoc (ifaceInstances iface) fam_insts return $ @@ -184,9 +185,11 @@ attachToExportItem -- ^ how to lookup the doc of an instance -> (Name -> Maybe Fixity) -- ^ how to lookup a fixity + -> (Name -> Maybe RealSrcSpan) + -- ^ how to lookup definition spans for instances -> ExportItem GhcRn -> Ghc (ExportItem GhcRn) -attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export = +attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity getInstLocIface export = case attachFixities export of ExportDecl e@(ExportD{expDDecl = L eSpan (TyClD _ d)}) -> do insts <- @@ -267,12 +270,17 @@ attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export -- spanName: attach the location to the name that is the same file as the instance location spanName s (InstHead{ihdClsName = clsn}) (L instL instn) = - let s1 = getSrcSpan s + let s1 = let orig_span = getSrcSpan s + in if isGoodSrcSpan orig_span + then orig_span + else case getInstLocIface s of + Nothing -> orig_span + Just rs -> RealSrcSpan rs mempty sn = if srcSpanFileName_maybe s1 == srcSpanFileName_maybe instL then instn else clsn - in L (getSrcSpan s) sn + in L s1 sn -- spanName on Either spanNameE s (Left e) _ = L (getSrcSpan s) (Left e) spanNameE s (Right ok) linst = ===================================== utils/haddock/haddock-api/src/Haddock/Interface/Create.hs ===================================== @@ -83,8 +83,9 @@ createInterface1 -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = +createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = let ModSummary { -- Cached flags from OPTIONS, INCLUDE and LANGUAGE @@ -94,7 +95,7 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance , ms_location = modl } = mod_sum in - createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) + createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings createInterface1' :: MonadIO m @@ -106,8 +107,9 @@ createInterface1' -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) = do +createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = do let sDocContext = DynFlags.initSDocContext dflags Outputable.defaultUserStyle mLanguage = language dflags @@ -205,7 +207,7 @@ createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces let -- Warnings in this module and transitive warnings from dependent modules transitiveWarnings :: Map Name (Doc Name) - transitiveWarnings = Map.unions (warningMap : map ifaceWarningMap (Map.elems ifaces)) + transitiveWarnings = Map.union warningMap depWarnings export_items <- mkExportItems ===================================== utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs ===================================== @@ -36,6 +36,7 @@ module Haddock.InterfaceFile , binaryInterfaceVersionCompatibility ) where +import Data.Coerce (coerce) import Data.Function ((&)) import Data.IORef import Data.Map (Map) @@ -366,6 +367,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) = do put_ bh modu put_ bh is_sig @@ -376,6 +379,8 @@ instance Binary InstalledInterface where put_ bh visExps put_ bh opts put_ bh fixMap + put_ bh warnMap + put_ bh (coerce @_ @(Map Name BinSpan) locMap) get bh = do modu <- get bh @@ -387,6 +392,8 @@ instance Binary InstalledInterface where visExps <- get bh opts <- get bh fixMap <- get bh + warnMap <- get bh + locMap <- get bh return ( InstalledInterface modu @@ -399,6 +406,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + (coerce @(Map Name BinSpan) locMap) ) instance Binary DocOption where ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -48,16 +48,18 @@ import Control.Monad.Catch import Control.Monad.State.Strict import Data.Data (Data) import Data.Map (Map) +import qualified Data.Map as Map import qualified Data.Set as Set import GHC import qualified GHC.Data.Strict as Strict import GHC.Driver.Session (Language) import qualified GHC.LanguageExtensions as LangExt +import GHC.Core.InstEnv (is_dfun_name) import GHC.Types.Fixity (Fixity (..)) import GHC.Types.Name (stableNameCmp) import GHC.Types.Name.Occurrence import GHC.Types.Name.Reader (RdrName (..)) -import GHC.Types.SrcLoc (BufPos (..), BufSpan (..)) +import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan) import GHC.Types.Var (Specificity) import GHC.Utils.Outputable @@ -166,6 +168,8 @@ data InstalledInterface = InstalledInterface , instOptions :: [DocOption] -- ^ Haddock options for this module (prune, ignore-exports, etc). , instFixMap :: Map Name Fixity + , instWarningMap :: WarningMap + , instInstanceLocMap :: Map Name RealSrcSpan } -- | Convert an 'Interface' to an 'InstalledInterface' @@ -182,6 +186,8 @@ toInstalledIface interface = , instOptions = interface.ifaceOptions , instFixMap = interface.ifaceFixMap , instDefMeths = interface.ifaceDefMeths + , instWarningMap = interface.ifaceWarningMap + , instInstanceLocMap = Map.fromList [(inst_name, loc) | i <- interface.ifaceInstances, let inst_name = is_dfun_name i, Just loc <- [srcSpanToRealSrcSpan (nameSrcSpan inst_name)]] } -- | A monad in which we create Haddock interfaces. Not to be confused with View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/84dadea9df46f11e2847a324d8c3ae0af936f5fd...b8b4b212ba2721fecba6ddce3b274e6f7c59630e -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/84dadea9df46f11e2847a324d8c3ae0af936f5fd...b8b4b212ba2721fecba6ddce3b274e6f7c59630e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 16:13:39 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 15 Jul 2024 12:13:39 -0400 Subject: [Git][ghc/ghc][master] ci: Refactor job_groups definition, split up by platform Message-ID: <66954ab37e60a_1303a296870032246@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 1 changed file: - .gitlab/generate-ci/gen_ci.hs Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -975,83 +975,128 @@ flattenNamedJob (NamedJob n i) = (n, i) jobs :: Map String Job jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups -job_groups :: [JobGroup Job] -job_groups = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) - , disableValidate (standardBuilds Amd64 (Linux Ubuntu1804)) - , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004)) - , disableValidate (standardBuilds Amd64 (Linux Rocky8)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla)) - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. - , fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs - , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) - , disableValidate (standardBuilds Amd64 (Linux Fedora38)) - , fastCI (standardBuildsWithConfig Amd64 Windows vanilla) - , disableValidate (standardBuildsWithConfig Amd64 Windows nativeInt) - , addValidateRule TestPrimops (standardBuilds Amd64 Darwin) - , fastCI (standardBuilds AArch64 Darwin) - , fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) - , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) - , standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) - -- Fully static build, in theory usable on any linux distribution. - , fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) - -- Dynamically linked build, suitable for building your own static executables on alpine - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) - , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - - , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - - , make_wasm_jobs wasm_build_config - , modifyValidateJobs manual $ - make_wasm_jobs wasm_build_config {bignumBackend = Native} - , modifyValidateJobs manual $ - make_wasm_jobs wasm_build_config {unregisterised = True} - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) - ] +debian_x86 :: [JobGroup Job] +debian_x86 = + [ disableValidate (standardBuilds Amd64 (Linux Debian10)) + , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , validateBuilds Amd64 (Linux Debian10) nativeInt + , validateBuilds Amd64 (Linux Debian10) unreg + , fastCI (validateBuilds Amd64 (Linux Debian10) debug) + , -- More work is needed to address TSAN failures: #22520 + modifyNightlyJobs allowFailure + (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure + (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + ] + where + + tsan_jobs = + modifyJobs + ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + -- Haddock is large enough to make TSAN choke without massive quantities of + -- memory. + . addVariable "HADRIAN_ARGS" "--docs=none") $ + validateBuilds Amd64 (Linux Debian12) tsan +debian_aarch64 :: [JobGroup Job] +debian_aarch64 = + [ + fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) + ] + +debian_i386 :: [JobGroup Job] +debian_i386 = + [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + +ubuntu_x86 :: [JobGroup Job] +ubuntu_x86 = + [ disableValidate (standardBuilds Amd64 (Linux Ubuntu1804)) + , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004)) + ] + +rhel_x86 :: [JobGroup Job] +rhel_x86 = + [ disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Rocky8)) + ] + +fedora_x86 :: [JobGroup Job] +fedora_x86 = + [ + -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. + fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) + -- This job is only for generating head.hackage docs + , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Fedora38)) + ] where - javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) - { bignumBackend = Native } + hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") +windows_x86 :: [JobGroup Job] +windows_x86 = + [ fastCI (standardBuildsWithConfig Amd64 Windows vanilla) + , disableValidate (standardBuildsWithConfig Amd64 Windows nativeInt) + ] + +darwin :: [JobGroup Job] +darwin = + [ addValidateRule TestPrimops (standardBuilds Amd64 Darwin) + , fastCI (standardBuilds AArch64 Darwin) + ] + +alpine_x86 :: [JobGroup Job] +alpine_x86 = + [ -- Fully static build, in theory usable on any linux distribution. + fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) + , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) + -- Dynamically linked build, suitable for building your own static executables on alpine + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) + ] + where -- ghcilink002 broken due to #17869 -- -- linker_unload_native: due to musl not supporting any means of probing dynlib dependencies -- (see Note [Object unloading]). fullyStaticBrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "ghcilink002 linker_unload_native") - hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") +alpine_aarch64 :: [JobGroup Job] +alpine_aarch64 = [ + disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) + ] - tsan_jobs = - modifyJobs - ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" - -- Haddock is large enough to make TSAN choke without massive quantities of - -- memory. - . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan +cross_jobs :: [JobGroup Job] +cross_jobs = [ + -- x86 -> aarch64 + validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) + + -- Javascript + , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) + + -- Wasm + , make_wasm_jobs wasm_build_config + , modifyValidateJobs manual $ + make_wasm_jobs wasm_build_config {bignumBackend = Native} + , modifyValidateJobs manual $ + make_wasm_jobs wasm_build_config {unregisterised = True} + ] + where + javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) + { bignumBackend = Native } make_wasm_jobs cfg = modifyJobs @@ -1069,6 +1114,20 @@ job_groups = , textWithSIMDUTF = True } +job_groups :: [JobGroup Job] +job_groups = + debian_x86 + ++ debian_aarch64 + ++ debian_i386 + ++ fedora_x86 + ++ windows_x86 + ++ darwin + ++ ubuntu_x86 + ++ rhel_x86 + ++ alpine_x86 + ++ alpine_aarch64 + ++ cross_jobs + mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/559a7a7c866ec5156168d102c44b0890d75a1680 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/559a7a7c866ec5156168d102c44b0890d75a1680 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 16:49:26 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 15 Jul 2024 12:49:26 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T24984 Message-ID: <66955316a64b3_1303a2e301ac334f8@gitlab.mail> Simon Peyton Jones pushed new branch wip/T24984 at Glasgow Haskell Compiler / GHC -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T24984 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 15 23:23:42 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 15 Jul 2024 19:23:42 -0400 Subject: [Git][ghc/ghc][wip/T24984] Wibbles Message-ID: <6695af7e70f56_1303a23f6f1dc44283@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: a42d4cae by Simon Peyton Jones at 2024-07-16T00:23:21+01:00 Wibbles - - - - - 4 changed files: - compiler/GHC/Core/Predicate.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Utils/Misc.hs Changes: ===================================== compiler/GHC/Core/Predicate.hs ===================================== @@ -192,18 +192,12 @@ getEqPredRole :: PredType -> Role -- Precondition: the PredType is (s ~#N t) or (s ~#R t) getEqPredRole ty = eqRelRole (predTypeEqRel ty) --- | Get the equality relation relevant for a pred type. --- Precondition: the PredType is (s ~#N t) or (s ~#R t) +-- | Get the equality relation relevant for a pred type +-- Returns NomEq for dictionary predicates, etc predTypeEqRel :: HasDebugCallStack => PredType -> EqRel predTypeEqRel ty - = case splitTyConApp_maybe ty of - Just (tc, _) | tc `hasKey` eqReprPrimTyConKey - -> ReprEq - | otherwise - -> assertPpr (tc `hasKey` eqPrimTyConKey) (ppr ty) - NomEq - _ -> pprPanic "predTypeEqRel" (ppr ty) - + | isReprEqPrimPred ty = ReprEq + | otherwise = NomEq {------------------------------------------- Predicates on PredType ===================================== compiler/GHC/Tc/Solver/InertSet.hs ===================================== @@ -1554,8 +1554,8 @@ kickOutRewritableLHS ko_spec new_fr@(_, new_role) (tv_eqs_out, tv_eqs_in) = partitionInertEqs kick_out_eq tv_eqs (feqs_out, feqs_in) = partitionFunEqs kick_out_eq funeqmap - (dicts_out, dicts_in) = partitionDicts (kick_out_non_eq . CDictCan) dictmap - (irs_out, irs_in) = partitionBag (kick_out_non_eq . CIrredCan) irreds + (dicts_out, dicts_in) = partitionDicts kick_out_dict dictmap + (irs_out, irs_in) = partitionBag kick_out_irred irreds -- Kick out even insolubles: See Note [Rewrite insolubles] -- Of course we must kick out irreducibles like (c a), in case -- we can rewrite 'c' to something more useful @@ -1581,7 +1581,6 @@ kickOutRewritableLHS ko_spec new_fr@(_, new_role) lookOnlyUnderFamApps = True fr_tv_can_rewrite_ty :: UnderFam -> (TyVar -> Bool) -> EqRel -> Type -> Bool - -- UnderFam = True <=> look only under type-family applications fr_tv_can_rewrite_ty look_under_famapp_only check_tv role ty = anyRewritableTyVar role can_rewrite ty where @@ -1591,7 +1590,6 @@ kickOutRewritableLHS ko_spec new_fr@(_, new_role) new_role `eqCanRewrite` old_role && check_tv tv fr_tf_can_rewrite_ty :: UnderFam -> TyCon -> [TcType] -> EqRel -> Type -> Bool - -- UnderFam = True <=> look only under type-family applications fr_tf_can_rewrite_ty look_under_famapp_only new_tf new_tf_args role ty = anyRewritableTyFamApp role can_rewrite ty where @@ -1619,17 +1617,16 @@ kickOutRewritableLHS ko_spec new_fr@(_, new_role) -- Kick it out if the new CEqCan can rewrite the inert one -- See Note [kickOutRewritable] kick_out_dict (DictCt { di_tys = tys, di_ev = ev }) - = fr_may_rewrite fs + = fr_may_rewrite (ctEvFlavour ev, NomEq) && any (fr_can_rewrite_ty lookEverywhere NomEq) tys - where - fs = (ctEvFlavour ev, NomEq) kick_out_irred :: IrredCt -> Bool - kick_out_irred (IrredCt }{ - = fr_may_rewrite fs - && any (fr_can_rewrite_ty lookEverywhere NomEq) tys + kick_out_irred (IrredCt { ir_ev = ev }) + = fr_may_rewrite (ctEvFlavour ev, eq_rel) + && fr_can_rewrite_ty lookEverywhere eq_rel pred where - fs = (ctEvFlavour ev, NomEq) + pred = ctEvPred ev + eq_rel = predTypeEqRel pred -- Implements criteria K1-K3 in Note [Extending the inert equalities] kick_out_eq :: EqCt -> Bool ===================================== compiler/GHC/Tc/Types/Constraint.hs ===================================== @@ -225,7 +225,7 @@ data DictCt -- e.g. Num ty dictCtEvidence :: DictCt -> CtEvidence dictCtEvidence = di_ev -dictCtPred :: DictCt -> CtEvidence +dictCtPred :: DictCt -> TcPredType dictCtPred (DictCt { di_cls = cls, di_tys = tys }) = mkClassPred cls tys instance Outputable DictCt where @@ -2048,9 +2048,7 @@ ctEvRewriteEqRel :: CtEvidence -> EqRel -- ^ Return the rewrite-role of an abitrary CtEvidence -- See Note [The rewrite-role of a constraint] -- We return ReprEq for (a ~R# b) and NomEq for all other preds -ctEvRewriteEqRel ev - | isReprEqPrimPred (ctEvPred ev) = ReprEq - | otherwise = NomEq +ctEvRewriteEqRel = predTypeEqRel . ctEvPred ctEvTerm :: CtEvidence -> EvTerm ctEvTerm ev = EvExpr (ctEvExpr ev) ===================================== compiler/GHC/Utils/Misc.hs ===================================== @@ -649,13 +649,12 @@ all2 :: (a -> b -> Bool) -> [a] -> [b] -> Bool -- True if the lists are the same length, and -- all corresponding elements satisfy the predicate all2 _ [] [] = True - all2 p (x:xs) (y:ys) = p x y && all2 p xs ys all2 _ _ _ = False any2 :: (a -> b -> Bool) -> [a] -> [b] -> Bool -- True if any of the corresponding elements satisfy the predicate --- Unlike `any2`, this ignores excess elements of the other list +-- Unlike `all2`, this ignores excess elements of the other list any2 p (x:xs) (y:ys) = p x y || all2 p xs ys any2 _ _ _ = False View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a42d4cae4d583bd46aca73f876e0c6445c2834c4 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a42d4cae4d583bd46aca73f876e0c6445c2834c4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 05:53:07 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 01:53:07 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] 107 commits: base: Add inits1 and tails1 to Data.List Message-ID: <66960ac396000_1303a274a5b305044c@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 7b2337c1 by Brandon Chinn at 2024-07-14T09:55:33-07:00 Add MultilineStrings extension - - - - - 6401ec7f by Brandon Chinn at 2024-07-14T09:55:33-07:00 Add test cases for MultilineStrings - - - - - af3d2fcc by Brandon Chinn at 2024-07-14T09:55:33-07:00 Break out common lex_magic_hash logic for strings and chars - - - - - 563df04a by Brandon Chinn at 2024-07-14T09:55:33-07:00 Factor out string processing functions - - - - - 1515d3e3 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Implement MultilineStrings (#24390) Updates haddock submodule for new ITmultiline constructor - - - - - 848c9133 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Add docs for MultilineStrings - - - - - 43e081c9 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Address feedback - - - - - c9096320 by Brandon Chinn at 2024-07-15T18:40:27-07:00 Add string literal performance test - - - - - c5fc1002 by Brandon Chinn at 2024-07-15T18:40:27-07:00 Address feedback - - - - - 30617619 by Brandon Chinn at 2024-07-15T22:52:30-07:00 Reimplement with manual iteration - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b1f8004e71f7f83bb2b523e37991ca3f3341c50d...306176192b2d11bdf57e727191a7bec771098a68 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b1f8004e71f7f83bb2b523e37991ca3f3341c50d...306176192b2d11bdf57e727191a7bec771098a68 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 06:14:54 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 02:14:54 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Reimplement with manual iteration Message-ID: <66960fde7017f_1303a2780983052264@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: d74fab2a by Brandon Chinn at 2024-07-15T23:04:09-07:00 Reimplement with manual iteration - - - - - 2 changed files: - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/String.hs Changes: ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -2226,65 +2226,9 @@ lex_quoted_label span buf _len _buf2 = do lex_string :: LexStringType -> P String lex_string strType = do start <- getInput - case lexString [] start of - Right (lexedStr, next) -> do - setInput next - either fromStringLexError pure $ resolveLexedString strType lexedStr - Left (e, s, i) -> do - -- see if we can find a smart quote in the string we've found so far. - -- if the built-up string s contains a smart double quote character, it was - -- likely the reason why the string literal was not lexed correctly - case filter (\(LexedChar c _) -> isDoubleSmartQuote c) s of - LexedChar c (AI loc _) : _ -> add_nonfatal_smart_quote_error c loc - _ -> pure () - - -- regardless whether we found a smart quote, throw a lexical error - setInput i >> lexError e - where - -- Given the (reversed) string we've seen so far and the current location, - -- return Right with the fully lexed string and the subsequent location, - -- or Left with the string we've seen so far and the location where lexing - -- failed. - lexString acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - _ | Just i1 <- lexDelimiter i0 -> Right (acc, i1) - - Just (c0, i1) -> do - let acc1 = LexedChar c0 i0 : acc0 - case c0 of - '\\' -> do - case alexGetChar' i1 of - Just (c1, i2) - | is_space c1 -> lexStringGap acc0 i2 - | otherwise -> lexString (LexedChar c1 i1 : acc1) i2 - Nothing -> Left (LexStringCharLit, acc, i1) - _ | isAny c0 -> lexString acc1 i1 - _ | strType == StringTypeMulti && c0 `elem` ['\n', '\t'] -> lexString acc1 i1 - _ -> Left (LexStringCharLit, acc, i0) - - Nothing -> Left (LexStringCharLit, acc, i0) - - lexDelimiter i0 = - case strType of - StringTypeSingle -> do - ('"', i1) <- alexGetChar' i0 - Just i1 - StringTypeMulti -> do - ('"', i1) <- alexGetChar' i0 - ('"', i2) <- alexGetChar' i1 - ('"', i3) <- alexGetChar' i2 - Just i3 - - lexStringGap acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - Just (c0, i1) -> - case c0 of - '\\' -> lexString acc0 i1 - _ | is_space c0 -> lexStringGap acc0 i1 - _ -> Left (LexStringCharLit, acc, i0) - Nothing -> Left (LexStringCharLitEOF, acc, i0) + (str, next) <- either fromStringLexError pure $ lexString strType alexGetChar' start + setInput next + pure str lex_char_tok :: Action @@ -2305,13 +2249,9 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' return (L (mkPsSpan loc end2) ITtyQuote) Just ('\\', i2@(AI end2 _)) -> do -- We've seen 'backslash - (LexedChar lit_ch _, rest) <- + (lit_ch, i3) <- either fromStringLexError pure $ - resolveEscapeCharacter (LexedChar '\\' i1) (asLexedString i2) - i3 <- - case rest of - LexedChar _ i3 : _ -> pure i3 - [] -> lexError LexStringCharLitEOF + resolveEscapeCharacter alexGetChar' i2 case alexGetChar' i3 of Just ('\'', i4) -> do setInput i4 @@ -2320,7 +2260,7 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' _ -> lit_error i3 Just (c, i2@(AI end2 _)) - | not (isAny c) -> lit_error i1 + | not (isAnyChar c) -> lit_error i1 | otherwise -> -- We've seen 'x, where x is a valid character @@ -2371,24 +2311,19 @@ lex_magic_hash i = do _other -> pure Nothing else pure Nothing -isAny :: Char -> Bool -isAny c | c > '\x7f' = isPrint c - | otherwise = is_any c - --- | Returns a LexedString that, when iterated, lazily streams --- successive characters from the AlexInput. -asLexedString :: AlexInput -> LexedString AlexInput -asLexedString = unfoldr toLexedChar - where - toLexedChar i = - case alexGetChar' i of - Just (c, i') -> Just (LexedChar c i, i') - Nothing -> Nothing - fromStringLexError :: StringLexError AlexInput -> P a fromStringLexError = \case - SmartQuoteError c (AI loc _) -> add_smart_quote_error c loc - StringLexError _ i e -> setInput i >> lexError e + UnexpectedEOF i squote -> checkSQuote squote >> throw i LexStringCharLitEOF + BadCharInitialLex i squote -> checkSQuote squote >> throw i LexStringCharLit + EscapeBadChar i -> throw i LexStringCharLit + EscapeUnexpectedEOF i -> throw i LexStringCharLitEOF + EscapeNumRangeError i -> throw i LexNumEscapeRange + EscapeSmartQuoteError c (AI loc _) -> add_smart_quote_error c loc + where + throw i e = setInput i >> lexError e + checkSQuote = \case + NoSmartQuote -> pure () + SmartQuote c (AI loc _) -> add_nonfatal_smart_quote_error c loc -- before calling lit_error, ensure that the current input is pointing to -- the position of the error in the buffer. This is so that we can report @@ -2397,12 +2332,6 @@ fromStringLexError = \case lit_error :: AlexInput -> P a lit_error i = do setInput i; lexError LexStringCharLit -getCharOrFail :: AlexInput -> P Char -getCharOrFail i = do - case alexGetChar' i of - Nothing -> lexError LexStringCharLitEOF - Just (c,i) -> do setInput i; return c - -- ----------------------------------------------------------------------------- -- QuasiQuote ===================================== compiler/GHC/Parser/String.hs ===================================== @@ -1,170 +1,269 @@ {-# LANGUAGE LambdaCase #-} module GHC.Parser.String ( - LexedString, - LexedChar (..), StringLexError (..), + ContainsSmartQuote (..), LexStringType (..), - resolveLexedString, - resolveEscapeCharacter, + lexString, -- * Unicode smart quote helpers isDoubleSmartQuote, isSingleSmartQuote, + + -- * Other helpers + isAnyChar, + resolveEscapeCharacter, ) where import GHC.Prelude import Control.Arrow ((>>>)) -import Control.Monad (forM_, guard, unless, when, (>=>)) -import Data.Char (chr, isSpace, ord) -import qualified Data.Foldable1 as Foldable1 -import qualified Data.List.NonEmpty as NonEmpty -import Data.Maybe (listToMaybe, mapMaybe, maybeToList) +import Control.Monad (guard, unless, when) +import Data.Char (chr, isPrint, ord) +import Data.List (unfoldr) +import Data.Maybe (listToMaybe, mapMaybe) import GHC.Parser.CharClass ( hexDigit, + is_any, is_decdigit, is_hexdigit, is_octdigit, + is_space, octDecDigit, ) -import GHC.Parser.Errors.Types (LexErr (..)) import GHC.Utils.Panic (panic) -data LexStringType = StringTypeSingle | StringTypeMulti deriving (Eq) - -data LexedChar loc = LexedChar !Char !loc -type LexedString loc = [LexedChar loc] +data LexStringType = StringTypeSingle | StringTypeMulti -unLexedChar :: LexedChar loc -> Char -unLexedChar (LexedChar c _) = c +data LexStringState loc = LexStringState + { stringAcc :: !String + , multilineCommonWsPrefix :: !Int + , smartQuoteGetChar :: GetChar loc + , initialLoc :: !loc + } -unLexedString :: LexedString loc -> String -unLexedString = map unLexedChar +-- | Get the character at the given location, with the location +-- of the next character. Returns Nothing if at the end of the +-- input. +type GetChar loc = loc -> Maybe (Char, loc) -resolveLexedString :: - LexStringType -> - LexedString loc -> - Either (StringLexError loc) String -resolveLexedString strType = fmap unLexedString . processString +lexString :: LexStringType -> GetChar loc -> loc -> Either (StringLexError loc) (String, loc) +lexString strType getChar initialLoc = go initialState initialLoc where - processString = - case strType of - StringTypeSingle -> - resolveEscapeCharacters - StringTypeMulti -> - resolveMultilineString - >>> (\s -> checkInnerTabs s >> pure s) - >=> resolveEscapeCharacters - -data StringLexError loc - = SmartQuoteError !Char !loc - | StringLexError !Char !loc !LexErr - -collapseStringGaps :: LexedString loc -> LexedString loc -collapseStringGaps s0 = go s0 + initialState = + LexStringState + { stringAcc = "" + , multilineCommonWsPrefix = + case strType of + StringTypeMulti -> maxBound + _ -> 0 + , smartQuoteGetChar = getChar + , initialLoc = initialLoc + } + + go s loc0 = + case getChar loc0 of + -- found closing delimiter + Just ('"', _) | Just loc1 <- checkDelimiter strType getChar loc0 -> do + let postprocess = + case strType of + StringTypeSingle -> id + StringTypeMulti -> postprocessMultiline (multilineCommonWsPrefix s) + Right (postprocess . reverse $ stringAcc s, loc1) + + -- found backslash + Just (c0@'\\', loc1) -> do + case getChar loc1 of + -- found '\&' character, which should be elided + Just ('&', loc2) -> go s loc2 + -- found start of a string gap + Just (c1, loc2) | is_space c1 -> collapseStringGap getChar s loc2 >>= go s + -- some other escape character + Just (c1, loc2) -> + case strType of + StringTypeSingle -> do + (c', loc') <- resolveEscapeCharacter getChar loc1 + go (addChar c' s) loc' + StringTypeMulti -> do + -- keep escape characters unresolved until after post-processing, + -- to distinguish between a user-newline and the user writing "\n". + -- but still process the characters here, to find any errors + _ <- resolveEscapeCharacter getChar loc1 + go (addChar c1 . addChar c0 $ s) loc2 + -- backslash at end of input + Nothing -> Left $ BadCharInitialLex loc1 (hasSQuote s) + + -- found newline character in multiline string + Just (c0@'\n', loc1) | StringTypeMulti <- strType -> + uncurry go $ parseLeadingWS getChar (addChar c0 s) loc1 + + -- found some other character + Just (c0, loc1) | isAnyChar c0 -> go (addChar c0 s) loc1 + + -- found some unknown character + Just (_, _) -> Left $ BadCharInitialLex loc0 (hasSQuote s) + + -- reached EOF before finding end of string + Nothing -> Left $ BadCharInitialLex loc0 (hasSQuote s) + +checkDelimiter :: LexStringType -> GetChar loc -> loc -> Maybe loc +checkDelimiter strType getChar loc0 = + case strType of + StringTypeSingle -> do + ('"', loc1) <- getChar loc0 + Just loc1 + StringTypeMulti -> do + ('"', loc1) <- getChar loc0 + ('"', loc2) <- getChar loc1 + ('"', loc3) <- getChar loc2 + Just loc3 + +-- | A helper for adding the given character to the lexed string. +addChar :: Char -> LexStringState loc -> LexStringState loc +addChar c s = s{stringAcc = c : stringAcc s} + +hasSQuote :: LexStringState loc -> ContainsSmartQuote loc +hasSQuote s + | any isDoubleSmartQuote (stringAcc s) + , (c, loc) : _ <- filter (isDoubleSmartQuote . fst) allChars = + SmartQuote c loc + | otherwise = + NoSmartQuote where - go = \case - [] -> [] + allChars = unfoldr getCharWithLoc (initialLoc s) + getCharWithLoc loc = + case smartQuoteGetChar s loc of + Just (c, loc') -> Just ((c, loc), loc') + Nothing -> Nothing + +-- | After parsing a backslash and a space character, consume the rest of +-- the string gap and return the next location. +collapseStringGap :: GetChar loc -> LexStringState loc -> loc -> Either (StringLexError loc) loc +collapseStringGap getChar s = go + where + go loc0 = + case getChar loc0 of + Just ('\\', loc1) -> pure loc1 + Just (c0, loc1) | is_space c0 -> go loc1 + Just _ -> Left $ BadCharInitialLex loc0 (hasSQuote s) + Nothing -> Left $ UnexpectedEOF loc0 (hasSQuote s) - backslash@(LexedChar '\\' _) : c : s - | isLexedSpace c -> - -- lexer should have validated that this is a valid gap, - -- so we'll panic if we find any invalid characters - case dropWhile isLexedSpace s of - LexedChar '\\' _ : s -> go s - _ -> panic $ "Invalid string gap in " ++ show (unLexedString s0) - | otherwise -> - backslash : c : go s +-- | See Note [Multiline string literals] +parseLeadingWS :: GetChar loc -> LexStringState loc -> loc -> (LexStringState loc, loc) +parseLeadingWS getChar = go 0 + where + go !col s loc = + case getChar loc of + Just (c@' ', loc') -> go (col + 1) (addChar c s) loc' + -- expand tabs + Just ('\t', loc') -> + let fill = 8 - (col `mod` 8) + s' = applyN fill (addChar ' ') s + in go (col + fill) s' loc' + -- if we see a newline or string delimiter, then this line only contained whitespace, so + -- don't include it in the common whitespace prefix + Just ('\n', _) -> (s, loc) + Just ('"', _) | Just _ <- checkDelimiter StringTypeMulti getChar loc -> (s, loc) + -- found some other character, so we're done parsing leading whitespace + _ -> + let s' = s{multilineCommonWsPrefix = min col (multilineCommonWsPrefix s)} + in (s', loc) + + applyN :: Int -> (a -> a) -> a -> a + applyN n f x0 = iterate f x0 !! n - c : s -> c : go s +data StringLexError loc + = UnexpectedEOF !loc !(ContainsSmartQuote loc) + -- ^ Unexpectedly hit EOF when lexing string + | BadCharInitialLex !loc !(ContainsSmartQuote loc) + -- ^ Found invalid character when initially lexing string + | EscapeBadChar !loc + -- ^ Found invalid character when parsing an escaped character + | EscapeUnexpectedEOF !loc + -- ^ Unexpectedly hit EOF when parsing an escaped character + | EscapeNumRangeError !loc + -- ^ Escaped number exceeds range + | EscapeSmartQuoteError !Char !loc + -- ^ Found escaped smart unicode chars as `\’` or `\”` + deriving (Show) + +-- | When initially lexing the string, we want to track if we've +-- seen a smart quote, to show a helpful "you might be accidentally +-- using a smart quote" error. +data ContainsSmartQuote loc + = NoSmartQuote + | SmartQuote !Char !loc + deriving (Show) -resolveEscapeCharacters :: LexedString loc -> Either (StringLexError loc) (LexedString loc) -resolveEscapeCharacters = go - where - go = \case - [] -> pure [] - LexedChar '\\' _ : LexedChar '&' _ : s -> go s - backslashChar@(LexedChar '\\' _) : s -> do - (c, s') <- resolveEscapeCharacter backslashChar s - (c :) <$> go s' - c : s -> - (c :) <$> go s - --- | After finding a backslash, parse the rest of the escape character. -resolveEscapeCharacter :: - LexedChar loc -> -- the backslash character - LexedString loc -> -- the rest of the string to parse - Either - (StringLexError loc) - (LexedChar loc, LexedString loc) -- the resolved escape character and the rest of the string -resolveEscapeCharacter backslashChar s0 = do - (firstChar@(LexedChar c loc), s1) <- expectNext backslashChar s0 - let rewrap c' = pure (LexedChar c' loc, s1) - case c of - 'a' -> rewrap '\a' - 'b' -> rewrap '\b' - 'f' -> rewrap '\f' - 'n' -> rewrap '\n' - 'r' -> rewrap '\r' - 't' -> rewrap '\t' - 'v' -> rewrap '\v' - '\\' -> rewrap '\\' - '"' -> rewrap '\"' - '\'' -> rewrap '\'' +-- ----------------------------------------------------------------------------- +-- Escape characters + +-- | After finding a backslash, parse the rest of the escape character, starting +-- at the given location. +resolveEscapeCharacter :: GetChar loc -> loc -> Either (StringLexError loc) (Char, loc) +resolveEscapeCharacter getChar loc0 = do + (c0, loc1) <- expectChar loc0 + case c0 of + 'a' -> pure ('\a', loc1) + 'b' -> pure ('\b', loc1) + 'f' -> pure ('\f', loc1) + 'n' -> pure ('\n', loc1) + 'r' -> pure ('\r', loc1) + 't' -> pure ('\t', loc1) + 'v' -> pure ('\v', loc1) + '\\' -> pure ('\\', loc1) + '"' -> pure ('\"', loc1) + '\'' -> pure ('\'', loc1) -- escape codes - 'x' -> expectNum is_hexdigit 16 hexDigit (firstChar, s1) - 'o' -> expectNum is_octdigit 8 octDecDigit (firstChar, s1) - _ | is_decdigit c -> expectNum is_decdigit 10 octDecDigit (backslashChar, s0) + 'x' -> expectNum is_hexdigit 16 hexDigit loc1 + 'o' -> expectNum is_octdigit 8 octDecDigit loc1 + _ | is_decdigit c0 -> expectNum is_decdigit 10 octDecDigit loc0 -- control characters (e.g. '\^M') '^' -> do - (LexedChar c1 loc1, s2) <- expectNext firstChar s1 - unless (c1 >= '@' && c1 <= '_') $ - Left $ StringLexError c1 loc1 LexStringCharLit - let c' = chr $ ord c1 - ord '@' - pure (LexedChar c' loc, s2) + (c1, loc2) <- expectChar loc1 + unless ('@' <= c1 && c1 <= '_') $ Left $ EscapeBadChar loc1 + pure (chr $ ord c1 - ord '@', loc2) -- long form escapes (e.g. '\NUL') - _ | Just (c', s2) <- parseLongEscape firstChar s1 -> pure (LexedChar c' loc, s2) + _ | Just (c1, loc2) <- parseLongEscape getChar c0 loc1 -> pure (c1, loc2) -- check unicode smart quotes (#21843) - _ | isDoubleSmartQuote c -> Left $ SmartQuoteError c loc - _ | isSingleSmartQuote c -> Left $ SmartQuoteError c loc + _ | isDoubleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 + _ | isSingleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 -- unknown escape - _ -> Left $ StringLexError c loc LexStringCharLit + _ -> Left $ EscapeBadChar loc0 where - expectNext lastChar = \case - [] -> do - let LexedChar c loc = lastChar - Left $ StringLexError c loc LexStringCharLitEOF - c : cs -> pure (c, cs) - - expectNum isDigit base toDigit (lastChar, s0) = do - (LexedChar c loc, s1) <- expectNext lastChar s0 - unless (isDigit c) $ Left $ StringLexError c loc LexStringCharLit - let parseNum x = \case - LexedChar c' loc' : s' | isDigit c' -> do - let x' = x * base + toDigit c' - when (x' > 0x10ffff) $ Left $ StringLexError c' loc' LexNumEscapeRange - parseNum x' s' - s -> - pure (LexedChar (chr x) loc, s) - parseNum (toDigit c) s1 - --- | Check if the escape characters match a long escape code. --- --- >>> parseLongEscape 'C' [LexedChar 'R', LexedChar 'X', ...s] = Just ('\CR', [LexedChar 'X', ...s]) --- >>> parseLongEscape 'X' [LexedChar 'X', LexedChar 'X', ...s] = Nothing -parseLongEscape :: LexedChar loc -> LexedString loc -> Maybe (Char, LexedString loc) -parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCodes + expectChar loc = + case getChar loc of + Just x -> pure x + Nothing -> Left $ EscapeUnexpectedEOF loc + + expectNum isDigit base toDigit loc1 = do + (c1, loc2) <- expectChar loc1 + unless (isDigit c1) $ Left $ EscapeBadChar loc1 + let parseNum x loc = + case getChar loc of + Just (c, loc') | isDigit c -> do + let x' = x * base + toDigit c + when (x' > 0x10ffff) $ Left $ EscapeNumRangeError loc' + parseNum x' loc' + _ -> + pure (chr x, loc) + parseNum (toDigit c1) loc2 + +parseLongEscape :: GetChar loc -> Char -> loc -> Maybe (Char, loc) +parseLongEscape getChar c0 loc1 = listToMaybe $ mapMaybe tryParse longEscapeCodes where - tryParse (prefix, c') = do + tryParse (prefix, c) = do p0 : p <- pure prefix - guard (p0 == c) -- see if the first character matches - s' <- parsePrefix p s -- see if the rest of the prefix matches - pure (c', s') + guard (p0 == c0) -- see if the first character matches + loc <- parsePrefix loc1 p -- see if the rest of the prefix matches + pure (c, loc) - parsePrefix (p : ps) (LexedChar t _ : ts) | p == t = parsePrefix ps ts - parsePrefix [] s' = Just s' -- we've matched the whole prefix, return the rest - parsePrefix _ _ = Nothing + parsePrefix loc = \case + [] -> pure loc + p : ps -> do + (c, loc') <- getChar loc + guard (p == c) + parsePrefix loc' ps longEscapeCodes = [ ("NUL", '\NUL') @@ -203,17 +302,6 @@ parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCo , ("DEL", '\DEL') ] --- | Error if string contains any tab characters. --- --- Normal strings don't lex tab characters in the first place, but we --- have to allow them in multiline strings for leading indentation. So --- we allow them in the initial lexing pass, then check for any remaining --- tabs after replacing leading tabs in resolveMultilineString. -checkInnerTabs :: LexedString loc -> Either (StringLexError loc) () -checkInnerTabs s = - forM_ s $ \(LexedChar c loc) -> - when (c == '\t') $ Left $ StringLexError c loc LexStringCharLit - -- ----------------------------------------------------------------------------- -- Unicode Smart Quote detection (#21843) @@ -242,7 +330,7 @@ is, HsMultilineString will contain the post-processed string. This matches the same behavior as HsString, which contains the normalized string (see Note [Literal source text]). -The string is post-processed with the following steps: +The canonical steps for post processing a multiline string are: 1. Collapse string gaps 2. Split the string by newlines 3. Convert leading tabs into spaces @@ -253,6 +341,17 @@ The string is post-processed with the following steps: 7. If the first character of the string is a newline, remove it 8. Interpret escaped characters +However, for performance reasons, we do as much of this in one pass as possible: +1. As we lex the string, do the following steps as they appear: + a. Collapse string gaps + b. Keep track of the common whitespace prefix so far + c. Validate escaped characters +2. At the very end, post process the lexed string: + a. Remove the common whitespace prefix from every line + b. Remove all whitespace from all-whitespace lines + c. Remove initial newline character + d. Resolve escaped characters + The common whitespace prefix can be informally defined as "The longest prefix of whitespace shared by all lines in the string, excluding the first line and any whitespace-only lines". @@ -267,83 +366,67 @@ It's more precisely defined with the following algorithm: 3. Calculate the longest prefix of whitespace shared by all lines in the remaining list -} --- | A lexed line, with the string and the location info of the ending newline --- character, if one exists -data LexedLine loc = LexedLine !(LexedString loc) (Maybe loc) - -mapLine :: (LexedString loc -> LexedString loc) -> LexedLine loc -> LexedLine loc -mapLine f (LexedLine line nl) = LexedLine (f line) nl - -mapLines :: (LexedString loc -> LexedString loc) -> [LexedLine loc] -> [LexedLine loc] -mapLines f = map (mapLine f) - -filterLines :: (LexedString loc -> Bool) -> [LexedLine loc] -> [LexedLine loc] -filterLines f = filter (\(LexedLine line _) -> f line) - -splitLines :: LexedString loc -> [LexedLine loc] -splitLines = - foldr - ( curry $ \case - (LexedChar '\n' loc, ls) -> LexedLine [] (Just loc) : ls - (c, l : ls) -> mapLine (c :) l : ls - (c, []) -> LexedLine [c] Nothing : [] -- should not happen - ) - [emptyLine] - where - emptyLine = LexedLine [] Nothing - -joinLines :: [LexedLine loc] -> LexedString loc -joinLines = concatMap $ \(LexedLine line nl) -> - case nl of - Nothing -> line - Just nl' -> line ++ [LexedChar '\n' nl'] - -- | See Note [Multiline string literals] -resolveMultilineString :: LexedString loc -> LexedString loc -resolveMultilineString = process +postprocessMultiline :: Int -> String -> String +postprocessMultiline commonWSPrefix = + rmCommonWhitespacePrefix + >>> collapseOnlyWsLines + >>> rmFirstNewline + >>> resolveEscapeChars where - process = - splitLines - >>> convertLeadingTabs - >>> rmCommonWhitespacePrefix - >>> stripOnlyWhitespace - >>> joinLines - >>> rmFirstNewline - - convertLeadingTabs = - let convertLine col = \case + rmCommonWhitespacePrefix = + let go = \case + '\n' : s -> '\n' : go (dropLine commonWSPrefix s) + c : s -> c : go s [] -> [] - c@(LexedChar ' ' _) : cs -> c : convertLine (col + 1) cs - LexedChar '\t' loc : cs -> - let fill = 8 - (col `mod` 8) - in replicate fill (LexedChar ' ' loc) ++ convertLine (col + fill) cs - c : cs -> c : cs - in mapLines (convertLine 0) - - rmCommonWhitespacePrefix = \case - [] -> [] - -- exclude the first line from this calculation - firstLine : strLines -> - let excludeWsOnlyLines = filterLines (not . all isLexedSpace) - commonWSPrefix = - case NonEmpty.nonEmpty (excludeWsOnlyLines strLines) of - Nothing -> 0 - Just strLines' -> - Foldable1.minimum $ - flip NonEmpty.map strLines' $ \(LexedLine line _) -> - length $ takeWhile isLexedSpace line - in firstLine : mapLines (drop commonWSPrefix) strLines - - stripOnlyWhitespace = - let stripWsOnlyLine line = if all isLexedSpace line then [] else line - in mapLines stripWsOnlyLine + -- drop x characters from the string, or up to a newline, whichever + -- comes first + dropLine !x = \case + s | x <= 0 -> s + s@('\n' : _) -> s + _ : s -> dropLine (x - 1) s + [] -> [] + in go + + collapseOnlyWsLines = + let go = \case + '\n' : s | Just s' <- checkAllWs s -> '\n' : go s' + c : s -> c : go s + [] -> [] + checkAllWs = \case + -- got all the way to a newline or the end of the string, return + s@('\n' : _) -> Just s + s@[] -> Just s + -- found whitespace, continue + c : s | is_space c -> checkAllWs s + -- anything else, stop + _ -> Nothing + in go rmFirstNewline = \case - LexedChar '\n' _ : s -> s + '\n' : s -> s s -> s + -- resolve escape characters, deferred from lexString. guaranteed + -- to not throw any errors, since we already checked them in lexString + resolveEscapeChars = \case + [] -> [] + '\\' : s -> + -- concretizing 'loc' to String: + -- resolveEscapeCharacter :: (String -> Maybe (Char, String)) -> String -> Either _ (Char, String) + case resolveEscapeCharacter uncons s of + Left e -> panic $ "resolving escape characters in multiline string unexpectedly found errors: " ++ show e + Right (c, s') -> c : resolveEscapeChars s' + c : s -> c : resolveEscapeChars s + + uncons = \case + c : cs -> Just (c, cs) + [] -> Nothing + -- ----------------------------------------------------------------------------- -- Helpers -isLexedSpace :: LexedChar loc -> Bool -isLexedSpace = isSpace . unLexedChar +isAnyChar :: Char -> Bool +isAnyChar c + | c > '\x7f' = isPrint c + | otherwise = is_any c View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d74fab2a1e8f113bc4d4191c526e808c444f566a -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d74fab2a1e8f113bc4d4191c526e808c444f566a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 06:18:15 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 02:18:15 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Reimplement with manual iteration Message-ID: <669610a75b3c2_1303a27981f2854995@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: d4510456 by Brandon Chinn at 2024-07-15T23:17:58-07:00 Reimplement with manual iteration - - - - - 2 changed files: - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/String.hs Changes: ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -2226,65 +2226,9 @@ lex_quoted_label span buf _len _buf2 = do lex_string :: LexStringType -> P String lex_string strType = do start <- getInput - case lexString [] start of - Right (lexedStr, next) -> do - setInput next - either fromStringLexError pure $ resolveLexedString strType lexedStr - Left (e, s, i) -> do - -- see if we can find a smart quote in the string we've found so far. - -- if the built-up string s contains a smart double quote character, it was - -- likely the reason why the string literal was not lexed correctly - case filter (\(LexedChar c _) -> isDoubleSmartQuote c) s of - LexedChar c (AI loc _) : _ -> add_nonfatal_smart_quote_error c loc - _ -> pure () - - -- regardless whether we found a smart quote, throw a lexical error - setInput i >> lexError e - where - -- Given the (reversed) string we've seen so far and the current location, - -- return Right with the fully lexed string and the subsequent location, - -- or Left with the string we've seen so far and the location where lexing - -- failed. - lexString acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - _ | Just i1 <- lexDelimiter i0 -> Right (acc, i1) - - Just (c0, i1) -> do - let acc1 = LexedChar c0 i0 : acc0 - case c0 of - '\\' -> do - case alexGetChar' i1 of - Just (c1, i2) - | is_space c1 -> lexStringGap acc0 i2 - | otherwise -> lexString (LexedChar c1 i1 : acc1) i2 - Nothing -> Left (LexStringCharLit, acc, i1) - _ | isAny c0 -> lexString acc1 i1 - _ | strType == StringTypeMulti && c0 `elem` ['\n', '\t'] -> lexString acc1 i1 - _ -> Left (LexStringCharLit, acc, i0) - - Nothing -> Left (LexStringCharLit, acc, i0) - - lexDelimiter i0 = - case strType of - StringTypeSingle -> do - ('"', i1) <- alexGetChar' i0 - Just i1 - StringTypeMulti -> do - ('"', i1) <- alexGetChar' i0 - ('"', i2) <- alexGetChar' i1 - ('"', i3) <- alexGetChar' i2 - Just i3 - - lexStringGap acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - Just (c0, i1) -> - case c0 of - '\\' -> lexString acc0 i1 - _ | is_space c0 -> lexStringGap acc0 i1 - _ -> Left (LexStringCharLit, acc, i0) - Nothing -> Left (LexStringCharLitEOF, acc, i0) + (str, next) <- either fromStringLexError pure $ lexString strType alexGetChar' start + setInput next + pure str lex_char_tok :: Action @@ -2305,13 +2249,9 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' return (L (mkPsSpan loc end2) ITtyQuote) Just ('\\', i2@(AI end2 _)) -> do -- We've seen 'backslash - (LexedChar lit_ch _, rest) <- + (lit_ch, i3) <- either fromStringLexError pure $ - resolveEscapeCharacter (LexedChar '\\' i1) (asLexedString i2) - i3 <- - case rest of - LexedChar _ i3 : _ -> pure i3 - [] -> lexError LexStringCharLitEOF + resolveEscapeCharacter alexGetChar' i2 case alexGetChar' i3 of Just ('\'', i4) -> do setInput i4 @@ -2320,7 +2260,7 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' _ -> lit_error i3 Just (c, i2@(AI end2 _)) - | not (isAny c) -> lit_error i1 + | not (isAnyChar c) -> lit_error i1 | otherwise -> -- We've seen 'x, where x is a valid character @@ -2371,24 +2311,19 @@ lex_magic_hash i = do _other -> pure Nothing else pure Nothing -isAny :: Char -> Bool -isAny c | c > '\x7f' = isPrint c - | otherwise = is_any c - --- | Returns a LexedString that, when iterated, lazily streams --- successive characters from the AlexInput. -asLexedString :: AlexInput -> LexedString AlexInput -asLexedString = unfoldr toLexedChar - where - toLexedChar i = - case alexGetChar' i of - Just (c, i') -> Just (LexedChar c i, i') - Nothing -> Nothing - fromStringLexError :: StringLexError AlexInput -> P a fromStringLexError = \case - SmartQuoteError c (AI loc _) -> add_smart_quote_error c loc - StringLexError _ i e -> setInput i >> lexError e + UnexpectedEOF i squote -> checkSQuote squote >> throw i LexStringCharLitEOF + BadCharInitialLex i squote -> checkSQuote squote >> throw i LexStringCharLit + EscapeBadChar i -> throw i LexStringCharLit + EscapeUnexpectedEOF i -> throw i LexStringCharLitEOF + EscapeNumRangeError i -> throw i LexNumEscapeRange + EscapeSmartQuoteError c (AI loc _) -> add_smart_quote_error c loc + where + throw i e = setInput i >> lexError e + checkSQuote = \case + NoSmartQuote -> pure () + SmartQuote c (AI loc _) -> add_nonfatal_smart_quote_error c loc -- before calling lit_error, ensure that the current input is pointing to -- the position of the error in the buffer. This is so that we can report @@ -2397,12 +2332,6 @@ fromStringLexError = \case lit_error :: AlexInput -> P a lit_error i = do setInput i; lexError LexStringCharLit -getCharOrFail :: AlexInput -> P Char -getCharOrFail i = do - case alexGetChar' i of - Nothing -> lexError LexStringCharLitEOF - Just (c,i) -> do setInput i; return c - -- ----------------------------------------------------------------------------- -- QuasiQuote ===================================== compiler/GHC/Parser/String.hs ===================================== @@ -1,170 +1,269 @@ {-# LANGUAGE LambdaCase #-} module GHC.Parser.String ( - LexedString, - LexedChar (..), StringLexError (..), + ContainsSmartQuote (..), LexStringType (..), - resolveLexedString, - resolveEscapeCharacter, + lexString, -- * Unicode smart quote helpers isDoubleSmartQuote, isSingleSmartQuote, + + -- * Other helpers + isAnyChar, + resolveEscapeCharacter, ) where import GHC.Prelude import Control.Arrow ((>>>)) -import Control.Monad (forM_, guard, unless, when, (>=>)) -import Data.Char (chr, isSpace, ord) -import qualified Data.Foldable1 as Foldable1 -import qualified Data.List.NonEmpty as NonEmpty -import Data.Maybe (listToMaybe, mapMaybe, maybeToList) +import Control.Monad (guard, unless, when) +import Data.Char (chr, isPrint, ord) +import Data.List (unfoldr) +import Data.Maybe (listToMaybe, mapMaybe) import GHC.Parser.CharClass ( hexDigit, + is_any, is_decdigit, is_hexdigit, is_octdigit, + is_space, octDecDigit, ) -import GHC.Parser.Errors.Types (LexErr (..)) import GHC.Utils.Panic (panic) -data LexStringType = StringTypeSingle | StringTypeMulti deriving (Eq) - -data LexedChar loc = LexedChar !Char !loc -type LexedString loc = [LexedChar loc] +data LexStringType = StringTypeSingle | StringTypeMulti -unLexedChar :: LexedChar loc -> Char -unLexedChar (LexedChar c _) = c +data LexStringState loc = LexStringState + { stringAcc :: !String + , multilineCommonWsPrefix :: !Int + , smartQuoteGetChar :: GetChar loc + , initialLoc :: !loc + } -unLexedString :: LexedString loc -> String -unLexedString = map unLexedChar +-- | Get the character at the given location, with the location +-- of the next character. Returns Nothing if at the end of the +-- input. +type GetChar loc = loc -> Maybe (Char, loc) -resolveLexedString :: - LexStringType -> - LexedString loc -> - Either (StringLexError loc) String -resolveLexedString strType = fmap unLexedString . processString +lexString :: LexStringType -> GetChar loc -> loc -> Either (StringLexError loc) (String, loc) +lexString strType getChar initialLoc = go initialState initialLoc where - processString = - case strType of - StringTypeSingle -> - resolveEscapeCharacters - StringTypeMulti -> - resolveMultilineString - >>> (\s -> checkInnerTabs s >> pure s) - >=> resolveEscapeCharacters - -data StringLexError loc - = SmartQuoteError !Char !loc - | StringLexError !Char !loc !LexErr - -collapseStringGaps :: LexedString loc -> LexedString loc -collapseStringGaps s0 = go s0 + initialState = + LexStringState + { stringAcc = "" + , multilineCommonWsPrefix = + case strType of + StringTypeMulti -> maxBound + _ -> 0 + , smartQuoteGetChar = getChar + , initialLoc = initialLoc + } + + go !s loc0 = + case getChar loc0 of + -- found closing delimiter + Just ('"', _) | Just loc1 <- checkDelimiter strType getChar loc0 -> do + let postprocess = + case strType of + StringTypeSingle -> id + StringTypeMulti -> postprocessMultiline (multilineCommonWsPrefix s) + Right (postprocess . reverse $ stringAcc s, loc1) + + -- found backslash + Just (c0@'\\', loc1) -> do + case getChar loc1 of + -- found '\&' character, which should be elided + Just ('&', loc2) -> go s loc2 + -- found start of a string gap + Just (c1, loc2) | is_space c1 -> collapseStringGap getChar s loc2 >>= go s + -- some other escape character + Just (c1, loc2) -> + case strType of + StringTypeSingle -> do + (c', loc') <- resolveEscapeCharacter getChar loc1 + go (addChar c' s) loc' + StringTypeMulti -> do + -- keep escape characters unresolved until after post-processing, + -- to distinguish between a user-newline and the user writing "\n". + -- but still process the characters here, to find any errors + _ <- resolveEscapeCharacter getChar loc1 + go (addChar c1 . addChar c0 $ s) loc2 + -- backslash at end of input + Nothing -> Left $ BadCharInitialLex loc1 (hasSQuote s) + + -- found newline character in multiline string + Just (c0@'\n', loc1) | StringTypeMulti <- strType -> + uncurry go $ parseLeadingWS getChar (addChar c0 s) loc1 + + -- found some other character + Just (c0, loc1) | isAnyChar c0 -> go (addChar c0 s) loc1 + + -- found some unknown character + Just (_, _) -> Left $ BadCharInitialLex loc0 (hasSQuote s) + + -- reached EOF before finding end of string + Nothing -> Left $ BadCharInitialLex loc0 (hasSQuote s) + +checkDelimiter :: LexStringType -> GetChar loc -> loc -> Maybe loc +checkDelimiter strType getChar loc0 = + case strType of + StringTypeSingle -> do + ('"', loc1) <- getChar loc0 + Just loc1 + StringTypeMulti -> do + ('"', loc1) <- getChar loc0 + ('"', loc2) <- getChar loc1 + ('"', loc3) <- getChar loc2 + Just loc3 + +-- | A helper for adding the given character to the lexed string. +addChar :: Char -> LexStringState loc -> LexStringState loc +addChar c s = s{stringAcc = c : stringAcc s} + +hasSQuote :: LexStringState loc -> ContainsSmartQuote loc +hasSQuote s + | any isDoubleSmartQuote (stringAcc s) + , (c, loc) : _ <- filter (isDoubleSmartQuote . fst) allChars = + SmartQuote c loc + | otherwise = + NoSmartQuote where - go = \case - [] -> [] + allChars = unfoldr getCharWithLoc (initialLoc s) + getCharWithLoc loc = + case smartQuoteGetChar s loc of + Just (c, loc') -> Just ((c, loc), loc') + Nothing -> Nothing + +-- | After parsing a backslash and a space character, consume the rest of +-- the string gap and return the next location. +collapseStringGap :: GetChar loc -> LexStringState loc -> loc -> Either (StringLexError loc) loc +collapseStringGap getChar s = go + where + go loc0 = + case getChar loc0 of + Just ('\\', loc1) -> pure loc1 + Just (c0, loc1) | is_space c0 -> go loc1 + Just _ -> Left $ BadCharInitialLex loc0 (hasSQuote s) + Nothing -> Left $ UnexpectedEOF loc0 (hasSQuote s) - backslash@(LexedChar '\\' _) : c : s - | isLexedSpace c -> - -- lexer should have validated that this is a valid gap, - -- so we'll panic if we find any invalid characters - case dropWhile isLexedSpace s of - LexedChar '\\' _ : s -> go s - _ -> panic $ "Invalid string gap in " ++ show (unLexedString s0) - | otherwise -> - backslash : c : go s +-- | See Note [Multiline string literals] +parseLeadingWS :: GetChar loc -> LexStringState loc -> loc -> (LexStringState loc, loc) +parseLeadingWS getChar = go 0 + where + go !col s loc = + case getChar loc of + Just (c@' ', loc') -> go (col + 1) (addChar c s) loc' + -- expand tabs + Just ('\t', loc') -> + let fill = 8 - (col `mod` 8) + s' = applyN fill (addChar ' ') s + in go (col + fill) s' loc' + -- if we see a newline or string delimiter, then this line only contained whitespace, so + -- don't include it in the common whitespace prefix + Just ('\n', _) -> (s, loc) + Just ('"', _) | Just _ <- checkDelimiter StringTypeMulti getChar loc -> (s, loc) + -- found some other character, so we're done parsing leading whitespace + _ -> + let s' = s{multilineCommonWsPrefix = min col (multilineCommonWsPrefix s)} + in (s', loc) + + applyN :: Int -> (a -> a) -> a -> a + applyN n f x0 = iterate f x0 !! n - c : s -> c : go s +data StringLexError loc + = UnexpectedEOF !loc !(ContainsSmartQuote loc) + -- ^ Unexpectedly hit EOF when lexing string + | BadCharInitialLex !loc !(ContainsSmartQuote loc) + -- ^ Found invalid character when initially lexing string + | EscapeBadChar !loc + -- ^ Found invalid character when parsing an escaped character + | EscapeUnexpectedEOF !loc + -- ^ Unexpectedly hit EOF when parsing an escaped character + | EscapeNumRangeError !loc + -- ^ Escaped number exceeds range + | EscapeSmartQuoteError !Char !loc + -- ^ Found escaped smart unicode chars as `\’` or `\”` + deriving (Show) + +-- | When initially lexing the string, we want to track if we've +-- seen a smart quote, to show a helpful "you might be accidentally +-- using a smart quote" error. +data ContainsSmartQuote loc + = NoSmartQuote + | SmartQuote !Char !loc + deriving (Show) -resolveEscapeCharacters :: LexedString loc -> Either (StringLexError loc) (LexedString loc) -resolveEscapeCharacters = go - where - go = \case - [] -> pure [] - LexedChar '\\' _ : LexedChar '&' _ : s -> go s - backslashChar@(LexedChar '\\' _) : s -> do - (c, s') <- resolveEscapeCharacter backslashChar s - (c :) <$> go s' - c : s -> - (c :) <$> go s - --- | After finding a backslash, parse the rest of the escape character. -resolveEscapeCharacter :: - LexedChar loc -> -- the backslash character - LexedString loc -> -- the rest of the string to parse - Either - (StringLexError loc) - (LexedChar loc, LexedString loc) -- the resolved escape character and the rest of the string -resolveEscapeCharacter backslashChar s0 = do - (firstChar@(LexedChar c loc), s1) <- expectNext backslashChar s0 - let rewrap c' = pure (LexedChar c' loc, s1) - case c of - 'a' -> rewrap '\a' - 'b' -> rewrap '\b' - 'f' -> rewrap '\f' - 'n' -> rewrap '\n' - 'r' -> rewrap '\r' - 't' -> rewrap '\t' - 'v' -> rewrap '\v' - '\\' -> rewrap '\\' - '"' -> rewrap '\"' - '\'' -> rewrap '\'' +-- ----------------------------------------------------------------------------- +-- Escape characters + +-- | After finding a backslash, parse the rest of the escape character, starting +-- at the given location. +resolveEscapeCharacter :: GetChar loc -> loc -> Either (StringLexError loc) (Char, loc) +resolveEscapeCharacter getChar loc0 = do + (c0, loc1) <- expectChar loc0 + case c0 of + 'a' -> pure ('\a', loc1) + 'b' -> pure ('\b', loc1) + 'f' -> pure ('\f', loc1) + 'n' -> pure ('\n', loc1) + 'r' -> pure ('\r', loc1) + 't' -> pure ('\t', loc1) + 'v' -> pure ('\v', loc1) + '\\' -> pure ('\\', loc1) + '"' -> pure ('\"', loc1) + '\'' -> pure ('\'', loc1) -- escape codes - 'x' -> expectNum is_hexdigit 16 hexDigit (firstChar, s1) - 'o' -> expectNum is_octdigit 8 octDecDigit (firstChar, s1) - _ | is_decdigit c -> expectNum is_decdigit 10 octDecDigit (backslashChar, s0) + 'x' -> expectNum is_hexdigit 16 hexDigit loc1 + 'o' -> expectNum is_octdigit 8 octDecDigit loc1 + _ | is_decdigit c0 -> expectNum is_decdigit 10 octDecDigit loc0 -- control characters (e.g. '\^M') '^' -> do - (LexedChar c1 loc1, s2) <- expectNext firstChar s1 - unless (c1 >= '@' && c1 <= '_') $ - Left $ StringLexError c1 loc1 LexStringCharLit - let c' = chr $ ord c1 - ord '@' - pure (LexedChar c' loc, s2) + (c1, loc2) <- expectChar loc1 + unless ('@' <= c1 && c1 <= '_') $ Left $ EscapeBadChar loc1 + pure (chr $ ord c1 - ord '@', loc2) -- long form escapes (e.g. '\NUL') - _ | Just (c', s2) <- parseLongEscape firstChar s1 -> pure (LexedChar c' loc, s2) + _ | Just (c1, loc2) <- parseLongEscape getChar c0 loc1 -> pure (c1, loc2) -- check unicode smart quotes (#21843) - _ | isDoubleSmartQuote c -> Left $ SmartQuoteError c loc - _ | isSingleSmartQuote c -> Left $ SmartQuoteError c loc + _ | isDoubleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 + _ | isSingleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 -- unknown escape - _ -> Left $ StringLexError c loc LexStringCharLit + _ -> Left $ EscapeBadChar loc0 where - expectNext lastChar = \case - [] -> do - let LexedChar c loc = lastChar - Left $ StringLexError c loc LexStringCharLitEOF - c : cs -> pure (c, cs) - - expectNum isDigit base toDigit (lastChar, s0) = do - (LexedChar c loc, s1) <- expectNext lastChar s0 - unless (isDigit c) $ Left $ StringLexError c loc LexStringCharLit - let parseNum x = \case - LexedChar c' loc' : s' | isDigit c' -> do - let x' = x * base + toDigit c' - when (x' > 0x10ffff) $ Left $ StringLexError c' loc' LexNumEscapeRange - parseNum x' s' - s -> - pure (LexedChar (chr x) loc, s) - parseNum (toDigit c) s1 - --- | Check if the escape characters match a long escape code. --- --- >>> parseLongEscape 'C' [LexedChar 'R', LexedChar 'X', ...s] = Just ('\CR', [LexedChar 'X', ...s]) --- >>> parseLongEscape 'X' [LexedChar 'X', LexedChar 'X', ...s] = Nothing -parseLongEscape :: LexedChar loc -> LexedString loc -> Maybe (Char, LexedString loc) -parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCodes + expectChar loc = + case getChar loc of + Just x -> pure x + Nothing -> Left $ EscapeUnexpectedEOF loc + + expectNum isDigit base toDigit loc1 = do + (c1, loc2) <- expectChar loc1 + unless (isDigit c1) $ Left $ EscapeBadChar loc1 + let parseNum x loc = + case getChar loc of + Just (c, loc') | isDigit c -> do + let x' = x * base + toDigit c + when (x' > 0x10ffff) $ Left $ EscapeNumRangeError loc' + parseNum x' loc' + _ -> + pure (chr x, loc) + parseNum (toDigit c1) loc2 + +parseLongEscape :: GetChar loc -> Char -> loc -> Maybe (Char, loc) +parseLongEscape getChar c0 loc1 = listToMaybe $ mapMaybe tryParse longEscapeCodes where - tryParse (prefix, c') = do + tryParse (prefix, c) = do p0 : p <- pure prefix - guard (p0 == c) -- see if the first character matches - s' <- parsePrefix p s -- see if the rest of the prefix matches - pure (c', s') + guard (p0 == c0) -- see if the first character matches + loc <- parsePrefix loc1 p -- see if the rest of the prefix matches + pure (c, loc) - parsePrefix (p : ps) (LexedChar t _ : ts) | p == t = parsePrefix ps ts - parsePrefix [] s' = Just s' -- we've matched the whole prefix, return the rest - parsePrefix _ _ = Nothing + parsePrefix loc = \case + [] -> pure loc + p : ps -> do + (c, loc') <- getChar loc + guard (p == c) + parsePrefix loc' ps longEscapeCodes = [ ("NUL", '\NUL') @@ -203,17 +302,6 @@ parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCo , ("DEL", '\DEL') ] --- | Error if string contains any tab characters. --- --- Normal strings don't lex tab characters in the first place, but we --- have to allow them in multiline strings for leading indentation. So --- we allow them in the initial lexing pass, then check for any remaining --- tabs after replacing leading tabs in resolveMultilineString. -checkInnerTabs :: LexedString loc -> Either (StringLexError loc) () -checkInnerTabs s = - forM_ s $ \(LexedChar c loc) -> - when (c == '\t') $ Left $ StringLexError c loc LexStringCharLit - -- ----------------------------------------------------------------------------- -- Unicode Smart Quote detection (#21843) @@ -242,7 +330,7 @@ is, HsMultilineString will contain the post-processed string. This matches the same behavior as HsString, which contains the normalized string (see Note [Literal source text]). -The string is post-processed with the following steps: +The canonical steps for post processing a multiline string are: 1. Collapse string gaps 2. Split the string by newlines 3. Convert leading tabs into spaces @@ -253,6 +341,17 @@ The string is post-processed with the following steps: 7. If the first character of the string is a newline, remove it 8. Interpret escaped characters +However, for performance reasons, we do as much of this in one pass as possible: +1. As we lex the string, do the following steps as they appear: + a. Collapse string gaps + b. Keep track of the common whitespace prefix so far + c. Validate escaped characters +2. At the very end, post process the lexed string: + a. Remove the common whitespace prefix from every line + b. Remove all whitespace from all-whitespace lines + c. Remove initial newline character + d. Resolve escaped characters + The common whitespace prefix can be informally defined as "The longest prefix of whitespace shared by all lines in the string, excluding the first line and any whitespace-only lines". @@ -267,83 +366,67 @@ It's more precisely defined with the following algorithm: 3. Calculate the longest prefix of whitespace shared by all lines in the remaining list -} --- | A lexed line, with the string and the location info of the ending newline --- character, if one exists -data LexedLine loc = LexedLine !(LexedString loc) (Maybe loc) - -mapLine :: (LexedString loc -> LexedString loc) -> LexedLine loc -> LexedLine loc -mapLine f (LexedLine line nl) = LexedLine (f line) nl - -mapLines :: (LexedString loc -> LexedString loc) -> [LexedLine loc] -> [LexedLine loc] -mapLines f = map (mapLine f) - -filterLines :: (LexedString loc -> Bool) -> [LexedLine loc] -> [LexedLine loc] -filterLines f = filter (\(LexedLine line _) -> f line) - -splitLines :: LexedString loc -> [LexedLine loc] -splitLines = - foldr - ( curry $ \case - (LexedChar '\n' loc, ls) -> LexedLine [] (Just loc) : ls - (c, l : ls) -> mapLine (c :) l : ls - (c, []) -> LexedLine [c] Nothing : [] -- should not happen - ) - [emptyLine] - where - emptyLine = LexedLine [] Nothing - -joinLines :: [LexedLine loc] -> LexedString loc -joinLines = concatMap $ \(LexedLine line nl) -> - case nl of - Nothing -> line - Just nl' -> line ++ [LexedChar '\n' nl'] - -- | See Note [Multiline string literals] -resolveMultilineString :: LexedString loc -> LexedString loc -resolveMultilineString = process +postprocessMultiline :: Int -> String -> String +postprocessMultiline commonWSPrefix = + rmCommonWhitespacePrefix + >>> collapseOnlyWsLines + >>> rmFirstNewline + >>> resolveEscapeChars where - process = - splitLines - >>> convertLeadingTabs - >>> rmCommonWhitespacePrefix - >>> stripOnlyWhitespace - >>> joinLines - >>> rmFirstNewline - - convertLeadingTabs = - let convertLine col = \case + rmCommonWhitespacePrefix = + let go = \case + '\n' : s -> '\n' : go (dropLine commonWSPrefix s) + c : s -> c : go s [] -> [] - c@(LexedChar ' ' _) : cs -> c : convertLine (col + 1) cs - LexedChar '\t' loc : cs -> - let fill = 8 - (col `mod` 8) - in replicate fill (LexedChar ' ' loc) ++ convertLine (col + fill) cs - c : cs -> c : cs - in mapLines (convertLine 0) - - rmCommonWhitespacePrefix = \case - [] -> [] - -- exclude the first line from this calculation - firstLine : strLines -> - let excludeWsOnlyLines = filterLines (not . all isLexedSpace) - commonWSPrefix = - case NonEmpty.nonEmpty (excludeWsOnlyLines strLines) of - Nothing -> 0 - Just strLines' -> - Foldable1.minimum $ - flip NonEmpty.map strLines' $ \(LexedLine line _) -> - length $ takeWhile isLexedSpace line - in firstLine : mapLines (drop commonWSPrefix) strLines - - stripOnlyWhitespace = - let stripWsOnlyLine line = if all isLexedSpace line then [] else line - in mapLines stripWsOnlyLine + -- drop x characters from the string, or up to a newline, whichever + -- comes first + dropLine !x = \case + s | x <= 0 -> s + s@('\n' : _) -> s + _ : s -> dropLine (x - 1) s + [] -> [] + in go + + collapseOnlyWsLines = + let go = \case + '\n' : s | Just s' <- checkAllWs s -> '\n' : go s' + c : s -> c : go s + [] -> [] + checkAllWs = \case + -- got all the way to a newline or the end of the string, return + s@('\n' : _) -> Just s + s@[] -> Just s + -- found whitespace, continue + c : s | is_space c -> checkAllWs s + -- anything else, stop + _ -> Nothing + in go rmFirstNewline = \case - LexedChar '\n' _ : s -> s + '\n' : s -> s s -> s + -- resolve escape characters, deferred from lexString. guaranteed + -- to not throw any errors, since we already checked them in lexString + resolveEscapeChars = \case + [] -> [] + '\\' : s -> + -- concretizing 'loc' to String: + -- resolveEscapeCharacter :: (String -> Maybe (Char, String)) -> String -> Either _ (Char, String) + case resolveEscapeCharacter uncons s of + Left e -> panic $ "resolving escape characters in multiline string unexpectedly found errors: " ++ show e + Right (c, s') -> c : resolveEscapeChars s' + c : s -> c : resolveEscapeChars s + + uncons = \case + c : cs -> Just (c, cs) + [] -> Nothing + -- ----------------------------------------------------------------------------- -- Helpers -isLexedSpace :: LexedChar loc -> Bool -isLexedSpace = isSpace . unLexedChar +isAnyChar :: Char -> Bool +isAnyChar c + | c > '\x7f' = isPrint c + | otherwise = is_any c View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d45104563b451983547d739bafd381f5fbb3b8a0 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d45104563b451983547d739bafd381f5fbb3b8a0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 09:16:30 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 16 Jul 2024 05:16:30 -0400 Subject: [Git][ghc/ghc][wip/deb10-migration] 6 commits: isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <66963a6eb3efc_219cf76cf6ec6989@gitlab.mail> Matthew Pickering pushed to branch wip/deb10-migration at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - e9730638 by Matthew Pickering at 2024-07-16T10:16:18+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Utils/Env.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/da4474bfe93b22e41321cb4d44afae1e7186a39a...e97306388e772bace62e05f92f87e4416e60eabe -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/da4474bfe93b22e41321cb4d44afae1e7186a39a...e97306388e772bace62e05f92f87e4416e60eabe You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 10:27:21 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Tue, 16 Jul 2024 06:27:21 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/vendor-semaphore Message-ID: <66964b09e6d9b_219cf710bac24163e4@gitlab.mail> Zubin pushed new branch wip/vendor-semaphore at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/vendor-semaphore You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 10:49:02 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 16 Jul 2024 06:49:02 -0400 Subject: [Git][ghc/ghc][wip/deb10-migration] ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <6696501e51686_219cf71244f90194f4@gitlab.mail> Matthew Pickering pushed to branch wip/deb10-migration at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 5 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 486541129a8e7bf77c2cf7cd76ca998f690d5685 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = @@ -1151,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/203830065b81fe29003c1640a354f11661ffc604 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/203830065b81fe29003c1640a354f11661ffc604 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 13:25:50 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 16 Jul 2024 09:25:50 -0400 Subject: [Git][ghc/ghc][wip/T24984] Fix egregious bug in any2 Message-ID: <669674deeba33_2454092ffcd857647@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: cc6e9cd2 by Simon Peyton Jones at 2024-07-16T14:25:29+01:00 Fix egregious bug in any2 - - - - - 5 changed files: - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Utils/Misc.hs Changes: ===================================== compiler/GHC/Core/Predicate.hs ===================================== @@ -194,7 +194,7 @@ getEqPredRole ty = eqRelRole (predTypeEqRel ty) -- | Get the equality relation relevant for a pred type -- Returns NomEq for dictionary predicates, etc -predTypeEqRel :: HasDebugCallStack => PredType -> EqRel +predTypeEqRel :: PredType -> EqRel predTypeEqRel ty | isReprEqPrimPred ty = ReprEq | otherwise = NomEq ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -171,7 +171,7 @@ module GHC.Core.Type ( anyFreeVarsOfType, anyFreeVarsOfTypes, noFreeVarsOfType, - expandTypeSynonyms, + expandTypeSynonyms, expandSynTyConApp_maybe, typeSize, occCheckExpand, -- ** Closing over kinds ===================================== compiler/GHC/Tc/Solver/InertSet.hs ===================================== @@ -1516,6 +1516,10 @@ data KickOutSpec -- See Note [KickOutSpec] | KOAfterAdding CanEqLHS -- We are adding to the inert set a canonical equality -- constraint with this LHS +instance Outputable KickOutSpec where + ppr (KOAfterUnify tvs) = text "KOAfterUnify" <> ppr tvs + ppr (KOAfterAdding lhs) = text "KOAfterAdding" <> parens (ppr lhs) + {- Note [KickOutSpec] ~~~~~~~~~~~~~~~~~~~~~~ KickOutSpec explains why we are kicking out. @@ -1632,8 +1636,10 @@ kickOutRewritableLHS ko_spec new_fr@(_, new_role) kick_out_eq :: EqCt -> Bool kick_out_eq (EqCt { eq_lhs = lhs, eq_rhs = rhs_ty , eq_ev = ev, eq_eq_rel = eq_rel }) + + -- (KK0) Keep it in the inert set if the new thing can't rewrite it | not (fr_may_rewrite fs) - = False -- (KK0) Keep it in the inert set if the new thing can't rewrite it + = False -- Below here (fr_may_rewrite fs) is True ===================================== compiler/GHC/Tc/Utils/TcType.hs ===================================== @@ -1012,21 +1012,26 @@ any_rewritable :: EqRel -- Ambient role -- -- See Note [Rewritable] in GHC.Tc.Solver.InertSet for a specification for this function. {-# INLINE any_rewritable #-} -- this allows specialization of predicates -any_rewritable role tv_pred tc_pred - = go False emptyVarSet role +any_rewritable role tv_pred tc_pred ty + = go False emptyVarSet role ty where go_tv uf bvs rl tv | tv `elemVarSet` bvs = False | otherwise = tv_pred uf rl tv go :: UnderFam -> VarSet -> EqRel -> TcType -> Bool - go under_fam bvs rl ty@(TyConApp tc tys) - | isFamFreeTyCon tc -- Not a type family, not a synonym hiding type families - = go_tc under_fam bvs rl tc tys + go under_fam bvs rl (TyConApp tc tys) - | Just ty' <- coreView ty -- Expand synonyms + -- Expand synonyms, unless (a) we are at Nominal role and (b) the synonym + -- is type-family-free; then it suffices just to look at the args + | isTypeSynonymTyCon tc + , case rl of { NomEq -> not (isFamFreeTyCon tc); ReprEq -> True } + , Just ty' <- expandSynTyConApp_maybe tc tys = go under_fam bvs rl ty' - | isTypeFamilyTyCon tc + -- Check if we are going under a type family application + | case rl of + NomEq -> isTypeFamilyTyCon tc + ReprEq -> isFamilyTyCon tc = if | tc_pred under_fam rl tc tys -> True | otherwise -> go_fam under_fam (tyConArity tc) bvs tys @@ -1048,12 +1053,12 @@ any_rewritable role tv_pred tc_pred go_tc uf bvs NomEq _ tys = any (go uf bvs NomEq) tys go_tc uf bvs ReprEq tc tys = any2 (go_arg uf bvs) tys (tyConRoleListRepresentational tc) - go_arg uf bvs ty Nominal = go uf bvs NomEq ty + go_arg uf bvs ty Nominal = go uf bvs NomEq ty go_arg uf bvs ty Representational = go uf bvs ReprEq ty go_arg _ _ _ Phantom = False -- We never rewrite with phantoms - -- For a type-family application (F t1 .. tn), all arguments have Nominal role - -- (whether in F's arity or, if over-saturated, beyond it) + -- For a type-family or data-family application (F t1 .. tn), all arguments + -- have Nominal role (whether in F's arity or, if over-saturated, beyond it) -- Switch on under_fam for arguments <= arity go_fam uf 0 bvs tys = any (go uf bvs NomEq) tys -- Like AppTy go_fam _ _ _ [] = False ===================================== compiler/GHC/Utils/Misc.hs ===================================== @@ -655,7 +655,7 @@ all2 _ _ _ = False any2 :: (a -> b -> Bool) -> [a] -> [b] -> Bool -- True if any of the corresponding elements satisfy the predicate -- Unlike `all2`, this ignores excess elements of the other list -any2 p (x:xs) (y:ys) = p x y || all2 p xs ys +any2 p (x:xs) (y:ys) = p x y || any2 p xs ys any2 _ _ _ = False -- Count the number of times a predicate is true View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc6e9cd20bcdd06d01b5902c750c785e5c67ef8d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc6e9cd20bcdd06d01b5902c750c785e5c67ef8d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 15:07:49 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 16 Jul 2024 11:07:49 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25055 Message-ID: <66968cc51abaa_20679c6a6558718da@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25055 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25055 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 15:46:27 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 11:46:27 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] 15 commits: isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <669695d3bc6d1_20679c8ff19c783a5@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - b6442dfb by Brandon Chinn at 2024-07-16T15:46:24+00:00 Add MultilineStrings extension - - - - - 2aa33311 by Brandon Chinn at 2024-07-16T15:46:24+00:00 Add test cases for MultilineStrings - - - - - 26b9647d by Brandon Chinn at 2024-07-16T15:46:24+00:00 Break out common lex_magic_hash logic for strings and chars - - - - - 64a99afb by Brandon Chinn at 2024-07-16T15:46:24+00:00 Factor out string processing functions - - - - - c8e86611 by Brandon Chinn at 2024-07-16T15:46:24+00:00 Implement MultilineStrings (#24390) Updates haddock submodule for new ITmultiline constructor - - - - - 82103cf9 by Brandon Chinn at 2024-07-16T15:46:24+00:00 Add docs for MultilineStrings - - - - - 05062a2b by Brandon Chinn at 2024-07-16T15:46:24+00:00 Address feedback - - - - - 785f338b by Brandon Chinn at 2024-07-16T15:46:24+00:00 Add string literal performance test - - - - - a437ed4d by Brandon Chinn at 2024-07-16T15:46:24+00:00 Address feedback - - - - - c788c5a1 by Brandon Chinn at 2024-07-16T15:46:24+00:00 Reimplement with manual iteration - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d45104563b451983547d739bafd381f5fbb3b8a0...c788c5a1e5b18db96eb71f7add0e7aebc4101db3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d45104563b451983547d739bafd381f5fbb3b8a0...c788c5a1e5b18db96eb71f7add0e7aebc4101db3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 15:57:06 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 11:57:06 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] 10 commits: Add MultilineStrings extension Message-ID: <669698521f6ea_20679ca14618807fd@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 7b2337c1 by Brandon Chinn at 2024-07-14T09:55:33-07:00 Add MultilineStrings extension - - - - - 6401ec7f by Brandon Chinn at 2024-07-14T09:55:33-07:00 Add test cases for MultilineStrings - - - - - af3d2fcc by Brandon Chinn at 2024-07-14T09:55:33-07:00 Break out common lex_magic_hash logic for strings and chars - - - - - 563df04a by Brandon Chinn at 2024-07-14T09:55:33-07:00 Factor out string processing functions - - - - - 1515d3e3 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Implement MultilineStrings (#24390) Updates haddock submodule for new ITmultiline constructor - - - - - 848c9133 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Add docs for MultilineStrings - - - - - 43e081c9 by Brandon Chinn at 2024-07-14T09:55:34-07:00 Address feedback - - - - - c9096320 by Brandon Chinn at 2024-07-15T18:40:27-07:00 Add string literal performance test - - - - - c5fc1002 by Brandon Chinn at 2024-07-15T18:40:27-07:00 Address feedback - - - - - d4510456 by Brandon Chinn at 2024-07-15T23:17:58-07:00 Reimplement with manual iteration - - - - - 30 changed files: - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/literals.rst - + docs/users_guide/exts/multiline_strings.rst - libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/driver/T4437.hs - testsuite/tests/interface-stability/template-haskell-exports.stdout - + testsuite/tests/parser/should_fail/MultilineStringsError.hs - + testsuite/tests/parser/should_fail/MultilineStringsError.stderr - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.hs - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.stderr - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.hs - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.stderr - testsuite/tests/parser/should_fail/all.T - + testsuite/tests/parser/should_run/MultilineStrings.hs - + testsuite/tests/parser/should_run/MultilineStrings.stdout - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.hs - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c788c5a1e5b18db96eb71f7add0e7aebc4101db3...d45104563b451983547d739bafd381f5fbb3b8a0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c788c5a1e5b18db96eb71f7add0e7aebc4101db3...d45104563b451983547d739bafd381f5fbb3b8a0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 15:57:43 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 16 Jul 2024 11:57:43 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] 15 commits: isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <6696987796ab1_20679ca685d8815e3@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 5233d4b6 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Add MultilineStrings extension - - - - - a993ae97 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Add test cases for MultilineStrings - - - - - edd2f1d5 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Break out common lex_magic_hash logic for strings and chars - - - - - ada6a2e1 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Factor out string processing functions - - - - - db433ff6 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Implement MultilineStrings (#24390) Updates haddock submodule for new ITmultiline constructor - - - - - a5b2e64f by Brandon Chinn at 2024-07-16T08:57:33-07:00 Add docs for MultilineStrings - - - - - 364e0cad by Brandon Chinn at 2024-07-16T08:57:33-07:00 Address feedback - - - - - c760383c by Brandon Chinn at 2024-07-16T08:57:33-07:00 Add string literal performance test - - - - - cdcfbbcd by Brandon Chinn at 2024-07-16T08:57:33-07:00 Address feedback - - - - - 17fca619 by Brandon Chinn at 2024-07-16T08:57:33-07:00 Reimplement with manual iteration - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d45104563b451983547d739bafd381f5fbb3b8a0...17fca61947b17f7d3baf29241c5d16defc9e250f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d45104563b451983547d739bafd381f5fbb3b8a0...17fca61947b17f7d3baf29241c5d16defc9e250f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 16:24:55 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 16 Jul 2024 12:24:55 -0400 Subject: [Git][ghc/ghc][wip/T24984] 9 commits: isIrrefutableHsPat: consider COMPLETE pragmas Message-ID: <66969ed749fd5_20679cd6a2a482854@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - a1d1b189 by Simon Peyton Jones at 2024-07-16T17:24:39+01:00 Work in progress on rejigging kick-out - - - - - de87a75e by Simon Peyton Jones at 2024-07-16T17:24:39+01:00 Wibbles - - - - - 1b309a3f by Simon Peyton Jones at 2024-07-16T17:24:39+01:00 Fix egregious bug in any2 - - - - - add92ec7 by Simon Peyton Jones at 2024-07-16T17:24:39+01:00 Add a very important rider to (KK3) (Not properly documented yet.) - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/IfaceToCore.hs-boot - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Pat.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Utils/Env.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc6e9cd20bcdd06d01b5902c750c785e5c67ef8d...add92ec7c0f58a4038602e2ffe413ed510690849 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cc6e9cd20bcdd06d01b5902c750c785e5c67ef8d...add92ec7c0f58a4038602e2ffe413ed510690849 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 21:14:06 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Tue, 16 Jul 2024 17:14:06 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Make ApplicativeDo work with HsExpansions Message-ID: <6696e29e60759_3b7f524764b8773e@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: e359a879 by Apoorv Ingle at 2024-07-16T16:13:26-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 28 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -475,9 +475,12 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) +-- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ Optional statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -490,8 +493,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded + -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +521,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_doTcApp = doTcApp}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour -- ^ source statement do flavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and --- expanded expression an associate with a provided location +-- expanded expression and associate it with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +607,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +855,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +902,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1013,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1065,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1585,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1626,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1686,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,7 +1708,7 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the @@ -1733,7 +1749,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1768,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1814,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1834,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1862,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -194,8 +194,8 @@ but several have a little bit of special treatment: (return (f x)))) See Note [Expanding HsDo with XXExprGhcRn] in `Ghc.Tc.Gen.Do` for more details. - To understand why is this done in the typechecker and not in the renamer. - See Note [Doing XXExprGhcRn in the Renamer vs Typechecker] + To understand why is this done in the typechecker and not in the renamer + see Note [Doing XXExprGhcRn in the Renamer vs Typechecker] Note [Overloaded labels] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1838,8 +1838,18 @@ ApplicativeDo * * ************************************************************************ -Note [ApplicativeDo] -~~~~~~~~~~~~~~~~~~~~ +Note [Overview of ApplicativeDo] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* The parser produces a list of statements `[Stmt]` for a `do` expression. +* If `ApplicativeDo` flag is set, the renamer calls `Rename.Expr.postProcessStmtsForApplicativeDo` + on the list of statements and the statements which can be parallalized + are clubbed together in an `ApplicativeStmt`. See example below. +* The expansion step in `GHC.Tc.Gen.Do.expandDo` transforms this list of statements, + into binds, fmaps etc. according to the expansion rules given below in = Expansion for do = +* The desugarer in `GHC.HsToCore.dsExpr` does not have any special treatement + for do statements as they are just normal expressions. + = Example = For a sequence of statements @@ -1926,20 +1936,20 @@ split({stmt_1; ..; stmt_n) = -- 1 <= i <= n -- i is a good place to insert a bind -== Desugaring for do == +== Expansion for do == -dsDo {} expr = expr +expandStmt {} expr = expr -dsDo {pat <- rhs; stmts} expr = - rhs >>= \pat -> dsDo stmts expr +expandStmt {pat <- rhs; stmts} expr = + rhs >>= \pat -> expandStmt stmts expr -dsDo {(arg_1 | ... | arg_n)} (return expr) = +expandStmt {(arg_1 | ... | arg_n)} (return expr) = (\argpat (arg_1) .. argpat(arg_n) -> expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) -dsDo {(arg_1 | ... | arg_n); stmts} expr = +expandStmt {(arg_1 | ... | arg_n); stmts} expr = join (\argpat (arg_1) .. argpat(arg_n) -> dsDo stmts expr) <$> argexpr(arg_1) <*> ... @@ -1964,15 +1974,10 @@ ApplicativeDo touches a few phases in the compiler: don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match - -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -1991,7 +1996,7 @@ instance Outputable MonadNames where ] -- | rearrange a list of statements using ApplicativeDoStmt. See --- Note [ApplicativeDo]. +-- Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo :: HsDoFlavour -> [(ExprLStmt GhcRn, FreeVars)] @@ -1999,7 +2004,7 @@ rearrangeForApplicativeDo rearrangeForApplicativeDo _ [] = return ([], emptyNameSet) -- If the do-block contains a single @return@ statement, change it to --- @pure@ if ApplicativeDo is turned on. See Note [ApplicativeDo]. +-- @pure@ if ApplicativeDo is turned on. See Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo ctxt [(one,_)] = do (return_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) returnMName (pure_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) pureAName @@ -2222,12 +2227,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -541,7 +541,7 @@ tcValArg do_ql (EValArg { ea_ctxt = ctxt do { traceTc "tcValArg" $ vcat [ ppr ctxt , text "arg type:" <+> ppr sc_arg_ty - , text "arg:" <+> ppr arg ] + , text "arg:" <+> ppr larg ] -- Crucial step: expose QL results before checking exp_arg_ty -- So far as the paper is concerned, this step applies @@ -576,7 +576,8 @@ tcValArg _ (EValArgQL { eaql_wanted = wanted do { -- Expose QL results to tcSkolemise, as in EValArg case Scaled mult exp_arg_ty <- liftZonkM $ zonkScaledTcType sc_arg_ty - ; traceTc "tcEValArgQL {" (vcat [ text "app_res_rho:" <+> ppr app_res_rho + ; traceTc "tcEValArgQL {" (vcat [ ppr ctxt + , text "app_res_rho:" <+> ppr app_res_rho , text "exp_arg_ty:" <+> ppr exp_arg_ty , text "args:" <+> ppr inst_args ]) @@ -649,10 +650,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -845,6 +846,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; return (mkScaled mult_ty arg_nu) } + -- Is the argument supposed to instantiate a forall? -- -- In other words, given a function application `fn arg`, @@ -896,24 +898,26 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode + ; traceTc "addArgCtxt" (ppr in_generated_code) ; case ctxt of - VACall fun arg_no _ | not in_generated_code + VACall fun arg_no _ + | not in_generated_code -> do setSrcSpanA arg_loc $ addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1048,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2256,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType @@ -52,66 +52,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav False expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -120,29 +107,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr_do doFlavour pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -162,12 +149,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -183,35 +170,126 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (((body <$> e1) <*> e2) ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) }) = + do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = L rhs_loc $ mkRnBindStmt pat (L rhs_loc rhs) + do_arg (ApplicativeArgMany { app_stmts = stmts + , final_expr = ret@(L ret_loc _) + , bv_pattern = pat + , stmt_context = ctxt }) = + do { xx_expr <- (wrapGenSpan . unLoc) <$> (expand_do_stmts addPop ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret]) + ; traceTc "do_arg" (text "ManyArg" <+> ppr addPop <+> vcat [ppr (stmts ++ [L ret_loc $ mkLastStmt ret]), text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr addPop doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) + + +mk_failable_expr_do :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr_do doFlav lpat@(L loc pat) expr fail_op = + do { is_strict <- xoptM LangExt.Strict + ; rdrEnv <- getGlobalRdrEnv + ; comps <- getCompleteMatchesTcM + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat + ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat + , text "isIrrefutable:" <+> ppr irrf_pat + ]) + + ; if irrf_pat -- don't wrap with fail block if + -- the pattern is irrefutable + then genHsLamDoExp doFlav [lpat] expr + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op + } + -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM - ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) pat + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -219,22 +297,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -301,14 +379,31 @@ They capture the essence of statement expansions as implemented in `expand_do_st = (>>=) e (\vars -> ‹PopErrCtxt›DO【 sss 】)) where (vars, e) = RECDO【 ss 】 - (5) DO【 s 】 = s + (5) DO【 s 】 = ‹ExpansionStmt s› s + + (6) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. - (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) + (7) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [Overview of ApplicativeDo] in GHC.Rename.Expr + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (8) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,32 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 + = setSrcSpanA loc $ + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc _) flav <- o + , doTcApp + = setSrcSpanA loc $ + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o + , not doTcApp = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,25 +325,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise + go (XExpr (ExpandedThingRn o e _)) ctxt args = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,18 +555,16 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt - thing_inside +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside + = setSrcSpanA loc $ addStmtCtxt stmt flav $ thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise - = setSrcSpan fun_loc $ - do case fun_ctxt of - VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - _ -> thing_inside + = do case fun_ctxt of + VAExpansion (OrigExpr orig) _ _ -> setSrcSpan fun_loc $ addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside + _ -> setSrcSpan fun_loc $ thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1247,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1262,8 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L l e)) -> addExprCtxt e $ thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -77,7 +77,6 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -352,22 +351,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -998,18 +989,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1065,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,22 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In a stmt of a 'do' block: return $ MkT fa - In the expression: - do return () - MkT fa <- runf - return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,23 +63,37 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) - In the expression: + • In the expression: do x1 <- getChar x2 <- getChar x3 <- const (return ()) x1 x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +101,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e359a8795637f801291cf80259f863cc5c317009 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e359a8795637f801291cf80259f863cc5c317009 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 21:59:59 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Tue, 16 Jul 2024 17:59:59 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 4 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <6696ed5f38a7b_3b7f5275ee508326@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - e683f8d2 by Apoorv Ingle at 2024-07-16T16:59:42-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - .gitlab/generate-ci/gen_ci.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout - utils/haddock/haddock-api/src/Haddock.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e359a8795637f801291cf80259f863cc5c317009...e683f8d25c61220fc40f83b48e6f85061cb3c937 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e359a8795637f801291cf80259f863cc5c317009...e683f8d25c61220fc40f83b48e6f85061cb3c937 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 22:04:38 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Tue, 16 Jul 2024 18:04:38 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Make ApplicativeDo work with HsExpansions Message-ID: <6696ee7671f36_3b7f528078d487b4@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 66e8a1c6 by Apoorv Ingle at 2024-07-16T17:04:05-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 28 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -475,9 +475,12 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) +-- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ Optional statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -490,8 +493,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded + -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +521,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_doTcApp = doTcApp}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour -- ^ source statement do flavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and --- expanded expression an associate with a provided location +-- expanded expression and associate it with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +607,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +855,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +902,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1013,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1065,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1585,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1626,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1686,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,7 +1708,7 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the @@ -1733,7 +1749,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1768,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1814,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1834,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1862,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -194,8 +194,8 @@ but several have a little bit of special treatment: (return (f x)))) See Note [Expanding HsDo with XXExprGhcRn] in `Ghc.Tc.Gen.Do` for more details. - To understand why is this done in the typechecker and not in the renamer. - See Note [Doing XXExprGhcRn in the Renamer vs Typechecker] + To understand why is this done in the typechecker and not in the renamer + see Note [Doing XXExprGhcRn in the Renamer vs Typechecker] Note [Overloaded labels] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1838,8 +1838,18 @@ ApplicativeDo * * ************************************************************************ -Note [ApplicativeDo] -~~~~~~~~~~~~~~~~~~~~ +Note [Overview of ApplicativeDo] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* The parser produces a list of statements `[Stmt]` for a `do` expression. +* If `ApplicativeDo` flag is set, the renamer calls `Rename.Expr.postProcessStmtsForApplicativeDo` + on the list of statements and the statements which can be parallalized + are clubbed together in an `ApplicativeStmt`. See example below. +* The expansion step in `GHC.Tc.Gen.Do.expandDo` transforms this list of statements, + into binds, fmaps etc. according to the expansion rules given below in = Expansion for do = +* The desugarer in `GHC.HsToCore.dsExpr` does not have any special treatement + for do statements as they are just normal expressions. + = Example = For a sequence of statements @@ -1926,20 +1936,20 @@ split({stmt_1; ..; stmt_n) = -- 1 <= i <= n -- i is a good place to insert a bind -== Desugaring for do == +== Expansion for do == -dsDo {} expr = expr +expandStmt {} expr = expr -dsDo {pat <- rhs; stmts} expr = - rhs >>= \pat -> dsDo stmts expr +expandStmt {pat <- rhs; stmts} expr = + rhs >>= \pat -> expandStmt stmts expr -dsDo {(arg_1 | ... | arg_n)} (return expr) = +expandStmt {(arg_1 | ... | arg_n)} (return expr) = (\argpat (arg_1) .. argpat(arg_n) -> expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) -dsDo {(arg_1 | ... | arg_n); stmts} expr = +expandStmt {(arg_1 | ... | arg_n); stmts} expr = join (\argpat (arg_1) .. argpat(arg_n) -> dsDo stmts expr) <$> argexpr(arg_1) <*> ... @@ -1964,15 +1974,10 @@ ApplicativeDo touches a few phases in the compiler: don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match - -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -1991,7 +1996,7 @@ instance Outputable MonadNames where ] -- | rearrange a list of statements using ApplicativeDoStmt. See --- Note [ApplicativeDo]. +-- Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo :: HsDoFlavour -> [(ExprLStmt GhcRn, FreeVars)] @@ -1999,7 +2004,7 @@ rearrangeForApplicativeDo rearrangeForApplicativeDo _ [] = return ([], emptyNameSet) -- If the do-block contains a single @return@ statement, change it to --- @pure@ if ApplicativeDo is turned on. See Note [ApplicativeDo]. +-- @pure@ if ApplicativeDo is turned on. See Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo ctxt [(one,_)] = do (return_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) returnMName (pure_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) pureAName @@ -2222,12 +2227,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -541,7 +541,7 @@ tcValArg do_ql (EValArg { ea_ctxt = ctxt do { traceTc "tcValArg" $ vcat [ ppr ctxt , text "arg type:" <+> ppr sc_arg_ty - , text "arg:" <+> ppr arg ] + , text "arg:" <+> ppr larg ] -- Crucial step: expose QL results before checking exp_arg_ty -- So far as the paper is concerned, this step applies @@ -576,7 +576,8 @@ tcValArg _ (EValArgQL { eaql_wanted = wanted do { -- Expose QL results to tcSkolemise, as in EValArg case Scaled mult exp_arg_ty <- liftZonkM $ zonkScaledTcType sc_arg_ty - ; traceTc "tcEValArgQL {" (vcat [ text "app_res_rho:" <+> ppr app_res_rho + ; traceTc "tcEValArgQL {" (vcat [ ppr ctxt + , text "app_res_rho:" <+> ppr app_res_rho , text "exp_arg_ty:" <+> ppr exp_arg_ty , text "args:" <+> ppr inst_args ]) @@ -649,10 +650,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -845,6 +846,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; return (mkScaled mult_ty arg_nu) } + -- Is the argument supposed to instantiate a forall? -- -- In other words, given a function application `fn arg`, @@ -896,24 +898,26 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode + ; traceTc "addArgCtxt" (ppr in_generated_code) ; case ctxt of - VACall fun arg_no _ | not in_generated_code + VACall fun arg_no _ + | not in_generated_code -> do setSrcSpanA arg_loc $ addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1048,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2256,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType @@ -52,66 +52,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav False expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -120,29 +107,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr False doFlavour Nothing pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -162,12 +149,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -183,35 +170,108 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (((body <$> e1) <*> e2) ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) }) = + do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = L rhs_loc $ mkRnBindStmt pat (L rhs_loc rhs) + do_arg (ApplicativeArgMany { app_stmts = stmts + , final_expr = ret@(L ret_loc _) + , bv_pattern = pat + , stmt_context = ctxt }) = + do { xx_expr <- (wrapGenSpan . unLoc) <$> (expand_do_stmts addPop ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret]) + ; traceTc "do_arg" (text "ManyArg" <+> ppr addPop <+> vcat [ppr (stmts ++ [L ret_loc $ mkLastStmt ret]), text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr addPop doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM - ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) pat + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -219,22 +279,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -301,14 +361,31 @@ They capture the essence of statement expansions as implemented in `expand_do_st = (>>=) e (\vars -> ‹PopErrCtxt›DO【 sss 】)) where (vars, e) = RECDO【 ss 】 - (5) DO【 s 】 = s + (5) DO【 s 】 = ‹ExpansionStmt s› s + + (6) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. - (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) + (7) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [Overview of ApplicativeDo] in GHC.Rename.Expr + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (8) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,32 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 + = setSrcSpanA loc $ + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc _) flav <- o + , doTcApp + = setSrcSpanA loc $ + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o + , not doTcApp = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,25 +325,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise + go (XExpr (ExpandedThingRn o e _)) ctxt args = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,18 +555,16 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt - thing_inside +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside + = setSrcSpanA loc $ addStmtCtxt stmt flav $ thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise - = setSrcSpan fun_loc $ - do case fun_ctxt of - VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - _ -> thing_inside + = do case fun_ctxt of + VAExpansion (OrigExpr orig) _ _ -> setSrcSpan fun_loc $ addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside + _ -> setSrcSpan fun_loc $ thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1247,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1262,8 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L _ e)) -> addExprCtxt e $ thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -77,7 +77,6 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -352,22 +351,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -998,18 +989,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1065,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,22 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In a stmt of a 'do' block: return $ MkT fa - In the expression: - do return () - MkT fa <- runf - return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,23 +63,37 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) - In the expression: + • In the expression: do x1 <- getChar x2 <- getChar x3 <- const (return ()) x1 x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +101,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/66e8a1c687800424e47b7309f84edac4671a8b53 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/66e8a1c687800424e47b7309f84edac4671a8b53 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 22:16:10 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Tue, 16 Jul 2024 18:16:10 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Make ApplicativeDo work with HsExpansions Message-ID: <6696f12a9b4e4_3b7f5294167893d1@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 731dd45a by Apoorv Ingle at 2024-07-16T17:15:38-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 28 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -475,9 +475,12 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) +-- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ Optional statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -490,8 +493,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded + -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +521,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_doTcApp = doTcApp}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour -- ^ source statement do flavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and --- expanded expression an associate with a provided location +-- expanded expression and associate it with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +607,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +855,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +902,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1013,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1065,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1585,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1626,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1686,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,14 +1708,14 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the -- appropriate applicative expression by the desugarer, but it is intended -- to be invisible in error messages. -- --- For full details, see Note [ApplicativeDo] in "GHC.Rename.Expr" +-- For full details, see Note [Overview of ApplicativeDo] in "GHC.Rename.Expr" -- data ApplicativeStmt idL idR = ApplicativeStmt @@ -1733,7 +1749,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1768,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1814,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1834,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1862,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -194,8 +194,8 @@ but several have a little bit of special treatment: (return (f x)))) See Note [Expanding HsDo with XXExprGhcRn] in `Ghc.Tc.Gen.Do` for more details. - To understand why is this done in the typechecker and not in the renamer. - See Note [Doing XXExprGhcRn in the Renamer vs Typechecker] + To understand why is this done in the typechecker and not in the renamer + see Note [Doing XXExprGhcRn in the Renamer vs Typechecker] Note [Overloaded labels] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1838,8 +1838,18 @@ ApplicativeDo * * ************************************************************************ -Note [ApplicativeDo] -~~~~~~~~~~~~~~~~~~~~ +Note [Overview of ApplicativeDo] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* The parser produces a list of statements `[Stmt]` for a `do` expression. +* If `ApplicativeDo` flag is set, the renamer calls `Rename.Expr.postProcessStmtsForApplicativeDo` + on the list of statements and the statements which can be parallalized + are clubbed together in an `ApplicativeStmt`. See example below. +* The expansion step in `GHC.Tc.Gen.Do.expandDo` transforms this list of statements, + into binds, fmaps etc. according to the expansion rules given below in = Expansion for do = +* The desugarer in `GHC.HsToCore.dsExpr` does not have any special treatement + for do statements as they are just normal expressions. + = Example = For a sequence of statements @@ -1926,20 +1936,20 @@ split({stmt_1; ..; stmt_n) = -- 1 <= i <= n -- i is a good place to insert a bind -== Desugaring for do == +== Expansion for do == -dsDo {} expr = expr +expandStmt {} expr = expr -dsDo {pat <- rhs; stmts} expr = - rhs >>= \pat -> dsDo stmts expr +expandStmt {pat <- rhs; stmts} expr = + rhs >>= \pat -> expandStmt stmts expr -dsDo {(arg_1 | ... | arg_n)} (return expr) = +expandStmt {(arg_1 | ... | arg_n)} (return expr) = (\argpat (arg_1) .. argpat(arg_n) -> expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) -dsDo {(arg_1 | ... | arg_n); stmts} expr = +expandStmt {(arg_1 | ... | arg_n); stmts} expr = join (\argpat (arg_1) .. argpat(arg_n) -> dsDo stmts expr) <$> argexpr(arg_1) <*> ... @@ -1964,15 +1974,10 @@ ApplicativeDo touches a few phases in the compiler: don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match - -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -1991,7 +1996,7 @@ instance Outputable MonadNames where ] -- | rearrange a list of statements using ApplicativeDoStmt. See --- Note [ApplicativeDo]. +-- Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo :: HsDoFlavour -> [(ExprLStmt GhcRn, FreeVars)] @@ -1999,7 +2004,7 @@ rearrangeForApplicativeDo rearrangeForApplicativeDo _ [] = return ([], emptyNameSet) -- If the do-block contains a single @return@ statement, change it to --- @pure@ if ApplicativeDo is turned on. See Note [ApplicativeDo]. +-- @pure@ if ApplicativeDo is turned on. See Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo ctxt [(one,_)] = do (return_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) returnMName (pure_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) pureAName @@ -2222,12 +2227,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -541,7 +541,7 @@ tcValArg do_ql (EValArg { ea_ctxt = ctxt do { traceTc "tcValArg" $ vcat [ ppr ctxt , text "arg type:" <+> ppr sc_arg_ty - , text "arg:" <+> ppr arg ] + , text "arg:" <+> ppr larg ] -- Crucial step: expose QL results before checking exp_arg_ty -- So far as the paper is concerned, this step applies @@ -576,7 +576,8 @@ tcValArg _ (EValArgQL { eaql_wanted = wanted do { -- Expose QL results to tcSkolemise, as in EValArg case Scaled mult exp_arg_ty <- liftZonkM $ zonkScaledTcType sc_arg_ty - ; traceTc "tcEValArgQL {" (vcat [ text "app_res_rho:" <+> ppr app_res_rho + ; traceTc "tcEValArgQL {" (vcat [ ppr ctxt + , text "app_res_rho:" <+> ppr app_res_rho , text "exp_arg_ty:" <+> ppr exp_arg_ty , text "args:" <+> ppr inst_args ]) @@ -649,10 +650,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -845,6 +846,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; return (mkScaled mult_ty arg_nu) } + -- Is the argument supposed to instantiate a forall? -- -- In other words, given a function application `fn arg`, @@ -896,24 +898,26 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode + ; traceTc "addArgCtxt" (ppr in_generated_code) ; case ctxt of - VACall fun arg_no _ | not in_generated_code + VACall fun arg_no _ + | not in_generated_code -> do setSrcSpanA arg_loc $ addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1048,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2256,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType @@ -52,66 +52,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav False expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -120,29 +107,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr False doFlavour Nothing pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -162,12 +149,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -183,35 +170,108 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (((body <$> e1) <*> e2) ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) }) = + do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = L rhs_loc $ mkRnBindStmt pat (L rhs_loc rhs) + do_arg (ApplicativeArgMany { app_stmts = stmts + , final_expr = ret@(L ret_loc _) + , bv_pattern = pat + , stmt_context = ctxt }) = + do { xx_expr <- (wrapGenSpan . unLoc) <$> (expand_do_stmts addPop ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret]) + ; traceTc "do_arg" (text "ManyArg" <+> ppr addPop <+> vcat [ppr (stmts ++ [L ret_loc $ mkLastStmt ret]), text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr addPop doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM - ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) pat + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -219,22 +279,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -301,14 +361,31 @@ They capture the essence of statement expansions as implemented in `expand_do_st = (>>=) e (\vars -> ‹PopErrCtxt›DO【 sss 】)) where (vars, e) = RECDO【 ss 】 - (5) DO【 s 】 = s + (5) DO【 s 】 = ‹ExpansionStmt s› s + + (6) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. - (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) + (7) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [Overview of ApplicativeDo] in GHC.Rename.Expr + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (8) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,32 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 + = setSrcSpanA loc $ + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc _) flav <- o + , doTcApp + = setSrcSpanA loc $ + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o + , not doTcApp = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,25 +325,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise + go (XExpr (ExpandedThingRn o e _)) ctxt args = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,18 +555,16 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt - thing_inside +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside + = setSrcSpanA loc $ addStmtCtxt stmt flav $ thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise - = setSrcSpan fun_loc $ - do case fun_ctxt of - VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - _ -> thing_inside + = do case fun_ctxt of + VAExpansion (OrigExpr orig) _ _ -> setSrcSpan fun_loc $ addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside + _ -> setSrcSpan fun_loc $ thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1247,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1262,8 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L _ e)) -> addExprCtxt e $ thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -77,7 +77,6 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -352,22 +351,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -998,18 +989,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1065,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,22 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In a stmt of a 'do' block: return $ MkT fa - In the expression: - do return () - MkT fa <- runf - return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,23 +63,37 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) - In the expression: + • In the expression: do x1 <- getChar x2 <- getChar x3 <- const (return ()) x1 x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +101,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/731dd45a1c59377ef589a2b6afef06465a6e5547 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/731dd45a1c59377ef589a2b6afef06465a6e5547 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 16 22:45:48 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 16 Jul 2024 18:45:48 -0400 Subject: [Git][ghc/ghc][wip/T24978] Fix perf bug Message-ID: <6696f81c602a0_2f3fc2104b905937b@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 6ecf1860 by Simon Peyton Jones at 2024-07-16T23:45:16+01:00 Fix perf bug - - - - - 1 changed file: - compiler/GHC/Core/Coercion.hs Changes: ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -2496,17 +2496,18 @@ coercion_lr_kind which orig_co go_app co args = piResultTys (go co) args ------------- - go_ax (BuiltInFamRewrite bif) cos = check_bif_res (bifrw_proves bif (map coercionKind cos)) - go_ax (BuiltInFamInteract bif) [co] = check_bif_res (bifint_proves bif (coercionKind co)) - go_ax (BuiltInFamInteract {}) _ = crash - go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos - go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos + go_ax axr@(BuiltInFamRewrite bif) cos = check_bif_res axr (bifrw_proves bif (map coercionKind cos)) + go_ax axr@(BuiltInFamInteract bif) [co] = check_bif_res axr (bifint_proves bif (coercionKind co)) + go_ax axr@(BuiltInFamInteract {}) _ = crash axr + go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos + go_ax (BranchedAxiom ax i) cos = go_branch ax (coAxiomNthBranch ax i) cos ------------- - check_bif_res (Just (Pair lhs rhs)) = pickLR which (lhs,rhs) - check_bif_res Nothing = crash + check_bif_res _ (Just (Pair lhs rhs)) = pickLR which (lhs,rhs) + check_bif_res axr Nothing = crash axr - crash = pprPanic "coercionKind" (ppr orig_co) + crash :: CoAxiomRule -> Type + crash axr = pprPanic "coercionKind" (ppr axr) ------------- go_branch :: CoAxiom br -> CoAxBranch -> [Coercion] -> Type View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ecf186049f4bbdd04f72c21a8960fe903c646ca -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6ecf186049f4bbdd04f72c21a8960fe903c646ca You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 05:24:10 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Wed, 17 Jul 2024 01:24:10 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Reimplement with manual iteration Message-ID: <6697557a8448b_2f3fc2124b854608cb@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 008b9c52 by Brandon Chinn at 2024-07-16T22:23:57-07:00 Reimplement with manual iteration - - - - - 2 changed files: - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/String.hs Changes: ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -87,7 +87,7 @@ import qualified GHC.Data.Strict as Strict import Control.Monad import Control.Applicative import Data.Char -import Data.List (stripPrefix, isInfixOf, partition, unfoldr) +import Data.List (stripPrefix, isInfixOf, partition) import Data.List.NonEmpty ( NonEmpty(..) ) import qualified Data.List.NonEmpty as NE import Data.Maybe @@ -2226,65 +2226,9 @@ lex_quoted_label span buf _len _buf2 = do lex_string :: LexStringType -> P String lex_string strType = do start <- getInput - case lexString [] start of - Right (lexedStr, next) -> do - setInput next - either fromStringLexError pure $ resolveLexedString strType lexedStr - Left (e, s, i) -> do - -- see if we can find a smart quote in the string we've found so far. - -- if the built-up string s contains a smart double quote character, it was - -- likely the reason why the string literal was not lexed correctly - case filter (\(LexedChar c _) -> isDoubleSmartQuote c) s of - LexedChar c (AI loc _) : _ -> add_nonfatal_smart_quote_error c loc - _ -> pure () - - -- regardless whether we found a smart quote, throw a lexical error - setInput i >> lexError e - where - -- Given the (reversed) string we've seen so far and the current location, - -- return Right with the fully lexed string and the subsequent location, - -- or Left with the string we've seen so far and the location where lexing - -- failed. - lexString acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - _ | Just i1 <- lexDelimiter i0 -> Right (acc, i1) - - Just (c0, i1) -> do - let acc1 = LexedChar c0 i0 : acc0 - case c0 of - '\\' -> do - case alexGetChar' i1 of - Just (c1, i2) - | is_space c1 -> lexStringGap acc0 i2 - | otherwise -> lexString (LexedChar c1 i1 : acc1) i2 - Nothing -> Left (LexStringCharLit, acc, i1) - _ | isAny c0 -> lexString acc1 i1 - _ | strType == StringTypeMulti && c0 `elem` ['\n', '\t'] -> lexString acc1 i1 - _ -> Left (LexStringCharLit, acc, i0) - - Nothing -> Left (LexStringCharLit, acc, i0) - - lexDelimiter i0 = - case strType of - StringTypeSingle -> do - ('"', i1) <- alexGetChar' i0 - Just i1 - StringTypeMulti -> do - ('"', i1) <- alexGetChar' i0 - ('"', i2) <- alexGetChar' i1 - ('"', i3) <- alexGetChar' i2 - Just i3 - - lexStringGap acc0 i0 = do - let acc = reverse acc0 - case alexGetChar' i0 of - Just (c0, i1) -> - case c0 of - '\\' -> lexString acc0 i1 - _ | is_space c0 -> lexStringGap acc0 i1 - _ -> Left (LexStringCharLit, acc, i0) - Nothing -> Left (LexStringCharLitEOF, acc, i0) + (str, next) <- either fromStringLexError pure $ lexString strType alexGetChar' start + setInput next + pure str lex_char_tok :: Action @@ -2305,13 +2249,9 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' return (L (mkPsSpan loc end2) ITtyQuote) Just ('\\', i2@(AI end2 _)) -> do -- We've seen 'backslash - (LexedChar lit_ch _, rest) <- + (lit_ch, i3) <- either fromStringLexError pure $ - resolveEscapeCharacter (LexedChar '\\' i1) (asLexedString i2) - i3 <- - case rest of - LexedChar _ i3 : _ -> pure i3 - [] -> lexError LexStringCharLitEOF + resolveEscapeCharacter alexGetChar' i2 case alexGetChar' i3 of Just ('\'', i4) -> do setInput i4 @@ -2320,7 +2260,7 @@ lex_char_tok span buf _len _buf2 = do -- We've seen ' _ -> lit_error i3 Just (c, i2@(AI end2 _)) - | not (isAny c) -> lit_error i1 + | not (isAnyChar c) -> lit_error i1 | otherwise -> -- We've seen 'x, where x is a valid character @@ -2371,24 +2311,19 @@ lex_magic_hash i = do _other -> pure Nothing else pure Nothing -isAny :: Char -> Bool -isAny c | c > '\x7f' = isPrint c - | otherwise = is_any c - --- | Returns a LexedString that, when iterated, lazily streams --- successive characters from the AlexInput. -asLexedString :: AlexInput -> LexedString AlexInput -asLexedString = unfoldr toLexedChar - where - toLexedChar i = - case alexGetChar' i of - Just (c, i') -> Just (LexedChar c i, i') - Nothing -> Nothing - fromStringLexError :: StringLexError AlexInput -> P a fromStringLexError = \case - SmartQuoteError c (AI loc _) -> add_smart_quote_error c loc - StringLexError _ i e -> setInput i >> lexError e + UnexpectedEOF i squote -> checkSQuote squote >> throw i LexStringCharLitEOF + BadCharInitialLex i squote -> checkSQuote squote >> throw i LexStringCharLit + EscapeBadChar i -> throw i LexStringCharLit + EscapeUnexpectedEOF i -> throw i LexStringCharLitEOF + EscapeNumRangeError i -> throw i LexNumEscapeRange + EscapeSmartQuoteError c (AI loc _) -> add_smart_quote_error c loc + where + throw i e = setInput i >> lexError e + checkSQuote = \case + NoSmartQuote -> pure () + SmartQuote c (AI loc _) -> add_nonfatal_smart_quote_error c loc -- before calling lit_error, ensure that the current input is pointing to -- the position of the error in the buffer. This is so that we can report @@ -2397,12 +2332,6 @@ fromStringLexError = \case lit_error :: AlexInput -> P a lit_error i = do setInput i; lexError LexStringCharLit -getCharOrFail :: AlexInput -> P Char -getCharOrFail i = do - case alexGetChar' i of - Nothing -> lexError LexStringCharLitEOF - Just (c,i) -> do setInput i; return c - -- ----------------------------------------------------------------------------- -- QuasiQuote ===================================== compiler/GHC/Parser/String.hs ===================================== @@ -1,170 +1,277 @@ {-# LANGUAGE LambdaCase #-} module GHC.Parser.String ( - LexedString, - LexedChar (..), StringLexError (..), + ContainsSmartQuote (..), LexStringType (..), - resolveLexedString, - resolveEscapeCharacter, + lexString, -- * Unicode smart quote helpers isDoubleSmartQuote, isSingleSmartQuote, + + -- * Other helpers + isAnyChar, + resolveEscapeCharacter, ) where import GHC.Prelude import Control.Arrow ((>>>)) -import Control.Monad (forM_, guard, unless, when, (>=>)) -import Data.Char (chr, isSpace, ord) -import qualified Data.Foldable1 as Foldable1 -import qualified Data.List.NonEmpty as NonEmpty -import Data.Maybe (listToMaybe, mapMaybe, maybeToList) +import Control.Monad (guard, unless, when) +import Data.Char (chr, isPrint, ord) +import Data.List (unfoldr) +import Data.Maybe (listToMaybe, mapMaybe) import GHC.Parser.CharClass ( hexDigit, + is_any, is_decdigit, is_hexdigit, is_octdigit, + is_space, octDecDigit, ) -import GHC.Parser.Errors.Types (LexErr (..)) import GHC.Utils.Panic (panic) -data LexStringType = StringTypeSingle | StringTypeMulti deriving (Eq) - -data LexedChar loc = LexedChar !Char !loc -type LexedString loc = [LexedChar loc] - -unLexedChar :: LexedChar loc -> Char -unLexedChar (LexedChar c _) = c +data LexStringType = StringTypeSingle | StringTypeMulti -unLexedString :: LexedString loc -> String -unLexedString = map unLexedChar - -resolveLexedString :: - LexStringType -> - LexedString loc -> - Either (StringLexError loc) String -resolveLexedString strType = fmap unLexedString . processString +-- | State to accumulate while iterating through string literal. +-- +-- Fields are strict here to avoid space leak when iterating through large string literal +-- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12089#note_576175 +data LexStringState loc = LexStringState + { stringAcc :: !String + -- ^ The string seen so far, reversed + , multilineCommonWsPrefix :: !Int + -- ^ The common prefix for multiline strings. See Note [Multiline string literals] + , initialLoc :: !loc + -- ^ The location of the beginning of the string literal + } + +-- | Get the character at the given location, with the location +-- of the next character. Returns Nothing if at the end of the +-- input. +type GetChar loc = loc -> Maybe (Char, loc) + +lexString :: LexStringType -> GetChar loc -> loc -> Either (StringLexError loc) (String, loc) +lexString strType getChar initialLoc = go initialState initialLoc where - processString = - case strType of - StringTypeSingle -> - resolveEscapeCharacters - StringTypeMulti -> - resolveMultilineString - >>> (\s -> checkInnerTabs s >> pure s) - >=> resolveEscapeCharacters - -data StringLexError loc - = SmartQuoteError !Char !loc - | StringLexError !Char !loc !LexErr - -collapseStringGaps :: LexedString loc -> LexedString loc -collapseStringGaps s0 = go s0 + initialState = + LexStringState + { stringAcc = "" + , multilineCommonWsPrefix = + case strType of + StringTypeMulti -> maxBound + _ -> 0 + , initialLoc = initialLoc + } + + -- 's' is strict here to avoid space leak when iterating through large string literal + -- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12089#note_576175 + go !s loc0 = + case getChar loc0 of + -- found closing delimiter + Just ('"', _) | Just loc1 <- checkDelimiter strType getChar loc0 -> do + let postprocess = + case strType of + StringTypeSingle -> id + StringTypeMulti -> postprocessMultiline (multilineCommonWsPrefix s) + Right (postprocess . reverse $ stringAcc s, loc1) + + -- found backslash + Just (c0@'\\', loc1) -> do + case getChar loc1 of + -- found '\&' character, which should be elided + Just ('&', loc2) -> go s loc2 + -- found start of a string gap + Just (c1, loc2) | is_space c1 -> collapseStringGap getChar s loc2 >>= go s + -- some other escape character + Just (c1, loc2) -> + case strType of + StringTypeSingle -> do + (c', loc') <- resolveEscapeCharacter getChar loc1 + go (addChar c' s) loc' + StringTypeMulti -> do + -- keep escape characters unresolved until after post-processing, + -- to distinguish between a user-newline and the user writing "\n". + -- but still process the characters here, to find any errors + _ <- resolveEscapeCharacter getChar loc1 + go (addChar c1 . addChar c0 $ s) loc2 + -- backslash at end of input + Nothing -> Left $ BadCharInitialLex loc1 (hasSQuote getChar s) + + -- found newline character in multiline string + Just (c0@'\n', loc1) | StringTypeMulti <- strType -> + uncurry go $ parseLeadingWS getChar (addChar c0 s) loc1 + + -- found some other character + Just (c0, loc1) | isAnyChar c0 -> go (addChar c0 s) loc1 + + -- found some unknown character + Just (_, _) -> Left $ BadCharInitialLex loc0 (hasSQuote getChar s) + + -- reached EOF before finding end of string + Nothing -> Left $ BadCharInitialLex loc0 (hasSQuote getChar s) + +checkDelimiter :: LexStringType -> GetChar loc -> loc -> Maybe loc +checkDelimiter strType getChar loc0 = + case strType of + StringTypeSingle -> do + ('"', loc1) <- getChar loc0 + Just loc1 + StringTypeMulti -> do + ('"', loc1) <- getChar loc0 + ('"', loc2) <- getChar loc1 + ('"', loc3) <- getChar loc2 + Just loc3 + +-- | A helper for adding the given character to the lexed string. +addChar :: Char -> LexStringState loc -> LexStringState loc +addChar c s = s{stringAcc = c : stringAcc s} + +-- | Return whether the string we've parsed so far contains any smart quotes. +hasSQuote :: GetChar loc -> LexStringState loc -> ContainsSmartQuote loc +hasSQuote getChar s + | any isDoubleSmartQuote (stringAcc s) + , (c, loc) : _ <- filter (isDoubleSmartQuote . fst) allChars = + SmartQuote c loc + | otherwise = + NoSmartQuote where - go = \case - [] -> [] + allChars = unfoldr getCharWithLoc (initialLoc s) + getCharWithLoc loc = + case getChar loc of + Just (c, loc') -> Just ((c, loc), loc') + Nothing -> Nothing + +-- | After parsing a backslash and a space character, consume the rest of +-- the string gap and return the next location. +collapseStringGap :: GetChar loc -> LexStringState loc -> loc -> Either (StringLexError loc) loc +collapseStringGap getChar s = go + where + go loc0 = + case getChar loc0 of + Just ('\\', loc1) -> pure loc1 + Just (c0, loc1) | is_space c0 -> go loc1 + Just _ -> Left $ BadCharInitialLex loc0 (hasSQuote getChar s) + Nothing -> Left $ UnexpectedEOF loc0 (hasSQuote getChar s) - backslash@(LexedChar '\\' _) : c : s - | isLexedSpace c -> - -- lexer should have validated that this is a valid gap, - -- so we'll panic if we find any invalid characters - case dropWhile isLexedSpace s of - LexedChar '\\' _ : s -> go s - _ -> panic $ "Invalid string gap in " ++ show (unLexedString s0) - | otherwise -> - backslash : c : go s +-- | See Note [Multiline string literals] +parseLeadingWS :: GetChar loc -> LexStringState loc -> loc -> (LexStringState loc, loc) +parseLeadingWS getChar = go 0 + where + go !col s loc = + case getChar loc of + Just (c@' ', loc') -> go (col + 1) (addChar c s) loc' + -- expand tabs + Just ('\t', loc') -> + let fill = 8 - (col `mod` 8) + s' = applyN fill (addChar ' ') s + in go (col + fill) s' loc' + -- if we see a newline or string delimiter, then this line only contained whitespace, so + -- don't include it in the common whitespace prefix + Just ('\n', _) -> (s, loc) + Just ('"', _) | Just _ <- checkDelimiter StringTypeMulti getChar loc -> (s, loc) + -- found some other character, so we're done parsing leading whitespace + _ -> + let s' = s{multilineCommonWsPrefix = min col (multilineCommonWsPrefix s)} + in (s', loc) + + applyN :: Int -> (a -> a) -> a -> a + applyN n f x0 = iterate f x0 !! n - c : s -> c : go s +data StringLexError loc + = UnexpectedEOF !loc !(ContainsSmartQuote loc) + -- ^ Unexpectedly hit EOF when lexing string + | BadCharInitialLex !loc !(ContainsSmartQuote loc) + -- ^ Found invalid character when initially lexing string + | EscapeBadChar !loc + -- ^ Found invalid character when parsing an escaped character + | EscapeUnexpectedEOF !loc + -- ^ Unexpectedly hit EOF when parsing an escaped character + | EscapeNumRangeError !loc + -- ^ Escaped number exceeds range + | EscapeSmartQuoteError !Char !loc + -- ^ Found escaped smart unicode chars as `\’` or `\”` + deriving (Show) + +-- | When initially lexing the string, we want to track if we've +-- seen a smart quote, to show a helpful "you might be accidentally +-- using a smart quote" error. +data ContainsSmartQuote loc + = NoSmartQuote + | SmartQuote !Char !loc + deriving (Show) -resolveEscapeCharacters :: LexedString loc -> Either (StringLexError loc) (LexedString loc) -resolveEscapeCharacters = go - where - go = \case - [] -> pure [] - LexedChar '\\' _ : LexedChar '&' _ : s -> go s - backslashChar@(LexedChar '\\' _) : s -> do - (c, s') <- resolveEscapeCharacter backslashChar s - (c :) <$> go s' - c : s -> - (c :) <$> go s - --- | After finding a backslash, parse the rest of the escape character. -resolveEscapeCharacter :: - LexedChar loc -> -- the backslash character - LexedString loc -> -- the rest of the string to parse - Either - (StringLexError loc) - (LexedChar loc, LexedString loc) -- the resolved escape character and the rest of the string -resolveEscapeCharacter backslashChar s0 = do - (firstChar@(LexedChar c loc), s1) <- expectNext backslashChar s0 - let rewrap c' = pure (LexedChar c' loc, s1) - case c of - 'a' -> rewrap '\a' - 'b' -> rewrap '\b' - 'f' -> rewrap '\f' - 'n' -> rewrap '\n' - 'r' -> rewrap '\r' - 't' -> rewrap '\t' - 'v' -> rewrap '\v' - '\\' -> rewrap '\\' - '"' -> rewrap '\"' - '\'' -> rewrap '\'' +-- ----------------------------------------------------------------------------- +-- Escape characters + +-- | After finding a backslash, parse the rest of the escape character, starting +-- at the given location. +resolveEscapeCharacter :: GetChar loc -> loc -> Either (StringLexError loc) (Char, loc) +resolveEscapeCharacter getChar loc0 = do + (c0, loc1) <- expectChar loc0 + case c0 of + 'a' -> pure ('\a', loc1) + 'b' -> pure ('\b', loc1) + 'f' -> pure ('\f', loc1) + 'n' -> pure ('\n', loc1) + 'r' -> pure ('\r', loc1) + 't' -> pure ('\t', loc1) + 'v' -> pure ('\v', loc1) + '\\' -> pure ('\\', loc1) + '"' -> pure ('\"', loc1) + '\'' -> pure ('\'', loc1) -- escape codes - 'x' -> expectNum is_hexdigit 16 hexDigit (firstChar, s1) - 'o' -> expectNum is_octdigit 8 octDecDigit (firstChar, s1) - _ | is_decdigit c -> expectNum is_decdigit 10 octDecDigit (backslashChar, s0) + 'x' -> expectNum is_hexdigit 16 hexDigit loc1 + 'o' -> expectNum is_octdigit 8 octDecDigit loc1 + _ | is_decdigit c0 -> expectNum is_decdigit 10 octDecDigit loc0 -- control characters (e.g. '\^M') '^' -> do - (LexedChar c1 loc1, s2) <- expectNext firstChar s1 - unless (c1 >= '@' && c1 <= '_') $ - Left $ StringLexError c1 loc1 LexStringCharLit - let c' = chr $ ord c1 - ord '@' - pure (LexedChar c' loc, s2) + (c1, loc2) <- expectChar loc1 + unless ('@' <= c1 && c1 <= '_') $ Left $ EscapeBadChar loc1 + pure (chr $ ord c1 - ord '@', loc2) -- long form escapes (e.g. '\NUL') - _ | Just (c', s2) <- parseLongEscape firstChar s1 -> pure (LexedChar c' loc, s2) + _ | Just (c1, loc2) <- parseLongEscape getChar c0 loc1 -> pure (c1, loc2) -- check unicode smart quotes (#21843) - _ | isDoubleSmartQuote c -> Left $ SmartQuoteError c loc - _ | isSingleSmartQuote c -> Left $ SmartQuoteError c loc + _ | isDoubleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 + _ | isSingleSmartQuote c0 -> Left $ EscapeSmartQuoteError c0 loc0 -- unknown escape - _ -> Left $ StringLexError c loc LexStringCharLit + _ -> Left $ EscapeBadChar loc0 where - expectNext lastChar = \case - [] -> do - let LexedChar c loc = lastChar - Left $ StringLexError c loc LexStringCharLitEOF - c : cs -> pure (c, cs) - - expectNum isDigit base toDigit (lastChar, s0) = do - (LexedChar c loc, s1) <- expectNext lastChar s0 - unless (isDigit c) $ Left $ StringLexError c loc LexStringCharLit - let parseNum x = \case - LexedChar c' loc' : s' | isDigit c' -> do - let x' = x * base + toDigit c' - when (x' > 0x10ffff) $ Left $ StringLexError c' loc' LexNumEscapeRange - parseNum x' s' - s -> - pure (LexedChar (chr x) loc, s) - parseNum (toDigit c) s1 - --- | Check if the escape characters match a long escape code. --- --- >>> parseLongEscape 'C' [LexedChar 'R', LexedChar 'X', ...s] = Just ('\CR', [LexedChar 'X', ...s]) --- >>> parseLongEscape 'X' [LexedChar 'X', LexedChar 'X', ...s] = Nothing -parseLongEscape :: LexedChar loc -> LexedString loc -> Maybe (Char, LexedString loc) -parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCodes + expectChar loc = + case getChar loc of + Just x -> pure x + Nothing -> Left $ EscapeUnexpectedEOF loc + + expectNum isDigit base toDigit loc1 = do + (c1, loc2) <- expectChar loc1 + unless (isDigit c1) $ Left $ EscapeBadChar loc1 + let parseNum x loc = + case getChar loc of + Just (c, loc') | isDigit c -> do + let x' = x * base + toDigit c + when (x' > 0x10ffff) $ Left $ EscapeNumRangeError loc + parseNum x' loc' + _ -> + pure (chr x, loc) + parseNum (toDigit c1) loc2 + +parseLongEscape :: GetChar loc -> Char -> loc -> Maybe (Char, loc) +parseLongEscape getChar c0 loc1 = listToMaybe $ mapMaybe tryParse longEscapeCodes where - tryParse (prefix, c') = do + tryParse (prefix, c) = do p0 : p <- pure prefix - guard (p0 == c) -- see if the first character matches - s' <- parsePrefix p s -- see if the rest of the prefix matches - pure (c', s') + guard (p0 == c0) -- see if the first character matches + loc <- parsePrefix loc1 p -- see if the rest of the prefix matches + pure (c, loc) - parsePrefix (p : ps) (LexedChar t _ : ts) | p == t = parsePrefix ps ts - parsePrefix [] s' = Just s' -- we've matched the whole prefix, return the rest - parsePrefix _ _ = Nothing + parsePrefix loc = \case + [] -> pure loc + p : ps -> do + (c, loc') <- getChar loc + guard (p == c) + parsePrefix loc' ps longEscapeCodes = [ ("NUL", '\NUL') @@ -203,17 +310,6 @@ parseLongEscape (LexedChar c _) s = listToMaybe $ mapMaybe tryParse longEscapeCo , ("DEL", '\DEL') ] --- | Error if string contains any tab characters. --- --- Normal strings don't lex tab characters in the first place, but we --- have to allow them in multiline strings for leading indentation. So --- we allow them in the initial lexing pass, then check for any remaining --- tabs after replacing leading tabs in resolveMultilineString. -checkInnerTabs :: LexedString loc -> Either (StringLexError loc) () -checkInnerTabs s = - forM_ s $ \(LexedChar c loc) -> - when (c == '\t') $ Left $ StringLexError c loc LexStringCharLit - -- ----------------------------------------------------------------------------- -- Unicode Smart Quote detection (#21843) @@ -242,7 +338,7 @@ is, HsMultilineString will contain the post-processed string. This matches the same behavior as HsString, which contains the normalized string (see Note [Literal source text]). -The string is post-processed with the following steps: +The canonical steps for post processing a multiline string are: 1. Collapse string gaps 2. Split the string by newlines 3. Convert leading tabs into spaces @@ -253,6 +349,17 @@ The string is post-processed with the following steps: 7. If the first character of the string is a newline, remove it 8. Interpret escaped characters +However, for performance reasons, we do as much of this in one pass as possible: +1. As we lex the string, do the following steps as they appear: + a. Collapse string gaps + b. Keep track of the common whitespace prefix so far + c. Validate escaped characters +2. At the very end, post process the lexed string: + a. Remove the common whitespace prefix from every line + b. Remove all whitespace from all-whitespace lines + c. Remove initial newline character + d. Resolve escaped characters + The common whitespace prefix can be informally defined as "The longest prefix of whitespace shared by all lines in the string, excluding the first line and any whitespace-only lines". @@ -267,83 +374,67 @@ It's more precisely defined with the following algorithm: 3. Calculate the longest prefix of whitespace shared by all lines in the remaining list -} --- | A lexed line, with the string and the location info of the ending newline --- character, if one exists -data LexedLine loc = LexedLine !(LexedString loc) (Maybe loc) - -mapLine :: (LexedString loc -> LexedString loc) -> LexedLine loc -> LexedLine loc -mapLine f (LexedLine line nl) = LexedLine (f line) nl - -mapLines :: (LexedString loc -> LexedString loc) -> [LexedLine loc] -> [LexedLine loc] -mapLines f = map (mapLine f) - -filterLines :: (LexedString loc -> Bool) -> [LexedLine loc] -> [LexedLine loc] -filterLines f = filter (\(LexedLine line _) -> f line) - -splitLines :: LexedString loc -> [LexedLine loc] -splitLines = - foldr - ( curry $ \case - (LexedChar '\n' loc, ls) -> LexedLine [] (Just loc) : ls - (c, l : ls) -> mapLine (c :) l : ls - (c, []) -> LexedLine [c] Nothing : [] -- should not happen - ) - [emptyLine] - where - emptyLine = LexedLine [] Nothing - -joinLines :: [LexedLine loc] -> LexedString loc -joinLines = concatMap $ \(LexedLine line nl) -> - case nl of - Nothing -> line - Just nl' -> line ++ [LexedChar '\n' nl'] - -- | See Note [Multiline string literals] -resolveMultilineString :: LexedString loc -> LexedString loc -resolveMultilineString = process +postprocessMultiline :: Int -> String -> String +postprocessMultiline commonWSPrefix = + rmCommonWhitespacePrefix + >>> collapseOnlyWsLines + >>> rmFirstNewline + >>> resolveEscapeChars where - process = - splitLines - >>> convertLeadingTabs - >>> rmCommonWhitespacePrefix - >>> stripOnlyWhitespace - >>> joinLines - >>> rmFirstNewline - - convertLeadingTabs = - let convertLine col = \case + rmCommonWhitespacePrefix = + let go = \case + '\n' : s -> '\n' : go (dropLine commonWSPrefix s) + c : s -> c : go s [] -> [] - c@(LexedChar ' ' _) : cs -> c : convertLine (col + 1) cs - LexedChar '\t' loc : cs -> - let fill = 8 - (col `mod` 8) - in replicate fill (LexedChar ' ' loc) ++ convertLine (col + fill) cs - c : cs -> c : cs - in mapLines (convertLine 0) - - rmCommonWhitespacePrefix = \case - [] -> [] - -- exclude the first line from this calculation - firstLine : strLines -> - let excludeWsOnlyLines = filterLines (not . all isLexedSpace) - commonWSPrefix = - case NonEmpty.nonEmpty (excludeWsOnlyLines strLines) of - Nothing -> 0 - Just strLines' -> - Foldable1.minimum $ - flip NonEmpty.map strLines' $ \(LexedLine line _) -> - length $ takeWhile isLexedSpace line - in firstLine : mapLines (drop commonWSPrefix) strLines - - stripOnlyWhitespace = - let stripWsOnlyLine line = if all isLexedSpace line then [] else line - in mapLines stripWsOnlyLine + -- drop x characters from the string, or up to a newline, whichever + -- comes first + dropLine !x = \case + s | x <= 0 -> s + s@('\n' : _) -> s + _ : s -> dropLine (x - 1) s + [] -> [] + in go + + collapseOnlyWsLines = + let go = \case + '\n' : s | Just s' <- checkAllWs s -> '\n' : go s' + c : s -> c : go s + [] -> [] + checkAllWs = \case + -- got all the way to a newline or the end of the string, return + s@('\n' : _) -> Just s + s@[] -> Just s + -- found whitespace, continue + c : s | is_space c -> checkAllWs s + -- anything else, stop + _ -> Nothing + in go rmFirstNewline = \case - LexedChar '\n' _ : s -> s + '\n' : s -> s s -> s + -- resolve escape characters, deferred from lexString. guaranteed + -- to not throw any errors, since we already checked them in lexString + resolveEscapeChars = \case + [] -> [] + '\\' : s -> + -- concretizing 'loc' to String: + -- resolveEscapeCharacter :: (String -> Maybe (Char, String)) -> String -> Either _ (Char, String) + case resolveEscapeCharacter uncons s of + Left e -> panic $ "resolving escape characters in multiline string unexpectedly found errors: " ++ show e + Right (c, s') -> c : resolveEscapeChars s' + c : s -> c : resolveEscapeChars s + + uncons = \case + c : cs -> Just (c, cs) + [] -> Nothing + -- ----------------------------------------------------------------------------- -- Helpers -isLexedSpace :: LexedChar loc -> Bool -isLexedSpace = isSpace . unLexedChar +isAnyChar :: Char -> Bool +isAnyChar c + | c > '\x7f' = isPrint c + | otherwise = is_any c View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/008b9c529887dcfd95c6c3706d98fe380b7aadbe -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/008b9c529887dcfd95c6c3706d98fe380b7aadbe You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 08:43:08 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 17 Jul 2024 04:43:08 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/arch-ghcup-metadata Message-ID: <6697841c7ff65_42fb433578535ad@gitlab.mail> Matthew Pickering pushed new branch wip/arch-ghcup-metadata at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/arch-ghcup-metadata You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 08:43:33 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 17 Jul 2024 04:43:33 -0400 Subject: [Git][ghc/ghc][wip/arch-ghcup-metadata] ghcup-metadata: Fix use of arch argument Message-ID: <669784357c900_42fb41a3d4537d1@gitlab.mail> Matthew Pickering pushed to branch wip/arch-ghcup-metadata at Glasgow Haskell Compiler / GHC Commits: 7527e4c7 by Matthew Pickering at 2024-07-17T09:43:19+01:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 1 changed file: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -94,19 +94,19 @@ windowsArtifact = PlatformSpec ( 'x86_64-windows' , 'ghc-{version}-x86_64-unknown-mingw32' ) def centos(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-centos{n}".format(n=n,arch=arch)) def fedora(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-fedora{n}".format(n=n,arch=arch)) def alpine(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-alpine{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-alpine{n}".format(n=n,arch=arch)) def rocky(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-rocky{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-rocky{n}".format(n=n,arch=arch)) def ubuntu(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-ubuntu{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-ubuntu{n}".format(n=n,arch=arch)) def linux_platform(arch, opsys): return PlatformSpec( opsys, 'ghc-{version}-{arch}-unknown-linux'.format(version="{version}", arch=arch) ) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7527e4c7ce13377478034202cffb1fbfbe409963 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7527e4c7ce13377478034202cffb1fbfbe409963 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 11:49:14 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Wed, 17 Jul 2024 07:49:14 -0400 Subject: [Git][ghc/ghc][wip/T25055] Address #25055, by disabling case-of-runRW# in Gentle phase Message-ID: <6697afbab8cf1_23fd702550f850423@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25055 at Glasgow Haskell Compiler / GHC Commits: 8f09f5e5 by Simon Peyton Jones at 2024-07-17T12:48:34+01:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 6 changed files: - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8f09f5e501163e80271fcd1406d34569b8ea83f7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8f09f5e501163e80271fcd1406d34569b8ea83f7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 12:19:02 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Wed, 17 Jul 2024 08:19:02 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/torsten.schmits/modiface-compat-complete-pragma Message-ID: <6697b6b6bf7e8_23fd7043e2ac52190@gitlab.mail> Torsten Schmits pushed new branch wip/torsten.schmits/modiface-compat-complete-pragma at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/torsten.schmits/modiface-compat-complete-pragma You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 13:02:31 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 17 Jul 2024 09:02:31 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <6697c0e73f6f1_23fd707490b46805a@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - f879c69d by Matthew Pickering at 2024-07-17T09:01:55-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 12 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - utils/haddock/haddock-api/src/Haddock.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs - utils/haddock/haddock-api/src/Haddock/Types.hs Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 486541129a8e7bf77c2cf7cd76ca998f690d5685 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -975,83 +975,136 @@ flattenNamedJob (NamedJob n i) = (n, i) jobs :: Map String Job jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups -job_groups :: [JobGroup Job] -job_groups = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) - -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 - -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) - , disableValidate (standardBuilds Amd64 (Linux Ubuntu1804)) - , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004)) - , disableValidate (standardBuilds Amd64 (Linux Rocky8)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla)) - -- Fedora33 job is always built with perf so there's one job in the normal - -- validate pipeline which is built with perf. - , fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) - -- This job is only for generating head.hackage docs - , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) - , disableValidate (standardBuilds Amd64 (Linux Fedora38)) - , fastCI (standardBuildsWithConfig Amd64 Windows vanilla) - , disableValidate (standardBuildsWithConfig Amd64 Windows nativeInt) - , addValidateRule TestPrimops (standardBuilds Amd64 Darwin) - , fastCI (standardBuilds AArch64 Darwin) - , fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) - , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) - , standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) - -- Fully static build, in theory usable on any linux distribution. - , fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) - -- Dynamically linked build, suitable for building your own static executables on alpine - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) - , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) - , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - - , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) - - , make_wasm_jobs wasm_build_config - , modifyValidateJobs manual $ - make_wasm_jobs wasm_build_config {bignumBackend = Native} - , modifyValidateJobs manual $ - make_wasm_jobs wasm_build_config {unregisterised = True} - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) - ] +debian_x86 :: [JobGroup Job] +debian_x86 = + [ -- Release configurations + -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 + -- not being at EOL until April 2023 and they still need tinfo5. + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) + + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) + ] + where + validate_debian = Debian12 + + tsan_jobs = + modifyJobs + ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + -- Haddock is large enough to make TSAN choke without massive quantities of + -- memory. + . addVariable "HADRIAN_ARGS" "--docs=none") $ + validateBuilds Amd64 (Linux validate_debian) tsan + +debian_aarch64 :: [JobGroup Job] +debian_aarch64 = + [ + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap + , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) + ] +debian_i386 :: [JobGroup Job] +debian_i386 = + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] + +ubuntu_x86 :: [JobGroup Job] +ubuntu_x86 = + [ disableValidate (standardBuilds Amd64 (Linux Ubuntu1804)) + , disableValidate (standardBuilds Amd64 (Linux Ubuntu2004)) + ] + +rhel_x86 :: [JobGroup Job] +rhel_x86 = + [ disableValidate (standardBuildsWithConfig Amd64 (Linux Centos7) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Rocky8)) + ] + +fedora_x86 :: [JobGroup Job] +fedora_x86 = + [ + -- Fedora33 job is always built with perf so there's one job in the normal + -- validate pipeline which is built with perf. + fastCI (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig) + -- This job is only for generating head.hackage docs + , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) releaseConfig)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora33) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Fedora38)) + ] where - javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) - { bignumBackend = Native } + hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") +windows_x86 :: [JobGroup Job] +windows_x86 = + [ fastCI (standardBuildsWithConfig Amd64 Windows vanilla) + , disableValidate (standardBuildsWithConfig Amd64 Windows nativeInt) + ] + +darwin :: [JobGroup Job] +darwin = + [ addValidateRule TestPrimops (standardBuilds Amd64 Darwin) + , fastCI (standardBuilds AArch64 Darwin) + ] + +alpine_x86 :: [JobGroup Job] +alpine_x86 = + [ -- Fully static build, in theory usable on any linux distribution. + fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken static)) + , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine312) staticNativeInt))) + -- Dynamically linked build, suitable for building your own static executables on alpine + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine312) (splitSectionsBroken vanilla)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine320) (splitSectionsBroken vanilla)) + ] + where -- ghcilink002 broken due to #17869 -- -- linker_unload_native: due to musl not supporting any means of probing dynlib dependencies -- (see Note [Object unloading]). fullyStaticBrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "ghcilink002 linker_unload_native") - hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") +alpine_aarch64 :: [JobGroup Job] +alpine_aarch64 = [ + disableValidate (standardBuildsWithConfig AArch64 (Linux Alpine318) (splitSectionsBroken vanilla)) + ] - tsan_jobs = - modifyJobs - ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" - -- Haddock is large enough to make TSAN choke without massive quantities of - -- memory. - . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan +cross_jobs :: [JobGroup Job] +cross_jobs = [ + -- x86 -> aarch64 + validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) + + -- Javascript + , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig) + + -- Wasm + , make_wasm_jobs wasm_build_config + , modifyValidateJobs manual $ + make_wasm_jobs wasm_build_config {bignumBackend = Native} + , modifyValidateJobs manual $ + make_wasm_jobs wasm_build_config {unregisterised = True} + ] + where + javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) + { bignumBackend = Native } make_wasm_jobs cfg = modifyJobs @@ -1069,6 +1122,20 @@ job_groups = , textWithSIMDUTF = True } +job_groups :: [JobGroup Job] +job_groups = + debian_x86 + ++ debian_aarch64 + ++ debian_i386 + ++ fedora_x86 + ++ windows_x86 + ++ darwin + ++ ubuntu_x86 + ++ rhel_x86 + ++ alpine_x86 + ++ alpine_aarch64 + ++ cross_jobs + mkPlatform :: Arch -> Opsys -> String mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys @@ -1092,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -94,19 +94,19 @@ windowsArtifact = PlatformSpec ( 'x86_64-windows' , 'ghc-{version}-x86_64-unknown-mingw32' ) def centos(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-centos{n}".format(n=n,arch=arch)) def fedora(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-fedora{n}".format(n=n,arch=arch)) def alpine(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-alpine{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-alpine{n}".format(n=n,arch=arch)) def rocky(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-rocky{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-rocky{n}".format(n=n,arch=arch)) def ubuntu(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-ubuntu{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-ubuntu{n}".format(n=n,arch=arch)) def linux_platform(arch, opsys): return PlatformSpec( opsys, 'ghc-{version}-{arch}-unknown-linux'.format(version="{version}", arch=arch) ) @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } ===================================== utils/haddock/haddock-api/src/Haddock.hs ===================================== @@ -438,16 +438,17 @@ render dflags languagesAndExtensions parserOpts logger unit_state flags sinceQua = Map.insert k srcNameUrl pkgSrcMap | otherwise = pkgSrcMap + pkgSrcLMap = Map.map (hypSrcModuleUrlToLineFormat . hypSrcPkgUrlToModuleFormat) + $ Map.mapKeys moduleUnit extSrcMap -- These urls have a template for the module %M and the line %L - -- TODO: Get these from the interface files as with srcMap pkgSrcLMap' | Flag_HyperlinkedSource `elem` flags , Just k <- pkgKey - = Map.singleton k hypSrcModuleLineUrlFormat + = Map.insert k hypSrcModuleLineUrlFormat pkgSrcLMap | Just path <- srcLEntity , Just k <- pkgKey - = Map.singleton k path - | otherwise = Map.empty + = Map.insert k path pkgSrcLMap + | otherwise = pkgSrcLMap sourceUrls' = (srcBase, srcModule', pkgSrcMap', pkgSrcLMap') ===================================== utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs ===================================== @@ -14,6 +14,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleNameUrlFormat , hypSrcModuleLineUrlFormat , hypSrcModuleUrlToNameFormat + , hypSrcModuleUrlToLineFormat , hypSrcPkgUrlToModuleFormat , spliceURL , spliceURL' @@ -86,6 +87,9 @@ hypSrcModuleLineUrlFormat = hypSrcModuleUrlFormat ++ "#" ++ lineFormat hypSrcModuleUrlToNameFormat :: String -> String hypSrcModuleUrlToNameFormat url = url ++ "#" ++ nameFormat +hypSrcModuleUrlToLineFormat :: String -> String +hypSrcModuleUrlToLineFormat url = url ++ "#" ++ lineFormat + hypSrcPkgUrlToModuleFormat :: String -> String hypSrcPkgUrlToModuleFormat url = url moduleFormat ===================================== utils/haddock/haddock-api/src/Haddock/Interface.hs ===================================== @@ -240,25 +240,28 @@ createIfaces verbosity modules flags instIfaceMap = do -- Visit modules in that order sortedMods = concatMap go $ topSortModuleGraph False modGraph Nothing out verbosity normal "Haddock coverage:" - (ifaces, _) <- foldM f ([], Map.empty) sortedMods + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) + (ifaces, _, _) <- foldM f ([], Map.empty, inst_warning_map) sortedMods return (reverse ifaces) where - f (ifaces, ifaceMap) modSummary = do + f (ifaces, ifaceMap, warningMap) modSummary = do x <- {-# SCC processModule #-} withTimingM "processModule" (const ()) $ do - processModule verbosity modSummary flags ifaceMap instIfaceMap + processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap return $ case x of Just iface -> ( iface:ifaces - , Map.insert (ifaceMod iface) iface ifaceMap ) + , Map.insert (ifaceMod iface) iface ifaceMap + , Map.union (ifaceWarningMap iface) warningMap) Nothing -> ( ifaces - , ifaceMap ) -- Boot modules don't generate ifaces. + , ifaceMap + , warningMap ) -- Boot modules don't generate ifaces. dropErr :: MaybeErr e a -> Maybe a dropErr (Succeeded a) = Just a dropErr (Failed _) = Nothing -processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface) -processModule verbosity modSummary flags ifaceMap instIfaceMap = do +processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> WarningMap -> Ghc (Maybe Interface) +processModule verbosity modSummary flags ifaceMap instIfaceMap warningMap = do out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modSummary) ++ "..." hsc_env <- getSession @@ -281,7 +284,7 @@ processModule verbosity modSummary flags ifaceMap instIfaceMap = do {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts + createInterface1 flags unit_state modSummary mod_iface ifaceMap instIfaceMap insts warningMap let (haddockable, haddocked) = @@ -387,13 +390,13 @@ createOneShotIface verbosity flags instIfaceMap moduleNameStr = do let hieFilePath = case res of Found ml _ -> ml_hie_file ml _ -> throwE "createOneShotIface: module not found" - + let inst_warning_map = Map.unions $ map instWarningMap (Map.elems instIfaceMap) !interface <- do logger <- getLogger {-# SCC createInterface #-} withTiming logger "createInterface" (const ()) $ runIfM (liftIO . fmap dropErr . lookupGlobal_maybe hsc_env) $ - createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts + createInterface1' flags (hsc_units hsc_env) dflags' hieFilePath iface mempty instIfaceMap insts inst_warning_map pure [interface] ===================================== utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs ===================================== @@ -143,10 +143,11 @@ attachInstances expInfo ifaces instIfaceMap isOneShot = do attach (cls_insts, fam_insts, inst_map) iface = do let getInstDoc = findInstDoc iface ifaceMap instIfaceMap getFixity = findFixity iface ifaceMap instIfaceMap + getInstLocIface name = Map.lookup name . instInstanceLocMap =<< Map.lookup (nameModule name) instIfaceMap newItems <- mapM - (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity) + (attachToExportItem cls_insts fam_insts inst_map expInfo getInstDoc getFixity getInstLocIface) (ifaceExportItems iface) let orphanInstances = attachOrphanInstances expInfo getInstDoc (ifaceInstances iface) fam_insts return $ @@ -184,9 +185,11 @@ attachToExportItem -- ^ how to lookup the doc of an instance -> (Name -> Maybe Fixity) -- ^ how to lookup a fixity + -> (Name -> Maybe RealSrcSpan) + -- ^ how to lookup definition spans for instances -> ExportItem GhcRn -> Ghc (ExportItem GhcRn) -attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export = +attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity getInstLocIface export = case attachFixities export of ExportDecl e@(ExportD{expDDecl = L eSpan (TyClD _ d)}) -> do insts <- @@ -267,12 +270,17 @@ attachToExportItem cls_index fam_index index expInfo getInstDoc getFixity export -- spanName: attach the location to the name that is the same file as the instance location spanName s (InstHead{ihdClsName = clsn}) (L instL instn) = - let s1 = getSrcSpan s + let s1 = let orig_span = getSrcSpan s + in if isGoodSrcSpan orig_span + then orig_span + else case getInstLocIface s of + Nothing -> orig_span + Just rs -> RealSrcSpan rs mempty sn = if srcSpanFileName_maybe s1 == srcSpanFileName_maybe instL then instn else clsn - in L (getSrcSpan s) sn + in L s1 sn -- spanName on Either spanNameE s (Left e) _ = L (getSrcSpan s) (Left e) spanNameE s (Right ok) linst = ===================================== utils/haddock/haddock-api/src/Haddock/Interface/Create.hs ===================================== @@ -83,8 +83,9 @@ createInterface1 -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) = +createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = let ModSummary { -- Cached flags from OPTIONS, INCLUDE and LANGUAGE @@ -94,7 +95,7 @@ createInterface1 flags unit_state mod_sum mod_iface ifaces inst_ifaces (instance , ms_location = modl } = mod_sum in - createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) + createInterface1' flags unit_state ms_hspp_opts (ml_hie_file modl) mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings createInterface1' :: MonadIO m @@ -106,8 +107,9 @@ createInterface1' -> IfaceMap -> InstIfaceMap -> ([ClsInst], [FamInst]) + -> WarningMap -> IfM m Interface -createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) = do +createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces (instances, fam_instances) depWarnings = do let sDocContext = DynFlags.initSDocContext dflags Outputable.defaultUserStyle mLanguage = language dflags @@ -205,7 +207,7 @@ createInterface1' flags unit_state dflags hie_file mod_iface ifaces inst_ifaces let -- Warnings in this module and transitive warnings from dependent modules transitiveWarnings :: Map Name (Doc Name) - transitiveWarnings = Map.unions (warningMap : map ifaceWarningMap (Map.elems ifaces)) + transitiveWarnings = Map.union warningMap depWarnings export_items <- mkExportItems ===================================== utils/haddock/haddock-api/src/Haddock/InterfaceFile.hs ===================================== @@ -36,6 +36,7 @@ module Haddock.InterfaceFile , binaryInterfaceVersionCompatibility ) where +import Data.Coerce (coerce) import Data.Function ((&)) import Data.IORef import Data.Map (Map) @@ -366,6 +367,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + locMap ) = do put_ bh modu put_ bh is_sig @@ -376,6 +379,8 @@ instance Binary InstalledInterface where put_ bh visExps put_ bh opts put_ bh fixMap + put_ bh warnMap + put_ bh (coerce @_ @(Map Name BinSpan) locMap) get bh = do modu <- get bh @@ -387,6 +392,8 @@ instance Binary InstalledInterface where visExps <- get bh opts <- get bh fixMap <- get bh + warnMap <- get bh + locMap <- get bh return ( InstalledInterface modu @@ -399,6 +406,8 @@ instance Binary InstalledInterface where visExps opts fixMap + warnMap + (coerce @(Map Name BinSpan) locMap) ) instance Binary DocOption where ===================================== utils/haddock/haddock-api/src/Haddock/Types.hs ===================================== @@ -48,16 +48,18 @@ import Control.Monad.Catch import Control.Monad.State.Strict import Data.Data (Data) import Data.Map (Map) +import qualified Data.Map as Map import qualified Data.Set as Set import GHC import qualified GHC.Data.Strict as Strict import GHC.Driver.Session (Language) import qualified GHC.LanguageExtensions as LangExt +import GHC.Core.InstEnv (is_dfun_name) import GHC.Types.Fixity (Fixity (..)) import GHC.Types.Name (stableNameCmp) import GHC.Types.Name.Occurrence import GHC.Types.Name.Reader (RdrName (..)) -import GHC.Types.SrcLoc (BufPos (..), BufSpan (..)) +import GHC.Types.SrcLoc (BufPos (..), BufSpan (..), srcSpanToRealSrcSpan) import GHC.Types.Var (Specificity) import GHC.Utils.Outputable @@ -166,6 +168,8 @@ data InstalledInterface = InstalledInterface , instOptions :: [DocOption] -- ^ Haddock options for this module (prune, ignore-exports, etc). , instFixMap :: Map Name Fixity + , instWarningMap :: WarningMap + , instInstanceLocMap :: Map Name RealSrcSpan } -- | Convert an 'Interface' to an 'InstalledInterface' @@ -182,6 +186,8 @@ toInstalledIface interface = , instOptions = interface.ifaceOptions , instFixMap = interface.ifaceFixMap , instDefMeths = interface.ifaceDefMeths + , instWarningMap = interface.ifaceWarningMap + , instInstanceLocMap = Map.fromList [(inst_name, loc) | i <- interface.ifaceInstances, let inst_name = is_dfun_name i, Just loc <- [srcSpanToRealSrcSpan (nameSrcSpan inst_name)]] } -- | A monad in which we create Haddock interfaces. Not to be confused with View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/be9c116f88f0d6e66bf7901da8a5329f491d69cb...f879c69daa1fe76932558c2f20e5bd1f12a0f09b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/be9c116f88f0d6e66bf7901da8a5329f491d69cb...f879c69daa1fe76932558c2f20e5bd1f12a0f09b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 15:13:22 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 17 Jul 2024 11:13:22 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 27 commits: Improve docs for NondecreasingIndentation Message-ID: <6697df9232554_f8fc36c2c801443a@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 043b9634 by sheaf at 2024-07-17T17:12:42+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - cf58d684 by sheaf at 2024-07-17T17:12:42+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 09c877e1 by sheaf at 2024-07-17T17:12:42+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 7e37dfd3 by sheaf at 2024-07-17T17:12:42+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 02959539 by sheaf at 2024-07-17T17:12:42+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 6c773f34 by sheaf at 2024-07-17T17:12:43+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f13b09c9daa35dab229b81196ae1a5224514a3a7...6c773f341f02dd09e5c13734d96ae192660971fb -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f13b09c9daa35dab229b81196ae1a5224514a3a7...6c773f341f02dd09e5c13734d96ae192660971fb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 15:51:08 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 17 Jul 2024 11:51:08 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <6697e86c6218a_f8fc399343c22594@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 114f122f by sheaf at 2024-07-17T17:50:55+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 3b5c21bb by sheaf at 2024-07-17T17:50:55+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - b8d72e46 by sheaf at 2024-07-17T17:50:56+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - b84761de by sheaf at 2024-07-17T17:50:56+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e45d90dc by sheaf at 2024-07-17T17:50:56+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - + testsuite/tests/simd/should_run/T25062_V16.hs - + testsuite/tests/simd/should_run/T25062_V16.stdout - + testsuite/tests/simd/should_run/T25062_V32.hs - + testsuite/tests/simd/should_run/T25062_V32.stdout - + testsuite/tests/simd/should_run/T25062_V64.hs - + testsuite/tests/simd/should_run/T25062_V64.stdout - testsuite/tests/simd/should_run/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c773f341f02dd09e5c13734d96ae192660971fb...e45d90dcb06dc8704318fff9bbc22ac0475fd34a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6c773f341f02dd09e5c13734d96ae192660971fb...e45d90dcb06dc8704318fff9bbc22ac0475fd34a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 17:22:41 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 17 Jul 2024 13:22:41 -0400 Subject: [Git][ghc/ghc][master] ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <6697fde172532_22267d4492d8460f3@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 5 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 486541129a8e7bf77c2cf7cd76ca998f690d5685 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = @@ -1151,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -206,7 +206,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +241,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 }} , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -249,6 +253,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 , "( >= 11 && < 12 )": deb11_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/203830065b81fe29003c1640a354f11661ffc604 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/203830065b81fe29003c1640a354f11661ffc604 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 17 17:23:17 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 17 Jul 2024 13:23:17 -0400 Subject: [Git][ghc/ghc][master] ghcup-metadata: Fix use of arch argument Message-ID: <6697fe052cb19_22267d73459c50646@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 1 changed file: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -94,19 +94,19 @@ windowsArtifact = PlatformSpec ( 'x86_64-windows' , 'ghc-{version}-x86_64-unknown-mingw32' ) def centos(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-centos{n}".format(n=n,arch=arch)) def fedora(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-fedora{n}".format(n=n,arch=arch)) def alpine(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-alpine{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-alpine{n}".format(n=n,arch=arch)) def rocky(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-rocky{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-rocky{n}".format(n=n,arch=arch)) def ubuntu(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-ubuntu{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-ubuntu{n}".format(n=n,arch=arch)) def linux_platform(arch, opsys): return PlatformSpec( opsys, 'ghc-{version}-{arch}-unknown-linux'.format(version="{version}", arch=arch) ) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12d3b66cedd3c80e7c1e030238c92d26631cab8d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12d3b66cedd3c80e7c1e030238c92d26631cab8d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 01:28:58 2024 From: gitlab at gitlab.haskell.org (Cheng Shao (@TerrorJack)) Date: Wed, 17 Jul 2024 21:28:58 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 42 commits: configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler Message-ID: <66986fda396fe_10c85fce8aec107794@gitlab.mail> Cheng Shao pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 3db39b77 by Cheng Shao at 2024-07-18T01:26:02+00:00 compiler: always generate dynamic stub objects when generating bytecode When foreign stub objects are compiled during bytecode generation (e.g. when using whole core bindings), ensure they are dynamic so they can be properly loaded. - - - - - 074cc029 by Cheng Shao at 2024-07-18T01:26:02+00:00 compiler: generate stub objects before writing iface This commit promotes foreign stub compilation a bit earlier before we actually write iface, to make it possible to actually serialize them into the final iface when compiling with `-fwrite-if-simplified-core`. Also ensures dynamic stub objects are generated if we're compiling with `-fwrite-if-simplified-core`. - - - - - 9219540a by Cheng Shao at 2024-07-18T01:26:02+00:00 compiler: add mi_stub_objs to ModIface This commit adds the mi_stub_objs field to ModIface, representing serialized foreign stub dynamic objects that can be reloaded later when compiling a downstream module with `-fprefer-byte-code` that loads whole core bindings from an upstream module that requires foreign stubs, see #24634 for such an example. - - - - - 83d4537a by Cheng Shao at 2024-07-18T01:26:02+00:00 compiler: serialize foreign stub dynamic objects in interface file when compiling with -fwrite-if-simplified-core This commit makes the compiler serialize foreign stub dynamic objects in mi_stub_objs when compiling with -fwrite-if-simplified-core. This is needed when we compile a downstream module with -fprefer-byte-code, in which case we want to make use of whole core bindings in upstream modules instead of having to load their dynamic objects, but the foreign stub information has been lost across different ghc invocations previously. Hence the fix in this commit. See #24634 for such an example. - - - - - 4d5dfcc5 by Cheng Shao at 2024-07-18T01:26:02+00:00 testsuite: fix T24634 This commit fixes T24634 and marks it as unbroken. - - - - - a5321003 by Cheng Shao at 2024-07-18T01:26:02+00:00 WIP: oneshot bytecode support - - - - - 27 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Pat.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/29df022f7ea42494da0c771611be181aa4310d4c...a532100318e9902f3e2405f6e525e9ee3e834be0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/29df022f7ea42494da0c771611be181aa4310d4c...a532100318e9902f3e2405f6e525e9ee3e834be0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 08:59:41 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Thu, 18 Jul 2024 04:59:41 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <6698d97d7acb8_13f1bc2534d8784ad@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 3ae55f31 by sheaf at 2024-07-18T10:59:32+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 1908d849 by sheaf at 2024-07-18T10:59:33+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 6707fba7 by sheaf at 2024-07-18T10:59:33+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 1e38fbcd by sheaf at 2024-07-18T10:59:33+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - e653fd1a by sheaf at 2024-07-18T10:59:33+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - + testsuite/tests/simd/should_run/T25062_V16.hs - + testsuite/tests/simd/should_run/T25062_V16.stdout - + testsuite/tests/simd/should_run/T25062_V32.hs - + testsuite/tests/simd/should_run/T25062_V32.stdout - + testsuite/tests/simd/should_run/T25062_V64.hs - + testsuite/tests/simd/should_run/T25062_V64.stdout - testsuite/tests/simd/should_run/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e45d90dcb06dc8704318fff9bbc22ac0475fd34a...e653fd1a630f45355f320f4eb9ed7cf5e6d912d3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e45d90dcb06dc8704318fff9bbc22ac0475fd34a...e653fd1a630f45355f320f4eb9ed7cf5e6d912d3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 11:07:17 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Thu, 18 Jul 2024 07:07:17 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/ghcup-metadata-mistakes-again Message-ID: <6698f76550a7d_1caf795b1a94446da@gitlab.mail> Matthew Pickering pushed new branch wip/ghcup-metadata-mistakes-again at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/ghcup-metadata-mistakes-again You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 12:29:36 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 18 Jul 2024 08:29:36 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] make mkFullIface backwards compatible Message-ID: <66990ab08c71f_1caf79941d3051038@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: 08655002 by Torsten Schmits at 2024-07-18T14:29:29+02:00 make mkFullIface backwards compatible - - - - - 3 changed files: - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Make.hs Changes: ===================================== compiler/GHC/Driver/Pipeline.hs ===================================== @@ -794,9 +794,9 @@ hscBackendPipeline pipe_env hsc_env mod_sum result = else case result of HscUpdate iface -> return (iface, emptyHomeModInfoLinkable) - HscRecomp {} -> (,) <$> liftIO (mkFullIface hsc_env (hscs_partial_iface result) Nothing Nothing []) <*> pure emptyHomeModInfoLinkable + HscRecomp {} -> (,) <$> liftIO (mkFullIface hsc_env (hscs_partial_iface result) Nothing Nothing) <*> pure emptyHomeModInfoLinkable -- TODO: Why is there not a linkable? - -- Interpreter -> (,) <$> use (T_IO (mkFullIface hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing + -- Interpreter -> (,) <$> use (T_IO (mkFullIfaceWithForeignStubs hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing hscGenBackendPipeline :: P m => PipeEnv ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -598,7 +598,7 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do | gopt Opt_WriteIfSimplifiedCore dflags = fos | otherwise = [] - final_iface <- mkFullIface hsc_env partial_iface stg_infos cg_infos iface_fos + final_iface <- mkFullIfaceWithForeignStubs hsc_env partial_iface stg_infos cg_infos iface_fos -- See Note [Writing interface files] hscMaybeWriteIface logger dflags False final_iface mb_old_iface_hash mod_location @@ -620,7 +620,7 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do -- In interpreted mode the regular codeGen backend is not run so we -- generate a interface without codeGen info. do - final_iface <- mkFullIface hsc_env partial_iface Nothing Nothing [] + final_iface <- mkFullIface hsc_env partial_iface Nothing Nothing hscMaybeWriteIface logger dflags True final_iface mb_old_iface_hash location bc <- generateFreshByteCode hsc_env mod_name (mkCgInteractiveGuts cgguts) mod_location return ([], final_iface, emptyHomeModInfoLinkable { homeMod_bytecode = Just bc } , panic "interpreter") ===================================== compiler/GHC/Iface/Make.hs ===================================== @@ -12,6 +12,7 @@ module GHC.Iface.Make ( mkPartialIface , mkFullIface + , mkFullIfaceWithForeignStubs , mkIfaceTc , mkIfaceExports ) @@ -129,14 +130,19 @@ mkPartialIface hsc_env core_prog mod_details mod_summary import_decls = mkIface_ hsc_env this_mod core_prog hsc_src used_th deps rdr_env import_decls fix_env warns hpc_info self_trust safe_mode usages docs mod_summary mod_details +-- | Backwards compat interface for 'mkFullIfaceWithForeignStubs'. +mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface +mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = + mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos [] + -- | Fully instantiate an interface. Adds fingerprints and potentially code -- generator produced information. -- -- CmmCgInfos is not available when not generating code (-fno-code), or when not -- generating interface pragmas (-fomit-interface-pragmas). See also -- Note [Conveying CAF-info and LFInfo between modules] in GHC.StgToCmm.Types. -mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> [FilePath] -> IO ModIface -mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos fos = do +mkFullIfaceWithForeignStubs :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> [FilePath] -> IO ModIface +mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos fos = do let decls | gopt Opt_OmitInterfacePragmas (hsc_dflags hsc_env) = mi_decls partial_iface @@ -278,7 +284,7 @@ mkIfaceTc hsc_env safe_mode mod_details mod_summary mb_program docs mod_summary mod_details - mkFullIface hsc_env partial_iface Nothing Nothing [] + mkFullIface hsc_env partial_iface Nothing Nothing mkIface_ :: HscEnv -> Module -> CoreProgram -> HscSource -> Bool -> Dependencies -> GlobalRdrEnv -> [ImportUserSpec] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/08655002a3f2e6c89b87c3b3eb1c6888a3326c92 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/08655002a3f2e6c89b87c3b3eb1c6888a3326c92 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 12:30:32 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 18 Jul 2024 08:30:32 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-squashed] Oneshot bytecode linking Message-ID: <66990ae857ab8_1caf7999f39051260@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 79b0072b by Cheng Shao at 2024-07-18T14:30:21+02:00 Oneshot bytecode linking - - - - - 12 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/tests/bytecode/T24634/Makefile - + testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -106,6 +106,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -292,6 +293,8 @@ import GHC.Types.TypeEnv import System.IO import {-# SOURCE #-} GHC.Driver.Pipeline import Data.Time +import Data.Traversable +import qualified Data.ByteString as BS import System.IO.Unsafe ( unsafeInterleaveIO ) import GHC.Iface.Env ( trace_if ) @@ -991,7 +994,18 @@ initModDetails hsc_env iface = -- Hydrate any WholeCoreBindings linkables into BCOs initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM utc_time this_mod <$> mapM go uls +initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do + -- If a module is compiled with -fbyte-code-and-object-code and it + -- makes use of foreign stubs, then the interface file will also + -- contain serialized stub dynamic objects, and we can simply write + -- them to temporary objects and refer to them as unlinked items + -- directly. + stub_uls <- for (mi_stub_objs mod_iface) $ \stub_obj -> do + f <- newTempName (hsc_logger hsc_env) (hsc_tmpfs hsc_env) (tmpDir (hsc_dflags hsc_env)) TFL_GhcSession "dyn_o" + BS.writeFile f stub_obj + pure $ DotO f + bytecode_uls <- for uls go + pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) @@ -1005,9 +1019,6 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - -- MP: The NoStubs here is only from (I think) the TH `qAddForeignFilePath` feature but it's a bit unclear what to do - -- with these files, do we have to read and serialise the foreign file? I will leave it for now until someone - -- reports a bug. let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) @@ -2044,7 +2055,10 @@ generateByteCode hsc_env cgguts mod_location = do stub_o <- case hasStub of Nothing -> return [] Just stub_c -> do - stub_o <- compileForeign hsc_env LangC stub_c + -- Always compile foreign stubs as shared objects so + -- they can be properly loaded later when the bytecode + -- is loaded. + stub_o <- compileForeign (hscUpdateFlags setDynamicNow hsc_env) LangC stub_c return [DotO stub_o] let hs_unlinked = [BCOs comp_bc spt_entries] ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,11 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModDetails +import GHC.Unit.Module.ModIface + +initModDetails :: HscEnv -> ModIface -> IO ModDetails + +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable ===================================== compiler/GHC/Driver/Pipeline.hs ===================================== @@ -796,7 +796,7 @@ hscBackendPipeline pipe_env hsc_env mod_sum result = HscUpdate iface -> return (iface, emptyHomeModInfoLinkable) HscRecomp {} -> (,) <$> liftIO (mkFullIface hsc_env (hscs_partial_iface result) Nothing Nothing) <*> pure emptyHomeModInfoLinkable -- TODO: Why is there not a linkable? - -- Interpreter -> (,) <$> use (T_IO (mkFullIface hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing + -- Interpreter -> (,) <$> use (T_IO (mkFullIfaceWithForeignStubs hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing hscGenBackendPipeline :: P m => PipeEnv ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -582,9 +582,23 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do do output_fn <- phaseOutputFilenameNew next_phase pipe_env hsc_env (Just location) (outputFilename, mStub, foreign_files, stg_infos, cg_infos) <- - hscGenHardCode hsc_env cgguts mod_location output_fn - final_iface <- mkFullIface hsc_env partial_iface stg_infos cg_infos + + -- When compiling with -fprefer-byte-code, always + -- compile foreign stubs as shared objects to ensure + -- they can be properly loaded. + let hsc_env_stub + | gopt Opt_WriteIfSimplifiedCore dflags = hscUpdateFlags setDynamicNow hsc_env + | otherwise = hsc_env + stub_o <- mapM (compileStub hsc_env_stub) mStub + foreign_os <- + mapM (uncurry (compileForeign hsc_env_stub)) foreign_files + let fos = maybe [] return stub_o ++ foreign_os + iface_fos + | gopt Opt_WriteIfSimplifiedCore dflags = fos + | otherwise = [] + + final_iface <- mkFullIfaceWithForeignStubs hsc_env partial_iface stg_infos cg_infos iface_fos -- See Note [Writing interface files] hscMaybeWriteIface logger dflags False final_iface mb_old_iface_hash mod_location @@ -596,12 +610,6 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do else return emptyHomeModInfoLinkable - - stub_o <- mapM (compileStub hsc_env) mStub - foreign_os <- - mapM (uncurry (compileForeign hsc_env)) foreign_files - let fos = (maybe [] return stub_o ++ foreign_os) - -- This is awkward, no linkable is produced here because we still -- have some way to do before the object file is produced -- In future we can split up the driver logic more so that this function ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -516,11 +516,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Iface/Make.hs ===================================== @@ -12,6 +12,7 @@ module GHC.Iface.Make ( mkPartialIface , mkFullIface + , mkFullIfaceWithForeignStubs , mkIfaceTc , mkIfaceExports ) @@ -89,6 +90,8 @@ import GHC.Unit.Module.ModGuts import GHC.Unit.Module.ModSummary import GHC.Unit.Module.Deps +import qualified Data.ByteString as BS +import Data.Traversable import Data.Function import Data.List ( sortBy ) import Data.Ord @@ -127,23 +130,30 @@ mkPartialIface hsc_env core_prog mod_details mod_summary import_decls = mkIface_ hsc_env this_mod core_prog hsc_src used_th deps rdr_env import_decls fix_env warns hpc_info self_trust safe_mode usages docs mod_summary mod_details +-- | Backwards compat interface for 'mkFullIfaceWithForeignStubs'. +mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface +mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = + mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos [] + -- | Fully instantiate an interface. Adds fingerprints and potentially code -- generator produced information. -- -- CmmCgInfos is not available when not generating code (-fno-code), or when not -- generating interface pragmas (-fomit-interface-pragmas). See also -- Note [Conveying CAF-info and LFInfo between modules] in GHC.StgToCmm.Types. -mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface -mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = do +mkFullIfaceWithForeignStubs :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> [FilePath] -> IO ModIface +mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos fos = do let decls | gopt Opt_OmitInterfacePragmas (hsc_dflags hsc_env) = mi_decls partial_iface | otherwise = updateDecl (mi_decls partial_iface) mb_stg_infos mb_cmm_infos + stub_objs <- for fos BS.readFile + full_iface <- {-# SCC "addFingerprints" #-} - addFingerprints hsc_env (set_mi_decls decls partial_iface) + addFingerprints hsc_env $ set_mi_stub_objs stub_objs $ set_mi_decls decls partial_iface -- Debug printing let unit_state = hsc_units hsc_env ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -52,10 +52,14 @@ import Control.Applicative import qualified Data.Set as Set import qualified Data.Map as M -import Data.List (isSuffixOf) import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts @@ -71,6 +75,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -141,7 +146,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do -- 3. For each dependent module, find its linkable -- This will either be in the HPT or (in the case of one-shot -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM (get_linkable (ldObjSuffix opts)) mods_needed + lnks_needed <- mapM get_linkable mods_needed return $ LinkDeps { ldNeededLinkables = lnks_needed @@ -267,7 +272,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable osuf mod -- A home-package module + get_linkable mod -- A home-package module | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) | otherwise @@ -284,13 +289,28 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "makima") mod + case mi_extra_decls iface of + Just extra_decls -> do + details <- initModDetails hsc_env iface + t <- getCurrentTime + initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do @@ -301,9 +321,13 @@ get_link_deps opts pls maybe_normal_osuf span mods = do return lnk adjust_ul new_osuf (DotO file) = do - massert (osuf `isSuffixOf` file) - let file_base = fromJust (stripExtension osuf file) - new_file = file_base <.> new_osuf + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf ok <- doesFileExist new_file if (not ok) then dieWith opts span $ @@ -408,4 +432,3 @@ failNonStd opts srcspan = dieWith opts srcspan $ Prof -> "with -prof" Dyn -> "with -dynamic" #endif - ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -22,6 +22,7 @@ module GHC.Unit.Module.ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -56,6 +57,7 @@ module GHC.Unit.Module.ModIface , set_mi_rules , set_mi_decls , set_mi_extra_decls + , set_mi_stub_objs , set_mi_top_env , set_mi_hpc , set_mi_trust @@ -119,6 +121,7 @@ import GHC.Utils.Binary import Control.DeepSeq import Control.Exception import qualified GHC.Data.Strict as Strict +import Data.ByteString (ByteString) {- Note [Interface file stages] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -282,6 +285,13 @@ data ModIface_ (phase :: ModIfacePhase) -- combined with mi_decls allows us to restart code generation. -- See Note [Interface Files with Core Definitions] and Note [Interface File with Core: Sharing RHSs] + mi_stub_objs_ :: ![ByteString], + -- ^ Serialized foreign stub dynamic objects when + -- compiled with -fbyte-code-and-object-code, empty + -- and unused in other cases. This is required to make + -- whole core bindings properly work with foreign + -- stubs (see #24634). + mi_top_env_ :: !(Maybe IfaceTopEnv), -- ^ Just enough information to reconstruct the top level environment in -- the /original source/ code for this module. which @@ -453,6 +463,7 @@ instance Binary ModIface where mi_anns_ = anns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_insts_ = insts, mi_fam_insts_ = fam_insts, mi_rules_ = rules, @@ -497,6 +508,7 @@ instance Binary ModIface where lazyPut bh anns put_ bh decls put_ bh extra_decls + put_ bh stub_objs put_ bh insts put_ bh fam_insts lazyPut bh rules @@ -529,6 +541,7 @@ instance Binary ModIface where anns <- {-# SCC "bin_anns" #-} lazyGet bh decls <- {-# SCC "bin_tycldecls" #-} get bh extra_decls <- get bh + stub_objs <- get bh insts <- {-# SCC "bin_insts" #-} get bh fam_insts <- {-# SCC "bin_fam_insts" #-} get bh rules <- {-# SCC "bin_rules" #-} lazyGet bh @@ -558,6 +571,7 @@ instance Binary ModIface where mi_warns_ = warns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_top_env_ = Nothing, mi_insts_ = insts, mi_fam_insts_ = fam_insts, @@ -611,6 +625,7 @@ emptyPartialModIface mod mi_rules_ = [], mi_decls_ = [], mi_extra_decls_ = Nothing, + mi_stub_objs_ = [], mi_top_env_ = Nothing, mi_hpc_ = False, mi_trust_ = noIfaceTrustInfo, @@ -664,7 +679,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) rnf (PrivateModIface { mi_module_, mi_sig_of_, mi_hsc_src_, mi_hi_bytes_, mi_deps_, mi_usages_ , mi_exports_, mi_used_th_, mi_fixities_, mi_warns_, mi_anns_ - , mi_decls_, mi_extra_decls_, mi_top_env_, mi_insts_ + , mi_decls_, mi_extra_decls_, mi_stub_objs_, mi_top_env_, mi_insts_ , mi_fam_insts_, mi_rules_, mi_hpc_, mi_trust_, mi_trust_pkg_ , mi_complete_matches_, mi_docs_, mi_final_exts_ , mi_ext_fields_, mi_src_hash_ }) @@ -681,6 +696,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) `seq` rnf mi_anns_ `seq` rnf mi_decls_ `seq` rnf mi_extra_decls_ + `seq` rnf mi_stub_objs_ `seq` rnf mi_top_env_ `seq` rnf mi_insts_ `seq` rnf mi_fam_insts_ @@ -844,6 +860,9 @@ set_mi_decls val iface = clear_mi_hi_bytes $ iface { mi_decls_ = val } set_mi_extra_decls :: Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> ModIface_ phase -> ModIface_ phase set_mi_extra_decls val iface = clear_mi_hi_bytes $ iface { mi_extra_decls_ = val } +set_mi_stub_objs :: [ByteString] -> ModIface_ phase -> ModIface_ phase +set_mi_stub_objs stub_objs iface = clear_mi_hi_bytes $ iface { mi_stub_objs_ = stub_objs } + set_mi_top_env :: Maybe IfaceTopEnv -> ModIface_ phase -> ModIface_ phase set_mi_top_env val iface = clear_mi_hi_bytes $ iface { mi_top_env_ = val } @@ -940,6 +959,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_anns #-} {-# INLINE mi_decls #-} {-# INLINE mi_extra_decls #-} +{-# INLINE mi_stub_objs #-} {-# INLINE mi_top_env #-} {-# INLINE mi_insts #-} {-# INLINE mi_fam_insts #-} @@ -957,7 +977,7 @@ However, with the pragma, the correct core is generated: pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> [IfaceExport] -> Bool -> [(OccName, Fixity)] -> IfaceWarnings -> - [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> + [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> [ByteString] -> Maybe IfaceTopEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> AnyHpcUsage -> IfaceTrustInfo -> Bool -> [IfaceCompleteMatch] -> Maybe Docs -> IfaceBackendExts phase -> ExtensibleFields -> Fingerprint -> IfaceBinHandle phase -> @@ -975,6 +995,7 @@ pattern ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -1001,6 +1022,7 @@ pattern ModIface , mi_anns_ = mi_anns , mi_decls_ = mi_decls , mi_extra_decls_ = mi_extra_decls + , mi_stub_objs_ = mi_stub_objs , mi_top_env_ = mi_top_env , mi_insts_ = mi_insts , mi_fam_insts_ = mi_fam_insts ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -2,8 +2,8 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -bytecode-capi: - $(TEST_HC) -c hello.c +T24634: + $(TEST_HC) -c -dynamic hello.c -o hello.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs $(TEST_HC) -fprefer-byte-code hello.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -0,0 +1,3 @@ +[2 of 3] Compiling Main ( Main.hs, Main.o ) +[3 of 3] Linking Main +42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,7 +1,8 @@ test('T24634', [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), - req_interp, - expect_broken(24634), + req_c, + req_th, + ignore_stderr ], makefile_test, - ['']) + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/79b0072bd6f04e90132b6c2b6e2cf7f9481ec9ac -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/79b0072bd6f04e90132b6c2b6e2cf7f9481ec9ac You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 12:33:26 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 18 Jul 2024 08:33:26 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] 2 commits: Oneshot bytecode linking Message-ID: <66990b95f1a3b_1caf799c737c51449@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 79b0072b by Cheng Shao at 2024-07-18T14:30:21+02:00 Oneshot bytecode linking - - - - - f06853e2 by Torsten Schmits at 2024-07-18T14:33:04+02:00 Package deps bytecode linking - - - - - 29 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/tests/bytecode/T24634/Makefile - + testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/obj.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash - + testsuite/tests/th/cross-package/unit1 - + testsuite/tests/th/cross-package/unit2 Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -106,6 +106,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -292,6 +293,8 @@ import GHC.Types.TypeEnv import System.IO import {-# SOURCE #-} GHC.Driver.Pipeline import Data.Time +import Data.Traversable +import qualified Data.ByteString as BS import System.IO.Unsafe ( unsafeInterleaveIO ) import GHC.Iface.Env ( trace_if ) @@ -991,7 +994,18 @@ initModDetails hsc_env iface = -- Hydrate any WholeCoreBindings linkables into BCOs initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM utc_time this_mod <$> mapM go uls +initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do + -- If a module is compiled with -fbyte-code-and-object-code and it + -- makes use of foreign stubs, then the interface file will also + -- contain serialized stub dynamic objects, and we can simply write + -- them to temporary objects and refer to them as unlinked items + -- directly. + stub_uls <- for (mi_stub_objs mod_iface) $ \stub_obj -> do + f <- newTempName (hsc_logger hsc_env) (hsc_tmpfs hsc_env) (tmpDir (hsc_dflags hsc_env)) TFL_GhcSession "dyn_o" + BS.writeFile f stub_obj + pure $ DotO f + bytecode_uls <- for uls go + pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) @@ -1005,9 +1019,6 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - -- MP: The NoStubs here is only from (I think) the TH `qAddForeignFilePath` feature but it's a bit unclear what to do - -- with these files, do we have to read and serialise the foreign file? I will leave it for now until someone - -- reports a bug. let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) @@ -2044,7 +2055,10 @@ generateByteCode hsc_env cgguts mod_location = do stub_o <- case hasStub of Nothing -> return [] Just stub_c -> do - stub_o <- compileForeign hsc_env LangC stub_c + -- Always compile foreign stubs as shared objects so + -- they can be properly loaded later when the bytecode + -- is loaded. + stub_o <- compileForeign (hscUpdateFlags setDynamicNow hsc_env) LangC stub_c return [DotO stub_o] let hs_unlinked = [BCOs comp_bc spt_entries] ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,11 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModDetails +import GHC.Unit.Module.ModIface + +initModDetails :: HscEnv -> ModIface -> IO ModDetails + +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable ===================================== compiler/GHC/Driver/Pipeline.hs ===================================== @@ -796,7 +796,7 @@ hscBackendPipeline pipe_env hsc_env mod_sum result = HscUpdate iface -> return (iface, emptyHomeModInfoLinkable) HscRecomp {} -> (,) <$> liftIO (mkFullIface hsc_env (hscs_partial_iface result) Nothing Nothing) <*> pure emptyHomeModInfoLinkable -- TODO: Why is there not a linkable? - -- Interpreter -> (,) <$> use (T_IO (mkFullIface hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing + -- Interpreter -> (,) <$> use (T_IO (mkFullIfaceWithForeignStubs hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing hscGenBackendPipeline :: P m => PipeEnv ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -582,9 +582,23 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do do output_fn <- phaseOutputFilenameNew next_phase pipe_env hsc_env (Just location) (outputFilename, mStub, foreign_files, stg_infos, cg_infos) <- - hscGenHardCode hsc_env cgguts mod_location output_fn - final_iface <- mkFullIface hsc_env partial_iface stg_infos cg_infos + + -- When compiling with -fprefer-byte-code, always + -- compile foreign stubs as shared objects to ensure + -- they can be properly loaded. + let hsc_env_stub + | gopt Opt_WriteIfSimplifiedCore dflags = hscUpdateFlags setDynamicNow hsc_env + | otherwise = hsc_env + stub_o <- mapM (compileStub hsc_env_stub) mStub + foreign_os <- + mapM (uncurry (compileForeign hsc_env_stub)) foreign_files + let fos = maybe [] return stub_o ++ foreign_os + iface_fos + | gopt Opt_WriteIfSimplifiedCore dflags = fos + | otherwise = [] + + final_iface <- mkFullIfaceWithForeignStubs hsc_env partial_iface stg_infos cg_infos iface_fos -- See Note [Writing interface files] hscMaybeWriteIface logger dflags False final_iface mb_old_iface_hash mod_location @@ -596,12 +610,6 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do else return emptyHomeModInfoLinkable - - stub_o <- mapM (compileStub hsc_env) mStub - foreign_os <- - mapM (uncurry (compileForeign hsc_env)) foreign_files - let fos = (maybe [] return stub_o ++ foreign_os) - -- This is awkward, no linkable is produced here because we still -- have some way to do before the object file is produced -- In future we can split up the driver logic more so that this function ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -516,11 +516,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Iface/Make.hs ===================================== @@ -12,6 +12,7 @@ module GHC.Iface.Make ( mkPartialIface , mkFullIface + , mkFullIfaceWithForeignStubs , mkIfaceTc , mkIfaceExports ) @@ -89,6 +90,8 @@ import GHC.Unit.Module.ModGuts import GHC.Unit.Module.ModSummary import GHC.Unit.Module.Deps +import qualified Data.ByteString as BS +import Data.Traversable import Data.Function import Data.List ( sortBy ) import Data.Ord @@ -127,23 +130,30 @@ mkPartialIface hsc_env core_prog mod_details mod_summary import_decls = mkIface_ hsc_env this_mod core_prog hsc_src used_th deps rdr_env import_decls fix_env warns hpc_info self_trust safe_mode usages docs mod_summary mod_details +-- | Backwards compat interface for 'mkFullIfaceWithForeignStubs'. +mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface +mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = + mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos [] + -- | Fully instantiate an interface. Adds fingerprints and potentially code -- generator produced information. -- -- CmmCgInfos is not available when not generating code (-fno-code), or when not -- generating interface pragmas (-fomit-interface-pragmas). See also -- Note [Conveying CAF-info and LFInfo between modules] in GHC.StgToCmm.Types. -mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface -mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = do +mkFullIfaceWithForeignStubs :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> [FilePath] -> IO ModIface +mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos fos = do let decls | gopt Opt_OmitInterfacePragmas (hsc_dflags hsc_env) = mi_decls partial_iface | otherwise = updateDecl (mi_decls partial_iface) mb_stg_infos mb_cmm_infos + stub_objs <- for fos BS.readFile + full_iface <- {-# SCC "addFingerprints" #-} - addFingerprints hsc_env (set_mi_decls decls partial_iface) + addFingerprints hsc_env $ set_mi_stub_objs stub_objs $ set_mi_decls decls partial_iface -- Debug printing let unit_state = hsc_units hsc_env ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -6,6 +6,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE NamedFieldPuns #-} module GHC.Linker.Deps ( LinkDepsOpts (..) @@ -47,15 +48,18 @@ import GHC.Utils.Misc import GHC.Unit.Home import GHC.Data.Maybe -import Control.Monad import Control.Applicative +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Control.Monad.Trans.Except (ExceptT, runExceptT, throwE) import qualified Data.Set as Set import qualified Data.Map as M -import Data.List (isSuffixOf) import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock data LinkDepsOpts = LinkDepsOpts @@ -66,18 +70,20 @@ data LinkDepsOpts = LinkDepsOpts , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldFinderCache :: !FinderCache -- ^ Finder cache , ldFinderOpts :: !FinderOpts -- ^ Finder options + , ldHugFinderOpts :: !(UnitEnvGraph FinderOpts) , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects , ldMsgOpts :: !(DiagnosticOpts IfaceMessage) -- ^ Options for diagnostics , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps { ldNeededLinkables :: [Linkable] , ldAllLinkables :: [Linkable] - , ldUnits :: [UnitId] - , ldNeededUnits :: UniqDSet UnitId + , ldNeededUnits :: [UnitId] + , ldAllUnits :: UniqDSet UnitId } -- | Find all the packages and linkables that a set of modules depends on @@ -103,7 +109,6 @@ getLinkDeps opts interp pls span mods = do get_link_deps opts pls maybe_normal_osuf span mods - get_link_deps :: LinkDepsOpts -> LoaderState @@ -112,47 +117,48 @@ get_link_deps -> [Module] -> IO LinkDeps get_link_deps opts pls maybe_normal_osuf span mods = do - -- 1. Find the dependent home-pkg-modules/packages from each iface - -- (omitting modules from the interactive package, which is already linked) - (mods_s, pkgs_s) <- - -- Why two code paths here? There is a significant amount of repeated work - -- performed calculating transitive dependencies - -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) - if ldOneShotMode opts - then follow_deps (filterOut isInteractiveModule mods) - emptyUniqDSet emptyUniqDSet; - else do - (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods - return (catMaybes mmods, unionManyUniqDSets (init_pkg_set : pkgs)) - - let - -- 2. Exclude ones already linked - -- Main reason: avoid findModule calls in get_linkable - (mods_needed, links_got) = partitionWith split_mods mods_s - pkgs_needed = eltsUDFM $ getUniqDSet pkgs_s `minusUDFM` pkgs_loaded pls - - split_mods mod = - let is_linked = lookupModuleEnv (objs_loaded pls) mod - <|> lookupModuleEnv (bcos_loaded pls) mod - in case is_linked of - Just linkable -> Right linkable - Nothing -> Left mod - - -- 3. For each dependent module, find its linkable - -- This will either be in the HPT or (in the case of one-shot - -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM (get_linkable (ldObjSuffix opts)) mods_needed - - return $ LinkDeps - { ldNeededLinkables = lnks_needed - , ldAllLinkables = links_got ++ lnks_needed - , ldUnits = pkgs_needed - , ldNeededUnits = pkgs_s - } + -- 1. Find the dependent home-pkg-modules/packages from each iface + -- (omitting modules from the interactive package, which is already linked) + -- Why two code paths here? There is a significant amount of repeated work + -- performed calculating transitive dependencies + -- if --make uses the oneShot code path (see MultiLayerModulesTH_* tests) + deps <- if ldOneShotMode opts + then oneshot_deps opts (filterOut isInteractiveModule mods) + else make_deps + + -- 2. Exclude ones already linked + -- Main reason: avoid findModule calls in get_linkable + -- TODO outdated + let (loaded_modules, needed_modules, ldAllUnits, ldNeededUnits) = + classify_deps pls deps + + -- 3. For each dependent module, find its linkable + -- This will either be in the HPT or (in the case of one-shot + -- compilation) we may need to use maybe_getFileLinkable + -- TODO outdated + ldNeededLinkables <- mapM module_linkable needed_modules + + pure LinkDeps { + ldNeededLinkables, + ldAllLinkables = loaded_modules ++ ldNeededLinkables, + ldNeededUnits, + ldAllUnits + } where mod_graph = ldModuleGraph opts unit_env = ldUnitEnv opts + make_deps = do + (pkgs, mmods) <- unzip <$> mapM get_mod_info all_home_mods + let + link_mods = + listToUDFM [(moduleName (mi_module (hm_iface m)), m) | m <- mmods] + link_libs = + uniqDSetToList (unionManyUniqDSets (init_pkg_set : pkgs)) + pure $ + LinkModules (LinkHomeModule <$> link_mods) : + (LinkLibrary <$> link_libs) + -- This code is used in `--make` mode to calculate the home package and unit dependencies -- for a set of modules. -- @@ -184,73 +190,14 @@ get_link_deps opts pls maybe_normal_osuf span mods = do get_mod_info (ModNodeKeyWithUid gwib uid) = case lookupHug (ue_home_unit_graph unit_env) uid (gwib_mod gwib) of - Just hmi -> - let iface = (hm_iface hmi) - mmod = case mi_hsc_src iface of - HsBootFile -> link_boot_mod_error (mi_module iface) - _ -> return $ Just (mi_module iface) - - in (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface),) <$> mmod + Just hmi -> do + let iface = hm_iface hmi + case mi_hsc_src iface of + HsBootFile -> throwProgramError opts $ link_boot_mod_error (mi_module iface) + _ -> pure (mkUniqDSet $ Set.toList $ dep_direct_pkgs (mi_deps iface), hmi) Nothing -> throwProgramError opts $ text "getLinkDeps: Home module not loaded" <+> ppr (gwib_mod gwib) <+> ppr uid - - -- This code is used in one-shot mode to traverse downwards through the HPT - -- to find all link dependencies. - -- The ModIface contains the transitive closure of the module dependencies - -- within the current package, *except* for boot modules: if we encounter - -- a boot module, we have to find its real interface and discover the - -- dependencies of that. Hence we need to traverse the dependency - -- tree recursively. See bug #936, testcase ghci/prog007. - follow_deps :: [Module] -- modules to follow - -> UniqDSet Module -- accum. module dependencies - -> UniqDSet UnitId -- accum. package dependencies - -> IO ([Module], UniqDSet UnitId) -- result - follow_deps [] acc_mods acc_pkgs - = return (uniqDSetToList acc_mods, acc_pkgs) - follow_deps (mod:mods) acc_mods acc_pkgs - = do - mb_iface <- ldLoadIface opts msg mod - iface <- case mb_iface of - Failed err -> throwProgramError opts $ - missingInterfaceErrorDiagnostic (ldMsgOpts opts) err - Succeeded iface -> return iface - - when (mi_boot iface == IsBoot) $ link_boot_mod_error mod - - let - pkg = moduleUnit mod - deps = mi_deps iface - - pkg_deps = dep_direct_pkgs deps - (boot_deps, mod_deps) = flip partitionWith (Set.toList (dep_direct_mods deps)) $ - \case - (_, GWIB m IsBoot) -> Left m - (_, GWIB m NotBoot) -> Right m - - mod_deps' = case ue_homeUnit unit_env of - Nothing -> [] - Just home_unit -> filter (not . (`elementOfUniqDSet` acc_mods)) (map (mkHomeModule home_unit) $ (boot_deps ++ mod_deps)) - acc_mods' = case ue_homeUnit unit_env of - Nothing -> acc_mods - Just home_unit -> addListToUniqDSet acc_mods (mod : map (mkHomeModule home_unit) mod_deps) - acc_pkgs' = addListToUniqDSet acc_pkgs (Set.toList pkg_deps) - - case ue_homeUnit unit_env of - Just home_unit | isHomeUnit home_unit pkg -> follow_deps (mod_deps' ++ mods) - acc_mods' acc_pkgs' - _ -> follow_deps mods acc_mods (addOneToUniqDSet acc_pkgs' (toUnitId pkg)) - where - msg = text "need to link module" <+> ppr mod <+> - text "due to use of Template Haskell" - - - - link_boot_mod_error :: Module -> IO a - link_boot_mod_error mod = throwProgramError opts $ - text "module" <+> ppr mod <+> - text "cannot be linked; it is only available as a boot module" - no_obj :: Outputable a => a -> IO b no_obj mod = dieWith opts span $ text "cannot find object file for module " <> @@ -259,6 +206,20 @@ get_link_deps opts pls maybe_normal_osuf span mods = do while_linking_expr = text "while linking an interpreted expression" + module_linkable = \case + LinkHomeModule hmi -> + adjust_linkable (expectJust "getLinkDeps" (homeModLinkable hmi)) + + LinkObjectModule iface loc -> do + let mod = mi_module iface + findObjectLinkableMaybe mod loc >>= \case + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + LinkByteCodeModule iface wcb -> do + details <- initModDetails (ldHscEnv opts) iface + t <- getCurrentTime + initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable @@ -267,54 +228,228 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable osuf mod -- A home-package module - | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) - = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) - | otherwise - = do -- It's not in the HPT because we are in one shot mode, - -- so use the Finder to get a ModLocation... - case ue_homeUnit unit_env of - Nothing -> no_obj mod - Just home_unit -> do - - let fc = ldFinderCache opts - let fopts = ldFinderOpts opts - mb_stuff <- findHomeModule fc fopts home_unit (moduleName mod) - case mb_stuff of - Found loc mod -> found loc mod - _ -> no_obj (moduleName mod) - where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} - - adjust_linkable lnk - | Just new_osuf <- maybe_normal_osuf = do - new_uls <- mapM (adjust_ul new_osuf) - (linkableUnlinked lnk) - return lnk{ linkableUnlinked=new_uls } - | otherwise = - return lnk - - adjust_ul new_osuf (DotO file) = do - massert (osuf `isSuffixOf` file) - let file_base = fromJust (stripExtension osuf file) - new_file = file_base <.> new_osuf - ok <- doesFileExist new_file - if (not ok) - then dieWith opts span $ - text "cannot find object file " - <> quotes (text new_file) $$ while_linking_expr - else return (DotO new_file) - adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) - adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) - adjust_ul _ l@(BCOs {}) = return l - adjust_ul _ l at LoadedBCOs{} = return l - adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + adjust_linkable lnk + | Just new_osuf <- maybe_normal_osuf = do + new_uls <- mapM (adjust_ul new_osuf) + (linkableUnlinked lnk) + return lnk{ linkableUnlinked=new_uls } + | otherwise = + return lnk + + adjust_ul new_osuf (DotO file) = do + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf + ok <- doesFileExist new_file + if (not ok) + then dieWith opts span $ + text "cannot find object file " + <> quotes (text new_file) $$ while_linking_expr + else return (DotO new_file) + adjust_ul _ (DotA fp) = panic ("adjust_ul DotA " ++ show fp) + adjust_ul _ (DotDLL fp) = panic ("adjust_ul DotDLL " ++ show fp) + adjust_ul _ l@(BCOs {}) = return l + adjust_ul _ l at LoadedBCOs{} = return l + adjust_ul _ (CoreBindings (WholeCoreBindings _ mod _)) = pprPanic "Unhydrated core bindings" (ppr mod) + +data LinkModule = + LinkHomeModule HomeModInfo + | + LinkObjectModule ModIface ModLocation + | + LinkByteCodeModule ModIface WholeCoreBindings + +link_module_iface :: LinkModule -> ModIface +link_module_iface = \case + LinkHomeModule hmi -> hm_iface hmi + LinkObjectModule iface _ -> iface + LinkByteCodeModule iface _ -> iface + +instance Outputable LinkModule where + ppr = \case + LinkHomeModule hmi -> ppr (mi_module (hm_iface hmi)) <+> brackets (text "HMI") + LinkObjectModule iface _ -> ppr (mi_module iface) + LinkByteCodeModule _ wcb -> ppr (wcb_module wcb) <+> brackets (text "BC") + +data LinkDep = + LinkModules (UniqDFM ModuleName LinkModule) + | + LinkLibrary UnitId + +instance Outputable LinkDep where + ppr = \case + LinkModules mods -> text "modules:" <+> ppr (eltsUDFM mods) + LinkLibrary uid -> text "library:" <+> ppr uid + +data OneshotError = + NoLocation Module + | + NoInterface MissingInterfaceError + | + LinkBootModule Module + +-- This code is used in one-shot mode to traverse downwards through the HPT +-- to find all link dependencies. +-- The ModIface contains the transitive closure of the module dependencies +-- within the current package, *except* for boot modules: if we encounter +-- a boot module, we have to find its real interface and discover the +-- dependencies of that. Hence we need to traverse the dependency +-- tree recursively. See bug #936, testcase ghci/prog007. +oneshot_deps :: + LinkDepsOpts -> + -- | Modules whose imports to follow + [Module] -> + IO [LinkDep] +oneshot_deps opts mods = + runExceptT (oneshot_deps_loop opts mods emptyUDFM) >>= \case + Right a -> pure (eltsUDFM a) + Left err -> throwProgramError opts (message err) + where + message = \case + NoLocation mod -> + pprPanic "found iface but no location" (ppr mod) + NoInterface err -> + missingInterfaceErrorDiagnostic (ldMsgOpts opts) err + LinkBootModule mod -> + link_boot_mod_error mod + +oneshot_deps_loop :: + LinkDepsOpts -> + [Module] -> + UniqDFM UnitId LinkDep -> + ExceptT OneshotError IO (UniqDFM UnitId LinkDep) +oneshot_deps_loop _ [] acc = + pure acc +oneshot_deps_loop opts (mod : mods) acc = do + (new_acc, new_mods) <- process_module + oneshot_deps_loop opts (new_mods ++ mods) new_acc + where + process_module + | already_seen = pure (acc, []) + | is_home || bytecode = try_iface + | otherwise = add_library + + already_seen + | Just (LinkModules mods) <- mod_dep + = elemUDFM mod_name mods + | Just (LinkLibrary _) <- mod_dep + = True + | otherwise + = False + + try_iface = + liftIO (ldLoadIface opts load_reason mod) >>= \case + Failed err -> throwE (NoInterface err) + Succeeded iface -> + location >>= \case + InstalledFound loc _ -> with_iface loc iface + _ -> throwE (NoLocation mod) + + with_iface loc iface + | mi_boot iface == IsBoot + = throwE (LinkBootModule mod) + | bytecode + , Just core_bindings <- mi_extra_decls iface + , let wcb = WholeCoreBindings core_bindings mod loc + = pure (add_module iface (LinkByteCodeModule iface wcb)) + | is_home + = pure (add_module iface (LinkObjectModule iface loc)) + | otherwise + = add_library + + add_library = pure (addToUDFM acc mod_unit_id (LinkLibrary mod_unit_id), []) + + add_module iface lmod = + (addListToUDFM with_mod (direct_pkgs iface), new_deps iface) + where + with_mod = alterUDFM (add_package_module lmod) acc mod_unit_id + + add_package_module lmod = \case + Just (LinkLibrary u) -> Just (LinkLibrary u) + Just (LinkModules old) -> Just (LinkModules (addToUDFM old mod_name lmod)) + Nothing -> Just (LinkModules (unitUDFM mod_name lmod)) + + direct_pkgs iface + | bytecode + = [] + | otherwise + = [(u, LinkLibrary u) | u <- Set.toList (dep_direct_pkgs (mi_deps iface))] + + new_deps iface + | bytecode + -- TODO How can we better determine the external deps? + = [usg_mod | UsagePackageModule {usg_mod} <- mi_usages iface] ++ local + | is_home + = local + | otherwise + = [] + where + local = + [ + mkModule mod_unit m + -- TODO Somehow this just works, no idea what the deal was in the + -- old code with boot modules. + | (_, GWIB m _) <- Set.toList (dep_direct_mods (mi_deps iface)) + ] + + is_home + | Just home <- mb_home + = homeUnitAsUnit home == mod_unit + | otherwise + = False + + location = + liftIO $ + findExactModule (ldFinderCache opts) (ldFinderOpts opts) + (ldHugFinderOpts opts) (hsc_units (ldHscEnv opts)) mb_home + (toUnitId <$> mod) + + mod_dep = lookupUDFM acc mod_unit_id + mod_name = moduleName mod + mod_unit_id = moduleUnitId mod + mod_unit = moduleUnit mod + load_reason = + text "need to link module" <+> ppr mod <+> + text "due to use of Template Haskell" + + bytecode = ldUseByteCode opts + mb_home = ue_homeUnit (ldUnitEnv opts) + +link_boot_mod_error :: Module -> SDoc +link_boot_mod_error mod = + text "module" <+> ppr mod <+> + text "cannot be linked; it is only available as a boot module" + +classify_deps :: + LoaderState -> + [LinkDep] -> + ([Linkable], [LinkModule], UniqDSet UnitId, [UnitId]) +classify_deps pls deps = + (loaded_modules, needed_modules, all_packages, needed_packages) + where + (loaded_modules, needed_modules) = + partitionWith loaded_or_needed (concatMap eltsUDFM modules) + + needed_packages = + eltsUDFM (getUniqDSet all_packages `minusUDFM` pkgs_loaded pls) + + all_packages = mkUniqDSet packages + + (modules, packages) = flip partitionWith deps $ \case + LinkModules mods -> Left mods + LinkLibrary lib -> Right lib + + loaded_or_needed lm = + maybe (Right lm) Left (loaded_linkable (mi_module (link_module_iface lm))) + + loaded_linkable mod = + lookupModuleEnv (objs_loaded pls) mod + <|> + lookupModuleEnv (bcos_loaded pls) mod {- Note [Using Byte Code rather than Object Code for Template Haskell] @@ -408,4 +543,3 @@ failNonStd opts srcspan = dieWith opts srcspan $ Prof -> "with -prof" Dyn -> "with -dynamic" #endif - ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -230,10 +230,10 @@ loadDependencies interp hsc_env pls span needed_mods = do -- Find what packages and linkables are required deps <- getLinkDeps opts interp pls span needed_mods - let this_pkgs_needed = ldNeededUnits deps + let this_pkgs_needed = ldAllUnits deps -- Link the packages and modules required - pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls + pls1 <- loadPackages' interp hsc_env (ldNeededUnits deps) pls (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps) let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed all_pkgs_loaded = pkgs_loaded pls2 @@ -645,9 +645,11 @@ initLinkDepsOpts hsc_env = opts , ldPprOpts = initSDocContext dflags defaultUserStyle , ldFinderCache = hsc_FC hsc_env , ldFinderOpts = initFinderOpts dflags + , ldHugFinderOpts = initFinderOpts . homeUnitEnv_dflags <$> hsc_HUG hsc_env , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== compiler/GHC/Unit/Finder.hs ===================================== @@ -748,7 +748,7 @@ mkStubPaths fopts mod location stub_basename <.> os "h" -- ----------------------------------------------------------------------------- --- findLinkable isn't related to the other stuff in here, +-- findObjectLinkable isn't related to the other stuff in here, -- but there's no other obvious place for it findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable) ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -22,6 +22,7 @@ module GHC.Unit.Module.ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -56,6 +57,7 @@ module GHC.Unit.Module.ModIface , set_mi_rules , set_mi_decls , set_mi_extra_decls + , set_mi_stub_objs , set_mi_top_env , set_mi_hpc , set_mi_trust @@ -119,6 +121,7 @@ import GHC.Utils.Binary import Control.DeepSeq import Control.Exception import qualified GHC.Data.Strict as Strict +import Data.ByteString (ByteString) {- Note [Interface file stages] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -282,6 +285,13 @@ data ModIface_ (phase :: ModIfacePhase) -- combined with mi_decls allows us to restart code generation. -- See Note [Interface Files with Core Definitions] and Note [Interface File with Core: Sharing RHSs] + mi_stub_objs_ :: ![ByteString], + -- ^ Serialized foreign stub dynamic objects when + -- compiled with -fbyte-code-and-object-code, empty + -- and unused in other cases. This is required to make + -- whole core bindings properly work with foreign + -- stubs (see #24634). + mi_top_env_ :: !(Maybe IfaceTopEnv), -- ^ Just enough information to reconstruct the top level environment in -- the /original source/ code for this module. which @@ -453,6 +463,7 @@ instance Binary ModIface where mi_anns_ = anns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_insts_ = insts, mi_fam_insts_ = fam_insts, mi_rules_ = rules, @@ -497,6 +508,7 @@ instance Binary ModIface where lazyPut bh anns put_ bh decls put_ bh extra_decls + put_ bh stub_objs put_ bh insts put_ bh fam_insts lazyPut bh rules @@ -529,6 +541,7 @@ instance Binary ModIface where anns <- {-# SCC "bin_anns" #-} lazyGet bh decls <- {-# SCC "bin_tycldecls" #-} get bh extra_decls <- get bh + stub_objs <- get bh insts <- {-# SCC "bin_insts" #-} get bh fam_insts <- {-# SCC "bin_fam_insts" #-} get bh rules <- {-# SCC "bin_rules" #-} lazyGet bh @@ -558,6 +571,7 @@ instance Binary ModIface where mi_warns_ = warns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_top_env_ = Nothing, mi_insts_ = insts, mi_fam_insts_ = fam_insts, @@ -611,6 +625,7 @@ emptyPartialModIface mod mi_rules_ = [], mi_decls_ = [], mi_extra_decls_ = Nothing, + mi_stub_objs_ = [], mi_top_env_ = Nothing, mi_hpc_ = False, mi_trust_ = noIfaceTrustInfo, @@ -664,7 +679,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) rnf (PrivateModIface { mi_module_, mi_sig_of_, mi_hsc_src_, mi_hi_bytes_, mi_deps_, mi_usages_ , mi_exports_, mi_used_th_, mi_fixities_, mi_warns_, mi_anns_ - , mi_decls_, mi_extra_decls_, mi_top_env_, mi_insts_ + , mi_decls_, mi_extra_decls_, mi_stub_objs_, mi_top_env_, mi_insts_ , mi_fam_insts_, mi_rules_, mi_hpc_, mi_trust_, mi_trust_pkg_ , mi_complete_matches_, mi_docs_, mi_final_exts_ , mi_ext_fields_, mi_src_hash_ }) @@ -681,6 +696,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) `seq` rnf mi_anns_ `seq` rnf mi_decls_ `seq` rnf mi_extra_decls_ + `seq` rnf mi_stub_objs_ `seq` rnf mi_top_env_ `seq` rnf mi_insts_ `seq` rnf mi_fam_insts_ @@ -844,6 +860,9 @@ set_mi_decls val iface = clear_mi_hi_bytes $ iface { mi_decls_ = val } set_mi_extra_decls :: Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> ModIface_ phase -> ModIface_ phase set_mi_extra_decls val iface = clear_mi_hi_bytes $ iface { mi_extra_decls_ = val } +set_mi_stub_objs :: [ByteString] -> ModIface_ phase -> ModIface_ phase +set_mi_stub_objs stub_objs iface = clear_mi_hi_bytes $ iface { mi_stub_objs_ = stub_objs } + set_mi_top_env :: Maybe IfaceTopEnv -> ModIface_ phase -> ModIface_ phase set_mi_top_env val iface = clear_mi_hi_bytes $ iface { mi_top_env_ = val } @@ -940,6 +959,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_anns #-} {-# INLINE mi_decls #-} {-# INLINE mi_extra_decls #-} +{-# INLINE mi_stub_objs #-} {-# INLINE mi_top_env #-} {-# INLINE mi_insts #-} {-# INLINE mi_fam_insts #-} @@ -957,7 +977,7 @@ However, with the pragma, the correct core is generated: pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> [IfaceExport] -> Bool -> [(OccName, Fixity)] -> IfaceWarnings -> - [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> + [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> [ByteString] -> Maybe IfaceTopEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> AnyHpcUsage -> IfaceTrustInfo -> Bool -> [IfaceCompleteMatch] -> Maybe Docs -> IfaceBackendExts phase -> ExtensibleFields -> Fingerprint -> IfaceBinHandle phase -> @@ -975,6 +995,7 @@ pattern ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -1001,6 +1022,7 @@ pattern ModIface , mi_anns_ = mi_anns , mi_decls_ = mi_decls , mi_extra_decls_ = mi_extra_decls + , mi_stub_objs_ = mi_stub_objs , mi_top_env_ = mi_top_env , mi_insts_ = mi_insts , mi_fam_insts_ = mi_fam_insts ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -2,8 +2,8 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -bytecode-capi: - $(TEST_HC) -c hello.c +T24634: + $(TEST_HC) -c -dynamic hello.c -o hello.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs $(TEST_HC) -fprefer-byte-code hello.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -0,0 +1,3 @@ +[2 of 3] Compiling Main ( Main.hs, Main.o ) +[3 of 3] Linking Main +42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,7 +1,8 @@ test('T24634', [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), - req_interp, - expect_broken(24634), + req_c, + req_th, + ignore_stderr ], makefile_test, - ['']) + []) ===================================== testsuite/tests/th/cross-package/Cross.hs ===================================== @@ -0,0 +1,12 @@ +{-# language TemplateHaskell #-} + +module Main where + +import GHC.Prim +import CrossLocal (splc) + +a :: Int +a = $(splc) + +main :: IO () +main = putStrLn (show a) ===================================== testsuite/tests/th/cross-package/CrossDep.hs ===================================== @@ -0,0 +1,15 @@ +module CrossDep where + +data A = A Int + +used :: Int +used = 9681 + +dep :: A +dep = A used + +unused1 :: A +unused1 = A 1 + +unused2 :: A +unused2 = unused1 ===================================== testsuite/tests/th/cross-package/CrossDepApi.hs ===================================== @@ -0,0 +1,7 @@ +module CrossDepApi (A (A), dep) where + +import CrossDep (A (A)) +import qualified CrossDep + +dep :: A +dep = CrossDep.dep ===================================== testsuite/tests/th/cross-package/CrossLocal.hs ===================================== @@ -0,0 +1,16 @@ +{-# language PackageImports #-} + +module CrossLocal where + +import GHC.Prim +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +-- just to be sure that the file isn't accidentally picked up locally +import "dep" CrossDepApi (dep, A (A)) +import {-# source #-} CrossNum (num) +import CrossObj (numo) + +splc :: ExpQ +splc = lift @_ @Int (num + d + numo) + where + A d = dep ===================================== testsuite/tests/th/cross-package/CrossNum.hs ===================================== @@ -0,0 +1,4 @@ +module CrossNum where + +num :: Int +num = 48332 ===================================== testsuite/tests/th/cross-package/CrossNum.hs-boot ===================================== @@ -0,0 +1,3 @@ +module CrossNum where + +num :: Int ===================================== testsuite/tests/th/cross-package/CrossObj.hs ===================================== @@ -0,0 +1,4 @@ +module CrossObj where + +numo :: Int +numo = 0 ===================================== testsuite/tests/th/cross-package/CrossPackage.stdout ===================================== @@ -0,0 +1 @@ +58013 ===================================== testsuite/tests/th/cross-package/Makefile ===================================== @@ -0,0 +1,37 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# TODO it works even without -package obj, but it should complain about the package not being exposed +DB := -package-db db -package dep +BASIC := $(TEST_HC_OPTS) $(DB) -this-unit-id=cross -v0 +BC := -fprefer-byte-code -fbyte-code-and-object-code +ARGS := $(BASIC) $(BC) + +.PHONY: CrossPackageArchive +CrossPackageArchive: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageEmptyArchive +CrossPackageEmptyArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 2 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageNoArchive +CrossPackageNoArchive: + ./prep.bash "$(TEST_HC)" " $(TEST_HC_OPTS)" "$(GHC_PKG)" 3 + ./run.bash "$(TEST_HC)" "$(ARGS)" + +.PHONY: CrossPackageArchiveObjCode +CrossPackageArchiveObjCode: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + ./run.bash "$(TEST_HC)" "$(BASIC)" + +.PHONY: CrossPackageMultiUnit +CrossPackageMultiUnit: + ./prep.bash "$(TEST_HC)" "$(TEST_HC_OPTS)" "$(GHC_PKG)" 1 + mkdir -p unit2-src/ + mv CrossLocal.hs CrossNum.hs CrossNum.hs-boot unit2-src/ + "$(TEST_HC)" $(TEST_HC_OPTS) $(ARGS) -unit @unit1 -unit @unit2 + ./Cross ===================================== testsuite/tests/th/cross-package/all.T ===================================== @@ -0,0 +1,29 @@ +def cross_test(suf, files = []): + name = f'CrossPackage{suf}' + test( + name, + [ + extra_files([ + 'Cross.hs', + 'CrossLocal.hs', + 'CrossDep.hs', + 'CrossDepApi.hs', + 'CrossNum.hs', + 'CrossNum.hs-boot', + 'CrossObj.hs', + 'dep.conf', + 'obj.conf', + 'prep.bash', + 'run.bash', + ] + files), + use_specs({'stdout': 'CrossPackage.stdout'}), + ], + makefile_test, + [name], + ) + +cross_test('Archive') +cross_test('EmptyArchive') +cross_test('NoArchive') +cross_test('ArchiveObjCode') +cross_test('MultiUnit', ['unit1', 'unit2']) ===================================== testsuite/tests/th/cross-package/dep.conf ===================================== @@ -0,0 +1,8 @@ +name: dep +version: 1.0 +id: dep-1.0 +key: dep-1.0 +exposed: True +exposed-modules: CrossDepApi +import-dirs: ${pkgroot}/dep +library-dirs: ${pkgroot}/dep ===================================== testsuite/tests/th/cross-package/obj.conf ===================================== @@ -0,0 +1,8 @@ +name: obj +version: 1.0 +id: obj-1.0 +key: obj-1.0 +exposed: True +exposed-modules: CrossObj +import-dirs: ${pkgroot}/obj +library-dirs: ${pkgroot}/obj ===================================== testsuite/tests/th/cross-package/prep.bash ===================================== @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" +ghc_pkg_cmd="$3" +archive="$4" + +base="$PWD" +db="$base/db" +dep="$base/dep" +conf_dep="${dep}/dep.conf" +obj="$base/obj" +conf_obj="${obj}/obj.conf" + +ghc_pkg() +{ + eval "${ghc_pkg_cmd at Q} --no-user-package-db --package-db=${db at Q} $@" +} + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +mkdir -p "$dep" "$obj" "$db" +mv CrossDep.hs CrossDepApi.hs "$dep/" +cp dep.conf "$dep/" +mv CrossObj.hs "$obj/" +cp obj.conf "$obj/" + +ghc_pkg recache + +ghc "-package-db ${db at Q} -hidir ${dep at Q} -O0 -this-unit-id dep-1.0 -fbyte-code-and-object-code -c ${dep at Q}/CrossDep.hs ${dep at Q}/CrossDepApi.hs" + +ghc "-package-db ${db at Q} -hidir ${obj at Q} -O0 -this-unit-id obj-1.0 -c ${obj at Q}/CrossObj.hs" +$AR cqs "${obj}/libHSobj-1.0.a" "${obj}/CrossObj.o" +echo 'hs-libraries: HSobj-1.0' >> "$conf_obj" + +if [[ "$archive" == 1 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" "${dep}/CrossDep.o" "${dep}/CrossDepApi.o" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +elif [[ "$archive" == 2 ]] +then + $AR cqs "${dep}/libHSdep-1.0.a" + echo 'hs-libraries: HSdep-1.0' >> "$conf_dep" +fi + +ghc_pkg -v0 register "${conf_dep at Q}" +ghc_pkg -v0 register "${conf_obj at Q}" ===================================== testsuite/tests/th/cross-package/run.bash ===================================== @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -eu + +ghc_cmd="$1" +ghc_opts="$2" + +ghc() +{ + eval "${ghc_cmd at Q} $ghc_opts $@" +} + +ghc -c CrossNum.hs-boot CrossNum.hs CrossLocal.hs +ghc -c Cross.hs +ghc Cross.o -o Cross +./Cross ===================================== testsuite/tests/th/cross-package/unit1 ===================================== @@ -0,0 +1 @@ +-i -i. Cross -this-unit-id unit1 -package-id unit2 ===================================== testsuite/tests/th/cross-package/unit2 ===================================== @@ -0,0 +1 @@ +-i -i./unit2-src CrossLocal CrossNum -this-unit-id unit2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/063136e957d557a18d4bb8a2e908caa72dbb56b9...f06853e2ecdb80d6bcc09833f1c7faf1fbe65685 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/063136e957d557a18d4bb8a2e908caa72dbb56b9...f06853e2ecdb80d6bcc09833f1c7faf1fbe65685 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 13:32:03 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 18 Jul 2024 09:32:03 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: ghcup-metadata: Fix use of arch argument Message-ID: <66991953b5848_3a15c722a8e434669@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 6ae770c5 by Simon Peyton Jones at 2024-07-18T09:31:54-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 40abddf9 by Torsten Schmits at 2024-07-18T09:31:54-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 9 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -94,19 +94,19 @@ windowsArtifact = PlatformSpec ( 'x86_64-windows' , 'ghc-{version}-x86_64-unknown-mingw32' ) def centos(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-centos{n}".format(n=n,arch=arch)) def fedora(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-fedora{n}".format(n=n,arch=arch)) def alpine(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-alpine{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-alpine{n}".format(n=n,arch=arch)) def rocky(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-rocky{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-rocky{n}".format(n=n,arch=arch)) def ubuntu(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-ubuntu{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-ubuntu{n}".format(n=n,arch=arch)) def linux_platform(arch, opsys): return PlatformSpec( opsys, 'ghc-{version}-{arch}-unknown-linux'.format(version="{version}", arch=arch) ) ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f879c69daa1fe76932558c2f20e5bd1f12a0f09b...40abddf92190bdd124524627a5cd1482c9fa734c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f879c69daa1fe76932558c2f20e5bd1f12a0f09b...40abddf92190bdd124524627a5cd1482c9fa734c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 18:12:36 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 18 Jul 2024 14:12:36 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <66995b145e88f_251ef7101dc83556@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d607141f by Matthew Pickering at 2024-07-18T14:12:18-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - a0dc7783 by Simon Peyton Jones at 2024-07-18T14:12:18-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3e25e034 by Torsten Schmits at 2024-07-18T14:12:18-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 78696a16 by Matthew Pickering at 2024-07-18T14:12:19-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 10 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40abddf92190bdd124524627a5cd1482c9fa734c...78696a162b1f952ed6bbc6496636fe596e7d431e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40abddf92190bdd124524627a5cd1482c9fa734c...78696a162b1f952ed6bbc6496636fe596e7d431e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 18 22:13:18 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 18 Jul 2024 18:13:18 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <6699937ec42e6_2ff9c38e51d4546ba@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 7e3817c2 by Matthew Pickering at 2024-07-18T18:13:06-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 35c9c87a by Simon Peyton Jones at 2024-07-18T18:13:06-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - e1abb6f5 by Torsten Schmits at 2024-07-18T18:13:06-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - cdd5bd99 by Matthew Pickering at 2024-07-18T18:13:07-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 10 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78696a162b1f952ed6bbc6496636fe596e7d431e...cdd5bd9926c1c4530f13aa8a51e89ae9bf98a933 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78696a162b1f952ed6bbc6496636fe596e7d431e...cdd5bd9926c1c4530f13aa8a51e89ae9bf98a933 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 02:53:43 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Thu, 18 Jul 2024 22:53:43 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <6699d537295f6_3f2552af9fb01006b7@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: a651f8f1 by Matthew Pickering at 2024-07-18T22:53:31-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - a442c8a7 by Simon Peyton Jones at 2024-07-18T22:53:32-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - ae3875f1 by Torsten Schmits at 2024-07-18T22:53:32-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 649a5d8c by Matthew Pickering at 2024-07-18T22:53:32-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 10 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cdd5bd9926c1c4530f13aa8a51e89ae9bf98a933...649a5d8c1c3992b111198dc6cfc79d0d692fbf85 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cdd5bd9926c1c4530f13aa8a51e89ae9bf98a933...649a5d8c1c3992b111198dc6cfc79d0d692fbf85 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 07:24:40 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 19 Jul 2024 03:24:40 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <669a14b833cdd_54d2a11cac440986@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 57e481e0 by Matthew Pickering at 2024-07-19T03:24:23-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 49647f9a by Simon Peyton Jones at 2024-07-19T03:24:23-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 46936875 by Torsten Schmits at 2024-07-19T03:24:23-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 743296c4 by Matthew Pickering at 2024-07-19T03:24:24-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 10 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,54 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + +module Main( main ) where + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +smallest :: Int -> UArray Int Int +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int Int -> Int -> Int -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int -> [Int] -> UArray Int Int +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int] -> Int +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +39001250856960000 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/649a5d8c1c3992b111198dc6cfc79d0d692fbf85...743296c4f63b52322ea1be87f199db9be66a75ab -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/649a5d8c1c3992b111198dc6cfc79d0d692fbf85...743296c4f63b52322ea1be87f199db9be66a75ab You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 09:54:10 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 19 Jul 2024 05:54:10 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <669a37c26dec4_2a52511d040c98828@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 501feff8 by Matthew Pickering at 2024-07-19T05:53:54-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 98886cf8 by Torsten Schmits at 2024-07-19T05:53:54-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 223e66bb by Matthew Pickering at 2024-07-19T05:53:54-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 4 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/743296c4f63b52322ea1be87f199db9be66a75ab...223e66bbf157639b7c4d1a3f73f6034dd0b2ea73 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/743296c4f63b52322ea1be87f199db9be66a75ab...223e66bbf157639b7c4d1a3f73f6034dd0b2ea73 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 11:28:23 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Fri, 19 Jul 2024 07:28:23 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] 4 commits: Comments and formatting Message-ID: <669a4dd78e383_2a5251948fb81123bc@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: 0fc9f7e8 by Sven Tennie at 2024-07-19T12:19:24+02:00 Comments and formatting - - - - - 832ce6aa by Sven Tennie at 2024-07-19T12:20:36+02:00 De-obfuscate immediate creation a bit - - - - - bf05a0a5 by Sven Tennie at 2024-07-19T12:21:08+02:00 Fix C Calling Convention Arguments are passed as whole words on the stack! - - - - - d691cd4f by Sven Tennie at 2024-07-19T12:55:26+02:00 Cleanup comments - - - - - 2 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Regs.hs Changes: ===================================== compiler/GHC/CmmToAsm/RV64/CodeGen.hs ===================================== @@ -372,8 +372,8 @@ getFloatReg expr = do -- -- N.B. this is a partial function, because not all `CmmLit`s have an immediate -- representation. -litToImm' :: CmmLit -> NatM (Operand, InstrBlock) -litToImm' lit = return (OpImm (litToImm lit), nilOL) +litToImm' :: CmmLit -> Operand +litToImm' = OpImm . litToImm -- | Compute a `CmmExpr` into a `Register` getRegister :: CmmExpr -> NatM Register @@ -384,10 +384,10 @@ getRegister e = do -- | The register width to be used for an operation on the given width -- operand. opRegWidth :: Width -> Width -opRegWidth W64 = W64 -- x -opRegWidth W32 = W32 -- w -opRegWidth W16 = W32 -- w -opRegWidth W8 = W32 -- w +opRegWidth W64 = W64 +opRegWidth W32 = W32 +opRegWidth W16 = W32 +opRegWidth W8 = W32 opRegWidth w = pprPanic "opRegWidth" (text "Unsupported width" <+> ppr w) -- Note [Signed arithmetic on RISCV64] @@ -428,17 +428,16 @@ opRegWidth w = pprPanic "opRegWidth" (text "Unsupported width" <+> ppr w) -- Craig Topper covers possible future improvements -- (https://llvm.org/devmtg/2022-11/slides/TechTalk21-RISC-VSignExtensionOptimizations.pdf) -- --- TODO: --- Don't use Width in Operands --- Instructions should rather carry a RegWidth -- -- Note [Handling PIC on RV64] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- RV64 does not have a special PIC register, the general approach is to --- simply go through the GOT, and there is assembly support for this: +-- RV64 does not have a special PIC register, the general approach is to simply +-- do PC-relative addressing or go through the GOT. There is assembly support +-- for both. -- -- rv64 assembly has a `la` (load address) pseudo-instruction, that allows --- loading a label, ... into a register. The instruction is desugared into +-- loading a label's address into a register. The instruction is desugared into +-- different addressing modes, e.g. PC-relative addressing: -- -- 1: lui rd1, %pcrel_hi(label) -- addi rd1, %pcrel_lo(1b) @@ -462,12 +461,12 @@ opRegWidth w = pprPanic "opRegWidth" (text "Unsupported width" <+> ppr w) -- getRegister' :: NCGConfig -> Platform -> CmmExpr -> NatM Register + -- OPTIMIZATION WARNING: CmmExpr rewrites -- 1. Rewrite: Reg + (-n) => Reg - n -- TODO: this expression shouldn't even be generated to begin with. getRegister' config plat (CmmMachOp (MO_Add w0) [x, CmmLit (CmmInt i w1)]) | i < 0 = getRegister' config plat (CmmMachOp (MO_Sub w0) [x, CmmLit (CmmInt (-i) w1)]) - getRegister' config plat (CmmMachOp (MO_Sub w0) [x, CmmLit (CmmInt i w1)]) | i < 0 = getRegister' config plat (CmmMachOp (MO_Add w0) [x, CmmLit (CmmInt (-i) w1)]) @@ -475,6 +474,7 @@ getRegister' config plat (CmmMachOp (MO_Sub w0) [x, CmmLit (CmmInt i w1)]) | i < getRegister' config plat expr = case expr of CmmReg (CmmGlobal (GlobalRegUse PicBaseReg _)) -> + -- See Note [Handling PIC on RV64] pprPanic "getRegister': There's no PIC base register on RISCV" (ppr PicBaseReg) CmmLit lit -> @@ -487,10 +487,9 @@ getRegister' config plat expr = in pure (Any (intFormat w) (\dst -> unitOL $ annExpr expr (MOV (OpReg w dst) imm))) - -- floatToBytes (fromRational f) CmmFloat 0 w -> do - (op, imm_code) <- litToImm' lit - return (Any (floatFormat w) (\dst -> imm_code `snocOL` annExpr expr (MOV (OpReg w dst) op))) + let op = litToImm' lit + pure (Any (floatFormat w) (\dst -> unitOL $ annExpr expr (MOV (OpReg w dst) op))) CmmFloat _f W8 -> pprPanic "getRegister' (CmmLit:CmmFloat), no support for bytes" (pdoc plat expr) CmmFloat _f W16 -> pprPanic "getRegister' (CmmLit:CmmFloat), no support for halfs" (pdoc plat expr) @@ -509,26 +508,26 @@ getRegister' config plat expr = , MOV (OpReg W64 dst) (OpReg W64 tmp) ])) CmmFloat _f _w -> pprPanic "getRegister' (CmmLit:CmmFloat), unsupported float lit" (pdoc plat expr) - CmmVec _ -> pprPanic "getRegister' (CmmLit:CmmVec): " (pdoc plat expr) - CmmLabel _lbl -> do - (op, imm_code) <- litToImm' lit - let rep = cmmLitType plat lit + CmmVec _lits -> pprPanic "getRegister' (CmmLit:CmmVec): " (pdoc plat expr) + CmmLabel lbl -> do + let op = OpImm (ImmCLbl lbl) + rep = cmmLitType plat lit format = cmmTypeFormat rep - return (Any format (\dst -> imm_code `snocOL` annExpr expr (LDR format (OpReg (formatToWidth format) dst) op))) + return (Any format (\dst -> unitOL $ annExpr expr (LDR format (OpReg (formatToWidth format) dst) op))) - CmmLabelOff _lbl off | isNbitEncodeable 12 (fromIntegral off) -> do - (op, imm_code) <- litToImm' lit - let rep = cmmLitType plat lit + CmmLabelOff lbl off | isNbitEncodeable 12 (fromIntegral off) -> do + let op = OpImm (ImmIndex lbl off) + rep = cmmLitType plat lit format = cmmTypeFormat rep - return (Any format (\dst -> imm_code `snocOL` LDR format (OpReg (formatToWidth format) dst) op)) + return (Any format (\dst -> unitOL $ LDR format (OpReg (formatToWidth format) dst) op)) CmmLabelOff lbl off -> do - (op, imm_code) <- litToImm' (CmmLabel lbl) - let rep = cmmLitType plat lit + let op = litToImm' (CmmLabel lbl) + rep = cmmLitType plat lit format = cmmTypeFormat rep width = typeWidth rep (off_r, _off_format, off_code) <- getSomeReg $ CmmLit (CmmInt (fromIntegral off) width) - return (Any format (\dst -> imm_code `appOL` off_code `snocOL` LDR format (OpReg (formatToWidth format) dst) op `snocOL` ADD (OpReg width dst) (OpReg width dst) (OpReg width off_r))) + return (Any format (\dst -> off_code `snocOL` LDR format (OpReg (formatToWidth format) dst) op `snocOL` ADD (OpReg width dst) (OpReg width dst) (OpReg width off_r))) CmmLabelDiffOff {} -> pprPanic "getRegister' (CmmLit:CmmLabelOff): " (pdoc plat expr) CmmBlock _ -> pprPanic "getRegister' (CmmLit:CmmLabelOff): " (pdoc plat expr) @@ -875,16 +874,14 @@ getRegister' config plat expr = -- Generic ternary case. CmmMachOp op [x, y, z] -> - case op of -- Floating-point fused multiply-add operations - - -- x86 fmadd x * y + z <=> AArch64 fmadd : d = r1 * r2 + r3 - -- x86 fmsub x * y - z <=> AArch64 fnmsub: d = r1 * r2 - r3 - -- x86 fnmadd - x * y + z <=> AArch64 fmsub : d = - r1 * r2 + r3 - -- x86 fnmsub - x * y - z <=> AArch64 fnmadd: d = - r1 * r2 - r3 - + -- + -- x86 fmadd x * y + z <=> RISCV64 fmadd : d = r1 * r2 + r3 + -- x86 fmsub x * y - z <=> RISCV64 fnmsub: d = r1 * r2 - r3 + -- x86 fnmadd - x * y + z <=> RISCV64 fmsub : d = - r1 * r2 + r3 + -- x86 fnmsub - x * y - z <=> RISCV64 fnmadd: d = - r1 * r2 - r3 MO_FMA var w -> case var of FMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMAdd d n m a) FMSub -> float3Op w (\d n m a -> unitOL $ FMA FMSub d n m a) @@ -893,7 +890,6 @@ getRegister' config plat expr = _ -> pprPanic "getRegister' (unhandled ternary CmmMachOp): " $ pprMachOp op <+> text "in" <+> pdoc plat expr - where float3Op w op = do (reg_fx, format_x, code_fx) <- getFloatReg x @@ -901,7 +897,7 @@ getRegister' config plat expr = (reg_fz, format_z, code_fz) <- getFloatReg z massertPpr (isFloatFormat format_x && isFloatFormat format_y && isFloatFormat format_z) $ text "float3Op: non-float" - return $ + pure $ Any (floatFormat w) $ \ dst -> code_fx `appOL` code_fy `appOL` @@ -1328,81 +1324,15 @@ genCondBranch true false expr = -- ----------------------------------------------------------------------------- -- Generating C calls --- Now the biggest nightmare---calls. Most of the nastiness is buried in --- @get_arg@, which moves the arguments to the correct registers/stack --- locations. Apart from that, the code is easy. --- --- As per *convention*: --- x0-x7: (volatile) argument registers --- x8: (volatile) indirect result register / Linux syscall no --- x9-x15: (volatile) caller saved regs --- x16,x17: (volatile) intra-procedure-call registers --- x18: (volatile) platform register. don't use for portability --- x19-x28: (non-volatile) callee save regs --- x29: (non-volatile) frame pointer --- x30: link register --- x31: stack pointer / zero reg --- --- Thus, this is what a c function will expect. Find the arguments in x0-x7, --- anything above that on the stack. We'll ignore c functions with more than --- 8 arguments for now. Sorry. --- --- We need to make sure we preserve x9-x15, don't want to touch x16, x17. - --- Note [PLT vs GOT relocations] --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- When linking objects together, we may need to lookup foreign references. That --- is symbolic references to functions or values in other objects. When --- compiling the object, we can not know where those elements will end up in --- memory (relative to the current location). Thus the use of symbols. There --- are two types of items we are interested, code segments we want to jump to --- and continue execution there (functions, ...), and data items we want to look --- up (strings, numbers, ...). For functions we can use the fact that we can use --- an intermediate jump without visibility to the programs execution. If we --- want to jump to a function that is simply too far away to reach for the B/BL --- instruction, we can create a small piece of code that loads the full target --- address and jumps to that on demand. Say f wants to call g, however g is out --- of range for a direct jump, we can create a function h in range for f, that --- will load the address of g, and jump there. The area where we construct h --- is called the Procedure Linking Table (PLT), we have essentially replaced --- f -> g with f -> h -> g. This is fine for function calls. However if we --- want to lookup values, this trick doesn't work, so we need something else. --- We will instead reserve a slot in memory, and have a symbol pointing to that --- slot. Now what we essentially do is, we reference that slot, and expect that --- slot to hold the final resting address of the data we are interested in. --- Thus what that symbol really points to is the location of the final data. --- The block of memory where we hold all those slots is the Global Offset Table --- (GOT). Instead of x <- $foo, we now do y <- $fooPtr, and x <- [$y]. --- --- FIXME: Update for RISCV, the below is still AArch64. --- For JUMP/CALLs we have 26bits (+/- 128MB), for conditional branches we only --- have 19bits (+/- 1MB). Symbol lookups are also within +/- 1MB, thus for most --- of the LOAD/STOREs we'd want to use adrp, and add to compute a value within --- 4GB of the PC, and load that. For anything outside of that range, we'd have --- to go through the GOT. --- --- adrp x0, --- add x0, :lo: --- --- will compute the address of int x0 if is within 4GB of the --- PC. --- --- If we want to get the slot in the global offset table (GOT), we can do this: --- --- adrp x0, #:got: --- ldr x0, [x0, #:got_lo12:] --- --- this will compute the address anywhere in the addressable 64bit space into --- x0, by loading the address from the GOT slot. --- --- To actually get the value of , we'd need to ldr x0, x0 still, which --- for the first case can be optimized to use ldr x0, [x0, #:lo12:] --- instead of the add instruction. --- --- As the memory model for AArch64 for PIC is considered to be +/- 4GB, we do --- not need to go through the GOT, unless we want to address the full address --- range within 64bit. +-- | Generate a call to a C function. +-- +-- - Integer values are passed in GP registers a0-a7. +-- - Floating point values are passed in FP registers fa0-fa7. +-- - If there are no free floating point registers, the FP values are passed in GP registers. +-- - If all GP registers are taken, the values are spilled as whole words (!) onto the stack. +-- - For integers/words, the return value is in a0. +-- - The return value is in fa0 if the return type is a floating point value. genCCall :: ForeignTarget -- function to call -> [CmmFormal] -- where to put the result @@ -1496,7 +1426,8 @@ genCCall target@(ForeignTarget expr _cconv) dest_regs arg_regs = do -- No mor regs left to pass. Must pass on stack. passArguments [] [] ((r, format, hint, code_r) : args) stackSpaceWords accumRegs accumCode = do let w = formatToWidth format - str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt stackSpaceWords))) + spOffet = 8 * stackSpaceWords + str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt spOffet))) stackCode = if hint == SignedHint then @@ -1511,7 +1442,8 @@ genCCall target@(ForeignTarget expr _cconv) dest_regs arg_regs = do -- Still have fpRegs left, but want to pass a GP argument. Must be passed on the stack then. passArguments [] fpRegs ((r, format, _hint, code_r):args) stackSpaceWords accumRegs accumCode | isIntFormat format = do let w = formatToWidth format - str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt stackSpaceWords))) + spOffet = 8 * stackSpaceWords + str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt spOffet))) stackCode = code_r `snocOL` ann (text "Pass argument (size " <> ppr w <> text ") on the stack: " <> ppr r) str passArguments [] fpRegs args (stackSpaceWords + 1) accumRegs (stackCode `appOL` accumCode) ===================================== compiler/GHC/CmmToAsm/RV64/Regs.hs ===================================== @@ -151,6 +151,10 @@ data Imm | ImmConstantDiff Imm Imm deriving (Eq, Show) +-- | Map `CmmLit` to `Imm` +-- +-- N.B. this is a partial function, because not all `CmmLit`s have an immediate +-- representation. litToImm :: CmmLit -> Imm litToImm (CmmInt i w) = ImmInteger (narrowS w i) -- narrow to the width: a CmmInt might be out of View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b7865a75bbeb725b85bdfc718d5273f28726a8b...d691cd4f53f51c62c10adcbaf81af5d54a92c9da -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b7865a75bbeb725b85bdfc718d5273f28726a8b...d691cd4f53f51c62c10adcbaf81af5d54a92c9da You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 14:14:24 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 19 Jul 2024 10:14:24 -0400 Subject: [Git][ghc/ghc][master] testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <669a74c0d1494_1495f17274dc103281@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 1 changed file: - testsuite/driver/testlib.py Changes: ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bace981e95f862364e202865293ce5c3331e8e69 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bace981e95f862364e202865293ce5c3331e8e69 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 14:14:56 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 19 Jul 2024 10:14:56 -0400 Subject: [Git][ghc/ghc][master] Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` Message-ID: <669a74e0f02c6_1495f198bc28106574@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - 2 changed files: - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs Changes: ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/478de1ab041578d0de72484ec4b7d87ee6b10451 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/478de1ab041578d0de72484ec4b7d87ee6b10451 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 14:15:37 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 19 Jul 2024 10:15:37 -0400 Subject: [Git][ghc/ghc][master] ci: Fix ghcup-metadata generation (again) Message-ID: <669a75099a38d_1495f1bbd2a81095f4@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1 changed file: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b57792a804ad71986238467abe6917406ffaeae5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b57792a804ad71986238467abe6917406ffaeae5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 14:39:54 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 19 Jul 2024 10:39:54 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/revert-type-faster Message-ID: <669a7aba43d16_1495f1dd1cb01113be@gitlab.mail> Matthew Pickering pushed new branch wip/revert-type-faster at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/revert-type-faster You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 15:09:56 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 19 Jul 2024 11:09:56 -0400 Subject: [Git][ghc/ghc][wip/revert-type-faster] 2 commits: Revert "Revert "Make type-equality on synonyms a bit faster"" Message-ID: <669a81c472197_1495f1f705a81132da@gitlab.mail> Matthew Pickering pushed to branch wip/revert-type-faster at Glasgow Haskell Compiler / GHC Commits: 87cedc4e by Matthew Pickering at 2024-07-19T15:41:12+01:00 Revert "Revert "Make type-equality on synonyms a bit faster"" This reverts commit 7c5b9cddf4ab3e85526e7d6a963fc049b1e14dc1. - - - - - 59381637 by Matthew Pickering at 2024-07-19T16:08:37+01:00 Add test for T25094 This test is minimised from hashtables library, before the revert it fails with: ``` T25094.hs:84:18: warning: Type of case alternatives not the same as the annotation on case: Actual type: ST s_a12L (Bucket s_a12L Any Any) Annotation on case: ST s_a12L (Bucket s_a12L k_a12M v_a12N) ``` See #25094 - - - - - 9 changed files: - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - + testsuite/tests/deSugar/should_compile/T25094.hs - testsuite/tests/deSugar/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Map/Type.hs ===================================== @@ -38,6 +38,7 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.TyCo.Rep +import GHC.Core.TyCon( isForgetfulSynTyCon ) import GHC.Core.TyCo.Compare( eqForAllVis ) import GHC.Data.TrieMap @@ -228,10 +229,11 @@ eqDeBruijnType env_t1@(D env1 t1) env_t2@(D env2 t2) = andEq TEQX e = hasCast e andEq TEQ e = e - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare - go (D _ (TyConApp tc1 [])) (D _ (TyConApp tc2 [])) - | tc1 == tc2 - = TEQ + -- See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare + go (D env1 (TyConApp tc1 tys1)) (D env2 (TyConApp tc2 tys2)) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) + = gos env1 env2 tys1 tys2 + go env_t@(D env t) env_t'@(D env' t') | Just new_t <- coreView t = go (D env new_t) env_t' | Just new_t' <- coreView t' = go env_t (D env' new_t') ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -138,35 +138,52 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing nullary type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form - TyConApp tc [] + TyConApp tc tys1 = TyConApp tc tys2 -where @tc@ is a type synonym. A naive way to perform this comparison these +where `tc` is a type synonym. A naive way to perform this comparison these would first expand the synonym and then compare the resulting expansions. -However, this is obviously wasteful and the RHS of @tc@ may be large; it is -much better to rather compare the TyCons directly. Consequently, before -expanding type synonyms in type comparisons we first look for a nullary -TyConApp and simply compare the TyCons if we find one. Of course, if we find -that the TyCons are *not* equal then we still need to perform the expansion as -their RHSs may still be equal. +However, this is obviously wasteful and the RHS of `tc` may be large. We'd +prefer to compare `tys1 = tys2`. When is that sound? Precisely when the +synonym is not /forgetful/; that is, all its type variables appear in its +RHS -- see `GHC.Core.TyCon.isForgetfulSynTyCon`. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be equal. + +This works fine for /equality/, but not for /comparison/. Consider + type S a b = (b, a) +Now consider + S Int Bool `compare` S Char Char +The ordering may depend on whether we expand the synonym or not, and we +don't want the result to depend on that. So for comparison we stick to +/nullary/ synonyms only, which is still useful. We perform this optimisation in a number of places: - * GHC.Core.Types.eqType - * GHC.Core.Types.nonDetCmpType - * GHC.Core.Unify.unify_ty - * GHC.Tc.Solver.Equality.can_eq_nc' - * TcUnify.uType + * GHC.Core.TyCo.Compare.eqType (works for non-nullary synonyms) + * GHC.Core.Map.TYpe.eqDeBruijnType (works for non-nullary synonyms) + * GHC.Core.Types.nonDetCmpType (nullary only) This optimisation is especially helpful for the ubiquitous GHC.Types.Type, since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. +Currently-missed opportunity (#25009): +* In the case of forgetful synonyms, we could still compare the args, pairwise, + and then compare the RHS's with a suitably extended RnEnv2. That would avoid + comparing the same arg repeatedly. e.g. + type S a b = (a,a) + Compare S y ~ S y + If we expand, we end up compare with itself twice. + + But since forgetful synonyms are rare, we have not tried this. + Note [Type comparisons using object pointer comparisons] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Quite often we substitute the type from a definition site into @@ -341,16 +358,26 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env = \ t1 t2 -> t1 `seq` t2 `seq` let go = generic_eq_type_x syn_flag mult_flag mb_env -- Abbreviation for recursive calls + + gos [] [] = True + gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 + gos _ _ = False + in case (t1,t2) of _ | 1# <- reallyUnsafePtrEquality# t1 t2 -> True -- See Note [Type comparisons using object pointer comparisons] - (TyConApp tc1 [], TyConApp tc2 []) | tc1 == tc2 -> True - -- See Note [Comparing nullary type synonyms] + (TyConApp tc1 tys1, TyConApp tc2 tys2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + -> gos tys1 tys2 _ | ExpandSynonyms <- syn_flag, Just t1' <- coreView t1 -> go t1' t2 | ExpandSynonyms <- syn_flag, Just t2' <- coreView t2 -> go t1 t2' + (TyConApp tc1 ts1, TyConApp tc2 ts2) + | tc1 == tc2 -> gos ts1 ts2 + | otherwise -> False + (TyVarTy tv1, TyVarTy tv2) -> case mb_env of Nothing -> tv1 == tv2 @@ -381,14 +408,6 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env | Just (s1, t1') <- tcSplitAppTyNoView_maybe t1 -> go s1 s2 && go t1' t2' - (TyConApp tc1 ts1, TyConApp tc2 ts2) - | tc1 == tc2 -> gos ts1 ts2 - | otherwise -> False - where - gos [] [] = True - gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 - gos _ _ = False - (ForAllTy (Bndr tv1 vis1) body1, ForAllTy (Bndr tv2 vis2) body2) -> case mb_env of Nothing -> generic_eq_type_x syn_flag mult_flag @@ -666,10 +685,11 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - -- See Note [Comparing nullary type synonyms] + go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 - = TEQ + = TEQ -- See Note [Comparing type synonyms] + go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -758,8 +778,10 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] - go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + + go env (TyConApp tc1 ts1) (TyConApp tc2 ts2) + | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] + = gos env (tyConBinders tc1) ts1 ts2 go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -841,7 +841,8 @@ data TyConDetails = -- are fine), again after expanding any -- nested synonyms - synIsForgetful :: Bool, -- True <= at least one argument is not mentioned + synIsForgetful :: Bool, -- See Note [Forgetful type synonyms] + -- True <= at least one argument is not mentioned -- in the RHS (or is mentioned only under -- forgetful synonyms) -- Test is conservative, so True does not guarantee @@ -2121,11 +2122,43 @@ isFamFreeTyCon (TyCon { tyConDetails = details }) -- True. Thus, False means that all bound variables appear on the RHS; -- True may not mean anything, as the test to set this flag is -- conservative. +-- +-- See Note [Forgetful type synonyms] isForgetfulSynTyCon :: TyCon -> Bool isForgetfulSynTyCon (TyCon { tyConDetails = details }) | SynonymTyCon { synIsForgetful = forget } <- details = forget | otherwise = False +{- Note [Forgetful type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A type synonyms is /forgetful/ if its RHS fails to mention one (or more) of its bound variables. + +Forgetfulness is conservative: + * A non-forgetful synonym /guarantees/ to mention all its bound variables in its RHS. + * It is always safe to classify a synonym as forgetful. + +Examples: + type R = Int -- Not forgetful + type S a = Int -- Forgetful + type T1 a = Int -> S a -- Forgetful + type T2 a = a -> S a -- Not forgetful + type T3 a = Int -> F a -- Not forgetful + where type family F a + +* R shows that nullary synonyms are not forgetful. + +* T2 shows that forgetfulness needs to account for uses of forgetful + synonyms. `a` appears on the RHS, but only under a forgetful S + +* T3 shows that non-forgetfulness is not the same as injectivity. T3 mentions its + bound variable on its RHS, but under a type family. So it is entirely possible + that T3 Int ~ T3 Bool + +* Since type synonyms are non-recursive, we don't need a fixpoint analysis to + determine forgetfulness. It's rather easy -- see `GHC.Core.Type.buildSynTyCon`, + which is a bit over-conservative for over-saturated synonyms. +-} + -- As for newtypes, it is in some contexts important to distinguish between -- closed synonyms and synonym families, as synonym families have no unique -- right hand side to which a synonym family application can expand. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon + -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,8 +3275,9 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing -nullary type synonyms] in "GHC.Core.Type". +applications (e.g. things like @TyConApp typeTyCon []@). See +* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" +* Note [Unifying type synonyms] in "GHC.Core.Unify" To accomplish these we use a number of tricks, implemented by mkTyConApp. ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1089,6 +1089,47 @@ of arity n: If we couldn't decompose in the previous step, we return SurelyApart. Afterwards, the rest of the code doesn't have to worry about type families. + +Note [Unifying type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the task of unifying two 'Type's of the form + + TyConApp tc [] ~ TyConApp tc [] + +where `tc` is a type synonym. A naive way to perform this comparison these +would first expand the synonym and then compare the resulting expansions. + +However, this is obviously wasteful and the RHS of `tc` may be large; it is +much better to rather compare the TyCons directly. Consequently, before +expanding type synonyms in type comparisons we first look for a nullary +TyConApp and simply compare the TyCons if we find one. + +Of course, if we find that the TyCons are *not* equal then we still need to +perform the expansion as their RHSs may still be unifiable. E.g + type T = S (a->a) + type S a = [a] +and consider + T Int ~ S (Int -> Int) + +We can't decompose non-nullary synonyms. E.g. + type R a = F a -- Where F is a type family +and consider + R (a->a) ~ R Int +We can't conclude that (a->) ~ Int. (There is a currently-missed opportunity +here; if we knew that R was /injective/, perhaps we could decompose.) + +We perform the nullary-type-synonym optimisation in a number of places: + + * GHC.Core.Unify.unify_ty + * GHC.Tc.Solver.Equality.can_eq_nc' + * GHC.Tc.Utils.Unify.uType + +This optimisation is especially helpful for the ubiquitous GHC.Types.Type, +since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications +whenever possible. See Note [Using synonyms to compress types] in +GHC.Core.Type for details. + +c.f. Note [Comparing type synonyms] in GHC.Core.TyCo.Compare -} -------------- unify_ty: the main workhorse ----------- @@ -1107,7 +1148,7 @@ unify_ty :: UMEnv -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare + -- See Note [Unifying type synonyms] | tc1 == tc2 = return () ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,7 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare +-- See Note [Unifying type synonyms] in GHC.Core.Unify can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2187,11 +2187,12 @@ uType env@(UE { u_role = role }) orig_ty1 orig_ty2 ; uType env orig_ty1 ty2 } Nothing -> uUnfilledVar env IsSwapped tv2 ty1 } - -- See Note [Expanding synonyms during unification] + -- See Note [Unifying type synonyms] in GHC.Core.Unify go ty1@(TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = return $ mkReflCo role ty1 + -- Now expand synonyms -- See Note [Expanding synonyms during unification] -- -- Also NB that we recurse to 'go' so that we don't push a @@ -2349,7 +2350,7 @@ We expand synonyms during unification, but: * The problem case immediately above can happen only with arguments to the tycon. So we check for nullary tycons *before* expanding. This is particularly helpful when checking (* ~ *), because * is - now a type synonym. + now a type synonym. See Note [Unifying type synonyms] in GHC.Core.Unify. Note [Deferred unification] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== testsuite/tests/deSugar/should_compile/T25094.hs ===================================== @@ -0,0 +1,99 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket + ===================================== testsuite/tests/deSugar/should_compile/all.T ===================================== @@ -115,3 +115,4 @@ test('T19883', normal, compile, ['']) test('T22719', normal, compile, ['-ddump-simpl -dsuppress-uniques -dno-typeable-binds']) test('T23550', normal, compile, ['']) test('T24489', normal, compile, ['-O']) +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c5b9cddf4ab3e85526e7d6a963fc049b1e14dc1...59381637958771f74e5139a67e7b6c869fc7fcd8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c5b9cddf4ab3e85526e7d6a963fc049b1e14dc1...59381637958771f74e5139a67e7b6c869fc7fcd8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 15:10:51 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Fri, 19 Jul 2024 11:10:51 -0400 Subject: [Git][ghc/ghc][wip/revert-type-faster] Add test for T25094 Message-ID: <669a81fbc59e9_1495f1103b49c113660@gitlab.mail> Matthew Pickering pushed to branch wip/revert-type-faster at Glasgow Haskell Compiler / GHC Commits: 557235ae by Matthew Pickering at 2024-07-19T16:10:39+01:00 Add test for T25094 This test is minimised from hashtables library, before the revert it fails with: ``` T25094.hs:84:18: warning: Type of case alternatives not the same as the annotation on case: Actual type: ST s_a12L (Bucket s_a12L Any Any) Annotation on case: ST s_a12L (Bucket s_a12L k_a12M v_a12N) ``` See #25094 - - - - - 2 changed files: - + testsuite/tests/deSugar/should_compile/T25094.hs - testsuite/tests/deSugar/should_compile/all.T Changes: ===================================== testsuite/tests/deSugar/should_compile/T25094.hs ===================================== @@ -0,0 +1,99 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket + ===================================== testsuite/tests/deSugar/should_compile/all.T ===================================== @@ -115,3 +115,4 @@ test('T19883', normal, compile, ['']) test('T22719', normal, compile, ['-ddump-simpl -dsuppress-uniques -dno-typeable-binds']) test('T23550', normal, compile, ['']) test('T24489', normal, compile, ['-O']) +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/557235aebd004bc728009415e3833dba00270f75 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/557235aebd004bc728009415e3833dba00270f75 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 19 15:53:32 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Fri, 19 Jul 2024 11:53:32 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/andreask/revert-rel-ghc-path Message-ID: <669a8bfcc95d_1495f113ef86811988a@gitlab.mail> Andreas Klebinger pushed new branch wip/andreask/revert-rel-ghc-path at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/andreask/revert-rel-ghc-path You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 07:24:02 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 20 Jul 2024 03:24:02 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <669b6612a5b21_cc74be98f4061075@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 7c5b9cdd by Matthew Pickering at 2024-07-19T15:39:14+01:00 Revert "Make type-equality on synonyms a bit faster" This reverts commit 280e4bf5ca62ec51eaeedd04b0db78b085257ab8. This patch causes core lint errors, hasty revert as it is purely a performance commit. Ticket #25094 - - - - - 557235ae by Matthew Pickering at 2024-07-19T16:10:39+01:00 Add test for T25094 This test is minimised from hashtables library, before the revert it fails with: ``` T25094.hs:84:18: warning: Type of case alternatives not the same as the annotation on case: Actual type: ST s_a12L (Bucket s_a12L Any Any) Annotation on case: ST s_a12L (Bucket s_a12L k_a12M v_a12N) ``` See #25094 - - - - - 1fda29d1 by Andreas Klebinger at 2024-07-20T03:23:47-04:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 14 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - configure.ac - testsuite/driver/testlib.py - + testsuite/tests/deSugar/should_compile/T25094.hs - testsuite/tests/deSugar/should_compile/all.T Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -205,7 +205,6 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) deb12_i386 = mk(debian(12, "i386")) @@ -243,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 }} + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -251,8 +250,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } ===================================== compiler/GHC/Core/Map/Type.hs ===================================== @@ -38,7 +38,6 @@ import GHC.Prelude import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.TyCo.Rep -import GHC.Core.TyCon( isForgetfulSynTyCon ) import GHC.Core.TyCo.Compare( eqForAllVis ) import GHC.Data.TrieMap @@ -229,11 +228,10 @@ eqDeBruijnType env_t1@(D env1 t1) env_t2@(D env2 t2) = andEq TEQX e = hasCast e andEq TEQ e = e - -- See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare - go (D env1 (TyConApp tc1 tys1)) (D env2 (TyConApp tc2 tys2)) - | tc1 == tc2, not (isForgetfulSynTyCon tc1) - = gos env1 env2 tys1 tys2 - + -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare + go (D _ (TyConApp tc1 [])) (D _ (TyConApp tc2 [])) + | tc1 == tc2 + = TEQ go env_t@(D env t) env_t'@(D env' t') | Just new_t <- coreView t = go (D env new_t) env_t' | Just new_t' <- coreView t' = go env_t (D env' new_t') ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -138,52 +138,35 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing nullary type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form - TyConApp tc tys1 = TyConApp tc tys2 + TyConApp tc [] -where `tc` is a type synonym. A naive way to perform this comparison these +where @tc@ is a type synonym. A naive way to perform this comparison these would first expand the synonym and then compare the resulting expansions. -However, this is obviously wasteful and the RHS of `tc` may be large. We'd -prefer to compare `tys1 = tys2`. When is that sound? Precisely when the -synonym is not /forgetful/; that is, all its type variables appear in its -RHS -- see `GHC.Core.TyCon.isForgetfulSynTyCon`. - -Of course, if we find that the TyCons are *not* equal then we still need to -perform the expansion as their RHSs may still be equal. - -This works fine for /equality/, but not for /comparison/. Consider - type S a b = (b, a) -Now consider - S Int Bool `compare` S Char Char -The ordering may depend on whether we expand the synonym or not, and we -don't want the result to depend on that. So for comparison we stick to -/nullary/ synonyms only, which is still useful. +However, this is obviously wasteful and the RHS of @tc@ may be large; it is +much better to rather compare the TyCons directly. Consequently, before +expanding type synonyms in type comparisons we first look for a nullary +TyConApp and simply compare the TyCons if we find one. Of course, if we find +that the TyCons are *not* equal then we still need to perform the expansion as +their RHSs may still be equal. We perform this optimisation in a number of places: - * GHC.Core.TyCo.Compare.eqType (works for non-nullary synonyms) - * GHC.Core.Map.TYpe.eqDeBruijnType (works for non-nullary synonyms) - * GHC.Core.Types.nonDetCmpType (nullary only) + * GHC.Core.Types.eqType + * GHC.Core.Types.nonDetCmpType + * GHC.Core.Unify.unify_ty + * GHC.Tc.Solver.Equality.can_eq_nc' + * TcUnify.uType This optimisation is especially helpful for the ubiquitous GHC.Types.Type, since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. -Currently-missed opportunity (#25009): -* In the case of forgetful synonyms, we could still compare the args, pairwise, - and then compare the RHS's with a suitably extended RnEnv2. That would avoid - comparing the same arg repeatedly. e.g. - type S a b = (a,a) - Compare S y ~ S y - If we expand, we end up compare with itself twice. - - But since forgetful synonyms are rare, we have not tried this. - Note [Type comparisons using object pointer comparisons] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Quite often we substitute the type from a definition site into @@ -358,26 +341,16 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env = \ t1 t2 -> t1 `seq` t2 `seq` let go = generic_eq_type_x syn_flag mult_flag mb_env -- Abbreviation for recursive calls - - gos [] [] = True - gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 - gos _ _ = False - in case (t1,t2) of _ | 1# <- reallyUnsafePtrEquality# t1 t2 -> True -- See Note [Type comparisons using object pointer comparisons] - (TyConApp tc1 tys1, TyConApp tc2 tys2) - | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] - -> gos tys1 tys2 + (TyConApp tc1 [], TyConApp tc2 []) | tc1 == tc2 -> True + -- See Note [Comparing nullary type synonyms] _ | ExpandSynonyms <- syn_flag, Just t1' <- coreView t1 -> go t1' t2 | ExpandSynonyms <- syn_flag, Just t2' <- coreView t2 -> go t1 t2' - (TyConApp tc1 ts1, TyConApp tc2 ts2) - | tc1 == tc2 -> gos ts1 ts2 - | otherwise -> False - (TyVarTy tv1, TyVarTy tv2) -> case mb_env of Nothing -> tv1 == tv2 @@ -408,6 +381,14 @@ inline_generic_eq_type_x syn_flag mult_flag mb_env | Just (s1, t1') <- tcSplitAppTyNoView_maybe t1 -> go s1 s2 && go t1' t2' + (TyConApp tc1 ts1, TyConApp tc2 ts2) + | tc1 == tc2 -> gos ts1 ts2 + | otherwise -> False + where + gos [] [] = True + gos (t1:ts1) (t2:ts2) = go t1 t2 && gos ts1 ts2 + gos _ _ = False + (ForAllTy (Bndr tv1 vis1) body1, ForAllTy (Bndr tv2 vis2) body2) -> case mb_env of Nothing -> generic_eq_type_x syn_flag mult_flag @@ -685,11 +666,10 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - + -- See Note [Comparing nullary type synonyms] go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 - = TEQ -- See Note [Comparing type synonyms] - + = TEQ go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -778,10 +758,8 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - - go env (TyConApp tc1 ts1) (TyConApp tc2 ts2) - | tc1 == tc2, not (isForgetfulSynTyCon tc1) -- See Note [Comparing type synonyms] - = gos env (tyConBinders tc1) ts1 ts2 + -- See Note [Comparing nullary type synonyms] + go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -841,8 +841,7 @@ data TyConDetails = -- are fine), again after expanding any -- nested synonyms - synIsForgetful :: Bool, -- See Note [Forgetful type synonyms] - -- True <= at least one argument is not mentioned + synIsForgetful :: Bool, -- True <= at least one argument is not mentioned -- in the RHS (or is mentioned only under -- forgetful synonyms) -- Test is conservative, so True does not guarantee @@ -2122,43 +2121,11 @@ isFamFreeTyCon (TyCon { tyConDetails = details }) -- True. Thus, False means that all bound variables appear on the RHS; -- True may not mean anything, as the test to set this flag is -- conservative. --- --- See Note [Forgetful type synonyms] isForgetfulSynTyCon :: TyCon -> Bool isForgetfulSynTyCon (TyCon { tyConDetails = details }) | SynonymTyCon { synIsForgetful = forget } <- details = forget | otherwise = False -{- Note [Forgetful type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A type synonyms is /forgetful/ if its RHS fails to mention one (or more) of its bound variables. - -Forgetfulness is conservative: - * A non-forgetful synonym /guarantees/ to mention all its bound variables in its RHS. - * It is always safe to classify a synonym as forgetful. - -Examples: - type R = Int -- Not forgetful - type S a = Int -- Forgetful - type T1 a = Int -> S a -- Forgetful - type T2 a = a -> S a -- Not forgetful - type T3 a = Int -> F a -- Not forgetful - where type family F a - -* R shows that nullary synonyms are not forgetful. - -* T2 shows that forgetfulness needs to account for uses of forgetful - synonyms. `a` appears on the RHS, but only under a forgetful S - -* T3 shows that non-forgetfulness is not the same as injectivity. T3 mentions its - bound variable on its RHS, but under a type family. So it is entirely possible - that T3 Int ~ T3 Bool - -* Since type synonyms are non-recursive, we don't need a fixpoint analysis to - determine forgetfulness. It's rather easy -- see `GHC.Core.Type.buildSynTyCon`, - which is a bit over-conservative for over-saturated synonyms. --} - -- As for newtypes, it is in some contexts important to distinguish between -- closed synonyms and synonym families, as synonym families have no unique -- right hand side to which a synonym family application can expand. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2327,7 +2327,7 @@ buildSynTyCon name binders res_kind roles rhs is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || uniqSetAny isForgetfulSynTyCon rhs_tycons -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon rhs_tycons = tyConsOfType rhs rhs_tyvars = tyCoVarsOfType rhs @@ -3275,9 +3275,8 @@ efficient. Specifically, we strive to Goal (b) is particularly useful as it makes traversals (e.g. free variable traversal, substitution, and comparison) more efficient. Comparison in particular takes special advantage of nullary type synonym -applications (e.g. things like @TyConApp typeTyCon []@). See -* Note [Comparing type synonyms] in "GHC.Core.TyCo.Compare" -* Note [Unifying type synonyms] in "GHC.Core.Unify" +applications (e.g. things like @TyConApp typeTyCon []@), Note [Comparing +nullary type synonyms] in "GHC.Core.Type". To accomplish these we use a number of tricks, implemented by mkTyConApp. ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1089,47 +1089,6 @@ of arity n: If we couldn't decompose in the previous step, we return SurelyApart. Afterwards, the rest of the code doesn't have to worry about type families. - -Note [Unifying type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider the task of unifying two 'Type's of the form - - TyConApp tc [] ~ TyConApp tc [] - -where `tc` is a type synonym. A naive way to perform this comparison these -would first expand the synonym and then compare the resulting expansions. - -However, this is obviously wasteful and the RHS of `tc` may be large; it is -much better to rather compare the TyCons directly. Consequently, before -expanding type synonyms in type comparisons we first look for a nullary -TyConApp and simply compare the TyCons if we find one. - -Of course, if we find that the TyCons are *not* equal then we still need to -perform the expansion as their RHSs may still be unifiable. E.g - type T = S (a->a) - type S a = [a] -and consider - T Int ~ S (Int -> Int) - -We can't decompose non-nullary synonyms. E.g. - type R a = F a -- Where F is a type family -and consider - R (a->a) ~ R Int -We can't conclude that (a->) ~ Int. (There is a currently-missed opportunity -here; if we knew that R was /injective/, perhaps we could decompose.) - -We perform the nullary-type-synonym optimisation in a number of places: - - * GHC.Core.Unify.unify_ty - * GHC.Tc.Solver.Equality.can_eq_nc' - * GHC.Tc.Utils.Unify.uType - -This optimisation is especially helpful for the ubiquitous GHC.Types.Type, -since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications -whenever possible. See Note [Using synonyms to compress types] in -GHC.Core.Type for details. - -c.f. Note [Comparing type synonyms] in GHC.Core.TyCo.Compare -} -------------- unify_ty: the main workhorse ----------- @@ -1148,7 +1107,7 @@ unify_ty :: UMEnv -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Unifying type synonyms] + -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare | tc1 == tc2 = return () ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,7 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Unifying type synonyms] in GHC.Core.Unify +-- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Tc/Utils/Unify.hs ===================================== @@ -2187,12 +2187,11 @@ uType env@(UE { u_role = role }) orig_ty1 orig_ty2 ; uType env orig_ty1 ty2 } Nothing -> uUnfilledVar env IsSwapped tv2 ty1 } - -- See Note [Unifying type synonyms] in GHC.Core.Unify + -- See Note [Expanding synonyms during unification] go ty1@(TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = return $ mkReflCo role ty1 - -- Now expand synonyms -- See Note [Expanding synonyms during unification] -- -- Also NB that we recurse to 'go' so that we don't push a @@ -2350,7 +2349,7 @@ We expand synonyms during unification, but: * The problem case immediately above can happen only with arguments to the tycon. So we check for nullary tycons *before* expanding. This is particularly helpful when checking (* ~ *), because * is - now a type synonym. See Note [Unifying type synonyms] in GHC.Core.Unify. + now a type synonym. Note [Deferred unification] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/deSugar/should_compile/T25094.hs ===================================== @@ -0,0 +1,99 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket + ===================================== testsuite/tests/deSugar/should_compile/all.T ===================================== @@ -115,3 +115,4 @@ test('T19883', normal, compile, ['']) test('T22719', normal, compile, ['-ddump-simpl -dsuppress-uniques -dno-typeable-binds']) test('T23550', normal, compile, ['']) test('T24489', normal, compile, ['-O']) +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/223e66bbf157639b7c4d1a3f73f6034dd0b2ea73...1fda29d1f29111e33d10d51caa956cf8ed6f7810 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/223e66bbf157639b7c4d1a3f73f6034dd0b2ea73...1fda29d1f29111e33d10d51caa956cf8ed6f7810 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 14:10:09 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 20 Jul 2024 10:10:09 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/supersven/aarch64-memory-barriers Message-ID: <669bc54192726_384ea560583862ba@gitlab.mail> Sven Tennie pushed new branch wip/supersven/aarch64-memory-barriers at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/supersven/aarch64-memory-barriers You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 14:47:17 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 20 Jul 2024 10:47:17 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] 5 commits: Formatting Message-ID: <669bcdf5174d1_384ea57d4b8c8695@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: c33a4b60 by Sven Tennie at 2024-07-19T16:56:41+02:00 Formatting - - - - - 4a3fa150 by Sven Tennie at 2024-07-19T17:02:22+02:00 Formatting - - - - - ec0465d5 by Sven Tennie at 2024-07-19T17:06:45+02:00 Use reg constant (less magical) - - - - - a7c3c209 by Sven Tennie at 2024-07-19T17:23:49+02:00 Checked memory barriers - - - - - 288b25fd by Sven Tennie at 2024-07-20T13:17:57+02:00 Check memory fences - - - - - 2 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs Changes: ===================================== compiler/GHC/CmmToAsm/RV64/CodeGen.hs ===================================== @@ -1374,12 +1374,12 @@ genCCall target@(ForeignTarget expr _cconv) dest_regs arg_regs = do , DELTA (-16) ] moveStackDown i | odd i = moveStackDown (i + 1) moveStackDown i = toOL [ PUSH_STACK_FRAME - , SUB (OpReg W64 (regSingle 2)) (OpReg W64 (regSingle 2)) (OpImm (ImmInt (8 * i))) + , SUB (OpReg W64 (spMachReg)) (OpReg W64 (spMachReg)) (OpImm (ImmInt (8 * i))) , DELTA (-8 * i - 16) ] moveStackUp 0 = toOL [ POP_STACK_FRAME , DELTA 0 ] moveStackUp i | odd i = moveStackUp (i + 1) - moveStackUp i = toOL [ ADD (OpReg W64 (regSingle 2)) (OpReg W64 (regSingle 2)) (OpImm (ImmInt (8 * i))) + moveStackUp i = toOL [ ADD (OpReg W64 (spMachReg)) (OpReg W64 (spMachReg)) (OpImm (ImmInt (8 * i))) , POP_STACK_FRAME , DELTA 0 ] @@ -1427,7 +1427,7 @@ genCCall target@(ForeignTarget expr _cconv) dest_regs arg_regs = do passArguments [] [] ((r, format, hint, code_r) : args) stackSpaceWords accumRegs accumCode = do let w = formatToWidth format spOffet = 8 * stackSpaceWords - str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt spOffet))) + str = STR format (OpReg w r) (OpAddr (AddrRegImm (spMachReg) (ImmInt spOffet))) stackCode = if hint == SignedHint then @@ -1443,7 +1443,7 @@ genCCall target@(ForeignTarget expr _cconv) dest_regs arg_regs = do passArguments [] fpRegs ((r, format, _hint, code_r):args) stackSpaceWords accumRegs accumCode | isIntFormat format = do let w = formatToWidth format spOffet = 8 * stackSpaceWords - str = STR format (OpReg w r) (OpAddr (AddrRegImm (regSingle 2) (ImmInt spOffet))) + str = STR format (OpReg w r) (OpAddr (AddrRegImm (spMachReg) (ImmInt spOffet))) stackCode = code_r `snocOL` ann (text "Pass argument (size " <> ppr w <> text ") on the stack: " <> ppr r) str passArguments [] fpRegs args (stackSpaceWords + 1) accumRegs (stackCode `appOL` accumCode) @@ -1587,13 +1587,11 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do MO_U_Mul2 _w -> unsupported mop -- Memory Ordering - -- The concrete encoding is copied from load_load_barrier() and write_barrier() (SMP.h) - -- TODO: This needs to be changed for https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10628 -- The related C functions are: + -- #include -- atomic_thread_fence(memory_order_acquire); -- atomic_thread_fence(memory_order_release); --- MO_ReadBarrier -> return (unitOL (DMBSY DmbRead DmbRead), Nothing) --- MO_WriteBarrier -> return (unitOL (DMBSY DmbWrite DmbWrite), Nothing) + -- atomic_thread_fence(memory_order_seq_cst); MO_AcquireFence -> pure (unitOL (DMBSY DmbRead DmbReadWrite)) MO_ReleaseFence -> pure (unitOL (DMBSY DmbReadWrite DmbWrite)) MO_SeqCstFence -> pure (unitOL (DMBSY DmbReadWrite DmbReadWrite)) @@ -1631,8 +1629,11 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do , [dst_reg] <- dest_regs -> do (p, _fmt_p, code_p) <- getSomeReg p_reg platform <- getPlatform - -- TODO: Check if these fence usages are correct. - -- See __atomic_load_n (in C) + -- Analog to the related MachOps (above) + -- The related C functions are: + -- #include + -- __atomic_load_n(&a, __ATOMIC_ACQUIRE); + -- __atomic_load_n(&a, __ATOMIC_SEQ_CST); let instrs = case ord of MemOrderRelaxed -> unitOL $ ann moDescr (LDR (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p)) MemOrderAcquire -> toOL [ @@ -1654,12 +1655,17 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do | [p_reg, val_reg] <- arg_regs -> do (p, _fmt_p, code_p) <- getSomeReg p_reg (val, fmt_val, code_val) <- getSomeReg val_reg - -- See __atomic_store_n (in C) + -- Analog to the related MachOps (above) + -- The related C functions are: + -- #include + -- __atomic_store_n(&a, 23, __ATOMIC_SEQ_CST); + -- __atomic_store_n(&a, 23, __ATOMIC_RELEASE); let instrs = case ord of MemOrderRelaxed -> unitOL $ ann moDescr (STR fmt_val (OpReg w val) (OpAddr $ AddrReg p)) MemOrderSeqCst -> toOL [ ann moDescr (DMBSY DmbReadWrite DmbWrite), - STR fmt_val (OpReg w val) (OpAddr $ AddrReg p) + STR fmt_val (OpReg w val) (OpAddr $ AddrReg p), + DMBSY DmbReadWrite DmbReadWrite ] MemOrderRelease -> toOL [ ann moDescr (DMBSY DmbReadWrite DmbWrite), ===================================== compiler/GHC/CmmToAsm/RV64/Instr.hs ===================================== @@ -132,18 +132,21 @@ regUsageOfInstr platform instr = case instr of -- filtering the usage is necessary, otherwise the register -- allocator will try to allocate pre-defined fixed stg -- registers as well, as they show up. - usage (src, dst) = RU (filter (interesting platform) src) - (filter (interesting platform) dst) + usage :: ([Reg], [Reg]) -> RegUsage + usage (srcRegs, dstRegs) = RU (filter (interesting platform) srcRegs) + (filter (interesting platform) dstRegs) regAddr :: AddrMode -> [Reg] - regAddr (AddrRegImm r1 _) = [r1] + regAddr (AddrRegImm r1 _imm) = [r1] regAddr (AddrReg r1) = [r1] + regOp :: Operand -> [Reg] - regOp (OpReg _ r1) = [r1] + regOp (OpReg _w r1) = [r1] regOp (OpAddr a) = regAddr a - regOp (OpImm _) = [] + regOp (OpImm _imm) = [] + regTarget :: Target -> [Reg] - regTarget (TBlock _) = [] + regTarget (TBlock _bid) = [] regTarget (TReg r1) = [r1] -- Is this register interesting for the register allocator? @@ -228,13 +231,16 @@ patchRegsOfInstr instr env = case instr of patchOp :: Operand -> Operand patchOp (OpReg w r) = OpReg w (env r) patchOp (OpAddr a) = OpAddr (patchAddr a) - patchOp op = op + patchOp opImm = opImm + patchTarget :: Target -> Target patchTarget (TReg r) = TReg (env r) - patchTarget t = t + patchTarget tBlock = tBlock + patchAddr :: AddrMode -> AddrMode - patchAddr (AddrRegImm r1 i) = AddrRegImm (env r1) i + patchAddr (AddrRegImm r1 imm) = AddrRegImm (env r1) imm patchAddr (AddrReg r) = AddrReg (env r) + patchReg :: Reg -> Reg patchReg = env View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d691cd4f53f51c62c10adcbaf81af5d54a92c9da...288b25fd25bdbf30c1cadbb688768711f7e07b9c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d691cd4f53f51c62c10adcbaf81af5d54a92c9da...288b25fd25bdbf30c1cadbb688768711f7e07b9c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 15:43:55 2024 From: gitlab at gitlab.haskell.org (Matthew Craven (@clyring)) Date: Sat, 20 Jul 2024 11:43:55 -0400 Subject: [Git][ghc/ghc][wip/T23490-part2] 91 commits: GHCi interpreter: Tag constructor closures when possible. Message-ID: <669bdb3b37cc_384ea5af5ba4136e5@gitlab.mail> Matthew Craven pushed to branch wip/T23490-part2 at Glasgow Haskell Compiler / GHC Commits: 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 5f61e78e by Matthew Craven at 2024-07-20T11:42:36-04:00 Add missing images to transformers submodule - - - - - 99e095aa by Matthew Craven at 2024-07-20T11:42:36-04:00 Remove reference to non-existent file in haddock.cabal - - - - - c02dff2d by Matthew Craven at 2024-07-20T11:42:37-04:00 Update hackage index state - - - - - 4d0cda0e by Matthew Craven at 2024-07-20T11:42:37-04:00 Repair the 'build-cabal' hadrian target Fixes #23117, fixes #23281, fixes #23490 - - - - - e799f25e by Matthew Craven at 2024-07-20T11:42:37-04:00 Revert "CI: Disable the test-cabal-reinstall job" This reverts commit 38c3afb64d3ffc42f12163c6f0f0d5c414aa8255. - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - cabal.project-reinstall - compiler/GHC.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/54f37a5454a0307b4a3f2c7575e5be7884e9354f...e799f25e7dcb43948c60dede8ac9ba4b3ab5ab98 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/54f37a5454a0307b4a3f2c7575e5be7884e9354f...e799f25e7dcb43948c60dede8ac9ba4b3ab5ab98 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 17:56:16 2024 From: gitlab at gitlab.haskell.org (Matthew Craven (@clyring)) Date: Sat, 20 Jul 2024 13:56:16 -0400 Subject: [Git][ghc/ghc][wip/T23490-part2] 2 commits: Repair the 'build-cabal' hadrian target Message-ID: <669bfa40672fe_384ea5102fd901850@gitlab.mail> Matthew Craven pushed to branch wip/T23490-part2 at Glasgow Haskell Compiler / GHC Commits: 1cceba60 by Matthew Craven at 2024-07-20T13:54:53-04:00 Repair the 'build-cabal' hadrian target Fixes #23117, fixes #23281, fixes #23490 - - - - - 4e1d5ab9 by Matthew Craven at 2024-07-20T13:55:34-04:00 Revert "CI: Disable the test-cabal-reinstall job" This reverts commit 38c3afb64d3ffc42f12163c6f0f0d5c414aa8255. - - - - - 4 changed files: - .gitlab-ci.yml - cabal.project-reinstall - compiler/Setup.hs - compiler/ghc.cabal.in Changes: ===================================== .gitlab-ci.yml ===================================== @@ -489,21 +489,16 @@ stack-hadrian-build: # Testing reinstallable ghc codepath #################################### -# As documented on the original ticket #19896, this feature already has a long -# way to go before it can actually be used. Meanwhile, parts of it have -# bit-rotted, possibly related to some Cabal change. The job is disabled for -# now. -# -# test-cabal-reinstall-x86_64-linux-deb10: -# extends: nightly-x86_64-linux-deb10-validate -# stage: full-build -# variables: -# REINSTALL_GHC: "yes" -# BUILD_FLAVOUR: validate -# TEST_ENV: "x86_64-linux-deb10-cabal-install" -# rules: -# - if: $NIGHTLY -# - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-reinstall.*/' +test-cabal-reinstall-x86_64-linux-deb10: + extends: nightly-x86_64-linux-deb10-validate + stage: full-build + variables: + REINSTALL_GHC: "yes" + BUILD_FLAVOUR: validate + TEST_ENV: "x86_64-linux-deb10-cabal-install" + rules: + - if: $NIGHTLY + - if: '$CI_MERGE_REQUEST_LABELS =~ /.*test-reinstall.*/' ######################################## # Testing ABI is invariant across builds ===================================== cabal.project-reinstall ===================================== @@ -17,6 +17,7 @@ packages: ./compiler ./libraries/ghc-boot/ -- ./libraries/ghc-boot-th/ ./libraries/ghc-compact + ./libraries/ghc-experimental ./libraries/ghc-heap ./libraries/ghci -- ./libraries/ghc-prim @@ -25,6 +26,7 @@ packages: ./compiler ./libraries/hpc -- ./libraries/integer-gmp ./libraries/mtl/ + ./libraries/os-string/ ./libraries/parsec/ -- ./libraries/pretty/ ./libraries/process/ @@ -39,6 +41,8 @@ packages: ./compiler ./libraries/Win32/ ./libraries/xhtml/ ./utils/ghc-pkg + ./utils/ghc-toolchain + ./utils/ghc-toolchain/exe ./utils/haddock ./utils/hp2ps ./utils/hpc @@ -61,15 +65,10 @@ constraints: ghc +internal-interpreter +dynamic-system-linke, any.pretty installed, any.template-haskell installed -allow-newer: - ghc-paths:Cabal, - *:base, - *:ghc-prim, - tree-diff:time benchmarks: False tests: False -allow-boot-library-installs: False +allow-boot-library-installs: True -- Workaround for https://github.com/haskell/cabal/issues/7297 package * ===================================== compiler/Setup.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE NamedFieldPuns #-} module Main where import Distribution.Simple @@ -52,10 +52,12 @@ primopIncls = , ("primop-vector-tys-exports.hs-incl", "--primop-vector-tys-exports") , ("primop-vector-tycons.hs-incl" , "--primop-vector-tycons") , ("primop-docs.hs-incl" , "--wired-in-docs") + , ("primop-deprecations.hs-incl" , "--wired-in-deprecations") ] ghcAutogen :: Verbosity -> LocalBuildInfo -> IO () -ghcAutogen verbosity lbi at LocalBuildInfo{..} = do +ghcAutogen verbosity lbi at LocalBuildInfo{pkgDescrFile,withPrograms,componentNameMap} + = do -- Get compiler/ root directory from the cabal file let Just compilerRoot = takeDirectory <$> pkgDescrFile @@ -77,7 +79,7 @@ ghcAutogen verbosity lbi at LocalBuildInfo{..} = do -- Call genprimopcode to generate *.hs-incl forM_ primopIncls $ \(file,command) -> do contents <- readProcess "genprimopcode" [command] primopsStr - rewriteFileEx verbosity (buildDir file) contents + rewriteFileEx verbosity (buildDir lbi file) contents -- Write GHC.Platform.Constants let platformConstantsPath = autogenPackageModulesDir lbi "GHC/Platform/Constants.hs" ===================================== compiler/ghc.cabal.in ===================================== @@ -50,7 +50,7 @@ extra-source-files: custom-setup - setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.10, directory, process, filepath, containers + setup-depends: base >= 3 && < 5, Cabal >= 1.6 && <3.14, directory, process, filepath, containers Flag internal-interpreter Description: Build with internal interpreter support. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e799f25e7dcb43948c60dede8ac9ba4b3ab5ab98...4e1d5ab9a397f05dc10dbce2469d67a4e857862f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e799f25e7dcb43948c60dede8ac9ba4b3ab5ab98...4e1d5ab9a397f05dc10dbce2469d67a4e857862f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 20 22:32:12 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sat, 20 Jul 2024 18:32:12 -0400 Subject: [Git][ghc/ghc][wip/T25055] 6 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <669c3aec4174a_15c37c5f083488050@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25055 at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 0807ffdf by Simon Peyton Jones at 2024-07-20T23:31:32+01:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 14 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== .gitlab-ci.yml ===================================== @@ -2,7 +2,7 @@ variables: GIT_SSL_NO_VERIFY: "1" # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: be59dc3d30f5acdc97af38e79d8d034b75df8939 + DOCKER_REV: 486541129a8e7bf77c2cf7cd76ca998f690d5685 # Sequential version number of all cached things. # Bump to invalidate GitLab CI cache. @@ -102,9 +102,9 @@ workflow: .bootstrap_matrix : &bootstrap_matrix matrix: - GHC_VERSION: 9.8.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_8:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_8:$DOCKER_REV" - GHC_VERSION: 9.10.1 - DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10-ghc9_10:$DOCKER_REV" + DOCKER_IMAGE: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-ghc9_10:$DOCKER_REV" # Allow linters to fail on draft MRs. # This must be explicitly transcluded in lint jobs which @@ -216,7 +216,7 @@ include: '.gitlab/jobs.yaml' ghc-linters: stage: tool-lint - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -256,7 +256,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. .lint-submods: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -274,7 +274,7 @@ typecheck-testsuite: # accommodate, e.g., haddock changes not yet upstream) but not on `master` or # Marge jobs. lint-author: - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint-params variables: BUILD_FLAVOUR: default @@ -349,7 +349,7 @@ lint-submods-branch: .lint-params: needs: [] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" extends: .lint before_script: - export PATH="/opt/toolchain/bin:$PATH" @@ -390,7 +390,7 @@ hadrian-ghc-in-ghci: - job: lint-linters - job: lint-submods optional: true - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -541,11 +541,11 @@ abi-test-nightly: doc-tarball: stage: packaging needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate optional: true - - job: release-x86_64-linux-deb10-release + - job: release-x86_64-linux-deb12-release optional: true - job: x86_64-windows-validate @@ -557,10 +557,10 @@ doc-tarball: tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: - LINUX_BINDIST: "ghc-x86_64-linux-deb10.tar.xz" + LINUX_BINDIST: "ghc-x86_64-linux-deb12.tar.xz" WINDOWS_BINDIST: "ghc-x86_64-windows.tar.xz" artifacts: expose_as: "Documentation Preview" @@ -576,9 +576,9 @@ doc-tarball: - users_guide.pdf script: - | - mv "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-validate.tar.xz" "$LINUX_BINDIST" \ - || mv "ghc-x86_64-linux-deb10-release.tar.xz" "$LINUX_BINDIST" \ + mv "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-validate.tar.xz" "$LINUX_BINDIST" \ + || mv "ghc-x86_64-linux-deb12-release.tar.xz" "$LINUX_BINDIST" \ || true mv "ghc-x86_64-windows-validate.tar.xz" "$WINDOWS_BINDIST" \ || mv "ghc-x86_64-windows-release.tar.xz" "$WINDOWS_BINDIST" \ @@ -606,7 +606,7 @@ hackage-doc-tarball: - job: source-tarball tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: null variables: # Don't clone the git repo.. @@ -634,7 +634,7 @@ source-tarball: stage: full-build tags: - x86_64-linux - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" dependencies: [] artifacts: paths: @@ -676,7 +676,7 @@ package-hadrian-bootstrap-sources: tags: - x86_64-linux needs: ["generate-hadrian-bootstrap-sources"] - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" artifacts: paths: - hadrian-bootstrap-sources-all.tar.gz @@ -720,7 +720,7 @@ test-bootstrap: variables: # Don't record performance benchmarks TEST_ENV: "" - BIN_DIST_NAME: "ghc-x86_64-deb10-linux" + BIN_DIST_NAME: "ghc-x86_64-deb12-linux" BUILD_FLAVOUR: "validate" NO_BOOT: "1" rules: @@ -769,16 +769,16 @@ test-bootstrap: hackage-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -793,10 +793,10 @@ hackage-lint: hackage-label-lint: needs: - - job: x86_64-linux-deb10-numa-slow-validate + - job: x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate optional: true artifacts: false extends: .hackage @@ -810,10 +810,10 @@ hackage-label-lint: # affects the total allocation numbers for the simplifier portion significantly. nightly-hackage-lint: needs: - - job: nightly-x86_64-linux-deb10-numa-slow-validate + - job: nightly-x86_64-linux-deb12-numa-slow-validate optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -830,7 +830,7 @@ nightly-hackage-perf: - job: nightly-x86_64-linux-fedora33-release optional: true artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate optional: true artifacts: false rules: @@ -849,7 +849,7 @@ release-hackage-lint: - job: release-x86_64-linux-fedora33-release optional: true artifacts: false - - job: release-aarch64-linux-deb10-release+no_split_sections + - job: release-aarch64-linux-deb12-release+no_split_sections optional: true artifacts: false rules: @@ -882,9 +882,9 @@ release-hackage-lint: .test-primops-validate-template: needs: - - job: x86_64-linux-deb10-validate+debug_info + - job: x86_64-linux-deb12-validate artifacts: false - - job: aarch64-linux-deb10-validate + - job: aarch64-linux-deb12-validate artifacts: false - job: aarch64-darwin-validate artifacts: false @@ -900,9 +900,9 @@ test-primops-label: test-primops-nightly: extends: .test-primops needs: - - job: nightly-x86_64-linux-deb10-validate + - job: nightly-x86_64-linux-deb12-validate artifacts: false - - job: nightly-aarch64-linux-deb10-validate + - job: nightly-aarch64-linux-deb12-validate artifacts: false - job: nightly-aarch64-darwin-validate artifacts: false @@ -1086,7 +1086,7 @@ pages: project-version: stage: packaging - image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV" + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV" tags: - x86_64-linux variables: @@ -1155,16 +1155,26 @@ ghcup-metadata-nightly: artifacts: false - job: nightly-x86_64-linux-alpine3_12-validate artifacts: false + - job: nightly-x86_64-linux-alpine3_20-validate + artifacts: false - job: nightly-x86_64-linux-deb9-validate artifacts: false - job: nightly-i386-linux-deb10-validate artifacts: false + - job: nightly-i386-linux-deb12-validate + artifacts: false - job: nightly-x86_64-linux-deb10-validate artifacts: false - job: nightly-aarch64-linux-deb10-validate artifacts: false - job: nightly-x86_64-linux-deb11-validate artifacts: false + - job: nightly-x86_64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-deb12-validate + artifacts: false + - job: nightly-aarch64-linux-alpine3_18-validate + artifacts: false - job: source-tarball artifacts: false - job: project-version ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -977,28 +977,33 @@ jobs = Map.fromList $ concatMap (flattenJobGroup) job_groups debian_x86 :: [JobGroup Job] debian_x86 = - [ disableValidate (standardBuilds Amd64 (Linux Debian10)) - , addValidateRule TestPrimops (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) - , validateBuilds Amd64 (Linux Debian10) nativeInt - , validateBuilds Amd64 (Linux Debian10) unreg - , fastCI (validateBuilds Amd64 (Linux Debian10) debug) - , -- More work is needed to address TSAN failures: #22520 - modifyNightlyJobs allowFailure - (modifyValidateJobs (allowFailure . manual) tsan_jobs) - , -- Nightly allowed to fail: #22343 - modifyNightlyJobs allowFailure - (modifyValidateJobs manual (validateBuilds Amd64 (Linux Debian10) noTntc)) - , onlyRule LLVMBackend (validateBuilds Amd64 (Linux Debian12) llvm) - , disableValidate (standardBuilds Amd64 (Linux Debian11)) - , disableValidate (standardBuilds Amd64 (Linux Debian12)) + [ -- Release configurations -- We still build Deb9 bindists for now due to Ubuntu 18 and Linux Mint 19 -- not being at EOL until April 2023 and they still need tinfo5. - , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig Amd64 (Linux Debian9) (splitSectionsBroken vanilla)) + , disableValidate (standardBuilds Amd64 (Linux Debian10)) + , disableValidate (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf) + , disableValidate (standardBuilds Amd64 (Linux Debian11)) + , disableValidate (standardBuilds Amd64 (Linux Debian12)) - , onlyRule NonmovingGc (validateBuilds Amd64 (Linux Debian11) vanilla {validateNonmovingGc = True}) - , onlyRule IpeData (validateBuilds Amd64 (Linux Debian10) zstdIpe) + + -- Validate only builds + , fastCI (validateBuilds Amd64 (Linux validate_debian) debug) + , validateBuilds Amd64 (Linux validate_debian) nativeInt + , validateBuilds Amd64 (Linux validate_debian) unreg + -- More work is needed to address TSAN failures: #22520 + , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) + , -- Nightly allowed to fail: #22343 + modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + + , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) + , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) + + , onlyRule NonmovingGc (validateBuilds Amd64 (Linux validate_debian) vanilla {validateNonmovingGc = True}) + , onlyRule IpeData (validateBuilds Amd64 (Linux validate_debian) zstdIpe) ] where + validate_debian = Debian12 tsan_jobs = modifyJobs @@ -1006,19 +1011,22 @@ debian_x86 = -- Haddock is large enough to make TSAN choke without massive quantities of -- memory. . addVariable "HADRIAN_ARGS" "--docs=none") $ - validateBuilds Amd64 (Linux Debian12) tsan + validateBuilds Amd64 (Linux validate_debian) tsan debian_aarch64 :: [JobGroup Job] debian_aarch64 = [ - fastCI (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) - , disableValidate (standardBuildsWithConfig AArch64 (Linux Debian11) (splitSectionsBroken vanilla)) + disableValidate (standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)) + , fastCI (standardBuildsWithConfig AArch64 (Linux Debian12) (splitSectionsBroken vanilla)) + -- LLVM backend bootstrap , onlyRule LLVMBackend (validateBuilds AArch64 (Linux Debian12) llvm) ] debian_i386 :: [JobGroup Job] debian_i386 = - [ standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla) ] + [ disableValidate (standardBuildsWithConfig I386 (Linux Debian10) (splitSectionsBroken vanilla)) + , standardBuildsWithConfig I386 (Linux Debian12) (splitSectionsBroken vanilla) + ] ubuntu_x86 :: [JobGroup Job] ubuntu_x86 = @@ -1151,12 +1159,14 @@ platform_mapping = Map.map go combined_result , "x86_64-linux-fedora33-release" , "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" , "x86_64-windows-validate" + , "aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "nightly-x86_64-linux-deb11-validate" , "nightly-x86_64-linux-deb12-validate" , "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf" , "x86_64-linux-deb12-validate+thread_sanitizer_cmm" , "nightly-aarch64-linux-deb10-validate" + , "nightly-aarch64-linux-deb12-validate" , "nightly-x86_64-linux-alpine3_12-validate" , "nightly-x86_64-linux-deb10-validate" , "nightly-x86_64-linux-fedora33-release" ===================================== .gitlab/jobs.yaml ===================================== @@ -66,7 +66,7 @@ "TEST_ENV": "aarch64-darwin-validate" } }, - "aarch64-linux-deb10-validate": { + "aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -77,7 +77,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-aarch64-linux-deb10-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -87,14 +87,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb10-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -120,12 +120,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb10-validate" + "TEST_ENV": "aarch64-linux-deb12-validate" } }, "aarch64-linux-deb12-validate+llvm": { @@ -190,7 +190,7 @@ "TEST_ENV": "aarch64-linux-deb12-validate+llvm" } }, - "i386-linux-deb10-validate": { + "i386-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -201,7 +201,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-i386-linux-deb10-validate.tar.xz", + "ghc-i386-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -211,14 +211,14 @@ "when": "always" }, "cache": { - "key": "i386-linux-deb10-$CACHE_REV", + "key": "i386-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -244,12 +244,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-i386-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "i386-linux-deb10-validate" + "TEST_ENV": "i386-linux-deb12-validate" } }, "nightly-aarch64-darwin-validate": { @@ -446,7 +446,7 @@ "XZ_OPT": "-9" } }, - "nightly-aarch64-linux-deb11-validate": { + "nightly-aarch64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -457,7 +457,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-aarch64-linux-deb11-validate.tar.xz", + "ghc-aarch64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -467,14 +467,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -500,12 +500,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-validate", + "TEST_ENV": "aarch64-linux-deb12-validate", "XZ_OPT": "-9" } }, @@ -635,6 +635,69 @@ "XZ_OPT": "-9" } }, + "nightly-i386-linux-deb12-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-i386-linux-deb12-validate.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-darwin-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -1218,7 +1281,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-int_native-validate": { + "nightly-x86_64-linux-deb10-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1229,7 +1292,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1271,28 +1334,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate", + "TEST_ENV": "x86_64-linux-deb10-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-no_tntc-validate": { + "nightly-x86_64-linux-deb10-validate+debug_info": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1335,16 +1398,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", + "BUILD_FLAVOUR": "validate+debug_info", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate", + "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-numa-slow-validate": { + "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1355,7 +1418,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1365,14 +1428,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1398,17 +1461,18 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate", + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-unreg-validate": { + "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1419,7 +1483,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1429,14 +1493,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1461,17 +1525,20 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate", + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate": { + "nightly-x86_64-linux-deb11-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1482,7 +1549,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate.tar.xz", + "ghc-x86_64-linux-deb11-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1492,14 +1559,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1525,16 +1592,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate", + "TEST_ENV": "x86_64-linux-deb11-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-validate+debug_info": { + "nightly-x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1545,7 +1612,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1555,14 +1622,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1587,28 +1654,28 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info", + "TEST_ENV": "x86_64-linux-deb12-int_native-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb10-zstd-validate": { + "nightly-x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1618,14 +1685,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1651,16 +1718,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate", + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "nightly-x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1671,7 +1738,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1681,14 +1748,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1714,18 +1781,17 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1736,7 +1802,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1746,14 +1812,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1778,20 +1844,17 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", + "TEST_ENV": "x86_64-linux-deb12-unreg-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate": { + "nightly-x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1802,7 +1865,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1812,14 +1875,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1845,16 +1908,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-validate", + "TEST_ENV": "x86_64-linux-deb12-validate", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "nightly-x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1865,7 +1928,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1875,14 +1938,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -1908,16 +1971,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate": { + "nightly-x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -1928,7 +1991,7 @@ "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -1971,27 +2034,27 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", - "BUILD_FLAVOUR": "validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+llvm": { + "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2034,27 +2097,29 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm", + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "nightly-x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "8 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2097,14 +2162,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions", + "TEST_ENV": "x86_64-linux-deb12-zstd-validate", "XZ_OPT": "-9" } }, @@ -2944,7 +3007,7 @@ "XZ_OPT": "-9" } }, - "release-aarch64-linux-deb11-release+no_split_sections": { + "release-aarch64-linux-deb12-release+no_split_sections": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -2955,7 +3018,7 @@ "artifacts": { "expire_in": "1 year", "paths": [ - "ghc-aarch64-linux-deb11-release+no_split_sections.tar.xz", + "ghc-aarch64-linux-deb12-release+no_split_sections.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -2965,14 +3028,14 @@ "when": "always" }, "cache": { - "key": "aarch64-linux-deb11-$CACHE_REV", + "key": "aarch64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -2998,14 +3061,14 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-aarch64-linux-deb11-release+no_split_sections", + "BIN_DIST_NAME": "ghc-aarch64-linux-deb12-release+no_split_sections", "BUILD_FLAVOUR": "release+no_split_sections", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "HADRIAN_ARGS": "--hash-unit-ids", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "aarch64-linux-deb11-release+no_split_sections", + "TEST_ENV": "aarch64-linux-deb12-release+no_split_sections", "XZ_OPT": "-9" } }, @@ -3074,6 +3137,71 @@ "XZ_OPT": "-9" } }, + "release-i386-linux-deb12-release+no_split_sections": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-i386-linux-deb12-release+no_split_sections.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "i386-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-i386-linux-deb12-release+no_split_sections", + "BUILD_FLAVOUR": "release+no_split_sections", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "i386-linux-deb12-release+no_split_sections", + "XZ_OPT": "-9" + } + }, "release-x86_64-darwin-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4712,7 +4840,7 @@ "TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf" } }, - "x86_64-linux-deb10-int_native-validate": { + "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4723,7 +4851,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-int_native-validate.tar.xz", + "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4733,14 +4861,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4765,16 +4893,18 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-int_native-validate", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", + "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-int_native-validate" + "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, - "x86_64-linux-deb10-no_tntc-validate": { + "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4785,7 +4915,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-no_tntc-validate.tar.xz", + "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4795,14 +4925,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4811,9 +4941,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -4828,16 +4957,19 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-no_tntc-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-no_tntc-validate" + "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, - "x86_64-linux-deb10-numa-slow-validate": { + "x86_64-linux-deb12-int_native-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4848,7 +4980,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-numa-slow-validate.tar.xz", + "ghc-x86_64-linux-deb12-int_native-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4858,14 +4990,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4874,7 +5006,7 @@ ], "rules": [ { - "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -4890,17 +5022,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-numa-slow-validate", - "BUILD_FLAVOUR": "slow-validate", + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-int_native-validate", + "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-numa-slow-validate" + "TEST_ENV": "x86_64-linux-deb12-int_native-validate" } }, - "x86_64-linux-deb10-unreg-validate": { + "x86_64-linux-deb12-no_tntc-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4911,7 +5042,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-unreg-validate.tar.xz", + "ghc-x86_64-linux-deb12-no_tntc-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4921,14 +5052,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4937,8 +5068,9 @@ ], "rules": [ { + "allow_failure": true, "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "when": "manual" } ], "script": [ @@ -4954,15 +5086,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-unreg-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-no_tntc-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--disable-tables-next-to-code --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-unreg-validate" + "TEST_ENV": "x86_64-linux-deb12-no_tntc-validate" } }, - "x86_64-linux-deb10-validate+debug_info": { + "x86_64-linux-deb12-numa-slow-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -4973,7 +5105,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-validate+debug_info.tar.xz", + "ghc-x86_64-linux-deb12-numa-slow-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -4983,14 +5115,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -4999,7 +5131,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5016,15 +5148,16 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-validate+debug_info", - "BUILD_FLAVOUR": "validate+debug_info", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-numa-slow-validate", + "BUILD_FLAVOUR": "slow-validate", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "ENABLE_NUMA": "1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-validate+debug_info" + "TEST_ENV": "x86_64-linux-deb12-numa-slow-validate" } }, - "x86_64-linux-deb10-zstd-validate": { + "x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5035,7 +5168,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb10-zstd-validate.tar.xz", + "ghc-x86_64-linux-deb12-unreg-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5045,14 +5178,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb10-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb10:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5061,7 +5194,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5078,15 +5211,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb10-zstd-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-unreg-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", + "CONFIGURE_ARGS": "--enable-unregisterised --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb10-zstd-validate" + "TEST_ENV": "x86_64-linux-deb12-unreg-validate" } }, - "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate": { + "x86_64-linux-deb12-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5097,7 +5230,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5107,14 +5240,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5123,7 +5256,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*test-primops.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5140,17 +5273,15 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate", "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu", - "CROSS_TARGET": "aarch64-linux-gnu", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" + "TEST_ENV": "x86_64-linux-deb12-validate" } }, - "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate": { + "x86_64-linux-deb12-validate+boot_nonmoving_gc": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5161,7 +5292,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate.tar.xz", + "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5171,14 +5302,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-emsdk-closure-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11-emsdk-closure:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5187,7 +5318,7 @@ ], "rules": [ { - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*javascript.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5203,19 +5334,16 @@ "x86_64-linux" ], "variables": { - "BIGNUM_BACKEND": "native", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", - "BUILD_FLAVOUR": "validate", - "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", - "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", - "CROSS_TARGET": "javascript-unknown-ghcjs", + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+boot_nonmoving_gc", + "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" + "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", + "TEST_ENV": "x86_64-linux-deb12-validate+boot_nonmoving_gc" } }, - "x86_64-linux-deb11-validate+boot_nonmoving_gc": { + "x86_64-linux-deb12-validate+llvm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5226,7 +5354,7 @@ "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc.tar.xz", + "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5236,14 +5364,14 @@ "when": "always" }, "cache": { - "key": "x86_64-linux-deb11-$CACHE_REV", + "key": "x86_64-linux-deb12-$CACHE_REV", "paths": [ "cabal-cache", "toolchain" ] }, "dependencies": [], - "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", "needs": [ { "artifacts": false, @@ -5252,7 +5380,7 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*non-moving GC.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -5269,26 +5397,26 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-validate+boot_nonmoving_gc", - "BUILD_FLAVOUR": "validate+boot_nonmoving_gc", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", + "BUILD_FLAVOUR": "validate+llvm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity", - "TEST_ENV": "x86_64-linux-deb11-validate+boot_nonmoving_gc" + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb12-validate+llvm" } }, - "x86_64-linux-deb12-validate+llvm": { + "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": false, + "allow_failure": true, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+llvm.tar.xz", + "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5314,8 +5442,9 @@ ], "rules": [ { - "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*LLVM backend.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "on_success" + "allow_failure": true, + "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "manual" } ], "script": [ @@ -5331,26 +5460,28 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+llvm", - "BUILD_FLAVOUR": "validate+llvm", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--docs=none", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+llvm" + "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", + "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" } }, - "x86_64-linux-deb12-validate+thread_sanitizer_cmm": { + "x86_64-linux-deb12-zstd-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", ".gitlab/ci.sh clean", "cat ci_timings" ], - "allow_failure": true, + "allow_failure": false, "artifacts": { "expire_in": "2 weeks", "paths": [ - "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm.tar.xz", + "ghc-x86_64-linux-deb12-zstd-validate.tar.xz", "junit.xml", "unexpected-test-output.tar.gz" ], @@ -5376,9 +5507,8 @@ ], "rules": [ { - "allow_failure": true, - "if": "((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", - "when": "manual" + "if": "(($CI_MERGE_REQUEST_LABELS =~ /.*IPE.*/)) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" } ], "script": [ @@ -5394,14 +5524,12 @@ ], "variables": { "BIGNUM_BACKEND": "gmp", - "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "BUILD_FLAVOUR": "validate+thread_sanitizer_cmm", - "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--docs=none", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-zstd-validate", + "BUILD_FLAVOUR": "validate", + "CONFIGURE_ARGS": "--enable-ipe-data-compression --enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", - "TEST_ENV": "x86_64-linux-deb12-validate+thread_sanitizer_cmm", - "TSAN_OPTIONS": "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" + "TEST_ENV": "x86_64-linux-deb12-zstd-validate" } }, "x86_64-linux-fedora33-release": { ===================================== .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py ===================================== @@ -21,12 +21,12 @@ def job_triple(job_name): 'release-x86_64-linux-rocky8-release': 'x86_64-rocky8-linux', 'release-x86_64-linux-ubuntu20_04-release': 'x86_64-ubuntu20_04-linux', 'release-x86_64-linux-ubuntu18_04-release': 'x86_64-ubuntu18_04-linux', + 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora33-release+debug_info': 'x86_64-fedora33-linux-dwarf', 'release-x86_64-linux-fedora33-release': 'x86_64-fedora33-linux', - 'release-x86_64-linux-fedora38-release': 'x86_64-fedora38-linux', 'release-x86_64-linux-fedora27-release': 'x86_64-fedora27-linux', - 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb12-release': 'x86_64-deb12-linux', + 'release-x86_64-linux-deb11-release': 'x86_64-deb11-linux', 'release-x86_64-linux-deb10-release+debug_info': 'x86_64-deb10-linux-dwarf', 'release-x86_64-linux-deb10-release': 'x86_64-deb10-linux', 'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux', @@ -36,11 +36,13 @@ def job_triple(job_name): 'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native', 'release-x86_64-linux-alpine3_20-release': 'x86_64-alpine3_20-linux', 'release-x86_64-darwin-release': 'x86_64-apple-darwin', - 'release-i386-linux-deb9-release': 'i386-deb9-linux', + 'release-i386-linux-deb12-release': 'i386-deb12-linux', 'release-i386-linux-deb10-release': 'i386-deb10-linux', + 'release-i386-linux-deb9-release': 'i386-deb9-linux', 'release-armv7-linux-deb10-release': 'armv7-deb10-linux', 'release-aarch64-linux-deb10-release': 'aarch64-deb10-linux', 'release-aarch64-linux-deb11-release': 'aarch64-deb11-linux', + 'release-aarch64-linux-deb12-release': 'aarch64-deb12-linux', 'release-aarch64-linux-alpine3_18-release+no_split_sections': 'aarch64-alpine3_18-linux', 'release-aarch64-darwin-release': 'aarch64-apple-darwin', ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -94,19 +94,19 @@ windowsArtifact = PlatformSpec ( 'x86_64-windows' , 'ghc-{version}-x86_64-unknown-mingw32' ) def centos(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-centos{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-centos{n}".format(n=n,arch=arch)) def fedora(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-fedora{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-fedora{n}".format(n=n,arch=arch)) def alpine(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-alpine{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-alpine{n}".format(n=n,arch=arch)) def rocky(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-rocky{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-rocky{n}".format(n=n,arch=arch)) def ubuntu(n, arch='x86_64'): - return linux_platform(arch, "x86_64-linux-ubuntu{n}".format(n=n)) + return linux_platform(arch, "{arch}-linux-ubuntu{n}".format(n=n,arch=arch)) def linux_platform(arch, opsys): return PlatformSpec( opsys, 'ghc-{version}-{arch}-unknown-linux'.format(version="{version}", arch=arch) ) @@ -205,8 +205,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): deb11 = mk(debian(11, "x86_64")) deb12 = mk(debian(12, "x86_64")) deb10_arm64 = mk(debian(10, "aarch64")) - deb11_arm64 = mk(debian(11, "aarch64")) + deb12_arm64 = mk(debian(12, "aarch64")) deb10_i386 = mk(debian(10, "i386")) + deb12_i386 = mk(debian(12, "i386")) source = mk_one_metadata(release_mode, version, job_map, source_artifact) test = mk_one_metadata(release_mode, version, job_map, test_artifact) @@ -239,7 +240,9 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): } - a32 = { "Linux_Debian": { "unknown_versioning": deb10_i386 } + a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 + , ">= 12": deb12_i386 + , "unknown versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } @@ -247,8 +250,8 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): arm64 = { "Linux_UnknownLinux": { "unknown_versioning": deb10_arm64 } , "Linux_Alpine" : { "unknown_versioning": alpine3_18_arm64 } - , "Linux_Debian": { "( >= 10 && < 11 )": deb10_arm64 - , "( >= 11 && < 12 )": deb11_arm64 + , "Linux_Debian": { "( >= 10 && < 12 )": deb10_arm64 + , "( >= 12 )": deb12_arm64 , "unknown_versioning": deb10_arm64 } , "Darwin": { "unknown_versioning": darwin_arm64 } ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Unit/Module/Location.hs ===================================== @@ -142,6 +142,8 @@ mkFileSrcSpan mod_loc -- Helpers for backwards compatibility -- ---------------------------------------------------------------------------- +{-# COMPLETE ModLocation #-} + pattern ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> ModLocation pattern ModLocation { ml_hs_file ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -953,6 +953,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_ext_fields #-} {-# INLINE mi_src_hash #-} {-# INLINE mi_hi_bytes #-} +{-# COMPLETE ModIface #-} pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> ===================================== testsuite/driver/testlib.py ===================================== @@ -621,7 +621,10 @@ def _extra_files(name, opts, files): # Record the size of a specific file def collect_size ( deviation, path ): - return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path)) ) + return collect_size_func(deviation, lambda: path) + +def collect_size_func ( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: os.path.getsize(in_testdir(path_func())) ) def get_dir_size(path): total = 0 @@ -637,13 +640,11 @@ def get_dir_size(path): print("Exception: Could not find: " + path) def collect_size_dir ( deviation, path ): + return collect_size_dir_func ( deviation, lambda: path ) - ## os.path.join joins the path with slashes (not backslashes) on windows - ## CI...for some reason, so we manually detect it here - sep = r"/" - if on_windows(): - sep = r"\\" - return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path) ) +# Like collect_size_dir but the path is passed as a function which can be evaluated later. +def collect_size_dir_func( deviation, path_func ): + return collect_generic_stat ( 'size', deviation, lambda way: get_dir_size(path_func()) ) # Read a number from a specific file def stat_from_file ( metric, deviation, path ): @@ -663,14 +664,14 @@ def collect_generic_stats ( metric_info ): # is call-by-value so if we placed the call in an all.T file then the python # interpreter would evaluate the call to path_from_ghcPkg def collect_size_ghc_pkg (deviation, library): - return collect_size_dir(deviation, path_from_ghcPkg(library, "library-dirs")) + return collect_size_dir_func(deviation, lambda: path_from_ghcPkg(library, "library-dirs")) # same for collect_size and find_so def collect_object_size (deviation, library, use_non_inplace=False): if use_non_inplace: - return collect_size(deviation, find_non_inplace_so(library)) + return collect_size_func(deviation, lambda: find_non_inplace_so(library)) else: - return collect_size(deviation, find_so(library)) + return collect_size_func(deviation, lambda: find_so(library)) def path_from_ghcPkg (library, field): """Find the field as a path for a library via a call to ghc-pkg. This is a ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8f09f5e501163e80271fcd1406d34569b8ea83f7...0807ffdfb4d5bf8252176d149f8a9b20bf6850c2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8f09f5e501163e80271fcd1406d34569b8ea83f7...0807ffdfb4d5bf8252176d149f8a9b20bf6850c2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 21 07:55:00 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 21 Jul 2024 03:55:00 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <669cbed47f5e4_15c37c1e02c74118057@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 2ee5240f by Andreas Klebinger at 2024-07-21T03:54:56-04:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 1 changed file: - configure.ac Changes: ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ee5240f30f6a1574d310fdac953ba57de359b2b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2ee5240f30f6a1574d310fdac953ba57de359b2b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 21 15:47:24 2024 From: gitlab at gitlab.haskell.org (adam (@adamse)) Date: Sun, 21 Jul 2024 11:47:24 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/adamse/rts-no-free-shutdown-24979 Message-ID: <669d2d8c570d5_2df8f1e74848857d1@gitlab.mail> adam pushed new branch wip/adamse/rts-no-free-shutdown-24979 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/adamse/rts-no-free-shutdown-24979 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 21 17:05:38 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sun, 21 Jul 2024 13:05:38 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25094 Message-ID: <669d3fe26edd2_2df8f111e868c92160@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25094 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25094 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 21 22:37:29 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sun, 21 Jul 2024 18:37:29 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/T25096 Message-ID: <669d8da99a0e0_2df8f11cb7f681019d1@gitlab.mail> Simon Peyton Jones pushed new branch wip/T25096 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25096 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 21 22:39:38 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Sun, 21 Jul 2024 18:39:38 -0400 Subject: [Git][ghc/ghc][wip/T25096] Fix nasty bug in occurrence analyser Message-ID: <669d8e2abcae3_2df8f11d24898103817@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25096 at Glasgow Haskell Compiler / GHC Commits: 58a09b76 by Simon Peyton Jones at 2024-07-21T23:39:28+01:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit fixes the bug and actually makes the code a bit tidier too. - - - - - 5 changed files: - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Utils/Outputable.hs - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2598,7 +2577,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2889,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo jp_info = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3794,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3815,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58a09b76211ba5944222a91b6eb4cd1074951456 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58a09b76211ba5944222a91b6eb4cd1074951456 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 01:22:57 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Sun, 21 Jul 2024 21:22:57 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 6 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <669db471f06a2_1a82551e2990374d9@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 6ae95217 by Apoorv Ingle at 2024-07-21T20:22:40-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/driver/testlib.py - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/731dd45a1c59377ef589a2b6afef06465a6e5547...6ae9521717919f6a42cf34640111e1a350037d62 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/731dd45a1c59377ef589a2b6afef06465a6e5547...6ae9521717919f6a42cf34640111e1a350037d62 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 02:32:18 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Sun, 21 Jul 2024 22:32:18 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Make ApplicativeDo work with HsExpansions Message-ID: <669dc4b277a77_1741c9c943c713@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: c4e6483e by Apoorv Ingle at 2024-07-21T21:27:11-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 28 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - testsuite/tests/ado/T13242a.stderr - testsuite/tests/ado/T16135.hs - − testsuite/tests/ado/T16135.stderr - + testsuite/tests/ado/T24406.hs - testsuite/tests/ado/ado002.stderr - testsuite/tests/ado/ado003.stderr - testsuite/tests/ado/ado004.stderr - testsuite/tests/ado/all.T - testsuite/tests/determinism/determ021/determ021.stdout - testsuite/tests/ghci.debugger/scripts/break029.stdout - testsuite/tests/hiefile/should_run/T23540.stdout Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -475,9 +475,12 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -data HsThingRn = OrigExpr (HsExpr GhcRn) - | OrigStmt (ExprLStmt GhcRn) - | OrigPat (LPat GhcRn) +-- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression + | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from + | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern + HsDoFlavour -- ^ which kind of do-block did this statement come from + (Maybe (ExprLStmt GhcRn)) -- ^ Optional statement binding this pattern isHsThingRnExpr, isHsThingRnStmt, isHsThingRnPat :: HsThingRn -> Bool isHsThingRnExpr (OrigExpr{}) = True @@ -490,8 +493,11 @@ isHsThingRnPat (OrigPat{}) = True isHsThingRnPat _ = False data XXExprGhcRn - = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing - , xrn_expanded :: HsExpr GhcRn } -- The compiler generated expanded thing + = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages + , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed + -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded + -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded | PopErrCtxt -- A hint for typechecker to pop {-# UNPACK #-} !(LHsExpr GhcRn) -- the top of the error context stack @@ -515,41 +521,49 @@ mkExpandedExpr :: HsExpr GhcRn -- ^ source expression -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn (OrigExpr oExpr) eExpr) +mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr + , xrn_expanded = eExpr + , xrn_doTcApp = False }) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and -- expanded expression mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ source statement do flavour + -> Bool -- ^ should this be type checked using tcApp? -> HsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmt oStmt eExpr = XExpr (ExpandedThingRn (OrigStmt oStmt) eExpr) +mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav + , xrn_expanded = eExpr + , xrn_doTcApp = doTcApp}) mkExpandedPatRn - :: LPat GhcRn -- ^ source pattern - -> HsExpr GhcRn -- ^ expanded expression - -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedPatRn oPat eExpr = XExpr (ExpandedThingRn (OrigPat oPat) eExpr) + :: LPat GhcRn -- ^ source pattern + -> HsDoFlavour -- ^ source statement do flavour + -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin + -> HsExpr GhcRn -- ^ expanded expression + -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' +mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt + , xrn_expanded = eExpr + , xrn_doTcApp = False}) -- | Build an expression using the extension constructor `XExpr`, -- and the two components of the expansion: original do stmt and --- expanded expression an associate with a provided location +-- expanded expression and associate it with a provided location mkExpandedStmtAt - :: SrcSpanAnnA -- ^ Location for the expansion expression + :: Bool -- ^ Wrap this expansion with a pop? + -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement + -> HsDoFlavour -- ^ the flavour of the statement + -> Bool -- ^ should type check with tcApp? -> HsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt loc oStmt eExpr = L loc $ mkExpandedStmt oStmt eExpr - --- | Wrap the expanded version of the expression with a pop. -mkExpandedStmtPopAt - :: SrcSpanAnnA -- ^ Location for the expansion statement - -> ExprLStmt GhcRn -- ^ source statement - -> HsExpr GhcRn -- ^ expanded expression - -> LHsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtPopAt loc oStmt eExpr = mkPopErrCtxtExprAt loc $ mkExpandedStmtAt loc oStmt eExpr - +mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr + | addPop + = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + | otherwise + = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -593,9 +607,10 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement + -> HsDoFlavour -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' -mkExpandedStmtTc oStmt eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt) eExpr) +mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) {- ********************************************************************* * * @@ -840,14 +855,14 @@ ppr_expr (XExpr x) = case ghcPass @p of instance Outputable HsThingRn where ppr thing = case thing of - OrigExpr x -> ppr_builder ":" x - OrigStmt x -> ppr_builder ":" x - OrigPat x -> ppr_builder ":" x + OrigExpr x -> ppr_builder ":" x + OrigStmt x _ -> ppr_builder ":" x + OrigPat x _ mb_stmt -> ifPprDebug (braces (text "" <+> parens (ppr x) <+> parens (ppr mb_stmt))) (ppr x) where ppr_builder prefix x = ifPprDebug (braces (text prefix <+> parens (ppr x))) (ppr x) instance Outputable XXExprGhcRn where - ppr (ExpandedThingRn o e) = ifPprDebug (braces $ vcat [ppr o, ppr e]) (ppr o) - ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) + ppr (ExpandedThingRn o e _) = ifPprDebug (braces $ vcat [ppr o, text ";;" , ppr e]) (ppr o) + ppr (PopErrCtxt e) = ifPprDebug (braces (text "" <+> ppr e)) (ppr e) instance Outputable XXExprGhcTc where ppr (WrapExpr (HsWrap co_fn e)) @@ -887,7 +902,7 @@ ppr_infix_expr (XExpr x) = case ghcPass @p of ppr_infix_expr _ = Nothing ppr_infix_expr_rn :: XXExprGhcRn -> Maybe SDoc -ppr_infix_expr_rn (ExpandedThingRn thing _) = ppr_infix_hs_expansion thing +ppr_infix_expr_rn (ExpandedThingRn thing _ _) = ppr_infix_hs_expansion thing ppr_infix_expr_rn (PopErrCtxt (L _ a)) = ppr_infix_expr a ppr_infix_expr_tc :: XXExprGhcTc -> Maybe SDoc @@ -998,7 +1013,7 @@ hsExprNeedsParens prec = go go_x_tc (HsBinTick _ _ (L _ e)) = hsExprNeedsParens prec e go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = hsExpandedNeedsParens thing + go_x_rn (ExpandedThingRn thing _ _) = hsExpandedNeedsParens thing go_x_rn (PopErrCtxt (L _ a)) = hsExprNeedsParens prec a hsExpandedNeedsParens :: HsThingRn -> Bool @@ -1050,7 +1065,7 @@ isAtomicHsExpr (XExpr x) go_x_tc (HsBinTick {}) = False go_x_rn :: XXExprGhcRn -> Bool - go_x_rn (ExpandedThingRn thing _) = isAtomicExpandedThingRn thing + go_x_rn (ExpandedThingRn thing _ _) = isAtomicExpandedThingRn thing go_x_rn (PopErrCtxt (L _ a)) = isAtomicHsExpr a isAtomicExpandedThingRn :: HsThingRn -> Bool @@ -1570,7 +1585,7 @@ pprMatch (Match { m_pats = L _ pats, m_ctxt = ctxt, m_grhss = grhss }) <+> pprInfixOcc fun <+> pprParendLPat opPrec p2 _ -> pprPanic "pprMatch" (ppr ctxt $$ ppr pats) - + StmtCtxt _ -> (char '\\', pats) LamAlt LamSingle -> (char '\\', pats) ArrowMatchCtxt (ArrowLamAlt LamSingle) -> (char '\\', pats) LamAlt LamCases -> lam_cases_result @@ -1611,6 +1626,7 @@ matchSeparator IfAlt = text "->" matchSeparator ArrowMatchCtxt{} = text "->" matchSeparator PatBindRhs = text "=" matchSeparator PatBindGuards = text "=" +matchSeparator (StmtCtxt (HsDoStmt{})) = text "->" matchSeparator StmtCtxt{} = text "<-" matchSeparator RecUpd = text "=" -- This can be printed by the pattern matchSeparator PatSyn = text "<-" -- match checker trace @@ -1670,7 +1686,7 @@ data XBindStmtTc = XBindStmtTc type instance XApplicativeStmt (GhcPass _) GhcPs = NoExtField type instance XApplicativeStmt (GhcPass _) GhcRn = NoExtField -type instance XApplicativeStmt (GhcPass _) GhcTc = Type +type instance XApplicativeStmt (GhcPass _) GhcTc = DataConCantHappen type instance XBodyStmt (GhcPass _) GhcPs b = NoExtField type instance XBodyStmt (GhcPass _) GhcRn b = NoExtField @@ -1692,14 +1708,14 @@ type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc type instance XXStmtLR (GhcPass _) GhcPs b = DataConCantHappen type instance XXStmtLR (GhcPass x) GhcRn b = ApplicativeStmt (GhcPass x) GhcRn -type instance XXStmtLR (GhcPass x) GhcTc b = ApplicativeStmt (GhcPass x) GhcTc +type instance XXStmtLR (GhcPass x) GhcTc b = DataConCantHappen -- | 'ApplicativeStmt' represents an applicative expression built with -- '<$>' and '<*>'. It is generated by the renamer, and is desugared into the -- appropriate applicative expression by the desugarer, but it is intended -- to be invisible in error messages. -- --- For full details, see Note [ApplicativeDo] in "GHC.Rename.Expr" +-- For full details, see Note [Overview of ApplicativeDo] in "GHC.Rename.Expr" -- data ApplicativeStmt idL idR = ApplicativeStmt @@ -1733,7 +1749,7 @@ data ApplicativeArg idL | ApplicativeArgMany -- do { stmts; return vars } { xarg_app_arg_many :: XApplicativeArgMany idL , app_stmts :: [ExprLStmt idL] -- stmts - , final_expr :: HsExpr idL -- return (v1,..,vn), or just (v1,..,vn) + , final_expr :: LHsExpr idL -- return (v1,..,vn), or just (v1,..,vn) , bv_pattern :: LPat idL -- (v1,...,vn) , stmt_context :: HsDoFlavour -- ^ context of the do expression, used in pprArg @@ -1752,7 +1768,7 @@ type instance XXParStmtBlock (GhcPass pL) (GhcPass pR) = DataConCantHappen type instance XApplicativeArgOne GhcPs = NoExtField type instance XApplicativeArgOne GhcRn = FailOperator GhcRn -type instance XApplicativeArgOne GhcTc = FailOperator GhcTc +type instance XApplicativeArgOne GhcTc = DataConCantHappen type instance XApplicativeArgMany (GhcPass _) = NoExtField type instance XXApplicativeArg (GhcPass _) = DataConCantHappen @@ -1798,7 +1814,6 @@ pprStmt (RecStmt { recS_stmts = segment, recS_rec_ids = rec_ids pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> pprApplicativeStmt x - GhcTc -> pprApplicativeStmt x where pprApplicativeStmt :: (OutputableBndrId idL, OutputableBndrId idR) => ApplicativeStmt (GhcPass idL) (GhcPass idR) -> SDoc @@ -1819,7 +1834,6 @@ pprStmt (XStmtLR x) = case ghcPass :: GhcPass idR of flattenStmt :: ExprLStmt (GhcPass idL) -> [SDoc] flattenStmt (L _ (XStmtLR x)) = case ghcPass :: GhcPass idL of GhcRn | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args - GhcTc | (ApplicativeStmt _ args _) <- x -> concatMap flattenArg args flattenStmt stmt = [ppr stmt] flattenArg :: (a, ApplicativeArg (GhcPass idL)) -> [SDoc] @@ -1848,13 +1862,13 @@ instance (OutputableBndrId idL) pprArg :: forall idL . (OutputableBndrId idL) => ApplicativeArg (GhcPass idL) -> SDoc pprArg (ApplicativeArgOne _ pat expr isBody) - | isBody = ppr expr -- See Note [Applicative BodyStmt] - | otherwise = pprBindStmt pat expr + | isBody = whenPprDebug (text "[AppStmt]") <+> ppr expr -- See Note [Applicative BodyStmt] + | otherwise = whenPprDebug (text "[AppStmt]") <+> pprBindStmt pat expr pprArg (ApplicativeArgMany _ stmts return pat ctxt) = ppr pat <+> text "<-" <+> pprDo ctxt (stmts ++ - [noLocA (LastStmt noExtField (noLocA return) Nothing noSyntaxExpr)]) + [noLocA (LastStmt noExtField return Nothing noSyntaxExpr)]) pprTransformStmt :: (OutputableBndrId p) => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) ===================================== compiler/GHC/Hs/Utils.hs ===================================== @@ -1187,7 +1187,6 @@ collectStmtBinders flag = \case RecStmt { recS_stmts = L _ ss } -> collectLStmtsBinders flag ss XStmtLR x -> case ghcPass :: GhcPass idR of GhcRn -> collectApplicativeStmtBndrs x - GhcTc -> collectApplicativeStmtBndrs x where collectApplicativeStmtBndrs :: ApplicativeStmt (GhcPass idL) a -> [IdP (GhcPass idL)] collectApplicativeStmtBndrs (ApplicativeStmt _ args _) = concatMap (collectArgBinders . snd) args @@ -1780,7 +1779,6 @@ lStmtsImplicits = hs_lstmts hs_stmt (BindStmt _ pat _) = lPatImplicits pat hs_stmt (XStmtLR x) = case ghcPass :: GhcPass idR of GhcRn -> hs_applicative_stmt x - GhcTc -> hs_applicative_stmt x hs_stmt (LetStmt _ binds) = hs_local_binds binds hs_stmt (BodyStmt {}) = [] hs_stmt (LastStmt {}) = [] ===================================== compiler/GHC/HsToCore/Expr.hs ===================================== @@ -314,7 +314,7 @@ dsExpr (HsOverLit _ lit) dsExpr e@(XExpr ext_expr_tc) = case ext_expr_tc of ExpandedThingTc o e - | OrigStmt (L loc _) <- o + | OrigStmt (L loc _) _ <- o -> putSrcSpanDsA loc $ dsExpr e | otherwise -> dsExpr e WrapExpr {} -> dsHsWrapped e @@ -462,10 +462,10 @@ dsExpr (HsLet _ binds body) = do -- because the interpretation of `stmts' depends on what sort of thing it is. -- dsExpr (HsDo res_ty ListComp (L _ stmts)) = dsListComp stmts res_ty -dsExpr (HsDo res_ty ctx at DoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty -dsExpr (HsDo res_ty ctx at MDoExpr{} (L _ stmts)) = dsDo ctx stmts res_ty dsExpr (HsDo _ MonadComp (L _ stmts)) = dsMonadComp stmts +dsExpr (HsDo res_ty ctx at GhciStmtCtxt (L _ stmts)) = dsDo ctx stmts res_ty +dsExpr (HsDo _ DoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo DoExpr" (ppr stmts) +dsExpr (HsDo _ MDoExpr{} (L _ stmts)) = pprPanic "shouldn't happen dsDo MDoExpr" (ppr stmts) dsExpr (HsIf _ guard_expr then_expr else_expr) = do { pred <- dsLExpr guard_expr @@ -822,37 +822,6 @@ dsDo ctx stmts res_ty -- which ignores the return_op in the LastStmt, -- so we must apply the return_op explicitly - go _ (XStmtLR (ApplicativeStmt body_ty args mb_join)) stmts - = do { - let - (pats, rhss) = unzip (map (do_arg . snd) args) - - do_arg (ApplicativeArgOne fail_op pat expr _) = - ((pat, fail_op), dsLExpr expr) - do_arg (ApplicativeArgMany _ stmts ret pat _) = - ((pat, Nothing), dsDo ctx (stmts ++ [noLocA $ mkLastStmt (noLocA ret)]) res_ty) - - ; rhss' <- sequence rhss - - ; body' <- dsLExpr $ noLocA $ HsDo body_ty ctx (noLocA stmts) - - ; let match_args (pat, fail_op) (vs,body) - = putSrcSpanDs (getLocA pat) $ - do { var <- selectSimpleMatchVarL ManyTy pat - ; match <- matchSinglePatVar var Nothing (StmtCtxt (HsDoStmt ctx)) pat - body_ty (cantFailMatchResult body) - ; match_code <- dsHandleMonadicFailure ctx pat body_ty match fail_op - ; return (var:vs, match_code) - } - - ; (vars, body) <- foldrM match_args ([],body') pats - ; let fun' = mkLams vars body - ; let mk_ap_call l (op,r) = dsSyntaxExpr op [l,r] - ; expr <- foldlM mk_ap_call fun' (zip (map fst args) rhss') - ; case mb_join of - Nothing -> return expr - Just join_op -> dsSyntaxExpr join_op [expr] } - go _ (ParStmt {}) _ = panic "dsDo ParStmt" go _ (TransStmt {}) _ = panic "dsDo TransStmt" ===================================== compiler/GHC/HsToCore/GuardedRHSs.hs ===================================== @@ -144,8 +144,6 @@ matchGuards (LastStmt {} : _) _ _ _ _ = panic "matchGuards LastStmt" matchGuards (ParStmt {} : _) _ _ _ _ = panic "matchGuards ParStmt" matchGuards (TransStmt {} : _) _ _ _ _ = panic "matchGuards TransStmt" matchGuards (RecStmt {} : _) _ _ _ _ = panic "matchGuards RecStmt" -matchGuards (XStmtLR ApplicativeStmt {} : _) _ _ _ _ = - panic "matchGuards ApplicativeLastStmt" {- Should {\em fail} if @e@ returns @D@ ===================================== compiler/GHC/HsToCore/ListComp.hs ===================================== @@ -257,9 +257,6 @@ deListComp (ParStmt _ stmtss_w_bndrs _ _ : quals) list deListComp (RecStmt {} : _) _ = panic "deListComp RecStmt" -deListComp (XStmtLR ApplicativeStmt {} : _) _ = - panic "deListComp ApplicativeStmt" - deBindComp :: LPat GhcTc -> CoreExpr -> [ExprStmt GhcTc] @@ -352,8 +349,6 @@ dfListComp c_id n_id (BindStmt _ pat list1 : quals) = do dfListComp _ _ (ParStmt {} : _) = panic "dfListComp ParStmt" dfListComp _ _ (RecStmt {} : _) = panic "dfListComp RecStmt" -dfListComp _ _ (XStmtLR ApplicativeStmt {} : _) = - panic "dfListComp ApplicativeStmt" dfBindComp :: Id -> Id -- 'c' and 'n' -> (LPat GhcTc, CoreExpr) @@ -580,7 +575,6 @@ dsMcStmt (ParStmt bind_ty blocks mzip_op bind_op) stmts_rest = do { exp <- dsInnerMonadComp stmts bndrs return_op ; return (exp, mkBigCoreVarTupTy bndrs) } -dsMcStmt stmt@(XStmtLR ApplicativeStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) dsMcStmt stmt@(RecStmt {}) _ = pprPanic "dsMcStmt: unexpected stmt" (ppr stmt) matchTuple :: [Id] -> CoreExpr -> DsM CoreExpr ===================================== compiler/GHC/HsToCore/Pmc/Desugar.hs ===================================== @@ -372,7 +372,6 @@ desugarGuard guard = case guard of ParStmt {} -> panic "desugarGuard ParStmt" TransStmt {} -> panic "desugarGuard TransStmt" RecStmt {} -> panic "desugarGuard RecStmt" - XStmtLR ApplicativeStmt{} -> panic "desugarGuard ApplicativeLastStmt" sequenceGrdDagMapM :: Applicative f => (a -> f GrdDag) -> [a] -> f GrdDag sequenceGrdDagMapM f as = sequenceGrdDags <$> traverse f as ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x)) +repE e@(XExpr (ExpandedThingRn o x _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -610,7 +610,7 @@ addTickHsExpr (HsDo srcloc cxt (L l stmts)) _ -> Nothing addTickHsExpanded :: HsThingRn -> HsExpr GhcTc -> TM (HsExpr GhcTc) -addTickHsExpanded o@(OrigStmt (L pos LastStmt{})) e +addTickHsExpanded o@(OrigStmt (L pos LastStmt{}) _) e -- LastStmt always gets a tick for breakpoint and hpc coverage = do d <- getDensity case d of @@ -751,33 +751,10 @@ addTickStmt isGuard stmt@(RecStmt {}) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickStmt isGuard (XStmtLR (ApplicativeStmt body_ty args mb_join)) = do - args' <- mapM (addTickApplicativeArg isGuard) args - return (XStmtLR (ApplicativeStmt body_ty args' mb_join)) - addTick :: Maybe (Bool -> BoxLabel) -> LHsExpr GhcTc -> TM (LHsExpr GhcTc) addTick isGuard e | Just fn <- isGuard = addBinTickLHsExpr fn e | otherwise = addTickLHsExprRHS e -addTickApplicativeArg - :: Maybe (Bool -> BoxLabel) -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> TM (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -addTickApplicativeArg isGuard (op, arg) = - liftM2 (,) (addTickSyntaxExpr hpcSrcSpan op) (addTickArg arg) - where - addTickArg (ApplicativeArgOne m_fail pat expr isBody) = - ApplicativeArgOne - <$> mapM (addTickSyntaxExpr hpcSrcSpan) m_fail - <*> addTickLPat pat - <*> addTickLHsExpr expr - <*> pure isBody - addTickArg (ApplicativeArgMany x stmts ret pat ctxt) = - (ApplicativeArgMany x) - <$> addTickLStmts isGuard stmts - <*> (unLoc <$> addTickLHsExpr (L (noAnnSrcSpan hpcSrcSpan) ret)) - <*> addTickLPat pat - <*> pure ctxt - addTickStmtAndBinders :: Maybe (Bool -> BoxLabel) -> ParStmtBlock GhcTc GhcTc -> TM (ParStmtBlock GhcTc GhcTc) addTickStmtAndBinders isGuard (ParStmtBlock x stmts ids returnExpr) = @@ -966,8 +943,6 @@ addTickCmdStmt stmt@(RecStmt {}) ; bind' <- addTickSyntaxExpr hpcSrcSpan (recS_bind_fn stmt) ; return (stmt { recS_stmts = noLocA stmts', recS_ret_fn = ret' , recS_mfix_fn = mfix', recS_bind_fn = bind' }) } -addTickCmdStmt (XStmtLR (ApplicativeStmt{})) = - panic "ToDo: addTickCmdStmt ApplicativeLastStmt" -- Others should never happen in a command context. addTickCmdStmt stmt = pprPanic "addTickHsCmd" (ppr stmt) ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1372,7 +1372,6 @@ instance ( ToHie (LocatedA (body (GhcPass p))) ] XStmtLR x -> case hiePass @p of HieRn -> extApplicativeStmt x - HieTc -> extApplicativeStmt x where node = case hiePass @p of HieTc -> makeNodeA stmt span ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -194,8 +194,8 @@ but several have a little bit of special treatment: (return (f x)))) See Note [Expanding HsDo with XXExprGhcRn] in `Ghc.Tc.Gen.Do` for more details. - To understand why is this done in the typechecker and not in the renamer. - See Note [Doing XXExprGhcRn in the Renamer vs Typechecker] + To understand why is this done in the typechecker and not in the renamer + see Note [Doing XXExprGhcRn in the Renamer vs Typechecker] Note [Overloaded labels] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1838,8 +1838,18 @@ ApplicativeDo * * ************************************************************************ -Note [ApplicativeDo] -~~~~~~~~~~~~~~~~~~~~ +Note [Overview of ApplicativeDo] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* The parser produces a list of statements `[Stmt]` for a `do` expression. +* If `ApplicativeDo` flag is set, the renamer calls `Rename.Expr.postProcessStmtsForApplicativeDo` + on the list of statements and the statements which can be parallalized + are clubbed together in an `ApplicativeStmt`. See example below. +* The expansion step in `GHC.Tc.Gen.Do.expandDo` transforms this list of statements, + into binds, fmaps etc. according to the expansion rules given below in = Expansion for do = +* The desugarer in `GHC.HsToCore.dsExpr` does not have any special treatement + for do statements as they are just normal expressions. + = Example = For a sequence of statements @@ -1926,21 +1936,21 @@ split({stmt_1; ..; stmt_n) = -- 1 <= i <= n -- i is a good place to insert a bind -== Desugaring for do == +== Expansion for do == -dsDo {} expr = expr +expandStmt {} expr = expr -dsDo {pat <- rhs; stmts} expr = - rhs >>= \pat -> dsDo stmts expr +expandStmt {pat <- rhs; stmts} expr = + rhs >>= \pat -> expandStmt stmts expr -dsDo {(arg_1 | ... | arg_n)} (return expr) = +expandStmt {(arg_1 | ... | arg_n)} (return expr) = (\argpat (arg_1) .. argpat(arg_n) -> expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) -dsDo {(arg_1 | ... | arg_n); stmts} expr = - join (\argpat (arg_1) .. argpat(arg_n) -> dsDo stmts expr) +expandStmt {(arg_1 | ... | arg_n); stmts} expr = + join (\argpat (arg_1) .. argpat(arg_n) -> expandStmt stmts expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) @@ -1962,17 +1972,12 @@ ApplicativeDo touches a few phases in the compiler: recover the original do-block when e.g. printing type errors, where we don't want to show any of the applicative combinators since they don't exist in the source code. - See ApplicativeStmt and ApplicativeArg in HsExpr. - -* Typechecker: ApplicativeDo passes through the typechecker much like any - other form of expression. The only crux is that the typechecker has to - be aware of the special ApplicativeDo statements in the do-notation, and - typecheck them appropriately. - Relevant module: GHC.Tc.Gen.Match + See `ApplicativeStmt` and `ApplicativeArg` in HsExpr. -* Desugarer: Any do-block which contains applicative statements is desugared - as outlined above, to use the Applicative combinators. - Relevant module: GHC.HsToCore.Expr +* Typechecker: All the ApplicativeDo statements are expanded on the fly + to its actual semantics (as shown above) with appropriate user syntax. The typechecker + then checks the syntax as any other form of expression. + Relevant module: GHC.Tc.Gen.Do , GHC.Tc.Gen.Match.tcStmts -} @@ -1991,7 +1996,7 @@ instance Outputable MonadNames where ] -- | rearrange a list of statements using ApplicativeDoStmt. See --- Note [ApplicativeDo]. +-- Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo :: HsDoFlavour -> [(ExprLStmt GhcRn, FreeVars)] @@ -1999,7 +2004,7 @@ rearrangeForApplicativeDo rearrangeForApplicativeDo _ [] = return ([], emptyNameSet) -- If the do-block contains a single @return@ statement, change it to --- @pure@ if ApplicativeDo is turned on. See Note [ApplicativeDo]. +-- @pure@ if ApplicativeDo is turned on. See Note [Overview of ApplicativeDo]. rearrangeForApplicativeDo ctxt [(one,_)] = do (return_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) returnMName (pure_name, _) <- lookupQualifiedDoName (HsDoStmt ctxt) pureAName @@ -2222,12 +2227,12 @@ stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ (XStmtLR ApplicativeStmt{}) <- last stmts' -> - return (unLoc tup, emptyNameSet) + return (tup, emptyNameSet) | otherwise -> do -- Need 'pureAName' and not 'returnMName' here, so that it requires -- 'Applicative' and not 'Monad' whenever possible (until #20540 is fixed). (ret, _) <- lookupQualifiedDoExpr (HsDoStmt ctxt) pureAName - let expr = HsApp noExtField (noLocA ret) tup + let expr = noLocA (HsApp noExtField (noLocA ret) tup) return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -541,7 +541,7 @@ tcValArg do_ql (EValArg { ea_ctxt = ctxt do { traceTc "tcValArg" $ vcat [ ppr ctxt , text "arg type:" <+> ppr sc_arg_ty - , text "arg:" <+> ppr arg ] + , text "arg:" <+> ppr larg ] -- Crucial step: expose QL results before checking exp_arg_ty -- So far as the paper is concerned, this step applies @@ -576,7 +576,8 @@ tcValArg _ (EValArgQL { eaql_wanted = wanted do { -- Expose QL results to tcSkolemise, as in EValArg case Scaled mult exp_arg_ty <- liftZonkM $ zonkScaledTcType sc_arg_ty - ; traceTc "tcEValArgQL {" (vcat [ text "app_res_rho:" <+> ppr app_res_rho + ; traceTc "tcEValArgQL {" (vcat [ ppr ctxt + , text "app_res_rho:" <+> ppr app_res_rho , text "exp_arg_ty:" <+> ppr exp_arg_ty , text "args:" <+> ppr inst_args ]) @@ -649,10 +650,10 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args ; go 1 [] fun_sigma rn_args } where fun_orig = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> DoOrigin - VAExpansion (OrigPat pat) _ _ -> DoPatOrigin pat - VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e - VACall e _ _ -> exprCtOrigin e + VAExpansion (OrigStmt{}) _ _ -> DoOrigin + VAExpansion (OrigPat pat _ _) _ _ -> DoPatOrigin pat + VAExpansion (OrigExpr e) _ _ -> exprCtOrigin e + VACall e _ _ -> exprCtOrigin e -- These are the type variables which must be instantiated to concrete -- types. See Note [Representation-polymorphic Ids with no binding] @@ -902,18 +903,18 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {}))) _ loc + VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) -> setSrcSpan loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - | otherwise -- This arg is the first argument to generated (>>=) + | otherwise -- This arg is the first argument to generated (>>=) -> setSrcSpanA arg_loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside - VAExpansion (OrigStmt (L loc stmt)) _ _ + VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ - addStmtCtxt stmt $ + addStmtCtxt stmt flav $ thing_inside _ -> setSrcSpanA arg_loc $ @@ -1044,7 +1045,7 @@ expr_to_type earg = | otherwise = not_in_scope where occ = occName rdr not_in_scope = failWith $ mkTcRnNotInScope rdr NotInScope - go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _))) = + go (L l (XExpr (ExpandedThingRn (OrigExpr orig) _ _))) = -- Use the original, user-written expression (before expansion). -- Example. Say we have vfun :: forall a -> blah -- and the call vfun (Maybe [1,2,3]) @@ -2252,4 +2253,3 @@ rejectRepPolyNewtypes (fun,_) app_res_rho = case fun of tcExprPrag :: HsPragE GhcRn -> HsPragE GhcTc tcExprPrag (HsPragSCC x1 ann) = HsPragSCC x1 ann - ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -21,8 +21,8 @@ module GHC.Tc.Gen.Do (expandDoStmts) where import GHC.Prelude -import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, - genHsLamDoExp, genHsCaseAltDoExp, genWildPat ) +import GHC.Rename.Utils ( wrapGenSpan, genHsExpApps, genHsApp, genHsLet, genLHsApp, + genHsLamDoExp, genHsCaseAltDoExp ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType @@ -52,66 +52,53 @@ import Data.List ((\\)) -- so that they can be typechecked. -- See Note [Expanding HsDo with XXExprGhcRn] below for `HsDo` specific commentary -- and Note [Handling overloaded and rebindable constructs] for high level commentary -expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expandDoStmts doFlav stmts = do expanded_expr <- expand_do_stmts doFlav stmts - case expanded_expr of - L _ (XExpr (PopErrCtxt e)) -> return e - -- The first expanded stmt doesn't need a pop as - -- it would otherwise pop the "In the expression do ... " from - -- the error context - _ -> return expanded_expr +expandDoStmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (HsExpr GhcRn) +expandDoStmts doFlav stmts = unLoc <$> expand_do_stmts False doFlav stmts -- | The main work horse for expanding do block statements into applications of binds and thens -- See Note [Expanding HsDo with XXExprGhcRn] -expand_do_stmts :: HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) +expand_do_stmts :: Bool -> HsDoFlavour -> [ExprLStmt GhcRn] -> TcM (LHsExpr GhcRn) -expand_do_stmts ListComp _ = +expand_do_stmts _ ListComp _ = pprPanic "expand_do_stmts: impossible happened. ListComp" empty -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty +expand_do_stmts _ _ [] = pprPanic "expand_do_stmts: impossible happened. Empty stmts" empty -expand_do_stmts _ (stmt@(L _ (TransStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (TransStmt {})):_) = pprPanic "expand_do_stmts: TransStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (ParStmt {})):_) = +expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts _ (stmt@(L _ (XStmtLR ApplicativeStmt{})): _) = - pprPanic "expand_do_stmts: Applicative Stmt" $ ppr stmt - -- Handeled by tcSyntaxOp see `GHC.Tc.Gen.Match.tcStmtsAndThen` - - -expand_do_stmts _ [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = do traceTc "expand_do_stmts last" (ppr ret_expr) - return $ mkExpandedStmtPopAt loc stmt body + = return $ mkExpandedStmtAt addPop loc stmt flav False body | SyntaxExprRn ret <- ret_expr -- -- ------------------------------------------------ -- return e ~~> return e -- to make T18324 work - = do traceTc "expand_do_stmts last" (ppr ret_expr) - let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtPopAt loc stmt expansion + = do let expansion = genHsApp ret (L body_loc body) + return $ mkExpandedStmtAt addPop loc stmt flav False expansion -expand_do_stmts do_or_lc (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion -expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -120,29 +107,29 @@ expand_do_stmts do_or_lc (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) -- _ -> fail "Pattern match failure .." -- ------------------------------------------------------- -- pat <- e ; stmts ~~> (>>=) e f - = do expand_stmts <- expand_do_stmts do_or_lc lstmts - failable_expr <- mk_failable_expr do_or_lc pat expand_stmts fail_op + = do expand_stmts <- expand_do_stmts True doFlavour lstmts + failable_expr <- mk_failable_expr False doFlavour Nothing pat expand_stmts fail_op let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts do_or_lc (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' -- ---------------------------------------------- -- e ; stmts ~~> (>>) e stmts' - do expand_stmts_expr <- expand_do_stmts do_or_lc lstmts + do expand_stmts_expr <- expand_do_stmts True doFlavour lstmts let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtPopAt loc stmt expansion + return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion -expand_do_stmts do_or_lc +expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts , recS_later_ids = later_ids -- forward referenced local ids , recS_rec_ids = local_ids -- ids referenced outside of the rec block @@ -162,12 +149,12 @@ expand_do_stmts do_or_lc -- -> do { rec_stmts -- ; return (local_only_ids ++ later_ids) } )) -- (\ [ local_only_ids ++ later_ids ] -> stmts') - do expand_stmts <- expand_do_stmts do_or_lc lstmts + do expand_stmts <- expand_do_stmts True doFlavour lstmts -- NB: No need to wrap the expansion with an ExpandedStmt -- as we want to flatten the rec block statements into its parent do block anyway return $ mkHsApps (wrapGenSpan bind_fun) -- (>>=) [ (wrapGenSpan mfix_fun) `mkHsApp` mfix_expr -- (mfix (do block)) - , genHsLamDoExp do_or_lc [ mkBigLHsVarPatTup all_ids ] -- (\ x -> + , genHsLamDoExp doFlavour [ mkBigLHsVarPatTup all_ids ] -- (\ x -> expand_stmts -- stmts') ] where @@ -183,35 +170,108 @@ expand_do_stmts do_or_lc do_stmts :: XRec GhcRn [ExprLStmt GhcRn] do_stmts = L stmts_loc $ rec_stmts ++ [return_stmt] do_block :: LHsExpr GhcRn - do_block = L loc $ HsDo noExtField do_or_lc do_stmts + do_block = L loc $ HsDo noExtField doFlavour do_stmts mfix_expr :: LHsExpr GhcRn - mfix_expr = genHsLamDoExp do_or_lc [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] + mfix_expr = genHsLamDoExp doFlavour [ wrapGenSpan (LazyPat noExtField $ mkBigLHsVarPatTup all_ids) ] $ do_block -- NB: LazyPat because we do not want to eagerly evaluate the pattern -- and potentially loop forever -expand_do_stmts _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) +expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join))): lstmts) = +-- See Note [Applicative BodyStmt] +-- +-- stmts ~~> stmts' +-- ------------------------------------------------------------------------- +-- [(fmap, \ x -> e1), (<*>, e2), (<*>, e3), .. ] ; stmts ~~> (\ x -> stmts') <$> e1 <*> e2 ... +-- +-- Very similar to HsToCore.Expr.dsDo + +-- args are [(<$>, e1), (<*>, e2), .., ] + do { xexpr <- expand_do_stmts False doFlavour lstmts + -- extracts pats and arg bodies (rhss) from args + + ; (pats_can_fail, rhss) <- unzip <$> mapM (do_arg . snd) args + + -- add blocks for failable patterns + ; body_with_fails <- foldrM match_args xexpr (zip pats_can_fail rhss) + + -- builds (((body <$> e1) <*> e2) ...) + ; let expand_ado_expr = foldl mk_apps body_with_fails (zip (map fst args) rhss) + + -- wrap the expanded expression with a `join` if needed + ; let final_expr = case mb_join of + Just (SyntaxExprRn join_op) + -> genLHsApp join_op expand_ado_expr + _ -> expand_ado_expr + ; traceTc "expand_do_stmts AppStmt" (vcat [ text "args:" <+> ppr args + , text "lstmts:" <+> ppr lstmts + , text "mb_join:" <+> ppr mb_join + , text "expansion:" <+> ppr final_expr]) + ; return final_expr + + } + where + do_arg :: ApplicativeArg GhcRn -> TcM ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) + do_arg (ApplicativeArgOne + { xarg_app_arg_one = mb_fail_op + , app_arg_pattern = pat + , arg_expr = (L rhs_loc rhs) }) = + do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) + return ((pat, mb_fail_op) + , xx_expr) + where stmt = L rhs_loc $ mkRnBindStmt pat (L rhs_loc rhs) + do_arg (ApplicativeArgMany { app_stmts = stmts + , final_expr = ret@(L ret_loc _) + , bv_pattern = pat + , stmt_context = ctxt }) = + do { xx_expr <- (wrapGenSpan . unLoc) <$> (expand_do_stmts addPop ctxt $ stmts ++ [L ret_loc $ mkLastStmt ret]) + ; traceTc "do_arg" (text "ManyArg" <+> ppr addPop <+> vcat [ppr (stmts ++ [L ret_loc $ mkLastStmt ret]), text "--", ppr xx_expr]) + ; return ((pat, Nothing) + , xx_expr) } + + match_args :: ((LPat GhcRn, FailOperator GhcRn), LHsExpr GhcRn) -> LHsExpr GhcRn -> TcM (LHsExpr GhcRn) + match_args ((pat, fail_op), stmt_expr) body = mk_failable_expr addPop doFlavour mb_stmt pat body fail_op + where mb_stmt = case unLoc stmt_expr of + XExpr (ExpandedThingRn (OrigStmt s _) _ _) -> Just s + XExpr (PopErrCtxt (L _ (XExpr (ExpandedThingRn (OrigStmt s _) _ _)))) -> Just s + _ -> Nothing + + mk_apps :: LHsExpr GhcRn -> (SyntaxExprRn, LHsExpr GhcRn) -> LHsExpr GhcRn + mk_apps l_expr (op, r_expr) = + case op of + SyntaxExprRn op -> wrapGenSpan $ genHsExpApps op [ l_expr, r_expr ] + NoSyntaxExprRn -> pprPanic "expand_do_stmts applicative op:" (ppr op) + +expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (ppr stmts) -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block -mk_failable_expr :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr doFlav pat@(L loc _) expr fail_op = +mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) +mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM - ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) pat + ; let irrf_pat = isIrrefutableHsPat is_strict (irrefutableConLikeRn rdrEnv comps) lpat ; traceTc "mk_failable_expr" (vcat [ text "pat:" <+> ppr pat , text "isIrrefutable:" <+> ppr irrf_pat ]) ; if irrf_pat -- don't wrap with fail block if -- the pattern is irrefutable - then return $ genHsLamDoExp doFlav [pat] expr - else L loc <$> mk_fail_block doFlav pat expr fail_op + then case pat of + (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr + _ -> return $ case mb_stmt of + Nothing -> genHsLamDoExp doFlav [lpat] expr + Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False + (unLoc $ (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr))) + else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op -mk_fail_block :: HsDoFlavour -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) -mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = +mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) +mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr @@ -219,22 +279,22 @@ mk_fail_block doFlav pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = ]) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) - fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav genWildPat $ + fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ L ploc (fail_op_expr dflags pat fail_op) fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op - = mkExpandedPatRn pat $ + = mkExpandedPatRn pat doFlav mb_stmt $ genHsApp fail_op (mk_fail_msg_expr dflags pat) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat = nlHsLit $ mkHsString $ showPpr dflags $ - text "Pattern match failure in" <+> pprHsDoFlavour (DoExpr Nothing) + text "Pattern match failure in" <+> pprHsDoFlavour doFlav <+> text "at" <+> ppr (getLocA pat) -mk_fail_block _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty +mk_fail_block _ _ _ _ _ = pprPanic "mk_fail_block: impossible happened" empty {- Note [Expanding HsDo with XXExprGhcRn] @@ -301,14 +361,31 @@ They capture the essence of statement expansions as implemented in `expand_do_st = (>>=) e (\vars -> ‹PopErrCtxt›DO【 sss 】)) where (vars, e) = RECDO【 ss 】 - (5) DO【 s 】 = s + (5) DO【 s 】 = ‹ExpansionStmt s› s + + (6) DO【 AppStmt s; ss 】 + = APPSTMT【 (AppStmt s, ss) 】 + RECDO【 _ 】 maps a sequence of recursively dependent monadic statements and converts it into an expression paired with the variables that the rec finds a fix point of. - (6) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) + (7) RECDO【 ss 】 = (vars, mfix (\~vars -> (>>=) (DO【 ss 】) (return vars))) where vars are all the variables free in ss + APPSTMT【 _ 】 expands the applicative statements as given in Note [Overview of ApplicativeDo] in GHC.Rename.Expr + The applicative statement is generated by GHC.Rename.Expr.postProcessStmtsForApplicativeDo + + + (8) APPSTMT 【 (AppStmt (s1 | s2 ... | sn), ss) 】 + = join (\argpat (s1) .. argpat(sn) -> DO 【 ss 】) + <$> ‹ExpansionStmt s1› argexpr(arg_1) + <*> ... + <*> ‹PopErrCtxt› ‹ExpansionStmt s1› argexpr(arg_n) + + where argpat (p <- s) = p + argexpr(p <- s) = s + For a concrete example, consider a `do`-block written by the user ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -714,27 +714,38 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e') res_ty - | OrigStmt ls@(L loc s at LetStmt{}) <- o +tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty + | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 + = setSrcSpanA loc $ + addStmtCtxt (unLoc s) flav $ + tcApp (XExpr xe) res_ty + + | OrigStmt ls@(L loc s) flav <- o , HsLet x binds e <- e' = do { (binds', wrapper, e') <- setSrcSpanA loc $ - addStmtCtxt s $ + addStmtCtxt s flav $ tcLocalBinds binds $ tcMonoExprNC e res_ty -- NB: Do not call tcMonoExpr here as it adds -- a duplicate error context - ; return $ mkExpandedStmtTc ls (HsLet x binds' (mkLHsWrap wrapper e')) + ; return $ mkExpandedStmtTc ls flav (HsLet x binds' (mkLHsWrap wrapper e')) } - | OrigStmt ls@(L loc s at LastStmt{}) <- o - = setSrcSpanA loc $ - addStmtCtxt s $ - mkExpandedStmtTc ls <$> tcExpr e' res_ty - -- It is important that we call tcExpr (and not tcApp) here as - -- `e` is the last statement's body expression - -- and not a HsApp of a generated (>>) or (>>=) - -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3 - | OrigStmt ls@(L loc _) <- o + + | OrigStmt ls@(L loc _) flav <- o + , doTcApp + = setSrcSpanA loc $ + mkExpandedStmtTc ls flav <$> tcApp (XExpr xe) res_ty + + -- There are currently 2 `do`-statements that require calling `tcExpr` and not `tcApp`: + -- `LastStmt`, `AppStmt` + -- The reason is that the expanded expression `e` is the last statement's body expression + -- (or the the argument expression of an applicative statement) + -- It is not an HsApp of a generated (>>) or (>>=) + -- This improves error messages e.g. tests: DoExpansion1, DoExpansion2, DoExpansion3, ado002 etc. + | OrigStmt ls@(L loc s) flav <- o + , not doTcApp = setSrcSpanA loc $ - mkExpandedStmtTc ls <$> tcApp (XExpr xe) res_ty + addStmtCtxt s flav $ + mkExpandedStmtTc ls flav <$> tcExpr e' res_ty tcXExpr xe res_ty = tcApp (XExpr xe) res_ty ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -252,7 +252,7 @@ appCtxtLoc (VACall _ _ l) = l insideExpansion :: AppCtxt -> Bool insideExpansion (VAExpansion {}) = True -insideExpansion (VACall {}) = False -- but what if the VACall has a generated context? +insideExpansion (VACall _ _ src) = isGeneratedSrcSpan src instance Outputable QLFlag where ppr DoQL = text "DoQL" @@ -300,8 +300,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] top_ctxt n (HsPragE _ _ fun) = top_lctxt n fun top_ctxt n (HsAppType _ fun _) = top_lctxt (n+1) fun top_ctxt n (HsApp _ fun _) = top_lctxt (n+1) fun - top_ctxt n (XExpr (ExpandedThingRn o _)) - | OrigExpr fun <- o = VACall fun n noSrcSpan + top_ctxt n (XExpr (ExpandedThingRn (OrigExpr fun) _ _)) + = VACall fun n noSrcSpan top_ctxt n other_fun = VACall other_fun n noSrcSpan top_lctxt n (L _ fun) = top_ctxt n fun @@ -325,25 +325,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e)) ctxt args - | isHsThingRnExpr o - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) - (EWrap (EExpand o) : args) - - | OrigStmt (L _ stmt) <- o -- so that we set `(>>)` as generated - , BodyStmt{} <- stmt -- and get the right unused bind warnings - = go e (VAExpansion o generatedSrcSpan generatedSrcSpan) - -- See Part 3. in Note [Expanding HsDo with XXExprGhcRn] - (EWrap (EExpand o) : args) -- in `GHC.Tc.Gen.Do` - - - | OrigPat (L loc _) <- o -- so that we set the compiler generated fail context - = go e (VAExpansion o (locA loc) (locA loc)) -- to be originating from a failable pattern - -- See Part 1. Wrinkle 2. of - (EWrap (EExpand o) : args) -- Note [Expanding HsDo with XXExprGhcRn] - -- in `GHC.Tc.Gen.Do` - - | otherwise + go (XExpr (ExpandedThingRn o e _)) ctxt args = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) (EWrap (EExpand o) : args) @@ -573,9 +555,9 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt)) _ _) thing_inside = +addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = do setSrcSpanA loc $ - addStmtCtxt stmt + addStmtCtxt stmt flav thing_inside addHeadCtxt fun_ctxt thing_inside | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments @@ -583,8 +565,11 @@ addHeadCtxt fun_ctxt thing_inside | otherwise = setSrcSpan fun_loc $ do case fun_ctxt of - VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - _ -> thing_inside + VAExpansion (OrigExpr orig) _ _ + -> addExprCtxt orig thing_inside + VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ + -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside + _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt @@ -1267,9 +1252,9 @@ mis-match in the number of value arguments. * * ********************************************************************* -} -addStmtCtxt :: ExprStmt GhcRn -> TcRn a -> TcRn a -addStmtCtxt stmt thing_inside - = do let err_doc = pprStmtInCtxt (HsDoStmt (DoExpr Nothing)) stmt +addStmtCtxt :: ExprStmt GhcRn -> HsDoFlavour -> TcRn a -> TcRn a +addStmtCtxt stmt flav thing_inside + = do let err_doc = pprStmtInCtxt (HsDoStmt flav) stmt addErrCtxt err_doc thing_inside where pprStmtInCtxt :: HsStmtContextRn -> StmtLR GhcRn GhcRn (LHsExpr GhcRn) -> SDoc @@ -1282,6 +1267,8 @@ addExprCtxt :: HsExpr GhcRn -> TcRn a -> TcRn a addExprCtxt e thing_inside = case e of HsUnboundVar {} -> thing_inside + XExpr (PopErrCtxt (L _ e)) -> addExprCtxt e $ thing_inside + XExpr (ExpandedThingRn (OrigStmt stmt flav) _ _) -> addStmtCtxt (unLoc stmt) flav thing_inside _ -> addErrCtxt (exprCtxt e) thing_inside -- The HsUnboundVar special case addresses situations like -- f x = _ ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -77,7 +77,6 @@ import GHC.Types.SrcLoc import GHC.Types.Basic( VisArity, isDoExpansionGenerated ) import Control.Monad -import Control.Arrow ( second ) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -352,22 +351,14 @@ tcDoStmts ListComp (L l stmts) res_ty (mkCheckExpType elt_ty) ; return $ mkHsWrapCo co (HsDo list_ty ListComp (L l stmts')) } -tcDoStmts doExpr@(DoExpr _) ss@(L l stmts) res_ty - = do { isApplicativeDo <- xoptM LangExt.ApplicativeDo - ; if isApplicativeDo - then do { stmts' <- tcStmts (HsDoStmt doExpr) tcDoStmt stmts res_ty - ; res_ty <- readExpType res_ty - ; return (HsDo res_ty doExpr (L l stmts')) } - else do { expanded_expr <- expandDoStmts doExpr stmts - -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } +tcDoStmts doExpr@(DoExpr _) ss@(L _ stmts) res_ty + = do { expanded_expr <- expandDoStmts doExpr stmts -- Do expansion on the fly + ; mkExpandedExprTc (HsDo noExtField doExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts mDoExpr@(MDoExpr _) ss@(L _ stmts) res_ty = do { expanded_expr <- expandDoStmts mDoExpr stmts -- Do expansion on the fly - ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> - tcExpr (unLoc expanded_expr) res_ty } + ; mkExpandedExprTc (HsDo noExtField mDoExpr ss) <$> tcExpr expanded_expr res_ty } tcDoStmts MonadComp (L l stmts) res_ty = do { stmts' <- tcStmts (HsDoStmt MonadComp) tcMcStmt stmts res_ty @@ -998,18 +989,6 @@ tcDoStmt ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_names , recS_ret_ty = stmts_ty} }, thing) }} -tcDoStmt ctxt (XStmtLR (ApplicativeStmt _ pairs mb_join)) res_ty thing_inside - = do { let tc_app_stmts ty = tcApplicativeStmts ctxt pairs ty $ - thing_inside . mkCheckExpType - ; ((pairs', body_ty, thing), mb_join') <- case mb_join of - Nothing -> (, Nothing) <$> tc_app_stmts res_ty - Just join_op -> - second Just <$> - (tcSyntaxOp DoOrigin join_op [SynRho] res_ty $ - \ [rhs_ty] [rhs_mult] -> tcScalingUsage rhs_mult $ tc_app_stmts (mkCheckExpType rhs_ty)) - - ; return (XStmtLR $ ApplicativeStmt body_ty pairs' mb_join', thing) } - tcDoStmt _ stmt _ _ = pprPanic "tcDoStmt: unexpected Stmt" (ppr stmt) @@ -1086,87 +1065,6 @@ To achieve this we: all branches. This step is done with bindLocalNames. -} -tcApplicativeStmts - :: HsStmtContextRn - -> [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)] - -> ExpRhoType -- rhs_ty - -> (TcRhoType -> TcM t) -- thing_inside - -> TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Type, t) - -tcApplicativeStmts ctxt pairs rhs_ty thing_inside - = do { body_ty <- newFlexiTyVarTy liftedTypeKind - ; let arity = length pairs - ; ts <- replicateM (arity-1) $ newInferExpType - ; exp_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; pat_tys <- replicateM arity $ newFlexiTyVarTy liftedTypeKind - ; let fun_ty = mkVisFunTysMany pat_tys body_ty - - -- NB. do the <$>,<*> operators first, we don't want type errors here - -- i.e. goOps before goArgs - -- See Note [Treat rebindable syntax first] - ; let (ops, args) = unzip pairs - ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) - - -- Typecheck each ApplicativeArg separately - -- See Note [ApplicativeDo and constraints] - ; args' <- mapM (goArg body_ty) (zip3 args pat_tys exp_tys) - - -- Bring into scope all the things bound by the args, - -- and typecheck the thing_inside - -- See Note [ApplicativeDo and constraints] - ; res <- tcExtendIdEnv (concatMap get_arg_bndrs args') $ - thing_inside body_ty - - ; return (zip ops' args', body_ty, res) } - where - goOps _ [] = return [] - goOps t_left ((op,t_i,exp_ty) : ops) - = do { (_, op') - <- tcSyntaxOp DoOrigin op - [synKnownType t_left, synKnownType exp_ty] t_i $ - \ _ _ -> return () - ; t_i <- readExpType t_i - ; ops' <- goOps t_i ops - ; return (op' : ops') } - - goArg :: Type -> (ApplicativeArg GhcRn, Type, Type) - -> TcM (ApplicativeArg GhcTc) - - goArg body_ty (ApplicativeArgOne - { xarg_app_arg_one = fail_op - , app_arg_pattern = pat - , arg_expr = rhs - , .. - }, pat_ty, exp_ty) - = setSrcSpan (combineSrcSpans (getLocA pat) (getLocA rhs)) $ - addErrCtxt (pprStmtInCtxt ctxt (mkRnBindStmt pat rhs)) $ - do { rhs' <- tcCheckMonoExprNC rhs exp_ty - ; (pat', _) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ - return () - ; fail_op' <- fmap join . forM fail_op $ \fail -> - tcMonadFailOp (DoPatOrigin pat) pat' fail body_ty - - ; return (ApplicativeArgOne - { xarg_app_arg_one = fail_op' - , app_arg_pattern = pat' - , arg_expr = rhs' - , .. } - ) } - - goArg _body_ty (ApplicativeArgMany x stmts ret pat ctxt, pat_ty, exp_ty) - = do { (stmts', (ret',pat')) <- - tcStmtsAndThen (HsDoStmt ctxt) tcDoStmt stmts (mkCheckExpType exp_ty) $ - \res_ty -> do - { ret' <- tcExpr ret res_ty - ; (pat', _) <- tcCheckPat (StmtCtxt (HsDoStmt ctxt)) pat (unrestricted pat_ty) $ - return () - ; return (ret', pat') - } - ; return (ApplicativeArgMany x stmts' ret' pat' ctxt) } - - get_arg_bndrs :: ApplicativeArg GhcTc -> [Id] - get_arg_bndrs (ApplicativeArgOne { app_arg_pattern = pat }) = collectPatBinders CollNoDictBinders pat - get_arg_bndrs (ApplicativeArgMany { bv_pattern = pat }) = collectPatBinders CollNoDictBinders pat {- Note [ApplicativeDo and constraints] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a - | OrigStmt _ <- thing = DoOrigin - | OrigPat p <- thing = DoPatOrigin p +exprCtOrigin (XExpr (ExpandedThingRn thing _ _)) | OrigExpr a <- thing = exprCtOrigin a + | OrigStmt _ _ <- thing = DoOrigin + | OrigPat p _ _ <- thing = DoPatOrigin p exprCtOrigin (XExpr (PopErrCtxt {})) = Shouldn'tHappenOrigin "PopErrCtxt" -- | Extract a suitable CtOrigin from a MatchGroup ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -97,7 +97,6 @@ import GHC.Tc.Types.BasicTypes import GHC.Data.Maybe import GHC.Data.Bag -import Control.Monad import Control.Monad.Trans.Class ( lift ) import Data.Semigroup import Data.List.NonEmpty ( NonEmpty ) @@ -1409,54 +1408,6 @@ zonkStmt zBody (BindStmt xbs pat body) }) new_pat new_body } --- Scopes: join > ops (in reverse order) > pats (in forward order) --- > rest of stmts -zonkStmt _zBody (XStmtLR (ApplicativeStmt body_ty args mb_join)) - = do { new_mb_join <- zonk_join mb_join - ; new_args <- zonk_args args - ; new_body_ty <- noBinders $ zonkTcTypeToTypeX body_ty - ; return $ XStmtLR $ ApplicativeStmt new_body_ty new_args new_mb_join } - where - zonk_join Nothing = return Nothing - zonk_join (Just j) = Just <$> zonkSyntaxExpr j - - get_pat :: (SyntaxExpr GhcTc, ApplicativeArg GhcTc) -> LPat GhcTc - get_pat (_, ApplicativeArgOne _ pat _ _) = pat - get_pat (_, ApplicativeArgMany _ _ _ pat _) = pat - - replace_pat :: LPat GhcTc - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - -> (SyntaxExpr GhcTc, ApplicativeArg GhcTc) - replace_pat pat (op, ApplicativeArgOne fail_op _ a isBody) - = (op, ApplicativeArgOne fail_op pat a isBody) - replace_pat pat (op, ApplicativeArgMany x a b _ c) - = (op, ApplicativeArgMany x a b pat c) - - zonk_args args - = do { new_args_rev <- zonk_args_rev (reverse args) - ; new_pats <- zonkPats (map get_pat args) - ; return $ zipWithEqual "zonkStmt" replace_pat - new_pats (reverse new_args_rev) } - - -- these need to go backward, because if any operators are higher-rank, - -- later operators may introduce skolems that are in scope for earlier - -- arguments - zonk_args_rev ((op, arg) : args) - = do { new_op <- zonkSyntaxExpr op - ; new_arg <- noBinders $ zonk_arg arg - ; new_args <- zonk_args_rev args - ; return $ (new_op, new_arg) : new_args } - zonk_args_rev [] = return [] - - zonk_arg (ApplicativeArgOne fail_op pat expr isBody) - = do { new_expr <- zonkLExpr expr - ; new_fail <- forM fail_op $ don'tBind . zonkSyntaxExpr - ; return (ApplicativeArgOne new_fail pat new_expr isBody) } - zonk_arg (ApplicativeArgMany x stmts ret pat ctxt) - = runZonkBndrT (zonkStmts zonkLExpr stmts) $ \ new_stmts -> - do { new_ret <- zonkExpr ret - ; return (ApplicativeArgMany x new_stmts new_ret pat ctxt) } - ------------------------------------------------------------------------- zonkRecFields :: HsRecordBinds GhcTc -> ZonkTcM (HsRecordBinds GhcTc) zonkRecFields (HsRecFields flds dd) ===================================== testsuite/tests/ado/T13242a.stderr ===================================== @@ -1,13 +1,13 @@ - T13242a.hs:10:5: error: [GHC-46956] • Couldn't match expected type ‘a0’ with actual type ‘a’ - • because type variable ‘a’ would escape its scope - This (rigid, skolem) type variable is bound by - a pattern with constructor: A :: forall a. Eq a => a -> T, - in a pattern binding in - a 'do' block - at T13242a.hs:10:3-5 - • In the expression: + because type variable ‘a’ would escape its scope + This (rigid, skolem) type variable is bound by + a pattern with constructor: A :: forall a. Eq a => a -> T, + in a pattern binding in + a 'do' block + at T13242a.hs:10:3-5 + • In a stmt of a 'do' block: A x <- undefined + In the expression: do A x <- undefined _ <- return 'a' _ <- return 'b' @@ -29,7 +29,7 @@ T13242a.hs:13:13: error: [GHC-39999] instance Eq Ordering -- Defined in ‘GHC.Classes’ instance Eq Integer -- Defined in ‘GHC.Num.Integer’ ...plus 23 others - ...plus five instances involving out-of-scope types + ...plus six instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: return (x == x) In the expression: @@ -43,3 +43,4 @@ T13242a.hs:13:13: error: [GHC-39999] _ <- return 'a' _ <- return 'b' return (x == x) + ===================================== testsuite/tests/ado/T16135.hs ===================================== @@ -1,5 +1,9 @@ {-# LANGUAGE ExistentialQuantification, ApplicativeDo #-} +{- This testcase failed before we treated Do statements via HsExpansions + This test passes after #24406 +-} + module Bug where data T f = forall a. MkT (f a) ===================================== testsuite/tests/ado/T16135.stderr deleted ===================================== @@ -1,22 +0,0 @@ -T16135.hs:11:18: error: [GHC-83865] - • Couldn't match type ‘a0’ with ‘a’ - Expected: f a0 - Actual: f a - ‘a0’ is untouchable - inside the constraints: Functor f - bound by the type signature for: - runf :: forall (f :: * -> *). Functor f => IO (T f) - at T16135.hs:7:1-39 - ‘a’ is a rigid type variable bound by - a pattern with constructor: - MkT :: forall {k} (f :: k -> *) (a :: k). f a -> T f, - in a pattern binding in - a 'do' block - at T16135.hs:10:5-10 - • In the first argument of ‘MkT’, namely ‘fa’ - In a stmt of a 'do' block: return $ MkT fa - In the expression: - do return () - MkT fa <- runf - return $ MkT fa - • Relevant bindings include fa :: f a (bound at T16135.hs:10:9) ===================================== testsuite/tests/ado/T24406.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE ImpredicativeTypes, ApplicativeDo #-} +module T where + +t :: IO (forall a. a -> a) +t = return id + +p :: (forall a. a -> a) -> (Bool, Int) +p f = (f True, f 3) + +-- This typechecks (with QL) +foo1 = t >>= \x -> return (p x) + +-- But this did not not type check: +foo2 = do { x <- t ; return (p x) } ===================================== testsuite/tests/ado/ado002.stderr ===================================== @@ -1,4 +1,3 @@ - ado002.hs:8:8: error: [GHC-83865] • Couldn't match expected type: Char -> IO b0 with actual type: IO Char @@ -24,30 +23,39 @@ ado002.hs:9:3: error: [GHC-83865] y <- getChar 'a' print (x, y) -ado002.hs:15:11: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: y - In a stmt of a 'do' block: return (y, x) +ado002.hs:13:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:15:13: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x - In a stmt of a 'do' block: return (y, x) +ado002.hs:14:8: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: y <- getChar In the expression: do x <- getChar y <- getChar return (y, x) + In an equation for ‘g’: + g = do x <- getChar + y <- getChar + return (y, x) -ado002.hs:23:9: error: [GHC-83865] - • Couldn't match expected type: Char -> IO a0 - with actual type: IO Char - • The function ‘getChar’ is applied to one visible argument, - but its type ‘IO Char’ has none - In a stmt of a 'do' block: x5 <- getChar x4 +ado002.hs:20:9: error: [GHC-83865] + • Couldn't match type ‘Char’ with ‘Int’ + Expected: IO Int + Actual: IO Char + • In a stmt of a 'do' block: x2 <- getChar In the expression: do x1 <- getChar x2 <- getChar @@ -55,23 +63,37 @@ ado002.hs:23:9: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:11: error: [GHC-83865] +ado002.hs:23:3: error: [GHC-83865] • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x2 - In a stmt of a 'do' block: return (x2, x4) - In the expression: + • In the expression: do x1 <- getChar x2 <- getChar x3 <- const (return ()) x1 x4 <- getChar x5 <- getChar x4 return (x2, x4) + In an equation for ‘h’: + h = do x1 <- getChar + x2 <- getChar + x3 <- const (return ()) x1 + x4 <- getChar + x5 <- getChar x4 + return (x2, x4) -ado002.hs:24:14: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the expression: x4 - In a stmt of a 'do' block: return (x2, x4) +ado002.hs:23:9: error: [GHC-83865] + • Couldn't match expected type: Char -> IO a0 + with actual type: IO Char + • The function ‘getChar’ is applied to one visible argument, + but its type ‘IO Char’ has none + In a stmt of a 'do' block: x5 <- getChar x4 In the expression: do x1 <- getChar x2 <- getChar @@ -79,3 +101,4 @@ ado002.hs:24:14: error: [GHC-83865] x4 <- getChar x5 <- getChar x4 return (x2, x4) + ===================================== testsuite/tests/ado/ado003.stderr ===================================== @@ -1,7 +1,7 @@ -ado003.hs:7:3: error: [GHC-83865] - • Couldn't match expected type ‘Int’ with actual type ‘Char’ - • In the pattern: 'a' +ado003.hs:7:18: error: [GHC-83865] + • Couldn't match expected type ‘Char’ with actual type ‘Int’ + • In the first argument of ‘return’, namely ‘(3 :: Int)’ In a stmt of a 'do' block: 'a' <- return (3 :: Int) In the expression: do x <- getChar ===================================== testsuite/tests/ado/ado004.stderr ===================================== @@ -8,24 +8,24 @@ TYPE SIGNATURES test1c :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b test2a :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2b :: forall {f :: * -> *} {t} {a}. (Applicative f, Num t) => (t -> a) -> f a test2c :: - forall {f :: * -> *} {t} {b}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Functor f, Num b, Num t) => (t -> f b) -> f b test2d :: - forall {f :: * -> *} {t} {b} {a}. - (Functor f, Num t, Num b) => + forall {f :: * -> *} {b} {t} {a}. + (Functor f, Num b, Num t) => (t -> f a) -> f b test3 :: forall {m :: * -> *} {t1} {t2} {a}. @@ -44,4 +44,4 @@ TYPE SIGNATURES (Monad m, Num (m a)) => (m a -> m (m a)) -> p -> m a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ado/all.T ===================================== @@ -20,6 +20,7 @@ test('T15344', normal, compile_and_run, ['']) test('T16628', normal, compile_fail, ['']) test('T17835', normal, compile, ['']) test('T20540', normal, compile, ['']) -test('T16135', [when(compiler_debugged(),expect_broken(16135))], compile_fail, ['']) +test('T16135', normal, compile, ['']) test('T22483', normal, compile, ['-Wall']) test('OrPatStrictness', normal, compile_and_run, ['']) +test('T24406', normal, compile, ['']) ===================================== testsuite/tests/determinism/determ021/determ021.stdout ===================================== @@ -1,16 +1,16 @@ [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] [1 of 1] Compiling A ( A.hs, A.o ) TYPE SIGNATURES test2 :: - forall {f :: * -> *} {t} {b}. - (Applicative f, Num t, Num b) => + forall {f :: * -> *} {b} {t}. + (Applicative f, Num b, Num t) => (t -> f b) -> f b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.20.0.0] ===================================== testsuite/tests/ghci.debugger/scripts/break029.stdout ===================================== @@ -1,9 +1,9 @@ Stopped in Main.f, break029.hs:(4,7)-(6,16) _result :: IO Int = _ x :: Int = 3 -Stopped in Main.f, break029.hs:5:8-21 -_result :: IO Int = _ -x :: Int = 3 +Stopped in Main.f, break029.hs:6:3-16 +_result :: Int = _ +y :: Int = _ Stopped in Main.f, break029.hs:6:11-15 _result :: Int = _ y :: Int = _ ===================================== testsuite/tests/hiefile/should_run/T23540.stdout ===================================== @@ -28,22 +28,6 @@ At point (15,8), we found: ========================== At point (30,8), we found: ========================== -┌ -│ $dMonad at T23540.hs:1:1, of type: Monad Identity -│ is an evidence variable bound by a let, depending on: [$fMonadIdentity] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fMonadIdentity at T23540.hs:25:10-23, of type: Monad Identity - │ is an evidence variable bound by an instance of class Monad - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:25:10 - └ - ========================== At point (43,8), we found: ========================== @@ -123,38 +107,6 @@ At point (49,14), we found: ========================== At point (61,7), we found: ========================== -┌ -│ $dApplicative at T23540.hs:1:1, of type: Applicative Identity' -│ is an evidence variable bound by a let, depending on: [$fApplicativeIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fApplicativeIdentity' at T23540.hs:56:10-30, of type: Applicative Identity' - │ is an evidence variable bound by an instance of class Applicative - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:56:10 - └ - -┌ -│ $dFunctor at T23540.hs:1:1, of type: Functor Identity' -│ is an evidence variable bound by a let, depending on: [$fFunctorIdentity'] -│ with scope: ModuleScope -│ -│ Defined at -└ -| -`- ┌ - │ $fFunctorIdentity' at T23540.hs:54:10-26, of type: Functor Identity' - │ is an evidence variable bound by an instance of class Functor - │ with scope: ModuleScope - │ - │ Defined at T23540.hs:54:10 - └ - ========================== At point (69,4), we found: ========================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4e6483e261251e271737d01adbb031218c2f915 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4e6483e261251e271737d01adbb031218c2f915 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 06:36:20 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 22 Jul 2024 02:36:20 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <669dfde4a842_1741c990720c191a9@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 3c14f8b4 by Andreas Klebinger at 2024-07-22T02:36:03-04:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 1 changed file: - configure.ac Changes: ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3c14f8b47c7e4d4eaf850f067dfe851fadcf25d0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3c14f8b47c7e4d4eaf850f067dfe851fadcf25d0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 07:25:35 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 22 Jul 2024 03:25:35 -0400 Subject: [Git][ghc/ghc][wip/T25096] Wibble Message-ID: <669e096f65f73_1741c9c3c5e426420@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25096 at Glasgow Haskell Compiler / GHC Commits: c518ef74 by Simon Peyton Jones at 2024-07-22T08:25:15+01:00 Wibble - - - - - 1 changed file: - compiler/GHC/Core/Opt/OccurAnal.hs Changes: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -2974,7 +2974,7 @@ zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo #ifdef DEBUG zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info #else -zapJoinPointInfo jp_info = emptyVarEnv +zapJoinPointInfo _ = emptyVarEnv #endif extendOneShotsForJoinPoint View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c518ef74fa78e88b325c5a9634d9a1be13e57d21 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c518ef74fa78e88b325c5a9634d9a1be13e57d21 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 09:54:14 2024 From: gitlab at gitlab.haskell.org (Hannes Siebenhandl (@fendor)) Date: Mon, 22 Jul 2024 05:54:14 -0400 Subject: [Git][ghc/ghc][wip/perf-ci] 29 commits: Improve docs for NondecreasingIndentation Message-ID: <669e2c46958a3_367d7b3a1c4048590@gitlab.mail> Hannes Siebenhandl pushed to branch wip/perf-ci at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 450f479a by Fendor at 2024-07-22T11:49:45+02:00 testsuite: Add support to capture performance metrics via 'perf' Performance metrics collected via 'perf' can be more accurate for run-time performance than GHC's rts, due to the usage of hardware counters. We allow performance tests to also record PMU events according to 'perf list'. - - - - - 5f414d6e by Fendor at 2024-07-22T11:53:58+02:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 78a9a402 by Fendor at 2024-07-22T11:53:59+02:00 Enable perf profiling for compiler performance tests - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52682e0254ce27599a949b8a93f1c423f02d6843...78a9a402bdf5d24424fbd30689b89a49e8cd66e1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52682e0254ce27599a949b8a93f1c423f02d6843...78a9a402bdf5d24424fbd30689b89a49e8cd66e1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 10:32:12 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 22 Jul 2024 06:32:12 -0400 Subject: [Git][ghc/ghc][wip/T25096] Do a bit less demand-zapping when floating Message-ID: <669e352ccd4e1_367d7b598ef4508c5@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25096 at Glasgow Haskell Compiler / GHC Commits: 10ee25c4 by Simon Peyton Jones at 2024-07-22T11:31:08+01:00 Do a bit less demand-zapping when floating See Note [Zapping demand info when floating] in GHC.Core.Opt.SetLevels - - - - - 6 changed files: - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs Changes: ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Zapping demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (lazifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,31 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Zapping demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x Here v is strict; but if we float v to top level, it isn't any more. -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +But NOTE that we only need to zap the /top-level/ demand info. For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify its +demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(1C(L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the out strictness +that we kill. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = lazifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Zapping demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -2651,7 +2651,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, lazifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -991,8 +991,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +lazifyIdDemandInfo :: Id -> Id +-- Lazify (remove the top-level demand, only) the demand on Id +lazifyIdDemandInfo = zapInfo lazifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,7 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +855,14 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Zapping demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/10ee25c405dde42326eb4ebc82b948f36b748eff -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/10ee25c405dde42326eb4ebc82b948f36b748eff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 11:26:38 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 22 Jul 2024 07:26:38 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 11 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <669e41eed81e0_367d7b89dac8563f7@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - c429acf5 by sheaf at 2024-07-22T13:26:04+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - a16e43e5 by sheaf at 2024-07-22T13:26:27+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 3631b8c5 by sheaf at 2024-07-22T13:26:27+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - c8aeafc4 by sheaf at 2024-07-22T13:26:28+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 4759c68b by sheaf at 2024-07-22T13:26:28+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 57809515 by sheaf at 2024-07-22T13:26:28+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e653fd1a630f45355f320f4eb9ed7cf5e6d912d3...57809515dd09c0ec7cebc6eaee7a75872ec55c8c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e653fd1a630f45355f320f4eb9ed7cf5e6d912d3...57809515dd09c0ec7cebc6eaee7a75872ec55c8c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 12:40:25 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 22 Jul 2024 08:40:25 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Wibbles ... Message-ID: <669e5339a868d_3bc9b523fc6c80734@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 8af8bff1 by Simon Peyton Jones at 2024-07-22T08:22:41+01:00 Wibbles ... ...including omitting parens around atomic coercion - - - - - 8119c093 by Simon Peyton Jones at 2024-07-22T13:40:05+01:00 Wibbles - - - - - 10 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/Core/TyCo/FVs.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Iface/Type.hs - testsuite/tests/pmcheck/should_compile/T11195.hs Changes: ===================================== compiler/GHC/Builtin/Types/Literals.hs ===================================== @@ -139,6 +139,7 @@ There are a few steps to adding a built-in type family: tryInteractTopFam :: BuiltInSynFamily -> TyCon -> [Type] -> Type -> [(CoAxiomRule, TypeEqn)] +-- The returned CoAxiomRule is always unary tryInteractTopFam fam fam_tc tys r = [(BuiltInFamInteract ax_rule, eqn_out) | ax_rule <- sfInteract fam ===================================== compiler/GHC/Core/Coercion.hs ===================================== @@ -2496,7 +2496,7 @@ coercion_lr_kind which orig_co go_app co args = piResultTys (go co) args ------------- - go_ax axr@(BuiltInFamRewrite bif) cos = check_bif_res axr (bifrw_proves bif (map coercionKind cos)) + go_ax axr@(BuiltInFamRewrite bif) cos = check_bif_res axr (bifrw_proves bif (map coercionKind cos)) go_ax axr@(BuiltInFamInteract bif) [co] = check_bif_res axr (bifint_proves bif (coercionKind co)) go_ax axr@(BuiltInFamInteract {}) _ = crash axr go_ax (UnbranchedAxiom ax) cos = go_branch ax (coAxiomSingleBranch ax) cos ===================================== compiler/GHC/Core/Coercion/Axiom.hs ===================================== @@ -567,8 +567,8 @@ instance Binary Role where * * ************************************************************************ -A CoAxiomRule is a built-in axiom for a built-in type family. -CoAxiomRules come in two flavours: +A CoAxiomRule is a built-in axiom, one that we assume to be true: +CoAxiomRules come in four flavours: * BuiltInFamRewrite: provides evidence for, say (ax1) 3+4 ----> 7 @@ -582,24 +582,43 @@ CoAxiomRules come in two flavours: * BuiltInFamInteract: provides evidence for the consequences of one or two other coercions. For example - (ax3) g1: a+b ~ 0 ---> a~0 - (ax4) g2: a+b ~ 0 ---> b~0 - (ax5) g3: a+b1~r1, g4 : a+b2~r ---> b1~b2 - The arguments to the AxiomCo are the full coercions - (not types, right from the get-go). + (ax3) g1: a+b ~ 0 ---> a~0 + (ax4) g2: a+b ~ 0 ---> b~0 + (ax5) g3: a+b1 ~ a~b2 ---> b1~b2 + The argument to the AxiomCo is the full coercion (always just one). So then: - AxiomCo ax3 [g1] :: a ~ 0 - AxiomCo ax4 [g2] :: b ~ 0 - AxiomCo ax5 [g3,g4] :: b1 ~ b2 - + AxiomCo ax3 [g1] :: a ~ 0 + AxiomCo ax4 [g2] :: b ~ 0 + AxiomCo ax5 [g3] :: b1 ~ b2 + +* BranchedAxiom: used for closed type families + type family F a where + F Int = Bool + F Bool = Char + F a = a -> Int + We get one (CoAxiom Branched) for the entire family; when used in an + AxiomCo we pair it with the BranchIndex to say which branch to pick. + +* UnbranchedAxiom: used for several purposes; + - Newtypes + - Data family instances + - Open type family instances -} --- | CoAxiomRule is a sum type that joins BuiltInFamRewrite and BuiltInFamInteract +-- | CoAxiomRule describes a built-in axiom, one that we assume to be true data CoAxiomRule - = BuiltInFamRewrite BuiltInFamRewrite - | BuiltInFamInteract BuiltInFamInteract - | BranchedAxiom (CoAxiom Branched) BranchIndex - | UnbranchedAxiom (CoAxiom Unbranched) + = BuiltInFamRewrite BuiltInFamRewrite -- Built-in type-family rewrites + -- e.g. 3+5 ~ 7 + + | BuiltInFamInteract BuiltInFamInteract -- Built-in type-family deductions + -- e.g. a+b~0 ==> a~0 + -- Always unary + + | BranchedAxiom (CoAxiom Branched) BranchIndex -- Closed type family + + | UnbranchedAxiom (CoAxiom Unbranched) -- Open type family instance, + -- data family instances + -- and newtypes instance Eq CoAxiomRule where (BuiltInFamRewrite bif1) == (BuiltInFamRewrite bif2) = bifrw_name bif1 == bifrw_name bif2 @@ -666,10 +685,10 @@ data BuiltInFamInteract -- Argument and result role are always Nominal = BIF_Interact { bifint_name :: FastString , bifint_proves :: TypeEqn -> Maybe TypeEqn - -- ^ Returns @Nothing@ when it doesn't like - -- the supplied arguments. When this happens in a coercion - -- that means that the coercion is ill-formed, and Core Lint - -- checks for that. + -- ^ Always unary: just one TypeEqn argument + -- Returns @Nothing@ when it doesn't like the supplied argument. + -- When this happens in a coercion that means that the coercion is + -- ill-formed, and Core Lint checks for that. } data BuiltInFamRewrite -- Argument roles and result role are always Nominal @@ -693,7 +712,7 @@ data BuiltInFamRewrite -- Argument roles and result role are always Nominal -- If Just (inst_tys, res_ty) = bifrw_match ax arg_tys -- then * length arg_tys = tyConArity fam_tc -- * length inst_tys = bifrw_arity - -- * bifrw_proves (map mkNomReflCo inst_tys) = Just (mkNomReflCo res_ty) + -- * bifrw_proves (map (return @Pair) inst_tys) = Just (return @Pair res_ty) -- Provides default implementations that do nothing. ===================================== compiler/GHC/Core/FVs.hs ===================================== @@ -39,9 +39,8 @@ module GHC.Core.FVs ( exprFVs, -- * Orphan names - orphNamesOfType, orphNamesOfTypes, - orphNamesOfCo, orphNamesOfAxiomLHS, - exprsOrphNames, + orphNamesOfType, orphNamesOfTypes, orphNamesOfAxiomLHS, + orphNamesOfExprs, -- * Core syntax tree annotation with free variables FVAnn, -- annotation, abstract @@ -291,53 +290,35 @@ tickish_fvs :: CoreTickish -> FV tickish_fvs (Breakpoint _ _ ids _) = FV.mkFVs ids tickish_fvs _ = emptyFV -{- -************************************************************************ -* * -\section{Free names} -* * -************************************************************************ --} - --- | Finds the free /external/ names of an expression, notably --- including the names of type constructors (which of course do not show --- up in 'exprFreeVars'). -exprOrphNames :: CoreExpr -> NameSet --- There's no need to delete local binders, because they will all --- be /internal/ names. -exprOrphNames e - = go e - where - go (Var v) - | isExternalName n = unitNameSet n - | otherwise = emptyNameSet - where n = idName v - go (Lit _) = emptyNameSet - go (Type ty) = orphNamesOfType ty -- Don't need free tyvars - go (Coercion co) = orphNamesOfCo co - go (App e1 e2) = go e1 `unionNameSet` go e2 - go (Lam v e) = go e `delFromNameSet` idName v - go (Tick _ e) = go e - go (Cast e co) = go e `unionNameSet` orphNamesOfCo co - go (Let (NonRec _ r) e) = go e `unionNameSet` go r - go (Let (Rec prs) e) = exprsOrphNames (map snd prs) `unionNameSet` go e - go (Case e _ ty as) = go e `unionNameSet` orphNamesOfType ty - `unionNameSet` unionNameSets (map go_alt as) - - go_alt (Alt _ _ r) = go r - --- | Finds the free /external/ names of several expressions: see 'exprOrphNames' for details -exprsOrphNames :: [CoreExpr] -> NameSet -exprsOrphNames es = foldr (unionNameSet . exprOrphNames) emptyNameSet es - - {- ********************************************************************** %* * - orphNamesXXX - + Orphan names %* * %********************************************************************* -} +{- Note [Finding orphan names] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The functions here (orphNamesOfType, orphNamesOfExpr etc) traverse a template: + * the head of an class instance decl + * the LHS of a type-family instance + * the arguments of a RULE +to find TyCons or (in the case of a RULE) Ids, that will be matched against when +matching the template. If none of these orphNames are locally defined, the instance +or RULE is an orphan: see Note [Orphans] in GHC.Core + +Wrinkles: + (ON1) We do not need to look inside coercions, because we never match against + them. Indeed, it'd be wrong to do so, because it could make an instance + into a non-orphan, when it really is an orphan. + + (ON2) These oprhNames functions are also (rather separately) used by GHCi, to + implement :info. When you say ":info Foo", we show all the instances that + involve `Foo`; that is, all the instances whose oprhNames include `Foo`. + + To support `:info (->)` we need to ensure that (->) is treated as an orphName + of FunTy, which is a bit messy since the "real" TyCon is `FUN` +-} + orphNamesOfTyCon :: TyCon -> NameSet orphNamesOfTyCon tycon = unitNameSet (getName tycon) `unionNameSet` case tyConClass_maybe tycon of Nothing -> emptyNameSet @@ -350,6 +331,8 @@ orphNamesOfType (TyVarTy _) = emptyNameSet orphNamesOfType (LitTy {}) = emptyNameSet orphNamesOfType (ForAllTy bndr res) = orphNamesOfType (binderType bndr) `unionNameSet` orphNamesOfType res +orphNamesOfType (AppTy fun arg) = orphNamesOfType fun `unionNameSet` orphNamesOfType arg + orphNamesOfType (TyConApp tycon tys) = func `unionNameSet` orphNamesOfTyCon tycon `unionNameSet` orphNamesOfTypes tys @@ -367,9 +350,9 @@ orphNamesOfType (FunTy af w arg res) = func fun_tc = tyConName (funTyFlagTyCon af) -orphNamesOfType (AppTy fun arg) = orphNamesOfType fun `unionNameSet` orphNamesOfType arg -orphNamesOfType (CastTy ty co) = orphNamesOfType ty `unionNameSet` orphNamesOfCo co -orphNamesOfType (CoercionTy co) = orphNamesOfCo co +-- Coercions: see wrinkle (ON1) of Note [Finding orphan names] +orphNamesOfType (CastTy ty _co) = orphNamesOfType ty +orphNamesOfType (CoercionTy _co) = emptyNameSet orphNamesOfThings :: (a -> NameSet) -> [a] -> NameSet orphNamesOfThings f = foldr (unionNameSet . f) emptyNameSet @@ -377,57 +360,6 @@ orphNamesOfThings f = foldr (unionNameSet . f) emptyNameSet orphNamesOfTypes :: [Type] -> NameSet orphNamesOfTypes = orphNamesOfThings orphNamesOfType -orphNamesOfMCo :: MCoercion -> NameSet -orphNamesOfMCo MRefl = emptyNameSet -orphNamesOfMCo (MCo co) = orphNamesOfCo co - -orphNamesOfCo :: Coercion -> NameSet -orphNamesOfCo (Refl ty) = orphNamesOfType ty -orphNamesOfCo (GRefl _ ty mco) = orphNamesOfType ty `unionNameSet` orphNamesOfMCo mco -orphNamesOfCo (TyConAppCo _ tc cos) = unitNameSet (getName tc) `unionNameSet` orphNamesOfCos cos -orphNamesOfCo (AppCo co1 co2) = orphNamesOfCo co1 `unionNameSet` orphNamesOfCo co2 -orphNamesOfCo (ForAllCo { fco_kind = kind_co, fco_body = co }) - = orphNamesOfCo kind_co - `unionNameSet` orphNamesOfCo co -orphNamesOfCo (FunCo { fco_mult = co_mult, fco_arg = co1, fco_res = co2 }) - = orphNamesOfCo co_mult - `unionNameSet` orphNamesOfCo co1 - `unionNameSet` orphNamesOfCo co2 -orphNamesOfCo (CoVarCo _) = emptyNameSet -orphNamesOfCo (AxiomCo con cos) = orphNamesOfAxRule con `unionNameSet` orphNamesOfCos cos -orphNamesOfCo (UnivCo { uco_lty = t1, uco_rty = t2, uco_deps = cos }) - = orphNamesOfType t1 `unionNameSet` orphNamesOfType t2 - `unionNameSet` orphNamesOfCos cos -orphNamesOfCo (SymCo co) = orphNamesOfCo co -orphNamesOfCo (TransCo co1 co2) = orphNamesOfCo co1 `unionNameSet` orphNamesOfCo co2 -orphNamesOfCo (SelCo _ co) = orphNamesOfCo co -orphNamesOfCo (LRCo _ co) = orphNamesOfCo co -orphNamesOfCo (InstCo co arg) = orphNamesOfCo co `unionNameSet` orphNamesOfCo arg -orphNamesOfCo (KindCo co) = orphNamesOfCo co -orphNamesOfCo (SubCo co) = orphNamesOfCo co -orphNamesOfCo (HoleCo _) = emptyNameSet - -orphNamesOfCos :: [Coercion] -> NameSet -orphNamesOfCos = orphNamesOfThings orphNamesOfCo - -orphNamesOfAxRule :: CoAxiomRule -> NameSet -orphNamesOfAxRule (BuiltInFamRewrite bif) = unitNameSet (tyConName (bifrw_fam_tc bif)) -orphNamesOfAxRule (BuiltInFamInteract {}) = emptyNameSet -- A free-floating axiom -orphNamesOfAxRule (UnbranchedAxiom ax) = orphNamesOfCoAx ax -orphNamesOfAxRule (BranchedAxiom ax _) = orphNamesOfCoAx ax - -orphNamesOfCoAx :: CoAxiom br -> NameSet -orphNamesOfCoAx (CoAxiom { co_ax_tc = tc, co_ax_branches = branches }) - = orphNamesOfTyCon tc `unionNameSet` orphNamesOfCoAxBranches branches - -orphNamesOfCoAxBranches :: Branches br -> NameSet -orphNamesOfCoAxBranches - = foldr (unionNameSet . orphNamesOfCoAxBranch) emptyNameSet . fromBranches - -orphNamesOfCoAxBranch :: CoAxBranch -> NameSet -orphNamesOfCoAxBranch (CoAxBranch { cab_lhs = lhs, cab_rhs = rhs }) - = orphNamesOfTypes lhs `unionNameSet` orphNamesOfType rhs - -- | `orphNamesOfAxiomLHS` collects the names of the concrete types and -- type constructors that make up the LHS of a type family instance, -- including the family name itself. @@ -442,12 +374,45 @@ orphNamesOfAxiomLHS axiom = (orphNamesOfTypes $ concatMap coAxBranchLHS $ fromBranches $ coAxiomBranches axiom) `extendNameSet` getName (coAxiomTyCon axiom) --- Detect FUN 'Many as an application of (->), so that :i (->) works as expected +-- Detect (FUN 'Many) as an application of (->), so that :i (->) works as expected -- (see #8535) Issue #16475 describes a more robust solution +-- See wrinkle (ON2) of Note [Finding orphan names] orph_names_of_fun_ty_con :: Mult -> NameSet orph_names_of_fun_ty_con ManyTy = unitNameSet unrestrictedFunTyConName orph_names_of_fun_ty_con _ = emptyNameSet +-- | Finds the free /external/ names of an expression, notably +-- including the names of type constructors (which of course do not show +-- up in 'exprFreeVars'). +orphNamesOfExpr :: CoreExpr -> NameSet +-- There's no need to delete local binders, because they will all +-- be /internal/ names. +orphNamesOfExpr e + = go e + where + go (Var v) + | isExternalName n = unitNameSet n + | otherwise = emptyNameSet + where n = idName v + go (Lit _) = emptyNameSet + go (Type ty) = orphNamesOfType ty -- Don't need free tyvars + go (Coercion _co) = emptyNameSet -- See wrinkle (ON1) of Note [Finding orphan names] + go (App e1 e2) = go e1 `unionNameSet` go e2 + go (Lam v e) = go e `delFromNameSet` idName v + go (Tick _ e) = go e + go (Cast e _co) = go e -- See wrinkle (ON1) of Note [Finding orphan names] + go (Let (NonRec _ r) e) = go e `unionNameSet` go r + go (Let (Rec prs) e) = orphNamesOfExprs (map snd prs) `unionNameSet` go e + go (Case e _ ty as) = go e `unionNameSet` orphNamesOfType ty + `unionNameSet` unionNameSets (map go_alt as) + + go_alt (Alt _ _ r) = go r + +-- | Finds the free /external/ names of several expressions: see 'exprOrphNames' for details +orphNamesOfExprs :: [CoreExpr] -> NameSet +orphNamesOfExprs es = foldr (unionNameSet . orphNamesOfExpr) emptyNameSet es + + {- ************************************************************************ * * ===================================== compiler/GHC/Core/Lint.hs ===================================== @@ -2467,11 +2467,16 @@ lintCoercion co@(FunCo { fco_role = r, fco_afl = afl, fco_afr = afr , text "res_co:" <+> ppr co2 ]) -- See Note [Bad unsafe coercion] -lintCoercion co@(UnivCo { uco_role = r +lintCoercion co@(UnivCo { uco_role = r, uco_prov = prov , uco_lty = ty1, uco_rty = ty2, uco_deps = deps }) - = do { ty1' <- lintType ty1 + = do { -- Check the role. PhantomProv must have Phantom role, otherwise any role is fine + case prov of + PhantomProv -> lintRole co Phantom r + _ -> return () + + -- Check the to and from types + ; ty1' <- lintType ty1 ; ty2' <- lintType ty2 - ; deps' <- mapM lintCoercion deps ; let k1 = typeKind ty1' k2 = typeKind ty2' @@ -2479,6 +2484,9 @@ lintCoercion co@(UnivCo { uco_role = r && isTYPEorCONSTRAINT k2) (checkTypes ty1 ty2) + -- Check the coercions on which this UnivCo depends + ; deps' <- mapM lintCoercion deps + ; return (co { uco_lty = ty1', uco_rty = ty2', uco_deps = deps' }) } where report s = hang (text $ "Unsafe coercion: " ++ s) ===================================== compiler/GHC/Core/Rules.hs ===================================== @@ -48,7 +48,7 @@ import GHC.Core -- All of it import GHC.Core.Subst import GHC.Core.SimpleOpt ( exprIsLambda_maybe ) import GHC.Core.FVs ( exprFreeVars, bindFreeVars - , rulesFreeVarsDSet, exprsOrphNames ) + , rulesFreeVarsDSet, orphNamesOfExprs ) import GHC.Core.Utils ( exprType, mkTick, mkTicks , stripTicksTopT, stripTicksTopE , isJoinBind, mkCastMCo ) @@ -207,7 +207,7 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs -- Compute orphanhood. See Note [Orphans] in GHC.Core.InstEnv -- A rule is an orphan only if none of the variables -- mentioned on its left-hand side are locally defined - lhs_names = extendNameSet (exprsOrphNames args) fn + lhs_names = extendNameSet (orphNamesOfExprs args) fn -- Since rules get eventually attached to one of the free names -- from the definition when compiling the ABI hash, we should make ===================================== compiler/GHC/Core/TyCo/FVs.hs ===================================== @@ -1098,6 +1098,21 @@ tyCoVarsOfTypesWellScoped = scopedSort . tyCoVarsOfTypesList ************************************************************************ -} +{- Note [tyConsOfType] +~~~~~~~~~~~~~~~~~~~~~~ +It is slightly odd to find the TyCons of a type. Especially since, via a type +family reduction or axiom, a type that doesn't mention T might start to mention T. + +This function is used in only three places: +* In GHC.Tc.Validity.validDerivPred, when identifying "exotic" predicates. +* In GHC.Tc.Errors.Ppr.pprTcSolverReportMsg, when trying to print a helpful + error about overlapping instances +* In utisl/dump-decls/Main.hs, an ill-documented module. + +None seem critical. Currently tyConsOfType looks inside coercions, but perhaps +it doesn't even need to do that. +-} + -- | All type constructors occurring in the type; looking through type -- synonyms, but not newtypes. -- When it finds a Class, it returns the class TyCon. ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -255,7 +255,6 @@ import GHC.Core.TyCo.FVs import GHC.Types.Var import GHC.Types.Var.Env import GHC.Types.Var.Set -import GHC.Types.Unique.Set import GHC.Core.TyCon import GHC.Builtin.Types.Prim @@ -2300,24 +2299,22 @@ buildSynTyCon name binders res_kind roles rhs = mkSynonymTyCon name binders res_kind roles rhs is_tau is_fam_free is_forgetful is_concrete where + qtvs = mkVarSet (map binderVar binders) is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs - is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. - -- type S a b = b - -- type family F a - -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See comments on GHC.Core.TyCon.isForgetfulSynTyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + is_concrete = isConcreteTypeWith qtvs rhs + + is_forgetful = not (qtvs `subVarSet` expanded_rhs_tyvars) + expanded_rhs_tyvars = tyCoVarsOfType (expandTypeSynonyms rhs) + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ @@ -2851,9 +2848,17 @@ isFixedRuntimeRepKind k -- -- See Note [Concrete types] in GHC.Tc.Utils.Concrete. isConcreteType :: Type -> Bool -isConcreteType = go +isConcreteType = isConcreteTypeWith emptyVarSet + +isConcreteTypeWith :: TyVarSet -> Type -> Bool +-- See Note [Concrete types] in GHC.Tc.Utils.Concrete. +-- For this "With" version we pass in a set of TyVars to be considered +-- concrete. This supports mkSynonymTyCon, which needs to test the RHS +-- for concreteness, under the assumption that the binders are instantiated +-- to concrete types +isConcreteTypeWith conc_tvs = go where - go (TyVarTy tv) = isConcreteTyVar tv + go (TyVarTy tv) = isConcreteTyVar tv || tv `elemVarSet` conc_tvs go (AppTy ty1 ty2) = go ty1 && go ty2 go (TyConApp tc tys) = go_tc tc tys go ForAllTy{} = False ===================================== compiler/GHC/Iface/Type.hs ===================================== @@ -2014,7 +2014,8 @@ ppr_co ctxt_prec (IfaceInstCo co ty) , pprParendIfaceCoercion ty ] ppr_co ctxt_prec (IfaceAxiomCo ax cos) - = ppr_special_co ctxt_prec (pprIfAxRule ax) cos + | null cos = pprIfAxRule ax -- Don't add parens + | otherwise = ppr_special_co ctxt_prec (pprIfAxRule ax) cos ppr_co ctxt_prec (IfaceSymCo co) = ppr_special_co ctxt_prec (text "Sym") [co] ppr_co ctxt_prec (IfaceTransCo co1 co2) ===================================== testsuite/tests/pmcheck/should_compile/T11195.hs ===================================== @@ -54,9 +54,10 @@ etaForAllCo_maybe = undefined matchAxiom = undefined checkAxInstCo = undefined -isAxiom_maybe = undefined +isAxiomCo_maybe co1 = undefined isCohLeft_maybe = undefined isCohRight_maybe = undefined +matchNewtypeBranch = undefined opt_transList :: InScopeSet -> [NormalCo] -> [NormalCo] -> [NormalCo] opt_transList is = zipWith (opt_trans is) @@ -109,61 +110,53 @@ opt_trans_rule is co1 co2 | ForAllCo tv2 vl2 vr1 eta2 r2 <- co2 , Just (tv1,vl1,vr2,eta1,r1) <- etaForAllCo_maybe co1 = undefined - where - push_trans tv1 eta1 r1 tv2 eta2 r2 = undefined - -- Push transitivity inside axioms opt_trans_rule is co1 co2 - | Just (sym, con, ind, cos1) <- co1_is_axiom_maybe + | Just (sym1, axr1, cos1) <- isAxiomCo_maybe co1 + , Just (sym2, axr2, cos2) <- isAxiomCo_maybe co2 + , axr1 == axr2 + , sym1 == not sym2 + , Just (tc, role, branch) <- coAxiomRuleBranch_maybe axr1 + , let qtvs = coAxBranchTyVars branch ++ coAxBranchCoVars branch + lhs = mkTyConApp tc (coAxBranchLHS branch) + rhs = coAxBranchRHS branch + pivot_tvs = exactTyCoVarsOfType (if sym2 then rhs else lhs) + , all (`elemVarSet` pivot_tvs) qtvs + = if sym2 + -- TrPushAxSym + then liftCoSubstWith role qtvs (opt_transList is cos1 (map mkSymCo cos2)) lhs + -- TrPushSymAx + else liftCoSubstWith role qtvs (opt_transList is (map mkSymCo cos1) cos2) rhs + + -- See Note [Push transitivity inside axioms] and + -- Note [Push transitivity inside newtype axioms only] + -- TrPushSymAxR + | Just (sym, axr, cos1) <- isAxiomCo_maybe co1 , True <- sym - , Just cos2 <- matchAxiom sym con ind co2 - , let newAxInst = AxiomInstCo con ind - (opt_transList is (map mkSymCo cos2) cos1) - , Nothing <- checkAxInstCo newAxInst - = undefined + , Just cos2 <- matchNewtypeBranch sym axr co2 + , let newAxInst = AxiomCo axr (opt_transList is (map mkSymCo cos2) cos1) + = SymCo newAxInst -- TrPushAxR - | Just (sym, con, ind, cos1) <- co1_is_axiom_maybe + | Just (sym, axr, cos1) <- isAxiomCo_maybe co1 , False <- sym - , Just cos2 <- matchAxiom sym con ind co2 - , let newAxInst = AxiomInstCo con ind (opt_transList is cos1 cos2) - , Nothing <- checkAxInstCo newAxInst - = undefined + , Just cos2 <- matchNewtypeBranch sym axr co2 + , let newAxInst = AxiomCo axr (opt_transList is cos1 cos2) + = newAxInst -- TrPushSymAxL - | Just (sym, con, ind, cos2) <- co2_is_axiom_maybe + | Just (sym, axr, cos2) <- isAxiomCo_maybe co2 , True <- sym - , Just cos1 <- matchAxiom (not sym) con ind co1 - , let newAxInst = AxiomInstCo con ind - (opt_transList is cos2 (map mkSymCo cos1)) - , Nothing <- checkAxInstCo newAxInst - = undefined + , Just cos1 <- matchNewtypeBranch (not sym) axr co1 + , let newAxInst = AxiomCo axr (opt_transList is cos2 (map mkSymCo cos1)) + = SymCo newAxInst -- TrPushAxL - | Just (sym, con, ind, cos2) <- co2_is_axiom_maybe + | Just (sym, axr, cos2) <- isAxiomCo_maybe co2 , False <- sym - , Just cos1 <- matchAxiom (not sym) con ind co1 - , let newAxInst = AxiomInstCo con ind (opt_transList is cos1 cos2) - , Nothing <- checkAxInstCo newAxInst - = undefined - - -- TrPushAxSym/TrPushSymAx - | Just (sym1, con1, ind1, cos1) <- co1_is_axiom_maybe - , Just (sym2, con2, ind2, cos2) <- co2_is_axiom_maybe - , con1 == con2 - , ind1 == ind2 - , sym1 == not sym2 - , let branch = coAxiomNthBranch con1 ind1 - qtvs = coAxBranchTyVars branch ++ coAxBranchCoVars branch - lhs = coAxNthLHS con1 ind1 - rhs = coAxBranchRHS branch - pivot_tvs = exactTyCoVarsOfType (if sym2 then rhs else lhs) - , all (`elemVarSet` pivot_tvs) qtvs - = undefined - where - co1_is_axiom_maybe = isAxiom_maybe co1 - co2_is_axiom_maybe = isAxiom_maybe co2 - role = coercionRole co1 -- should be the same as coercionRole co2! + , Just cos1 <- matchNewtypeBranch (not sym) axr co1 + , let newAxInst = AxiomCo axr (opt_transList is cos1 cos2) + = newAxInst opt_trans_rule is co1 co2 | Just (lco, lh) <- isCohRight_maybe co1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6ecf186049f4bbdd04f72c21a8960fe903c646ca...8119c093ba8c52c9c22b81ef727022beeff60ecd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6ecf186049f4bbdd04f72c21a8960fe903c646ca...8119c093ba8c52c9c22b81ef727022beeff60ecd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 12:52:31 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 22 Jul 2024 08:52:31 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <669e560faae09_3bc9b546571c81380@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: f7c5e9e1 by sheaf at 2024-07-22T14:51:28+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 6d5ac080 by sheaf at 2024-07-22T14:51:28+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 00231d83 by sheaf at 2024-07-22T14:51:29+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 1c85027d by sheaf at 2024-07-22T14:51:29+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - f5356e73 by sheaf at 2024-07-22T14:51:29+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - hadrian/src/Builder.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/GenApply.hs - hadrian/src/Settings/Packages.hs - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - rts/rts.cabal - + testsuite/tests/simd/should_run/T25062_V16.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57809515dd09c0ec7cebc6eaee7a75872ec55c8c...f5356e73c4cb68c8a4dae4b31018ef8f332c1058 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57809515dd09c0ec7cebc6eaee7a75872ec55c8c...f5356e73c4cb68c8a4dae4b31018ef8f332c1058 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 14:21:09 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 22 Jul 2024 10:21:09 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <669e6ad5e3d75_3bc9b59844288659e@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: d258ed04 by sheaf at 2024-07-22T16:20:59+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 97e78109 by sheaf at 2024-07-22T16:20:59+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 47dd184d by sheaf at 2024-07-22T16:20:59+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 3751f82a by sheaf at 2024-07-22T16:20:59+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 0d0260ba by sheaf at 2024-07-22T16:21:00+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - hadrian/src/Builder.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/GenApply.hs - hadrian/src/Settings/Packages.hs - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - rts/include/Cmm.h - rts/rts.cabal - + testsuite/tests/simd/should_run/T25062_V16.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f5356e73c4cb68c8a4dae4b31018ef8f332c1058...0d0260ba50fa09a7650929503b9638e217ef41ad -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f5356e73c4cb68c8a4dae4b31018ef8f332c1058...0d0260ba50fa09a7650929503b9638e217ef41ad You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 15:48:35 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 22 Jul 2024 11:48:35 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 5 commits: Use xmm registers in genapply Message-ID: <669e7f537cf72_2a48cf2ec264597df@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 6d1da12a by sheaf at 2024-07-22T17:48:24+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 0efdda94 by sheaf at 2024-07-22T17:48:24+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - 62b65514 by sheaf at 2024-07-22T17:48:24+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 4455cc79 by sheaf at 2024-07-22T17:48:24+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 3194acb9 by sheaf at 2024-07-22T17:48:25+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/Llvm/Ppr.hs - compiler/GHC/Llvm/Syntax.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - hadrian/src/Builder.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/GenApply.hs - hadrian/src/Settings/Packages.hs - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - + rts/AutoApplyVecs.h - rts/include/Cmm.h - rts/include/stg/MiscClosures.h The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d0260ba50fa09a7650929503b9638e217ef41ad...3194acb99f826655d98b938a461df7a764555e3e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0d0260ba50fa09a7650929503b9638e217ef41ad...3194acb99f826655d98b938a461df7a764555e3e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 22 17:11:37 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 22 Jul 2024 13:11:37 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/torsten.schmits/hadrian-flavor-table Message-ID: <669e92c98a618_2a48cf6fa07c6885a@gitlab.mail> Torsten Schmits pushed new branch wip/torsten.schmits/hadrian-flavor-table at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/torsten.schmits/hadrian-flavor-table You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 06:58:38 2024 From: gitlab at gitlab.haskell.org (Hannes Siebenhandl (@fendor)) Date: Tue, 23 Jul 2024 02:58:38 -0400 Subject: [Git][ghc/ghc][wip/perf-ci] 2 commits: gitlab-ci: Add nightly job for running the testsuite with perf profiling support Message-ID: <669f549ee0ac8_497556de78c25186@gitlab.mail> Hannes Siebenhandl pushed to branch wip/perf-ci at Glasgow Haskell Compiler / GHC Commits: a4fc1bda by Fendor at 2024-07-23T08:58:18+02:00 gitlab-ci: Add nightly job for running the testsuite with perf profiling support - - - - - 9afe5c49 by Fendor at 2024-07-23T08:58:18+02:00 Enable perf profiling for compiler performance tests - - - - - 3 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - testsuite/tests/perf/compiler/all.T Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -155,6 +155,7 @@ data BuildConfig , noSplitSections :: Bool , validateNonmovingGc :: Bool , textWithSIMDUTF :: Bool + , testsuiteUsePerf :: Bool } -- Extra arguments to pass to ./configure due to the BuildConfig @@ -216,6 +217,7 @@ vanilla = BuildConfig , noSplitSections = False , validateNonmovingGc = False , textWithSIMDUTF = False + , testsuiteUsePerf = False } splitSectionsBroken :: BuildConfig -> BuildConfig @@ -268,6 +270,9 @@ tsan = vanilla { threadSanitiser = True } noTntc :: BuildConfig noTntc = vanilla { tablesNextToCode = False } +usePerfProfilingTestsuite :: BuildConfig -> BuildConfig +usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } + ----------------------------------------------------------------------------- -- Platform specific variables ----------------------------------------------------------------------------- @@ -288,6 +293,9 @@ runnerTag _ _ = error "Invalid arch/opsys" tags :: Arch -> Opsys -> BuildConfig -> [String] tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use +runnerPerfTag :: Arch -> Opsys -> String +runnerPerfTag arch sys = runnerTag arch sys ++ "-perf" + -- These names are used to find the docker image so they have to match what is -- in the docker registry. distroName :: LinuxDistro -> String @@ -770,6 +778,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } | validateNonmovingGc buildConfig ] in "RUNTEST_ARGS" =: unwords runtestArgs + , if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty ] jobArtifacts = Artifacts @@ -892,6 +901,12 @@ highCompression = addVariable "XZ_OPT" "-9" useHashUnitIds :: Job -> Job useHashUnitIds = addVariable "HADRIAN_ARGS" "--hash-unit-ids" +-- | Change the tag of the job to make sure the job is scheduled on a +-- runner that has the necessary capabilties to run the job with 'perf' +-- profiling counters. +perfProfilingJobTag :: Arch -> Opsys -> Job -> Job +perfProfilingJobTag arch opsys j = j { jobTags = [ runnerPerfTag arch opsys ] } + -- | Mark the validate job to run in fast-ci mode -- This is default way, to enable all jobs you have to apply the `full-ci` label. fastCI :: JobGroup Job -> JobGroup Job @@ -995,6 +1010,8 @@ debian_x86 = , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + -- Run the 'perf' profiling nightly job in the release config. + , perfProfilingJob Amd64 (Linux Debian12) releaseConfig , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) @@ -1005,6 +1022,12 @@ debian_x86 = where validate_debian = Debian12 + perfProfilingJob arch sys buildConfig = + -- Rename the job to avoid conflicts + rename (<> "-perf") + $ modifyJobs (perfProfilingJobTag arch sys) + $ disableValidate (validateBuilds arch sys $ usePerfProfilingTestsuite buildConfig) + tsan_jobs = modifyJobs ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" ===================================== .gitlab/jobs.yaml ===================================== @@ -1791,6 +1791,69 @@ "XZ_OPT": "-9" } }, + "nightly-x86_64-linux-deb12-release-perf": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-x86_64-linux-deb12-release.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb12-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux-perf" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-release", + "BUILD_FLAVOUR": "release", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": " --config perf_path=perf", + "TEST_ENV": "x86_64-linux-deb12-release", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-linux-deb12-unreg-validate": { "after_script": [ ".gitlab/ci.sh save_cache", ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -8,7 +8,7 @@ test('T1969', extra_run_opts('+RTS -A64k -RTS'), # The default RESIDENCY_OPTS is 256k and we need higher sampling # frequency. Incurs a slow-down by about 2. - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), only_ways(['normal']), extra_hc_opts('-dcore-lint -static'), @@ -32,14 +32,14 @@ else: test('T3294', [collect_compiler_residency(15), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), conf_3294, ], compile, ['']) test('T4801', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']), extra_hc_opts('-static'), when(arch('wasm32') and unregisterised(), fragile(23290)) @@ -49,7 +49,7 @@ test('T4801', test('T3064', [collect_compiler_residency(20), - collect_compiler_stats('bytes allocated',2), + collect_compiler_runtime(2), only_ways(['normal']), ], compile, @@ -59,7 +59,7 @@ test('T3064', test('T4007', normal, makefile_test, ['T4007']) test('T5030', - [collect_compiler_stats('bytes allocated', 2), + [collect_compiler_runtime(2), only_ways(['normal']) ], @@ -67,14 +67,14 @@ test('T5030', ['-freduction-depth=300']) test('T5631', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']) ], compile, ['']) test('parsing001', - [collect_compiler_stats('bytes allocated',2), + [collect_compiler_runtime(2), only_ways(['normal']), ], compile_fail, ['']) @@ -82,27 +82,27 @@ test('parsing001', test('T783', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2), + collect_compiler_runtime(2), extra_hc_opts('-static') ], compile,['']) test('T5321Fun', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) test('T5321FD', [ only_ways(['normal']), # no optimisation for this one - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) test('T5642', [ only_ways(['normal']), normal, - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['-O']) @@ -114,7 +114,7 @@ test('T5837', test('T6048', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated',2) + collect_compiler_runtime(2), ], compile,['']) @@ -134,7 +134,7 @@ test('T9675', test('T9872a', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, @@ -142,28 +142,28 @@ test('T9872a', test('T9872b', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, ['']) test('T9872b_defer', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile, ['-fdefer-type-errors']) test('T9872c', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), high_memory_usage ], compile_fail, ['']) test('T9872d', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['']) @@ -227,14 +227,14 @@ test ('LargeRecord', test('T9961', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['-O']) test('T9233', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], multimod_compile, ['T9233', '-v0 -O2 -fno-spec-constr']) @@ -249,14 +249,14 @@ test('T10370', test('T11068', normal, makefile_test, ['T11068']) test('T10547', - [ collect_compiler_stats('bytes allocated', 4), + [ collect_compiler_runtime(4), ], compile_fail, ['-fprint-expanded-synonyms']) test('T12227', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, # Use `-M1G` to prevent memory thrashing with ghc-8.0.1. @@ -264,14 +264,14 @@ test('T12227', test('T12425', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], compile, ['']) test('T12234', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 2), + collect_compiler_runtime(2), ], compile, ['']) @@ -279,14 +279,14 @@ test('T12234', # See Note [Sensitivity to unique increment] in T12545.hs; spread was 4.8% test('T12545', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 10), # + collect_compiler_runtime(10), # ], multimod_compile, ['T12545', '-v0'] ) test('T13035', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), ], compile, [''] ) @@ -299,7 +299,7 @@ test('T13056', ['-O1']) test('T12707', - [ collect_compiler_stats('bytes allocated', 1), + [ collect_compiler_runtime(1), ], compile, ['']) @@ -311,7 +311,7 @@ test('T12707', # to avoid spurious errors. test('T12150', [ only_ways(['optasm']), - collect_compiler_stats('bytes allocated', 2) + collect_compiler_runtime(2) ], compile, ['']) @@ -483,7 +483,7 @@ test('MultiLayerModulesNoCode', ['MultiLayerModulesNoCode.script']) test('MultiComponentModulesRecomp', - [ collect_compiler_stats('bytes allocated', 2), + [ collect_compiler_runtime(2), pre_cmd('$MAKE -s --no-print-directory MultiComponentModulesRecomp'), extra_files(['genMultiComp.py']), compile_timeout_multiplier(5) @@ -492,7 +492,7 @@ test('MultiComponentModulesRecomp', [['unitp%d' % n for n in range(20)], '-fno-code -fwrite-interface -v0']) test('MultiComponentModules', - [ collect_compiler_stats('bytes allocated', 2), + [ collect_compiler_runtime(2), pre_cmd('$PYTHON ./genMultiComp.py'), extra_files(['genMultiComp.py']), compile_timeout_multiplier(5) @@ -565,7 +565,7 @@ test('T14683', test ('T9630', [ collect_compiler_residency(15), - collect_compiler_stats('bytes allocated', 2), + collect_compiler_runtime(2), ], multimod_compile, ['T9630', '-v0 -O']) @@ -611,7 +611,7 @@ test ('T16473', ['-O2 -flate-specialise']) test('T17516', - [ collect_compiler_stats('bytes allocated', 5), + [ collect_compiler_runtime(5), ], multimod_compile, ['T17516', '-O -v0']) @@ -635,13 +635,13 @@ test ('T18140', ['-v0 -O']) test('T10421', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 1) + collect_compiler_runtime(1) ], multimod_compile, ['T10421', '-v0 -O']) test('T10421a', [ only_ways(['normal']), - collect_compiler_stats('bytes allocated', 10) + collect_compiler_runtime(10) ], multimod_compile, ['T10421a', '-v0 -O']) @@ -700,13 +700,13 @@ test ('T19695', ['-v0 -O2']) test('hard_hole_fits', # Testing multiple hole-fits with lots in scope for #16875 - collect_compiler_stats('bytes allocated', 2), # 1 is 300s, 0.010 is 3s. Without hole-fits it takes 1s + collect_compiler_runtime(2), # 1 is 300s, 0.010 is 3s. Without hole-fits it takes 1s compile, ['-fdefer-type-errors -fno-max-valid-hole-fits -package ghc']) test('T16875', # Testing one hole-fit with a lot in scope for #16875 # This test is very sensitive to environmental differences.. we should fix # that but for now the failure threshold is 4% (see #21557) - collect_compiler_stats('bytes allocated', 4), + collect_compiler_runtime(4), compile, ['-fdefer-type-errors -fno-max-valid-hole-fits -package ghc']) test ('T20261', @@ -720,7 +720,7 @@ test ('T20261', # a compile-time and a run-time performance test test('T21839c', [ collect_compiler_stats('all', 10), - collect_compiler_stats('bytes allocated', 1), + collect_compiler_runtime(1), only_ways(['normal'])], compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78a9a402bdf5d24424fbd30689b89a49e8cd66e1...9afe5c499181d64935bbba00a7b21b2ba20d570c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78a9a402bdf5d24424fbd30689b89a49e8cd66e1...9afe5c499181d64935bbba00a7b21b2ba20d570c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 11:42:20 2024 From: gitlab at gitlab.haskell.org (Sylvain Henry (@hsyl20)) Date: Tue, 23 Jul 2024 07:42:20 -0400 Subject: [Git][ghc/ghc][wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug] Apply 1 suggestion(s) to 1 file(s) Message-ID: <669f971c856ef_298934e7c08106064@gitlab.mail> Sylvain Henry pushed to branch wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug at Glasgow Haskell Compiler / GHC Commits: cbfe38a7 by Sylvain Henry at 2024-07-23T11:42:05+00:00 Apply 1 suggestion(s) to 1 file(s) - - - - - 1 changed file: - rts/linker/elf_reloc_aarch64.c Changes: ===================================== rts/linker/elf_reloc_aarch64.c ===================================== @@ -327,7 +327,7 @@ relocateObjectCodeAarch64(ObjectCode * oc) { CHECK(0x0 != symbol); if(0x0 == symbol->addr) - barf("0x0 address for %s + %d of type %d in %s for relocation %d in section %d of kind: %d\n", symbol->name, rel->r_addend, ELF64_R_TYPE((Elf64_Xword)rel->r_info), OC_INFORMATIVE_FILENAME(oc), i, relaTab->targetSectionIndex, oc->sections[relaTab->targetSectionIndex].kind); + barf("0x0 address for %s + %ld of type %ld in %s for relocation %d in section %d of kind: %d\n", symbol->name, rel->r_addend, ELF64_R_TYPE((Elf64_Xword)rel->r_info), OC_INFORMATIVE_FILENAME(oc), i, relaTab->targetSectionIndex, oc->sections[relaTab->targetSectionIndex].kind); /* take explicit addend */ int64_t addend = rel->r_addend; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbfe38a72bdeef1d2360cd64d4c68747087dc701 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cbfe38a72bdeef1d2360cd64d4c68747087dc701 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 13:40:31 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 23 Jul 2024 09:40:31 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <669fb2cf317ad_17e139c939c788c1@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - ba7af862 by Simon Peyton Jones at 2024-07-23T09:40:18-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - 4 changed files: - compiler/GHC/Core/Type.hs - configure.ac - + testsuite/tests/typecheck/should_compile/T25094.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2315,22 +2315,27 @@ buildSynTyCon name binders res_kind roles rhs where is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs + expanded_rhs = expandTypeSynonyms rhs + is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. + rhs_tycons = tyConsOfType expanded_rhs + -- NB: we look at expanded_rhs e.g. -- type S a b = b -- type family F a -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + -- We want to mark T as concrete, because S ignores its first argument + + is_forgetful = not (all ((`elemVarSet` expanded_rhs_tyvars) . binderVar) binders) + expanded_rhs_tyvars = tyCoVarsOfType expanded_rhs + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, ===================================== testsuite/tests/typecheck/should_compile/T25094.hs ===================================== @@ -0,0 +1,98 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,4 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) - +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c14f8b47c7e4d4eaf850f067dfe851fadcf25d0...ba7af8627667d8d6d1894ed88a8b1961d72a7fca -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3c14f8b47c7e4d4eaf850f067dfe851fadcf25d0...ba7af8627667d8d6d1894ed88a8b1961d72a7fca You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 14:27:56 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 23 Jul 2024 10:27:56 -0400 Subject: [Git][ghc/ghc][wip/romes/25052] ghc-internal: No trailing whitespace in exceptions Message-ID: <669fbdecdff65_17e1394f1924904ac@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25052 at Glasgow Haskell Compiler / GHC Commits: 1fb2ac40 by Rodrigo Mesquita at 2024-07-23T15:27:48+01:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -199,11 +199,14 @@ instance Exception SomeException where fromException = Just backtraceDesired (SomeException e) = backtraceDesired e displayException (SomeException e) = - displayException e ++ "\n" ++ displayContext ?exceptionContext + case displayContext ?exceptionContext of + "" -> displayException e + dc -> displayException e ++ "\n" ++ dc displayContext :: ExceptionContext -> String displayContext (ExceptionContext anns0) = go anns0 where + go [SomeExceptionAnnotation ann] = displayExceptionAnnotation ann go (SomeExceptionAnnotation ann : anns) = displayExceptionAnnotation ann ++ "\n" ++ go anns go [] = "" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fb2ac40630a68a8db4af3fc483229cb4e71a8f7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fb2ac40630a68a8db4af3fc483229cb4e71a8f7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 14:39:59 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 23 Jul 2024 10:39:59 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/25091 Message-ID: <669fc0bf41232_17e1396603289275f@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/25091 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/25091 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 23 15:22:19 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 23 Jul 2024 11:22:19 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Address feedback Message-ID: <669fcaab61a5e_17e13988fb309593e@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: bdbda97a by Brandon Chinn at 2024-07-23T07:53:13-07:00 Address feedback - - - - - 2 changed files: - compiler/GHC/Parser/String.hs - testsuite/tests/perf/compiler/all.T Changes: ===================================== compiler/GHC/Parser/String.hs ===================================== @@ -112,6 +112,7 @@ lexString strType getChar initialLoc = go initialState initialLoc -- reached EOF before finding end of string Nothing -> Left $ BadCharInitialLex loc0 (hasSQuote getChar s) +{-# INLINE lexString #-} checkDelimiter :: LexStringType -> GetChar loc -> loc -> Maybe loc checkDelimiter strType getChar loc0 = @@ -124,10 +125,12 @@ checkDelimiter strType getChar loc0 = ('"', loc2) <- getChar loc1 ('"', loc3) <- getChar loc2 Just loc3 +{-# INLINE checkDelimiter #-} -- | A helper for adding the given character to the lexed string. addChar :: Char -> LexStringState loc -> LexStringState loc addChar c s = s{stringAcc = c : stringAcc s} +{-# INLINE addChar #-} -- | Return whether the string we've parsed so far contains any smart quotes. hasSQuote :: GetChar loc -> LexStringState loc -> ContainsSmartQuote loc @@ -143,6 +146,7 @@ hasSQuote getChar s case getChar loc of Just (c, loc') -> Just ((c, loc), loc') Nothing -> Nothing +{-# INLINE hasSQuote #-} -- | After parsing a backslash and a space character, consume the rest of -- the string gap and return the next location. @@ -155,6 +159,7 @@ collapseStringGap getChar s = go Just (c0, loc1) | is_space c0 -> go loc1 Just _ -> Left $ BadCharInitialLex loc0 (hasSQuote getChar s) Nothing -> Left $ UnexpectedEOF loc0 (hasSQuote getChar s) +{-# INLINE collapseStringGap #-} -- | See Note [Multiline string literals] parseLeadingWS :: GetChar loc -> LexStringState loc -> loc -> (LexStringState loc, loc) @@ -179,6 +184,7 @@ parseLeadingWS getChar = go 0 applyN :: Int -> (a -> a) -> a -> a applyN n f x0 = iterate f x0 !! n +{-# INLINE parseLeadingWS #-} data StringLexError loc = UnexpectedEOF !loc !(ContainsSmartQuote loc) @@ -256,6 +262,7 @@ resolveEscapeCharacter getChar loc0 = do _ -> pure (chr x, loc) parseNum (toDigit c1) loc2 +{-# INLINE resolveEscapeCharacter #-} parseLongEscape :: GetChar loc -> Char -> loc -> Maybe (Char, loc) parseLongEscape getChar c0 loc1 = listToMaybe $ mapMaybe tryParse longEscapeCodes @@ -309,6 +316,7 @@ parseLongEscape getChar c0 loc1 = listToMaybe $ mapMaybe tryParse longEscapeCode , ("SP", '\SP') , ("DEL", '\DEL') ] +{-# INLINE parseLongEscape #-} -- ----------------------------------------------------------------------------- -- Unicode Smart Quote detection (#21843) ===================================== testsuite/tests/perf/compiler/all.T ===================================== @@ -764,6 +764,8 @@ test ('T24582', ['-O']) test ('MultilineStringsPerf', - [ collect_compiler_stats('peak_megabytes_allocated',20) ], + [ collect_compiler_stats('peak_megabytes_allocated', 20), + collect_compiler_stats('bytes allocated', 5), + ], compile, ['-O']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bdbda97a21eac55a88276e0b602453f0c8dc55bc -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bdbda97a21eac55a88276e0b602453f0c8dc55bc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 06:40:58 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 24 Jul 2024 02:40:58 -0400 Subject: [Git][ghc/ghc][master] Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a0a1fa67a2c_584e8688e68983a@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 1 changed file: - configure.ac Changes: ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fa35b6429f8168d8b39a703d82511775810c0f9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1fa35b6429f8168d8b39a703d82511775810c0f9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 06:41:36 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 24 Jul 2024 02:41:36 -0400 Subject: [Git][ghc/ghc][master] Fix bad bug in mkSynonymTyCon, re forgetfulness Message-ID: <66a0a22023d33_584e867a85413795@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - 3 changed files: - compiler/GHC/Core/Type.hs - + testsuite/tests/typecheck/should_compile/T25094.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2315,22 +2315,27 @@ buildSynTyCon name binders res_kind roles rhs where is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs + expanded_rhs = expandTypeSynonyms rhs + is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. + rhs_tycons = tyConsOfType expanded_rhs + -- NB: we look at expanded_rhs e.g. -- type S a b = b -- type family F a -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + -- We want to mark T as concrete, because S ignores its first argument + + is_forgetful = not (all ((`elemVarSet` expanded_rhs_tyvars) . binderVar) binders) + expanded_rhs_tyvars = tyCoVarsOfType expanded_rhs + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ ===================================== testsuite/tests/typecheck/should_compile/T25094.hs ===================================== @@ -0,0 +1,98 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,4 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) - +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/55117e13765f2fc2a8b01a377433553c5fd29719 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/55117e13765f2fc2a8b01a377433553c5fd29719 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 07:12:53 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 24 Jul 2024 03:12:53 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: Fix bad bug in mkSynonymTyCon, re forgetfulness Message-ID: <66a0a975e0959_109c0cca00877138@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - 2fd0c439 by Sergey Vinokurov at 2024-07-24T03:12:31-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - 6a13e672 by Simon Peyton Jones at 2024-07-24T03:12:31-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 16 changed files: - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T - + testsuite/tests/typecheck/should_compile/T25094.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2315,22 +2315,27 @@ buildSynTyCon name binders res_kind roles rhs where is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs + expanded_rhs = expandTypeSynonyms rhs + is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. + rhs_tycons = tyConsOfType expanded_rhs + -- NB: we look at expanded_rhs e.g. -- type S a b = b -- type family F a -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + -- We want to mark T as concrete, because S ignores its first argument + + is_forgetful = not (all ((`elemVarSet` expanded_rhs_tyvars) . binderVar) binders) + expanded_rhs_tyvars = tyCoVarsOfType expanded_rhs + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== libraries/base/changelog.md ===================================== @@ -14,6 +14,7 @@ * Add `inits1` and `tails1` to `Data.List`, factored from the corresponding functions in `Data.List.NonEmpty` ([CLC proposal #252](https://github.com/haskell/core-libraries-committee/issues/252)) * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) + * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/Data/Functor/Classes.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE Safe #-} @@ -78,12 +79,13 @@ import Data.List.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) -import GHC.Generics (Generic1(..), Generically1(..)) +import GHC.Generics (Generic1(..), Generically1(..), V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..) , (:+:)(..), (:*:)(..), (:.:)(..), URec(..), UAddr, UChar, UDouble, UFloat, UInt, UWord) import GHC.Tuple (Solo (..)) -import GHC.Internal.Read (expectP, list, paren) +import GHC.Internal.Read (expectP, list, paren, readField) +import GHC.Internal.Show (appPrec) -import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) -import GHC.Internal.Text.Read (Read(..), parens, prec, step) +import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec, pfail) +import GHC.Internal.Text.Read (Read(..), parens, prec, step, reset) import GHC.Internal.Text.Read.Lex (Lexeme(..)) import GHC.Internal.Text.Show (showListWith) import Prelude @@ -1123,3 +1125,322 @@ and the corresponding 'Show1' instance as > showsBinaryWith sp (liftShowsPrec sp sl) "Two" d x y -} + +-- | @since base-4.21.0.0 +instance Eq1 V1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 V1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 V1 where + liftShowsPrec _ _ _ = \_ -> showString "V1" + +-- | @since base-4.21.0.0 +instance Read1 V1 where + liftReadsPrec _ _ = readPrec_to_S pfail + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 U1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 U1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 U1 where + liftShowsPrec _ _ _ = \U1 -> showString "U1" + +-- | @since base-4.21.0.0 +instance Read1 U1 where + liftReadPrec _ _ = + parens (expectP (Ident "U1") *> pure U1) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 Par1 where + liftEq eq = \(Par1 a) (Par1 a') -> eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 Par1 where + liftCompare cmp = \(Par1 a) (Par1 a') -> cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 Par1 where + liftShowsPrec sp _ d = \(Par1 { unPar1 = a }) -> + showsSingleFieldRecordWith sp "Par1" "unPar1" d a + +-- | @since base-4.21.0.0 +instance Read1 Par1 where + liftReadPrec rp _ = + readsSingleFieldRecordWith rp "Par1" "unPar1" Par1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (Rec1 f) where + liftEq eq = \(Rec1 a) (Rec1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (Rec1 f) where + liftCompare cmp = \(Rec1 a) (Rec1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (Rec1 f) where + liftShowsPrec sp sl d = \(Rec1 { unRec1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "Rec1" "unRec1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (Rec1 f) where + liftReadPrec rp rl = + readsSingleFieldRecordWith (liftReadPrec rp rl) "Rec1" "unRec1" Rec1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq c => Eq1 (K1 i c) where + liftEq _ = \(K1 a) (K1 a') -> a == a' + +-- | @since base-4.21.0.0 +instance Ord c => Ord1 (K1 i c) where + liftCompare _ = \(K1 a) (K1 a') -> compare a a' + +-- | @since base-4.21.0.0 +instance Show c => Show1 (K1 i c) where + liftShowsPrec _ _ d = \(K1 { unK1 = a }) -> + showsSingleFieldRecordWith showsPrec "K1" "unK1" d a + +-- | @since base-4.21.0.0 +instance Read c => Read1 (K1 i c) where + liftReadPrec _ _ = readData $ + readsSingleFieldRecordWith readPrec "K1" "unK1" K1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (M1 i c f) where + liftEq eq = \(M1 a) (M1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (M1 i c f) where + liftCompare cmp = \(M1 a) (M1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (M1 i c f) where + liftShowsPrec sp sl d = \(M1 { unM1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "M1" "unM1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (M1 i c f) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith (liftReadPrec rp rl) "M1" "unM1" M1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :+: g) where + liftEq eq = \lhs rhs -> case (lhs, rhs) of + (L1 a, L1 a') -> liftEq eq a a' + (R1 b, R1 b') -> liftEq eq b b' + _ -> False + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :+: g) where + liftCompare cmp = \lhs rhs -> case (lhs, rhs) of + (L1 _, R1 _) -> LT + (R1 _, L1 _) -> GT + (L1 a, L1 a') -> liftCompare cmp a a' + (R1 b, R1 b') -> liftCompare cmp b b' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :+: g) where + liftShowsPrec sp sl d = \x -> case x of + L1 a -> showsUnaryWith (liftShowsPrec sp sl) "L1" d a + R1 b -> showsUnaryWith (liftShowsPrec sp sl) "R1" d b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :+: g) where + liftReadPrec rp rl = readData $ + readUnaryWith (liftReadPrec rp rl) "L1" L1 <|> + readUnaryWith (liftReadPrec rp rl) "R1" R1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :*: g) where + liftEq eq = \(f :*: g) (f' :*: g') -> liftEq eq f f' && liftEq eq g g' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :*: g) where + liftCompare cmp = \(f :*: g) (f' :*: g') -> liftCompare cmp f f' <> liftCompare cmp g g' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :*: g) where + liftShowsPrec sp sl d = \(a :*: b) -> + showsBinaryOpWith + (liftShowsPrec sp sl) + (liftShowsPrec sp sl) + 7 + ":*:" + d + a + b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :*: g) where + liftReadPrec rp rl = parens $ prec 6 $ + readBinaryOpWith (liftReadPrec rp rl) (liftReadPrec rp rl) ":*:" (:*:) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where + liftEq eq = \(Comp1 a) (Comp1 a') -> liftEq (liftEq eq) a a' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where + liftCompare cmp = \(Comp1 a) (Comp1 a') -> liftCompare (liftCompare cmp) a a' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :.: g) where + liftShowsPrec sp sl d = \(Comp1 { unComp1 = a }) -> + showsSingleFieldRecordWith + (liftShowsPrec (liftShowsPrec sp sl) (liftShowList sp sl)) + "Comp1" + "unComp1" + d + a + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :.: g) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith + (liftReadPrec (liftReadPrec rp rl) (liftReadListPrec rp rl)) + "Comp1" + "unComp1" + Comp1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 UAddr where + -- NB cannot use eqAddr# because its module isn't safe + liftEq _ = \(UAddr a) (UAddr b) -> UAddr a == UAddr b + +-- | @since base-4.21.0.0 +instance Ord1 UAddr where + liftCompare _ = \(UAddr a) (UAddr b) -> compare (UAddr a) (UAddr b) + +-- | @since base-4.21.0.0 +instance Show1 UAddr where + liftShowsPrec _ _ = showsPrec + +-- NB no Read1 for URec (Ptr ()) because there's no Read for Ptr. + +-- | @since base-4.21.0.0 +instance Eq1 UChar where + liftEq _ = \(UChar a) (UChar b) -> UChar a == UChar b + +-- | @since base-4.21.0.0 +instance Ord1 UChar where + liftCompare _ = \(UChar a) (UChar b) -> compare (UChar a) (UChar b) + +-- | @since base-4.21.0.0 +instance Show1 UChar where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UDouble where + liftEq _ = \(UDouble a) (UDouble b) -> UDouble a == UDouble b + +-- | @since base-4.21.0.0 +instance Ord1 UDouble where + liftCompare _ = \(UDouble a) (UDouble b) -> compare (UDouble a) (UDouble b) + +-- | @since base-4.21.0.0 +instance Show1 UDouble where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UFloat where + liftEq _ = \(UFloat a) (UFloat b) -> UFloat a == UFloat b + +-- | @since base-4.21.0.0 +instance Ord1 UFloat where + liftCompare _ = \(UFloat a) (UFloat b) -> compare (UFloat a) (UFloat b) + +-- | @since base-4.21.0.0 +instance Show1 UFloat where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UInt where + liftEq _ = \(UInt a) (UInt b) -> UInt a == UInt b + +-- | @since base-4.21.0.0 +instance Ord1 UInt where + liftCompare _ = \(UInt a) (UInt b) -> compare (UInt a) (UInt b) + +-- | @since base-4.21.0.0 +instance Show1 UInt where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UWord where + liftEq _ = \(UWord a) (UWord b) -> UWord a == UWord b + +-- | @since base-4.21.0.0 +instance Ord1 UWord where + liftCompare _ = \(UWord a) (UWord b) -> compare (UWord a) (UWord b) + +-- | @since base-4.21.0.0 +instance Show1 UWord where + liftShowsPrec _ _ = showsPrec + +showsSingleFieldRecordWith :: (Int -> a -> ShowS) -> String -> String -> Int -> a -> ShowS +showsSingleFieldRecordWith sp name field d x = + showParen (d > appPrec) $ + showString name . showString " {" . showString field . showString " = " . sp 0 x . showChar '}' + +readsSingleFieldRecordWith :: ReadPrec a -> String -> String -> (a -> t) -> ReadPrec t +readsSingleFieldRecordWith rp name field cons = parens $ prec 11 $ do + expectP $ Ident name + expectP $ Punc "{" + x <- readField field $ reset rp + expectP $ Punc "}" + pure $ cons x + +showsBinaryOpWith + :: (Int -> a -> ShowS) + -> (Int -> b -> ShowS) + -> Int + -> String + -> Int + -> a + -> b + -> ShowS +showsBinaryOpWith sp1 sp2 opPrec name d x y = showParen (d >= opPrec) $ + sp1 opPrec x . showChar ' ' . showString name . showChar ' ' . sp2 opPrec y + +readBinaryOpWith + :: ReadPrec a + -> ReadPrec b + -> String + -> (a -> b -> t) + -> ReadPrec t +readBinaryOpWith rp1 rp2 name cons = + cons <$> step rp1 <* expectP (Symbol name) <*> step rp2 ===================================== libraries/ghc-internal/src/GHC/Internal/Generics.hs ===================================== @@ -735,7 +735,7 @@ import GHC.Internal.Data.Maybe ( Maybe(..), fromMaybe ) import GHC.Internal.Data.Ord ( Down(..) ) import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) -import GHC.Internal.Ptr ( Ptr ) +import GHC.Internal.Ptr ( Ptr(..) ) import GHC.Types -- Needed for instances @@ -746,7 +746,7 @@ import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Internal.Enum ( Bounded, Enum ) import GHC.Internal.Read ( Read(..) ) -import GHC.Internal.Show ( Show(..), showString ) +import GHC.Internal.Show ( Show(..), showString, showChar, showParen, appPrec ) import GHC.Internal.Stack.Types ( SrcLoc(..) ) import GHC.Tuple (Solo (..)) import GHC.Internal.Unicode ( GeneralCategory(..) ) @@ -1037,6 +1037,14 @@ data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# } , Generic1 -- ^ @since base-4.9.0.0 ) +-- | @since base-4.21.0.0 +instance Show (UAddr p) where + -- This Show instance would be equivalent to what deriving Show would generate, + -- but because deriving Show doesn't support Addr# fields we define it manually. + showsPrec d (UAddr x) = + showParen (d > appPrec) + (\y -> showString "UAddr {uAddr# = " (showsPrec 0 (Ptr x) (showChar '}' y))) + -- | Used for marking occurrences of 'Char#' -- -- @since base-4.9.0.0 ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -14003,6 +14003,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14017,6 +14018,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14032,6 +14034,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14047,6 +14050,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -15525,6 +15529,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -11230,6 +11230,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11244,6 +11245,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11259,6 +11261,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11274,6 +11277,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12770,6 +12774,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) ===================================== testsuite/tests/typecheck/should_compile/T25094.hs ===================================== @@ -0,0 +1,98 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,4 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) - +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ba7af8627667d8d6d1894ed88a8b1961d72a7fca...6a13e67250ef1b3ea96faef046bc4f15b5ea20ff -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ba7af8627667d8d6d1894ed88a8b1961d72a7fca...6a13e67250ef1b3ea96faef046bc4f15b5ea20ff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 08:48:22 2024 From: gitlab at gitlab.haskell.org (Sylvain Henry (@hsyl20)) Date: Wed, 24 Jul 2024 04:48:22 -0400 Subject: [Git][ghc/ghc][wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug] 67 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a0bfd687802_109c0c72331490131@gitlab.mail> Sylvain Henry pushed to branch wip/haskell-nix-patches/aarch64-multiplatform/ghc-9.0-better-symbol-addr-debug at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - b91b7230 by doyougnu at 2024-07-24T10:47:45+02:00 RTS linker: aarch64: better debug information Dump better debugging information when a symbol address is null. Part of the haskell.nix patches upstream project Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cbfe38a72bdeef1d2360cd64d4c68747087dc701...b91b723032cb28cf3601068f4752552a2cf66224 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cbfe38a72bdeef1d2360cd64d4c68747087dc701...b91b723032cb28cf3601068f4752552a2cf66224 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 09:15:16 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Wed, 24 Jul 2024 05:15:16 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 8 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a0c6241b4e7_109c0ca308a49645e@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - 7d3bd85e by sheaf at 2024-07-24T11:14:19+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 476968b9 by sheaf at 2024-07-24T11:14:52+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - c494d74f by sheaf at 2024-07-24T11:14:53+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - e4424e07 by sheaf at 2024-07-24T11:14:53+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 2c53480f by sheaf at 2024-07-24T11:14:53+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - f0b74c5c by sheaf at 2024-07-24T11:14:53+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3194acb99f826655d98b938a461df7a764555e3e...f0b74c5c83dfb886c869930e149218758057d7ba -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3194acb99f826655d98b938a461df7a764555e3e...f0b74c5c83dfb886c869930e149218758057d7ba You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 12:35:06 2024 From: gitlab at gitlab.haskell.org (josephf (@josephf)) Date: Wed, 24 Jul 2024 08:35:06 -0400 Subject: [Git][ghc/ghc][wip/type-sharing] 10 commits: prep: make type-lets pass through CorePrep Message-ID: <66a0f4fa3000f_1749c752190839b3@gitlab.mail> josephf pushed to branch wip/type-sharing at Glasgow Haskell Compiler / GHC Commits: dc71cd49 by Joseph Fourment at 2024-07-24T10:18:28+02:00 prep: make type-lets pass through CorePrep As a first attempt, ignore type-lets in CorePrep to avoid crashes. However, this is not enough: CorePrep also does some let-floating. If we don't float type-lets along with value-level let-bindings, the latter can float out of the scope of a type variable in use. - - - - - 62a7ba90 by Joseph Fourment at 2024-07-24T10:49:48+02:00 simple-opt: fix simple_type_bind Also: - Inline small types using a new typeIsSmallEnoughToInline predicate - Inline single-occurrence variables - - - - - bc8e90dc by Joseph Fourment at 2024-07-24T10:52:16+02:00 simple-opt: make beta-reduction use simple_bind_type - - - - - 1c49b92e by Joseph Fourment at 2024-07-24T11:38:48+02:00 iface: add IfaceTypeLetBndr to represent non-top-level type-let binders IfaceLetBndr isn't fit to represent type-let binders, as it includes a bunch of vacuous flags for Ids only. Instead of putting squares in circles, I added a new constructor for type binders. The downside is that it breaks existing iface files, so since we can't bootstrap yet so we have to bootstrap a cherry-picked branch and then checkout again to build with --freeze1. To avoid similar issues in the future, IfaceTyVarInfoItem serialises with a tag despite there being only one constructor for now. - - - - - da70f53b by Joseph Fourment at 2024-07-24T11:39:59+02:00 dmd-anal: prefix unused variable with _ to avoid warning - - - - - f40b480a by Joseph Fourment at 2024-07-24T11:40:54+02:00 type: inline unfoldView in sORTKind_maybe - - - - - 870d2858 by Joseph Fourment at 2024-07-24T11:41:18+02:00 tidy: deal with type-lets - - - - - af50043e by Joseph Fourment at 2024-07-24T14:13:50+02:00 notes: add Note [Type and coercion lets] - - - - - a1cab68d by Joseph Fourment at 2024-07-24T14:17:15+02:00 notes: update Note [Comparing nullary type synonyms] to account for type variables While updating backlinks, I noticed the optimisation for type variables could be performed in more places. - - - - - 9324ed07 by Joseph Fourment at 2024-07-24T14:28:48+02:00 simplifier: inline single-occurring type-lets - - - - - 17 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/Tidy.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Iface/Rename.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Types/Var.hs Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -297,7 +297,7 @@ dmdAnalBind -- where the binding is in scope -> WithDmdType (DmdResult CoreBind a) dmdAnalBind top_lvl env dmd bind anal_body = case bind of - NonRec var rhs + NonRec var _rhs | isTyVar var -> dmdAnalBindLetDown top_lvl env dmd bind anal_body NonRec id rhs ===================================== compiler/GHC/Core/Opt/Simplify/Utils.hs ===================================== @@ -60,7 +60,7 @@ import GHC.Core.Opt.Arity import GHC.Core.Unfold import GHC.Core.Unfold.Make import GHC.Core.Opt.Simplify.Monad -import GHC.Core.Type hiding( substTy ) +import GHC.Core.Type hiding( extendTvSubst, substTy ) import GHC.Core.Coercion hiding( substCo ) import GHC.Core.DataCon ( dataConWorkId, isNullaryRepDataCon ) import GHC.Core.Multiplicity @@ -72,6 +72,7 @@ import GHC.Types.Id.Info import GHC.Types.Tickish import GHC.Types.Demand import GHC.Types.Var.Set +import GHC.Types.Var ( tyVarOccInfo, tyVarUnfolding ) import GHC.Types.Basic import GHC.Data.OrdList ( isNilOL ) @@ -86,7 +87,6 @@ import Control.Monad ( when ) import Data.List ( sortBy ) import GHC.Types.Name.Env import Data.Graph -import GHC.Types.Var (tyVarOccInfo) {- ********************************************************************* * * @@ -1469,22 +1469,26 @@ preInlineUnconditionally -- for unlifted, side-effect-ful bindings preInlineUnconditionally env top_lvl bndr rhs rhs_env | not pre_inline_unconditionally = Nothing - | isTyVar bndr = Nothing + | isTyVar bndr + , not (one_occ (tyVarOccInfo bndr)) = Nothing + | isTyVar bndr + , Just unf <- tyVarUnfolding bndr = Just $! (extend_tv_subst_with unf) | not active = Nothing | isTopLevel top_lvl && isDeadEndId bndr = Nothing -- Note [Top-level bottoming Ids] | isCoVar bndr = Nothing -- Note [Do not inline CoVars unconditionally] | isExitJoinId bndr = Nothing -- Note [Do not inline exit join points] -- in module Exitify | not (one_occ (idOccInfo bndr)) = Nothing - | not (isStableUnfolding unf) = Just $! (extend_subst_with rhs) + | not (isStableUnfolding unf) = Just $! (extend_id_subst_with rhs) -- See Note [Stable unfoldings and preInlineUnconditionally] | not (isInlinePragma inline_prag) - , Just inl <- maybeUnfoldingTemplate unf = Just $! (extend_subst_with inl) + , Just inl <- maybeUnfoldingTemplate unf = Just $! (extend_id_subst_with inl) | otherwise = Nothing where unf = idUnfolding bndr - extend_subst_with inl_rhs = extendIdSubst env bndr $! (mkContEx rhs_env inl_rhs) + extend_id_subst_with inl_rhs = extendIdSubst env bndr $! (mkContEx rhs_env inl_rhs) + extend_tv_subst_with ty = extendTvSubst env bndr ty one_occ IAmDead = True -- Happens in ((\x.1) v) one_occ OneOcc{ occ_n_br = 1 @@ -2224,7 +2228,7 @@ abstractFloats uf_opts top_lvl main_tvs floats body ; return (float_binds, GHC.Core.Subst.substExpr subst body) } where is_top_lvl = isTopLevel top_lvl - body_floats = letFloatBinds (sfLetFloats floats) + body_floats = letFloatBinds (sfLetFloats floats) ++ typeFloatBinds (sfTypeFloats floats) empty_subst = GHC.Core.Subst.mkEmptySubst (sfInScope floats) -- See wrinkle (AB5) in Note [Which type variables to abstract over] ===================================== compiler/GHC/Core/SimpleOpt.hs ===================================== @@ -32,7 +32,7 @@ import GHC.Core.Opt.OccurAnal( occurAnalyseExpr, occurAnalysePgm, zapLambdaBndrs import GHC.Types.Literal import GHC.Types.Id import GHC.Types.Id.Info ( realUnfoldingInfo, setUnfoldingInfo, setRuleInfo, IdInfo (..) ) -import GHC.Types.Var ( isNonCoVarId, tyVarUnfolding, setTyVarUnfolding ) +import GHC.Types.Var ( isTcTyVar, isNonCoVarId, setTyVarUnfolding, tyVarOccInfo ) import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Core.DataCon @@ -357,6 +357,11 @@ simple_app env e@(Lam {}) as@(_:_) n_args = length as do_beta env (Lam b body) (a:as) + | (t_env, Type t) <- a + , (env'', mb_tpr) <- simple_bind_type env b (t_env, t) + = assert (isTyVar b) $ + wrapTypeLet mb_tpr $ do_beta env'' body as + | -- simpl binder before looking at its type -- See Note [Dark corner with representation polymorphism] needsCaseBinding (idType b') (snd a) @@ -414,6 +419,14 @@ finish_app env fun args ---------------------- simple_opt_bind :: SimpleOptEnv -> InBind -> TopLevelFlag -> (SimpleOptEnv, Maybe OutBind) +simple_opt_bind env (NonRec b r) _top_level + | Type t <- r + = assert (isTyVar b) $ + let (env', mb_pr) = simple_bind_type env b (env, t) + in (env', case mb_pr of + Nothing -> Nothing + Just (b, r) -> Just (NonRec b (Type r))) + simple_opt_bind env (NonRec b r) top_level = (env', case mb_pr of Nothing -> Nothing @@ -439,26 +452,23 @@ simple_opt_bind env (Rec prs) top_level ---------------------- simple_bind_type :: SimpleOptEnv - -> InTyVar -> Maybe OutTyVar + -> InTyVar -> (SimpleOptEnv, InType) -> (SimpleOptEnv, Maybe (OutTyVar, OutType)) +-- See Note [Type and coercion lets] simple_bind_type env@(SOE { soe_subst = subst }) - in_bndr mb_out_bndr (rhs_env, in_rhs) - | Just in_tyvar <- getTyVar_maybe in_rhs - , Just unf <- tyVarUnfolding in_tyvar - , let out_unf = substTyUnchecked (soe_subst rhs_env) unf - , isAtomicTy out_unf - = {- pprTrace "simple_bind_type" (ppr in_tyvar) $ -} - (env { soe_subst = extendTvSubst subst in_bndr out_unf }, Nothing) - + in_bndr (rhs_env, in_ty) + | occurs_once || typeIsSmallEnoughToInline out_ty + = (env { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) | otherwise - = let - out_ty = substTyUnchecked (soe_subst rhs_env) in_rhs - (env', bndr1) = case mb_out_bndr of - Just out_bndr -> (env, out_bndr) - Nothing -> subst_opt_bndr env in_bndr - out_bndr = setTyVarUnfolding bndr1 out_ty + = let (env', subst_bndr) = subst_opt_bndr env in_bndr + out_bndr | isTcTyVar subst_bndr = subst_bndr + | otherwise = subst_bndr `setTyVarUnfolding` out_ty in (env', Just (out_bndr, out_ty)) + where + out_ty = substTyUnchecked (soe_subst (soeSetInScope (soeInScope env) rhs_env)) in_ty + bndr_occ = tyVarOccInfo in_bndr + occurs_once {- syntactically -} = isOneOcc bndr_occ && occ_n_br bndr_occ == 1 ---------------------- simple_bind_pair :: SimpleOptEnv @@ -472,15 +482,8 @@ simple_bind_pair :: SimpleOptEnv simple_bind_pair env@(SOE { soe_inl = inl_env, soe_subst = subst }) in_bndr mb_out_bndr clo@(rhs_env, in_rhs) top_level - | Type in_ty <- in_rhs -- let a::* = TYPE ty in - = let - (env', mb_out_bind_type) = simple_bind_type env in_bndr mb_out_bndr (rhs_env, in_ty) - in - case mb_out_bind_type of - Just (out_bndr, out_ty) - | isAtomicTy out_ty -> (env' { soe_subst = extendTvSubst subst in_bndr out_ty }, Nothing) - | otherwise -> (env', Just (out_bndr, Type out_ty)) - Nothing -> (env', Nothing) + | Type in_ty <- in_rhs + = pprPanic "simple_bind_pair" (ppr in_bndr $$ ppr in_ty) | Coercion co <- in_rhs , let out_co = optCoercion (so_co_opts (soe_opts env)) (soe_subst rhs_env) co @@ -805,6 +808,10 @@ wrapLet :: Maybe (Id,CoreExpr) -> CoreExpr -> CoreExpr wrapLet Nothing body = body wrapLet (Just (b,r)) body = Let (NonRec b r) body +wrapTypeLet :: Maybe (TyVar,Type) -> CoreExpr -> CoreExpr +wrapTypeLet Nothing body = body +wrapTypeLet (Just (b,t)) body = Let (NonRec b (Type t)) body + {- Note [Inline prag in simplOpt] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Core/Tidy.hs ===================================== @@ -52,6 +52,13 @@ tidyBind :: TidyEnv -> (TidyEnv, CoreBind) tidyBind env (NonRec bndr rhs) + | isTyVar bndr + = -- pprTrace "tidyBindNonRecType" (ppr bndr) $ + let (env', bndr') = tidyLetBndr env env bndr + tidy_rhs = (tidyExpr env' rhs) + in (env', NonRec bndr' tidy_rhs) + + | otherwise = -- pprTrace "tidyBindNonRec" (ppr bndr) $ let cbv_bndr = (tidyCbvInfoLocal bndr rhs) (env', bndr') = tidyLetBndr env env cbv_bndr @@ -315,9 +322,25 @@ tidyIdBndr env@(tidy_env, var_env) id tidyLetBndr :: TidyEnv -- Knot-tied version for unfoldings -> TidyEnv -- The one to extend - -> Id -> (TidyEnv, Id) + -> Var -> (TidyEnv, Var) -- Used for local (non-top-level) let(rec)s -- Just like tidyIdBndr above, but with more IdInfo +tidyLetBndr rec_tidy_env env@(tidy_env, var_env) tv + | isTyVar tv + = case tidyOccName tidy_env (getOccName tv) of { (tidy_env', occ') -> + let + ki' = tidyType env (tyVarKind tv) + name' = mkInternalName (varUnique tv) occ' noSrcSpan + mb_unf = tyVarUnfolding tv + occ_info = tyVarOccInfo tv + tv' | Just unf <- mb_unf = mkTyVarWithUnfolding name' ki' (tidyType rec_tidy_env unf) + | otherwise = mkTyVar name' ki' + tv'' = tv' `setTyVarOccInfo` occ_info + var_env' = extendVarEnv var_env tv tv'' + + in + ((tidy_env', var_env'), tv') } + tidyLetBndr rec_tidy_env env@(tidy_env, var_env) id = case tidyOccName tidy_env (getOccName id) of { (tidy_env', occ') -> let ===================================== compiler/GHC/Core/TyCo/Compare.hs ===================================== @@ -146,8 +146,9 @@ mayLookIdentical orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] + -- See Note [Comparing nullary type synonyms and type variables] go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True + go _ (TyVarTy tv1) (TyVarTy tv2) | tv1 == tv2 = True go env t1 t2 | Just t1' <- coreView t1 = go env t1' t2 go env t1 t2 | Just t2' <- coreView t2 = go env t1 t2' @@ -228,13 +229,14 @@ tc_eq_type keep_syns orig_ty1 orig_ty2 orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2] view - | keep_syns = unfoldView + | keep_syns = unfoldView -- We still want to look through let-bound type variables + -- See Note [Type and coercion lets] in GHC.Core | otherwise = coreView go :: RnEnv2 -> Type -> Type -> Bool - -- See Note [Comparing nullary type synonyms] + -- See Note [Comparing nullary type synonyms and type variables] go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = True - go _ (TyVarTy tv1) (TyVarTy tv2) | tv1 == tv2 = True + go _ (TyVarTy tv1) (TyVarTy tv2) | tv1 == tv2 = True go env t1 t2 | Just t1' <- view t1 = go env t1' t2 go env t1 t2 | Just t2' <- view t2 = go env t1 t2' @@ -462,8 +464,8 @@ But the left is an AppTy while the right is a TyConApp. The solution is to use splitAppTyNoView_maybe to break up the TyConApp into its pieces and then continue. Easy to do, but also easy to forget to do. -Note [Comparing nullary type synonyms] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Comparing nullary type synonyms and type variables] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the task of testing equality between two 'Type's of the form TyConApp tc [] @@ -491,6 +493,10 @@ since GHC prefers to use the type synonym over @TYPE 'LiftedRep@ applications whenever possible. See Note [Using synonyms to compress types] in GHC.Core.Type for details. +As coreView also expands let-bound type variables (c.f. Note [Type and coercion lets] +in GHC.Core) into their unfolding, we want the same short-cutting behavior. +After all, type variables are similar in nature to nullary type synonyms. + -} eqType :: Type -> Type -> Bool @@ -607,7 +613,7 @@ nonDetCmpTypeX env orig_t1 orig_t2 = -- Returns both the resulting ordering relation between -- the two types and whether either contains a cast. go :: RnEnv2 -> Type -> Type -> TypeOrdering - -- See Note [Comparing nullary type synonyms] + -- See Note [Comparing nullary type synonyms and type variables] go _ (TyConApp tc1 []) (TyConApp tc2 []) | tc1 == tc2 = TEQ ===================================== compiler/GHC/Core/TyCo/Rep.hs ===================================== @@ -62,6 +62,7 @@ module GHC.Core.TyCo.Rep ( -- * Sizes typeSize, typesSize, coercionSize, provSize, + typeIsSmallEnoughToInline, -- * Multiplicities Scaled(..), scaledMult, scaledThing, mapScaledType, Mult @@ -1930,6 +1931,9 @@ provSize (PhantomProv co) = 1 + coercionSize co provSize (ProofIrrelProv co) = 1 + coercionSize co provSize (PluginProv _) = 1 +typeIsSmallEnoughToInline :: Type -> Bool +typeIsSmallEnoughToInline ty = typeSize ty <= 1 + {- ************************************************************************ * * ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -118,6 +118,8 @@ module GHC.Core.Type ( isValidJoinPointType, tyConAppNeedsKindSig, + typeIsSmallEnoughToInline, + -- * Space-saving construction mkTYPEapp, mkTYPEapp_maybe, mkCONSTRAINTapp, mkCONSTRAINTapp_maybe, @@ -362,6 +364,7 @@ import GHC.Data.Maybe ( orElse, isJust, firstJust ) -} unfoldView :: Type -> Maybe Type +-- Look through type variables, see Note [Type and coercion lets] in GHC.Core {-# INLINE unfoldView #-} unfoldView (TyVarTy tv) = tyVarUnfolding tv unfoldView _ = Nothing @@ -390,7 +393,7 @@ coreView :: Type -> Maybe Type -- By being non-recursive and inlined, this case analysis gets efficiently -- joined onto the case analysis that the caller is already doing coreView (TyConApp tc tys) = expandSynTyConApp_maybe tc tys -coreView (TyVarTy tv) = tyVarUnfolding tv +coreView (TyVarTy tv) = tyVarUnfolding tv -- c.f. unfoldView coreView _ = Nothing -- See Note [Inlining coreView]. {-# INLINE coreView #-} @@ -403,6 +406,7 @@ coreFullView, core_full_view :: Type -> Type coreFullView ty@(TyConApp tc _) | isTypeSynonymTyCon tc = core_full_view ty coreFullView (TyVarTy tv) + -- c.f. unfoldView | Just ty <- tyVarUnfolding tv = core_full_view ty coreFullView ty = ty {-# INLINE coreFullView #-} @@ -2718,8 +2722,8 @@ sORTKind_maybe :: Kind -> Maybe (TypeOrConstraint, Type) -- -- This is a "hot" function. Do not call splitTyConApp_maybe here, -- to avoid the faff with FunTy -sORTKind_maybe ty - | Just ty <- unfoldView ty +sORTKind_maybe (TyVarTy tv) + | Just ty <- tyVarUnfolding tv = sORTKind_maybe ty sORTKind_maybe (TyConApp tc tys) -- First, short-cuts for Type and Constraint that do no allocation ===================================== compiler/GHC/Core/Unify.hs ===================================== @@ -1065,10 +1065,14 @@ unify_ty :: UMEnv -- See Note [Specification of unification] -- Respects newtypes, PredTypes -- See Note [Computing equality on types] in GHC.Core.Type + +-- See Note [Comparing nullary type synonyms and type variables] in GHC.Core.TyCo.Compare unify_ty _env (TyConApp tc1 []) (TyConApp tc2 []) _kco - -- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare | tc1 == tc2 = return () +unify_ty _env (TyVarTy tv1) (TyVarTy tv2) _kco + | tv1 == tv2 + = return () unify_ty env ty1 ty2 kco -- Now handle the cases we can "look through": synonyms and casts. ===================================== compiler/GHC/Core/Utils.hs ===================================== @@ -53,8 +53,9 @@ module GHC.Core.Utils ( -- * StaticPtr collectMakeStaticArgs, - -- * Join points + -- * Predicates on binds isJoinBind, + isTypeBind, -- * Tag inference mkStrictFieldSeqs, shouldStrictifyIdForCbv, shouldUseCbvForId, @@ -2653,17 +2654,22 @@ collectMakeStaticArgs _ = Nothing {- ************************************************************************ * * -\subsection{Join points} +\subsection{Predicates on binds} * * ************************************************************************ -} --- | Does this binding bind a join point (or a recursive group of join points)? isJoinBind :: CoreBind -> Bool isJoinBind (NonRec b _) = isJoinId b isJoinBind (Rec ((b, _) : _)) = isJoinId b isJoinBind _ = False +-- | Does this binding bind a type? +isTypeBind :: CoreBind -> Bool +-- See Note [Type and coercion lets] in GHC.Core +isTypeBind (NonRec b (Type _)) = isTyVar b +isTypeBind _ = False + dumpIdInfoOfProgram :: Bool -> (IdInfo -> SDoc) -> CoreProgram -> SDoc dumpIdInfoOfProgram dump_locals ppr_id_info binds = vcat (map printId ids) where ===================================== compiler/GHC/CoreToIface.hs ===================================== @@ -432,7 +432,15 @@ toIfaceBang _ (HsStrict _) = IfStrict toIfaceSrcBang :: HsSrcBang -> IfaceSrcBang toIfaceSrcBang (HsSrcBang _ unpk bang) = IfSrcBang unpk bang -toIfaceLetBndr :: Id -> IfaceLetBndr +toIfaceLetBndr :: Var -> IfaceLetBndr +toIfaceLetBndr tv + | isTyVar tv = IfTypeLetBndr (occNameFS (getOccName (tyVarName tv))) + (toIfaceKind (tyVarKind tv)) + info + where + info | Just unf <- tyVarUnfolding tv = [HsTypeUnfold (toIfaceType unf)] + | otherwise = [] + toIfaceLetBndr id = IfLetBndr (occNameFS (getOccName id)) (toIfaceType (idType id)) (toIfaceIdInfo (idInfo id)) ===================================== compiler/GHC/CoreToStg.hs ===================================== @@ -52,7 +52,7 @@ import GHC.Builtin.PrimOps import GHC.Utils.Outputable import GHC.Utils.Monad -import GHC.Utils.Misc (HasDebugCallStack) +import GHC.Utils.Misc (HasDebugCallStack, HasCallStack) import GHC.Utils.Panic import Control.Monad (ap) @@ -228,7 +228,7 @@ import Control.Monad (ap) -- -------------------------------------------------------------- -coreToStg :: CoreToStgOpts -> Module -> ModLocation -> CoreProgram +coreToStg :: HasCallStack => CoreToStgOpts -> Module -> ModLocation -> CoreProgram -> ([StgTopBinding], InfoTableProvMap, CollectedCCs) coreToStg opts at CoreToStgOpts { coreToStg_ways = ways @@ -260,7 +260,7 @@ coreToStg opts at CoreToStgOpts (all_cafs_cc, all_cafs_ccs) = getAllCAFsCC this_mod coreTopBindsToStg - :: CoreToStgOpts + :: HasCallStack => CoreToStgOpts -> Module -> IdEnv HowBound -- environment for the bindings -> CollectedCCs @@ -273,13 +273,13 @@ coreTopBindsToStg opts this_mod env ccs (b:bs) | NonRec _ rhs <- b, isTyCoArg rhs = coreTopBindsToStg opts this_mod env1 ccs1 bs | otherwise - = (env2, ccs2, b':bs') + = assertPpr (not (isTypeBind b)) (ppr b) $ (env2, ccs2, b':bs') where (env1, ccs1, b' ) = coreTopBindToStg opts this_mod env ccs b (env2, ccs2, bs') = coreTopBindsToStg opts this_mod env1 ccs1 bs coreTopBindToStg - :: CoreToStgOpts + :: HasCallStack => CoreToStgOpts -> Module -> IdEnv HowBound -> CollectedCCs @@ -304,6 +304,7 @@ coreTopBindToStg opts at CoreToStgOpts (ccs', (id', stg_rhs)) = initCts platform env $ + pprTrace "coreTopBindToStg" (ppr id $$ ppr rhs) $ coreToTopStgRhs opts this_mod ccs (id,rhs) bind = StgTopLifted $ StgNonRec id' stg_rhs @@ -331,7 +332,7 @@ coreTopBindToStg opts at CoreToStgOpts (env', ccs', bind) coreToTopStgRhs - :: CoreToStgOpts + :: HasCallStack => CoreToStgOpts -> Module -> CollectedCCs -> (Id,CoreExpr) @@ -375,7 +376,7 @@ coreToTopStgRhs opts this_mod ccs (bndr, rhs) -- handle with the function coreToPreStgRhs. coreToStgExpr - :: HasDebugCallStack => CoreExpr + :: HasCallStack => CoreExpr -> CtsM StgExpr -- The second and third components can be derived in a simple bottom up pass, not @@ -693,9 +694,10 @@ data PreStgRhs = PreStgRhs [Id] StgExpr Type -- The [Id] is empty for thunks -- Convert the RHS of a binding from Core to STG. This is a wrapper around -- coreToStgExpr that can handle value lambdas. -coreToPreStgRhs :: HasDebugCallStack => CoreExpr -> CtsM PreStgRhs +coreToPreStgRhs :: HasCallStack => CoreExpr -> CtsM PreStgRhs coreToPreStgRhs expr - = extendVarEnvCts [ (a, LambdaBound) | a <- args' ] $ + = pprTrace "coreToPreStgRhs" (ppr expr) $ + extendVarEnvCts [ (a, LambdaBound) | a <- args' ] $ do { body' <- coreToStgExpr body ; return (PreStgRhs args' body' (exprType body)) } where ===================================== compiler/GHC/CoreToStg/Prep.hs ===================================== @@ -242,7 +242,10 @@ corePrepTopBinds initialCorePrepEnv binds = go initialCorePrepEnv binds where go _ [] = return emptyFloats - go env (bind : binds) = do (env', floats, maybe_new_bind) + go env (bind : binds) | isTypeBind bind + = go env binds + | otherwise + = do (env', floats, maybe_new_bind) <- cpeBind TopLevel env bind massert (isNothing maybe_new_bind) -- Only join points get returned this way by @@ -775,6 +778,9 @@ cpeRhsE env expr@(Var {}) = cpeApp env expr cpeRhsE env expr@(App {}) = cpeApp env expr cpeRhsE env (Let bind body) + | isTypeBind bind + = cpeRhsE env body + | otherwise = do { (env', bind_floats, maybe_bind') <- cpeBind NotTopLevel env bind ; (body_floats, body') <- cpeRhsE env' body ; let expr' = case maybe_bind' of Just bind' -> Let bind' body' ===================================== compiler/GHC/Iface/Rename.hs ===================================== @@ -583,12 +583,19 @@ rnIfaceAxBranch d = do rnIfaceIdInfo :: Rename IfaceIdInfo rnIfaceIdInfo = mapM rnIfaceInfoItem +rnIfaceTyVarInfo :: Rename IfaceTyVarInfo +rnIfaceTyVarInfo = mapM rnIfaceTyVarInfoItem + rnIfaceInfoItem :: Rename IfaceInfoItem rnIfaceInfoItem (HsUnfold lb if_unf) = HsUnfold lb <$> rnIfaceUnfolding if_unf rnIfaceInfoItem i = pure i +rnIfaceTyVarInfoItem :: Rename IfaceTyVarInfoItem +rnIfaceTyVarInfoItem (HsTypeUnfold if_unf) + = HsTypeUnfold <$> rnIfaceType if_unf + rnIfaceUnfolding :: Rename IfaceUnfolding rnIfaceUnfolding (IfCoreUnfold src cache guide if_expr) = IfCoreUnfold src cache guide <$> rnIfaceExpr if_expr @@ -650,6 +657,8 @@ rnIfaceConAlt alt = pure alt rnIfaceLetBndr :: Rename IfaceLetBndr rnIfaceLetBndr (IfLetBndr fs ty info jpi) = IfLetBndr fs <$> rnIfaceType ty <*> rnIfaceIdInfo info <*> pure jpi +rnIfaceLetBndr (IfTypeLetBndr fs ki info) + = IfTypeLetBndr fs <$> rnIfaceType ki <*> rnIfaceTyVarInfo info rnIfaceLamBndr :: Rename IfaceLamBndr rnIfaceLamBndr (bndr, oneshot) = (,) <$> rnIfaceBndr bndr <*> pure oneshot ===================================== compiler/GHC/Iface/Syntax.hs ===================================== @@ -16,6 +16,7 @@ module GHC.Iface.Syntax ( IfaceBindingX(..), IfaceMaybeRhs(..), IfaceConAlt(..), IfaceIdInfo, IfaceIdDetails(..), IfaceUnfolding(..), IfGuidance(..), IfaceInfoItem(..), IfaceRule(..), IfaceAnnotation(..), IfaceAnnTarget, + IfaceTyVarInfo, IfaceTyVarInfoItem(..), IfaceWarnings(..), IfaceWarningTxt(..), IfaceStringLiteral(..), IfaceClsInst(..), IfaceFamInst(..), IfaceTickish(..), IfaceClassBody(..), IfaceBooleanFormula(..), @@ -420,6 +421,11 @@ data IfGuidance -- implicit ones are needed here, because they are not put in -- interface files +type IfaceTyVarInfo = [IfaceTyVarInfoItem] + +data IfaceTyVarInfoItem + = HsTypeUnfold IfaceType + data IfaceIdDetails = IfVanillaId | IfWorkerLikeId [CbvMark] @@ -653,10 +659,14 @@ data IfaceBindingX r b | IfaceRec [(b, r)] deriving (Functor, Foldable, Traversable, Ord, Eq) --- IfaceLetBndr is like IfaceIdBndr, but has IdInfo too +-- IfaceLetBndr is like IfaceIdBndr, but has additional information too -- It's used for *non-top-level* let/rec binders --- See Note [IdInfo on nested let-bindings] -data IfaceLetBndr = IfLetBndr IfLclName IfaceType IfaceIdInfo JoinPointHood +data IfaceLetBndr + -- See Note [IdInfo on nested let-bindings] + = IfLetBndr IfLclName IfaceType IfaceIdInfo JoinPointHood + + -- See Note [Type and coercion lets] + | IfTypeLetBndr IfLclName IfaceKind IfaceTyVarInfo data IfaceTopBndrInfo = IfLclTopBndr IfLclName IfaceType IfaceIdInfo IfaceIdDetails | IfGblTopBndr IfaceTopBndr @@ -1531,6 +1541,9 @@ ppr_bind :: (IfaceLetBndr, IfaceExpr) -> SDoc ppr_bind (IfLetBndr b ty info ji, rhs) = sep [hang (ppr b <+> dcolon <+> ppr ty) 2 (ppr ji <+> ppr info), equals <+> pprIfaceExpr noParens rhs] +ppr_bind (IfTypeLetBndr b ki info, rhs) + = sep [hang (char '@' <> ppr b <+> dcolon <+> ppr ki) 2 (ppr info), + equals <+> pprIfaceExpr noParens rhs] ------------------ pprIfaceTickish :: IfaceTickish -> SDoc @@ -1577,6 +1590,10 @@ instance Outputable IfaceInfoItem where ppr (HsLFInfo lf_info) = text "LambdaFormInfo:" <+> ppr lf_info ppr (HsTagSig tag_sig) = text "TagSig:" <+> ppr tag_sig +instance Outputable IfaceTyVarInfoItem where + ppr (HsTypeUnfold unf) = text "Unfolding" + <> colon <+> ppr unf + instance Outputable IfaceUnfolding where ppr (IfCoreUnfold src _ guide e) = sep [ text "Core:" <+> ppr src <+> ppr guide, ppr e ] @@ -1816,6 +1833,8 @@ freeNamesIfLetBndr :: IfaceLetBndr -> NameSet -- local INLINE pragmas), so look there too freeNamesIfLetBndr (IfLetBndr _name ty info _ji) = freeNamesIfType ty &&& freeNamesIfIdInfo info +freeNamesIfLetBndr (IfTypeLetBndr _name ki info) = freeNamesIfKind ki + &&& freeNamesIfTyVarInfo info freeNamesIfTvBndr :: IfaceTvBndr -> NameSet freeNamesIfTvBndr (_fs,k) = freeNamesIfKind k @@ -1827,11 +1846,17 @@ freeNamesIfIdBndr (_, _fs,k) = freeNamesIfKind k freeNamesIfIdInfo :: IfaceIdInfo -> NameSet freeNamesIfIdInfo = fnList freeNamesItem +freeNamesIfTyVarInfo :: IfaceTyVarInfo -> NameSet +freeNamesIfTyVarInfo = fnList freeNamesTyVarItem + freeNamesItem :: IfaceInfoItem -> NameSet freeNamesItem (HsUnfold _ u) = freeNamesIfUnfold u freeNamesItem (HsLFInfo (IfLFCon n)) = unitNameSet n freeNamesItem _ = emptyNameSet +freeNamesTyVarItem :: IfaceTyVarInfoItem -> NameSet +freeNamesTyVarItem (HsTypeUnfold u) = freeNamesIfType u + freeNamesIfUnfold :: IfaceUnfolding -> NameSet freeNamesIfUnfold (IfCoreUnfold _ _ _ e) = freeNamesIfExpr e freeNamesIfUnfold (IfDFunUnfold bs es) = freeNamesIfBndrs bs &&& fnList freeNamesIfExpr es @@ -2405,6 +2430,15 @@ instance Binary IfaceInfoItem where 7 -> HsLFInfo <$> get bh _ -> HsTagSig <$> get bh +instance Binary IfaceTyVarInfoItem where + put_ bh (HsTypeUnfold ad) = putByte bh 0 >> put_ bh ad + + get :: BinHandle -> IO IfaceTyVarInfoItem + get bh = do + h <- getByte bh + case h of + _ -> HsTypeUnfold <$> get bh + instance Binary IfaceUnfolding where put_ bh (IfCoreUnfold s c g e) = do putByte bh 0 @@ -2654,15 +2688,31 @@ instance (Binary r, Binary b) => Binary (IfaceBindingX b r) where instance Binary IfaceLetBndr where put_ bh (IfLetBndr a b c d) = do + putByte bh 0 put_ bh a put_ bh b put_ bh c put_ bh d - get bh = do a <- get bh - b <- get bh - c <- get bh - d <- get bh - return (IfLetBndr a b c d) + + put_ bh (IfTypeLetBndr a b c) = do + putByte bh 1 + put_ bh a + put_ bh b + put_ bh c + get bh = do + h <- getByte bh + case h of + 0 -> do + a <- get bh + b <- get bh + c <- get bh + d <- get bh + return (IfLetBndr a b c d) + _ -> do + a <- get bh + b <- get bh + c <- get bh + return (IfTypeLetBndr a b c) instance Binary IfaceTopBndrInfo where put_ bh (IfLclTopBndr lcl ty info dets) = do @@ -2816,6 +2866,10 @@ instance NFData IfaceInfoItem where HsLFInfo lf_info -> lf_info `seq` () -- TODO: seq further? HsTagSig sig -> sig `seq` () +instance NFData IfaceTyVarInfoItem where + rnf = \case + HsTypeUnfold unf -> rnf unf + instance NFData IfGuidance where rnf = \case IfNoGuidance -> () @@ -2864,6 +2918,8 @@ instance NFData IfaceMaybeRhs where instance NFData IfaceLetBndr where rnf (IfLetBndr nm ty id_info join_info) = rnf nm `seq` rnf ty `seq` rnf id_info `seq` rnf join_info + rnf (IfTypeLetBndr nm ki tv_info) = + rnf nm `seq` rnf ki `seq` rnf tv_info instance NFData IfaceFamTyConFlav where rnf = \case ===================================== compiler/GHC/IfaceToCore.hs ===================================== @@ -1592,6 +1592,22 @@ tcIfaceExpr (IfaceLet (IfaceNonRec (IfLetBndr fs ty info ji) rhs) body) ; body' <- extendIfaceIdEnv [id] (tcIfaceExpr body) ; return (Let (NonRec id rhs') body') } +tcIfaceExpr (IfaceLet (IfaceNonRec (IfTypeLetBndr fs ki info) rhs) body) + = case rhs of + IfaceType ty -> + do { name <- newIfaceName (mkVarOccFS fs) + ; ki' <- tcIfaceType ki + ; mb_unf <- extract_unf info + ; let tv | Just unf <- mb_unf = mkTyVarWithUnfolding name ki' unf + | otherwise = mkTyVar name ki' + ; ty' <- tcIfaceType ty + ; body' <- extendIfaceTyVarEnv [tv] (tcIfaceExpr body) + ; return (Let (NonRec tv (Type ty')) body') } + _ -> pprPanic "tcIfaceExpr:IfaceTypeLet" (ppr rhs) + where + extract_unf [] = return Nothing + extract_unf (HsTypeUnfold unf : _) = Just <$> tcIfaceType unf + tcIfaceExpr (IfaceLet (IfaceRec pairs) body) = do { ids <- mapM tc_rec_bndr (map fst pairs) ; extendIfaceIdEnv ids $ do @@ -1603,11 +1619,16 @@ tcIfaceExpr (IfaceLet (IfaceRec pairs) body) = do { name <- newIfaceName (mkVarOccFS fs) ; ty' <- tcIfaceType ty ; return (mkLocalId name ManyTy ty' `asJoinId_maybe` ji) } + tc_rec_bndr (IfTypeLetBndr fs ki _) + = pprPanic "tcIfaceExpr" (char '@' <> ppr fs <+> dcolon <+> ppr ki) + tc_pair (IfLetBndr _ _ info _, rhs) id = do { rhs' <- tcIfaceExpr rhs ; id_info <- tcIdInfo False {- Don't ignore prags; we are inside one! -} NotTopLevel (idName id) (idType id) info ; return (setIdInfo id id_info, rhs') } + tc_pair (IfTypeLetBndr fs ki _, ty) tv + = pprPanic "tcIfaceExpr" (char '@' <> ppr fs <+> dcolon <+> ppr ki $$ ppr ty $$ ppr tv) tcIfaceExpr (IfaceTick tickish expr) = do expr' <- tcIfaceExpr expr ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -305,7 +305,8 @@ can_eq_nc -> Type -> Type -- RHS, after and before type-synonym expansion, resp -> TcS (StopOrContinue (Either IrredCt EqCt)) --- See Note [Comparing nullary type synonyms] in GHC.Core.TyCo.Compare +-- See Note [Comparing nullary type synonyms and type variables] in GHC.Core.TyCo.Compare +-- We don't need it for (immutable) type variables because they don't exist at this stage. can_eq_nc _flat _rdr_env _envs ev eq_rel ty1@(TyConApp tc1 []) _ps_ty1 (TyConApp tc2 []) _ps_ty2 | tc1 == tc2 = canEqReflexive ev eq_rel ty1 ===================================== compiler/GHC/Types/Var.hs ===================================== @@ -259,7 +259,7 @@ data Var -- cached here for speed varType :: Kind, -- ^ The type or kind of the 'Var' in question tv_unfolding :: Maybe Type, -- ^ The type to which the variable is bound to, - -- if any. + -- if any, see Note [Type and coercion lets] in GHC.Core tv_occ_info :: OccInfo } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/80ffac20b1ca82855908d73d69717901a02d034e...9324ed073bb61115a061f8a1bdcc50a97f0cb4f7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/80ffac20b1ca82855908d73d69717901a02d034e...9324ed073bb61115a061f8a1bdcc50a97f0cb4f7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 12:38:04 2024 From: gitlab at gitlab.haskell.org (josephf (@josephf)) Date: Wed, 24 Jul 2024 08:38:04 -0400 Subject: [Git][ghc/ghc][wip/type-sharing] cleanup: remove NOINLINE on tyVarOccInfo Message-ID: <66a0f5acab6df_1749c762f80444cd@gitlab.mail> josephf pushed to branch wip/type-sharing at Glasgow Haskell Compiler / GHC Commits: 2917b910 by Joseph Fourment at 2024-07-24T14:37:56+02:00 cleanup: remove NOINLINE on tyVarOccInfo - - - - - 1 changed file: - compiler/GHC/Types/Var.hs Changes: ===================================== compiler/GHC/Types/Var.hs ===================================== @@ -1100,7 +1100,6 @@ tyVarUnfolding _ = Nothing tyVarOccInfo :: TyVar -> OccInfo tyVarOccInfo (TcTyVar {}) = noOccInfo tyVarOccInfo tv = assertPpr (isTyVar tv) (ppr tv) $ tv_occ_info tv -{-# NOINLINE tyVarOccInfo #-} setTyVarUnique :: TyVar -> Unique -> TyVar setTyVarUnique = setVarUnique View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2917b910bf5a5d88ea127b4fd7c988cbd7764fa7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2917b910bf5a5d88ea127b4fd7c988cbd7764fa7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 13:20:40 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Wed, 24 Jul 2024 09:20:40 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] async001: Adjust waiting time (for slow machines) Message-ID: <66a0ffa86a520_1749c7a27a8814167@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: f90036f3 by Sven Tennie at 2024-07-24T13:20:05+00:00 async001: Adjust waiting time (for slow machines) - - - - - 1 changed file: - testsuite/tests/concurrent/should_run/async001.hs Changes: ===================================== testsuite/tests/concurrent/should_run/async001.hs ===================================== @@ -13,7 +13,7 @@ main = do `onException` return () t <- forkIO $ do evaluate x; return () - threadDelay 1000 + threadDelay 2000 killThread t print x `E.catch` \e -> putStrLn ("main caught: " ++ show (e::SomeException)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f90036f37886edbe1aae4ceedbc3a0cda3c93f73 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f90036f37886edbe1aae4ceedbc3a0cda3c93f73 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 15:02:15 2024 From: gitlab at gitlab.haskell.org (Artin Ghasivand (@Ei30metry)) Date: Wed, 24 Jul 2024 11:02:15 -0400 Subject: [Git][ghc/ghc][wip/T24467] 4319 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <66a117772ac9_37cee64405982348a@gitlab.mail> Artin Ghasivand pushed to branch wip/T24467 at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - 24 changed files: - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - CODEOWNERS - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f8aa6a145748602b4b68c836518bd8f8c426862b...55117e13765f2fc2a8b01a377433553c5fd29719 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f8aa6a145748602b4b68c836518bd8f8c426862b...55117e13765f2fc2a8b01a377433553c5fd29719 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 16:23:12 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 24 Jul 2024 12:23:12 -0400 Subject: [Git][ghc/ghc][master] Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types Message-ID: <66a12a7036d71_37cee68b722027460@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - 7 changed files: - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 Changes: ===================================== libraries/base/changelog.md ===================================== @@ -14,6 +14,7 @@ * Add `inits1` and `tails1` to `Data.List`, factored from the corresponding functions in `Data.List.NonEmpty` ([CLC proposal #252](https://github.com/haskell/core-libraries-committee/issues/252)) * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) + * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/Data/Functor/Classes.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE Safe #-} @@ -78,12 +79,13 @@ import Data.List.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) -import GHC.Generics (Generic1(..), Generically1(..)) +import GHC.Generics (Generic1(..), Generically1(..), V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..) , (:+:)(..), (:*:)(..), (:.:)(..), URec(..), UAddr, UChar, UDouble, UFloat, UInt, UWord) import GHC.Tuple (Solo (..)) -import GHC.Internal.Read (expectP, list, paren) +import GHC.Internal.Read (expectP, list, paren, readField) +import GHC.Internal.Show (appPrec) -import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) -import GHC.Internal.Text.Read (Read(..), parens, prec, step) +import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec, pfail) +import GHC.Internal.Text.Read (Read(..), parens, prec, step, reset) import GHC.Internal.Text.Read.Lex (Lexeme(..)) import GHC.Internal.Text.Show (showListWith) import Prelude @@ -1123,3 +1125,322 @@ and the corresponding 'Show1' instance as > showsBinaryWith sp (liftShowsPrec sp sl) "Two" d x y -} + +-- | @since base-4.21.0.0 +instance Eq1 V1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 V1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 V1 where + liftShowsPrec _ _ _ = \_ -> showString "V1" + +-- | @since base-4.21.0.0 +instance Read1 V1 where + liftReadsPrec _ _ = readPrec_to_S pfail + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 U1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 U1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 U1 where + liftShowsPrec _ _ _ = \U1 -> showString "U1" + +-- | @since base-4.21.0.0 +instance Read1 U1 where + liftReadPrec _ _ = + parens (expectP (Ident "U1") *> pure U1) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 Par1 where + liftEq eq = \(Par1 a) (Par1 a') -> eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 Par1 where + liftCompare cmp = \(Par1 a) (Par1 a') -> cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 Par1 where + liftShowsPrec sp _ d = \(Par1 { unPar1 = a }) -> + showsSingleFieldRecordWith sp "Par1" "unPar1" d a + +-- | @since base-4.21.0.0 +instance Read1 Par1 where + liftReadPrec rp _ = + readsSingleFieldRecordWith rp "Par1" "unPar1" Par1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (Rec1 f) where + liftEq eq = \(Rec1 a) (Rec1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (Rec1 f) where + liftCompare cmp = \(Rec1 a) (Rec1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (Rec1 f) where + liftShowsPrec sp sl d = \(Rec1 { unRec1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "Rec1" "unRec1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (Rec1 f) where + liftReadPrec rp rl = + readsSingleFieldRecordWith (liftReadPrec rp rl) "Rec1" "unRec1" Rec1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq c => Eq1 (K1 i c) where + liftEq _ = \(K1 a) (K1 a') -> a == a' + +-- | @since base-4.21.0.0 +instance Ord c => Ord1 (K1 i c) where + liftCompare _ = \(K1 a) (K1 a') -> compare a a' + +-- | @since base-4.21.0.0 +instance Show c => Show1 (K1 i c) where + liftShowsPrec _ _ d = \(K1 { unK1 = a }) -> + showsSingleFieldRecordWith showsPrec "K1" "unK1" d a + +-- | @since base-4.21.0.0 +instance Read c => Read1 (K1 i c) where + liftReadPrec _ _ = readData $ + readsSingleFieldRecordWith readPrec "K1" "unK1" K1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (M1 i c f) where + liftEq eq = \(M1 a) (M1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (M1 i c f) where + liftCompare cmp = \(M1 a) (M1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (M1 i c f) where + liftShowsPrec sp sl d = \(M1 { unM1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "M1" "unM1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (M1 i c f) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith (liftReadPrec rp rl) "M1" "unM1" M1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :+: g) where + liftEq eq = \lhs rhs -> case (lhs, rhs) of + (L1 a, L1 a') -> liftEq eq a a' + (R1 b, R1 b') -> liftEq eq b b' + _ -> False + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :+: g) where + liftCompare cmp = \lhs rhs -> case (lhs, rhs) of + (L1 _, R1 _) -> LT + (R1 _, L1 _) -> GT + (L1 a, L1 a') -> liftCompare cmp a a' + (R1 b, R1 b') -> liftCompare cmp b b' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :+: g) where + liftShowsPrec sp sl d = \x -> case x of + L1 a -> showsUnaryWith (liftShowsPrec sp sl) "L1" d a + R1 b -> showsUnaryWith (liftShowsPrec sp sl) "R1" d b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :+: g) where + liftReadPrec rp rl = readData $ + readUnaryWith (liftReadPrec rp rl) "L1" L1 <|> + readUnaryWith (liftReadPrec rp rl) "R1" R1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :*: g) where + liftEq eq = \(f :*: g) (f' :*: g') -> liftEq eq f f' && liftEq eq g g' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :*: g) where + liftCompare cmp = \(f :*: g) (f' :*: g') -> liftCompare cmp f f' <> liftCompare cmp g g' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :*: g) where + liftShowsPrec sp sl d = \(a :*: b) -> + showsBinaryOpWith + (liftShowsPrec sp sl) + (liftShowsPrec sp sl) + 7 + ":*:" + d + a + b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :*: g) where + liftReadPrec rp rl = parens $ prec 6 $ + readBinaryOpWith (liftReadPrec rp rl) (liftReadPrec rp rl) ":*:" (:*:) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where + liftEq eq = \(Comp1 a) (Comp1 a') -> liftEq (liftEq eq) a a' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where + liftCompare cmp = \(Comp1 a) (Comp1 a') -> liftCompare (liftCompare cmp) a a' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :.: g) where + liftShowsPrec sp sl d = \(Comp1 { unComp1 = a }) -> + showsSingleFieldRecordWith + (liftShowsPrec (liftShowsPrec sp sl) (liftShowList sp sl)) + "Comp1" + "unComp1" + d + a + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :.: g) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith + (liftReadPrec (liftReadPrec rp rl) (liftReadListPrec rp rl)) + "Comp1" + "unComp1" + Comp1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 UAddr where + -- NB cannot use eqAddr# because its module isn't safe + liftEq _ = \(UAddr a) (UAddr b) -> UAddr a == UAddr b + +-- | @since base-4.21.0.0 +instance Ord1 UAddr where + liftCompare _ = \(UAddr a) (UAddr b) -> compare (UAddr a) (UAddr b) + +-- | @since base-4.21.0.0 +instance Show1 UAddr where + liftShowsPrec _ _ = showsPrec + +-- NB no Read1 for URec (Ptr ()) because there's no Read for Ptr. + +-- | @since base-4.21.0.0 +instance Eq1 UChar where + liftEq _ = \(UChar a) (UChar b) -> UChar a == UChar b + +-- | @since base-4.21.0.0 +instance Ord1 UChar where + liftCompare _ = \(UChar a) (UChar b) -> compare (UChar a) (UChar b) + +-- | @since base-4.21.0.0 +instance Show1 UChar where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UDouble where + liftEq _ = \(UDouble a) (UDouble b) -> UDouble a == UDouble b + +-- | @since base-4.21.0.0 +instance Ord1 UDouble where + liftCompare _ = \(UDouble a) (UDouble b) -> compare (UDouble a) (UDouble b) + +-- | @since base-4.21.0.0 +instance Show1 UDouble where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UFloat where + liftEq _ = \(UFloat a) (UFloat b) -> UFloat a == UFloat b + +-- | @since base-4.21.0.0 +instance Ord1 UFloat where + liftCompare _ = \(UFloat a) (UFloat b) -> compare (UFloat a) (UFloat b) + +-- | @since base-4.21.0.0 +instance Show1 UFloat where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UInt where + liftEq _ = \(UInt a) (UInt b) -> UInt a == UInt b + +-- | @since base-4.21.0.0 +instance Ord1 UInt where + liftCompare _ = \(UInt a) (UInt b) -> compare (UInt a) (UInt b) + +-- | @since base-4.21.0.0 +instance Show1 UInt where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UWord where + liftEq _ = \(UWord a) (UWord b) -> UWord a == UWord b + +-- | @since base-4.21.0.0 +instance Ord1 UWord where + liftCompare _ = \(UWord a) (UWord b) -> compare (UWord a) (UWord b) + +-- | @since base-4.21.0.0 +instance Show1 UWord where + liftShowsPrec _ _ = showsPrec + +showsSingleFieldRecordWith :: (Int -> a -> ShowS) -> String -> String -> Int -> a -> ShowS +showsSingleFieldRecordWith sp name field d x = + showParen (d > appPrec) $ + showString name . showString " {" . showString field . showString " = " . sp 0 x . showChar '}' + +readsSingleFieldRecordWith :: ReadPrec a -> String -> String -> (a -> t) -> ReadPrec t +readsSingleFieldRecordWith rp name field cons = parens $ prec 11 $ do + expectP $ Ident name + expectP $ Punc "{" + x <- readField field $ reset rp + expectP $ Punc "}" + pure $ cons x + +showsBinaryOpWith + :: (Int -> a -> ShowS) + -> (Int -> b -> ShowS) + -> Int + -> String + -> Int + -> a + -> b + -> ShowS +showsBinaryOpWith sp1 sp2 opPrec name d x y = showParen (d >= opPrec) $ + sp1 opPrec x . showChar ' ' . showString name . showChar ' ' . sp2 opPrec y + +readBinaryOpWith + :: ReadPrec a + -> ReadPrec b + -> String + -> (a -> b -> t) + -> ReadPrec t +readBinaryOpWith rp1 rp2 name cons = + cons <$> step rp1 <* expectP (Symbol name) <*> step rp2 ===================================== libraries/ghc-internal/src/GHC/Internal/Generics.hs ===================================== @@ -735,7 +735,7 @@ import GHC.Internal.Data.Maybe ( Maybe(..), fromMaybe ) import GHC.Internal.Data.Ord ( Down(..) ) import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) -import GHC.Internal.Ptr ( Ptr ) +import GHC.Internal.Ptr ( Ptr(..) ) import GHC.Types -- Needed for instances @@ -746,7 +746,7 @@ import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Internal.Enum ( Bounded, Enum ) import GHC.Internal.Read ( Read(..) ) -import GHC.Internal.Show ( Show(..), showString ) +import GHC.Internal.Show ( Show(..), showString, showChar, showParen, appPrec ) import GHC.Internal.Stack.Types ( SrcLoc(..) ) import GHC.Tuple (Solo (..)) import GHC.Internal.Unicode ( GeneralCategory(..) ) @@ -1037,6 +1037,14 @@ data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# } , Generic1 -- ^ @since base-4.9.0.0 ) +-- | @since base-4.21.0.0 +instance Show (UAddr p) where + -- This Show instance would be equivalent to what deriving Show would generate, + -- but because deriving Show doesn't support Addr# fields we define it manually. + showsPrec d (UAddr x) = + showParen (d > appPrec) + (\y -> showString "UAddr {uAddr# = " (showsPrec 0 (Ptr x) (showChar '}' y))) + -- | Used for marking occurrences of 'Char#' -- -- @since base-4.9.0.0 ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -14003,6 +14003,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14017,6 +14018,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14032,6 +14034,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14047,6 +14050,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -15525,6 +15529,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -11230,6 +11230,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11244,6 +11245,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11259,6 +11261,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11274,6 +11277,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12770,6 +12774,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a836263063a0f4e02b97d835724a02e4df47086e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a836263063a0f4e02b97d835724a02e4df47086e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 24 16:23:41 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 24 Jul 2024 12:23:41 -0400 Subject: [Git][ghc/ghc][master] Address #25055, by disabling case-of-runRW# in Gentle phase Message-ID: <66a12a8d8d984_37cee69bf17c303f5@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 6 changed files: - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/de5d9852dbdd367611bf9e45e69c723d26351992 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/de5d9852dbdd367611bf9e45e69c723d26351992 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 02:23:35 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Wed, 24 Jul 2024 22:23:35 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] 10 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <66a1b7275ccf1_37cee61eeacf46176@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - acc13908 by Brandon Chinn at 2024-07-24T19:22:53-07:00 Implement MultilineStrings (#24390) - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - configure.ac - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/literals.rst - + docs/users_guide/exts/multiline_strings.rst - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bdbda97a21eac55a88276e0b602453f0c8dc55bc...acc13908549698d19247ae28425539a214a7eb74 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bdbda97a21eac55a88276e0b602453f0c8dc55bc...acc13908549698d19247ae28425539a214a7eb74 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 11:44:37 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 25 Jul 2024 07:44:37 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/andreask/keep_rules_docs Message-ID: <66a23aa51235f_17463b12299c6639e@gitlab.mail> Andreas Klebinger pushed new branch wip/andreask/keep_rules_docs at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/andreask/keep_rules_docs You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 12:00:36 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 25 Jul 2024 08:00:36 -0400 Subject: [Git][ghc/ghc][wip/T25096] 8 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a23e64a9861_17463b2b082c76815@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25096 at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 8bc53240 by Simon Peyton Jones at 2024-07-25T12:58:59+01:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit fixes the bug and actually makes the code a bit tidier too. - - - - - b9e79e92 by Simon Peyton Jones at 2024-07-25T12:58:59+01:00 Wibble - - - - - 1f147ad1 by Simon Peyton Jones at 2024-07-25T12:58:59+01:00 Do a bit less demand-zapping when floating See Note [Zapping demand info when floating] in GHC.Core.Opt.SetLevels - - - - - 63830f45 by Simon Peyton Jones at 2024-07-25T12:58:59+01:00 Wibbles - - - - - 28 changed files: - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - configure.ac - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T - + testsuite/tests/typecheck/should_compile/T25094.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2598,7 +2577,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2889,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3794,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3815,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2315,22 +2315,27 @@ buildSynTyCon name binders res_kind roles rhs where is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs + expanded_rhs = expandTypeSynonyms rhs + is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. + rhs_tycons = tyConsOfType expanded_rhs + -- NB: we look at expanded_rhs e.g. -- type S a b = b -- type family F a -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + -- We want to mark T as concrete, because S ignores its first argument + + is_forgetful = not (all ((`elemVarSet` expanded_rhs_tyvars) . binderVar) binders) + expanded_rhs_tyvars = tyCoVarsOfType expanded_rhs + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -991,8 +991,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, ===================================== libraries/base/changelog.md ===================================== @@ -14,6 +14,7 @@ * Add `inits1` and `tails1` to `Data.List`, factored from the corresponding functions in `Data.List.NonEmpty` ([CLC proposal #252](https://github.com/haskell/core-libraries-committee/issues/252)) * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) + * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/Data/Functor/Classes.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE Safe #-} @@ -78,12 +79,13 @@ import Data.List.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) -import GHC.Generics (Generic1(..), Generically1(..)) +import GHC.Generics (Generic1(..), Generically1(..), V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..) , (:+:)(..), (:*:)(..), (:.:)(..), URec(..), UAddr, UChar, UDouble, UFloat, UInt, UWord) import GHC.Tuple (Solo (..)) -import GHC.Internal.Read (expectP, list, paren) +import GHC.Internal.Read (expectP, list, paren, readField) +import GHC.Internal.Show (appPrec) -import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) -import GHC.Internal.Text.Read (Read(..), parens, prec, step) +import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec, pfail) +import GHC.Internal.Text.Read (Read(..), parens, prec, step, reset) import GHC.Internal.Text.Read.Lex (Lexeme(..)) import GHC.Internal.Text.Show (showListWith) import Prelude @@ -1123,3 +1125,322 @@ and the corresponding 'Show1' instance as > showsBinaryWith sp (liftShowsPrec sp sl) "Two" d x y -} + +-- | @since base-4.21.0.0 +instance Eq1 V1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 V1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 V1 where + liftShowsPrec _ _ _ = \_ -> showString "V1" + +-- | @since base-4.21.0.0 +instance Read1 V1 where + liftReadsPrec _ _ = readPrec_to_S pfail + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 U1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 U1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 U1 where + liftShowsPrec _ _ _ = \U1 -> showString "U1" + +-- | @since base-4.21.0.0 +instance Read1 U1 where + liftReadPrec _ _ = + parens (expectP (Ident "U1") *> pure U1) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 Par1 where + liftEq eq = \(Par1 a) (Par1 a') -> eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 Par1 where + liftCompare cmp = \(Par1 a) (Par1 a') -> cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 Par1 where + liftShowsPrec sp _ d = \(Par1 { unPar1 = a }) -> + showsSingleFieldRecordWith sp "Par1" "unPar1" d a + +-- | @since base-4.21.0.0 +instance Read1 Par1 where + liftReadPrec rp _ = + readsSingleFieldRecordWith rp "Par1" "unPar1" Par1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (Rec1 f) where + liftEq eq = \(Rec1 a) (Rec1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (Rec1 f) where + liftCompare cmp = \(Rec1 a) (Rec1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (Rec1 f) where + liftShowsPrec sp sl d = \(Rec1 { unRec1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "Rec1" "unRec1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (Rec1 f) where + liftReadPrec rp rl = + readsSingleFieldRecordWith (liftReadPrec rp rl) "Rec1" "unRec1" Rec1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq c => Eq1 (K1 i c) where + liftEq _ = \(K1 a) (K1 a') -> a == a' + +-- | @since base-4.21.0.0 +instance Ord c => Ord1 (K1 i c) where + liftCompare _ = \(K1 a) (K1 a') -> compare a a' + +-- | @since base-4.21.0.0 +instance Show c => Show1 (K1 i c) where + liftShowsPrec _ _ d = \(K1 { unK1 = a }) -> + showsSingleFieldRecordWith showsPrec "K1" "unK1" d a + +-- | @since base-4.21.0.0 +instance Read c => Read1 (K1 i c) where + liftReadPrec _ _ = readData $ + readsSingleFieldRecordWith readPrec "K1" "unK1" K1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (M1 i c f) where + liftEq eq = \(M1 a) (M1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (M1 i c f) where + liftCompare cmp = \(M1 a) (M1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (M1 i c f) where + liftShowsPrec sp sl d = \(M1 { unM1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "M1" "unM1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (M1 i c f) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith (liftReadPrec rp rl) "M1" "unM1" M1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :+: g) where + liftEq eq = \lhs rhs -> case (lhs, rhs) of + (L1 a, L1 a') -> liftEq eq a a' + (R1 b, R1 b') -> liftEq eq b b' + _ -> False + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :+: g) where + liftCompare cmp = \lhs rhs -> case (lhs, rhs) of + (L1 _, R1 _) -> LT + (R1 _, L1 _) -> GT + (L1 a, L1 a') -> liftCompare cmp a a' + (R1 b, R1 b') -> liftCompare cmp b b' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :+: g) where + liftShowsPrec sp sl d = \x -> case x of + L1 a -> showsUnaryWith (liftShowsPrec sp sl) "L1" d a + R1 b -> showsUnaryWith (liftShowsPrec sp sl) "R1" d b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :+: g) where + liftReadPrec rp rl = readData $ + readUnaryWith (liftReadPrec rp rl) "L1" L1 <|> + readUnaryWith (liftReadPrec rp rl) "R1" R1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :*: g) where + liftEq eq = \(f :*: g) (f' :*: g') -> liftEq eq f f' && liftEq eq g g' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :*: g) where + liftCompare cmp = \(f :*: g) (f' :*: g') -> liftCompare cmp f f' <> liftCompare cmp g g' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :*: g) where + liftShowsPrec sp sl d = \(a :*: b) -> + showsBinaryOpWith + (liftShowsPrec sp sl) + (liftShowsPrec sp sl) + 7 + ":*:" + d + a + b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :*: g) where + liftReadPrec rp rl = parens $ prec 6 $ + readBinaryOpWith (liftReadPrec rp rl) (liftReadPrec rp rl) ":*:" (:*:) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where + liftEq eq = \(Comp1 a) (Comp1 a') -> liftEq (liftEq eq) a a' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where + liftCompare cmp = \(Comp1 a) (Comp1 a') -> liftCompare (liftCompare cmp) a a' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :.: g) where + liftShowsPrec sp sl d = \(Comp1 { unComp1 = a }) -> + showsSingleFieldRecordWith + (liftShowsPrec (liftShowsPrec sp sl) (liftShowList sp sl)) + "Comp1" + "unComp1" + d + a + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :.: g) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith + (liftReadPrec (liftReadPrec rp rl) (liftReadListPrec rp rl)) + "Comp1" + "unComp1" + Comp1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 UAddr where + -- NB cannot use eqAddr# because its module isn't safe + liftEq _ = \(UAddr a) (UAddr b) -> UAddr a == UAddr b + +-- | @since base-4.21.0.0 +instance Ord1 UAddr where + liftCompare _ = \(UAddr a) (UAddr b) -> compare (UAddr a) (UAddr b) + +-- | @since base-4.21.0.0 +instance Show1 UAddr where + liftShowsPrec _ _ = showsPrec + +-- NB no Read1 for URec (Ptr ()) because there's no Read for Ptr. + +-- | @since base-4.21.0.0 +instance Eq1 UChar where + liftEq _ = \(UChar a) (UChar b) -> UChar a == UChar b + +-- | @since base-4.21.0.0 +instance Ord1 UChar where + liftCompare _ = \(UChar a) (UChar b) -> compare (UChar a) (UChar b) + +-- | @since base-4.21.0.0 +instance Show1 UChar where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UDouble where + liftEq _ = \(UDouble a) (UDouble b) -> UDouble a == UDouble b + +-- | @since base-4.21.0.0 +instance Ord1 UDouble where + liftCompare _ = \(UDouble a) (UDouble b) -> compare (UDouble a) (UDouble b) + +-- | @since base-4.21.0.0 +instance Show1 UDouble where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UFloat where + liftEq _ = \(UFloat a) (UFloat b) -> UFloat a == UFloat b + +-- | @since base-4.21.0.0 +instance Ord1 UFloat where + liftCompare _ = \(UFloat a) (UFloat b) -> compare (UFloat a) (UFloat b) + +-- | @since base-4.21.0.0 +instance Show1 UFloat where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UInt where + liftEq _ = \(UInt a) (UInt b) -> UInt a == UInt b + +-- | @since base-4.21.0.0 +instance Ord1 UInt where + liftCompare _ = \(UInt a) (UInt b) -> compare (UInt a) (UInt b) + +-- | @since base-4.21.0.0 +instance Show1 UInt where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UWord where + liftEq _ = \(UWord a) (UWord b) -> UWord a == UWord b + +-- | @since base-4.21.0.0 +instance Ord1 UWord where + liftCompare _ = \(UWord a) (UWord b) -> compare (UWord a) (UWord b) + +-- | @since base-4.21.0.0 +instance Show1 UWord where + liftShowsPrec _ _ = showsPrec + +showsSingleFieldRecordWith :: (Int -> a -> ShowS) -> String -> String -> Int -> a -> ShowS +showsSingleFieldRecordWith sp name field d x = + showParen (d > appPrec) $ + showString name . showString " {" . showString field . showString " = " . sp 0 x . showChar '}' + +readsSingleFieldRecordWith :: ReadPrec a -> String -> String -> (a -> t) -> ReadPrec t +readsSingleFieldRecordWith rp name field cons = parens $ prec 11 $ do + expectP $ Ident name + expectP $ Punc "{" + x <- readField field $ reset rp + expectP $ Punc "}" + pure $ cons x + +showsBinaryOpWith + :: (Int -> a -> ShowS) + -> (Int -> b -> ShowS) + -> Int + -> String + -> Int + -> a + -> b + -> ShowS +showsBinaryOpWith sp1 sp2 opPrec name d x y = showParen (d >= opPrec) $ + sp1 opPrec x . showChar ' ' . showString name . showChar ' ' . sp2 opPrec y + +readBinaryOpWith + :: ReadPrec a + -> ReadPrec b + -> String + -> (a -> b -> t) + -> ReadPrec t +readBinaryOpWith rp1 rp2 name cons = + cons <$> step rp1 <* expectP (Symbol name) <*> step rp2 ===================================== libraries/ghc-internal/src/GHC/Internal/Generics.hs ===================================== @@ -735,7 +735,7 @@ import GHC.Internal.Data.Maybe ( Maybe(..), fromMaybe ) import GHC.Internal.Data.Ord ( Down(..) ) import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) -import GHC.Internal.Ptr ( Ptr ) +import GHC.Internal.Ptr ( Ptr(..) ) import GHC.Types -- Needed for instances @@ -746,7 +746,7 @@ import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Internal.Enum ( Bounded, Enum ) import GHC.Internal.Read ( Read(..) ) -import GHC.Internal.Show ( Show(..), showString ) +import GHC.Internal.Show ( Show(..), showString, showChar, showParen, appPrec ) import GHC.Internal.Stack.Types ( SrcLoc(..) ) import GHC.Tuple (Solo (..)) import GHC.Internal.Unicode ( GeneralCategory(..) ) @@ -1037,6 +1037,14 @@ data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# } , Generic1 -- ^ @since base-4.9.0.0 ) +-- | @since base-4.21.0.0 +instance Show (UAddr p) where + -- This Show instance would be equivalent to what deriving Show would generate, + -- but because deriving Show doesn't support Addr# fields we define it manually. + showsPrec d (UAddr x) = + showParen (d > appPrec) + (\y -> showString "UAddr {uAddr# = " (showsPrec 0 (Ptr x) (showChar '}' y))) + -- | Used for marking occurrences of 'Char#' -- -- @since base-4.9.0.0 ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -14003,6 +14003,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14017,6 +14018,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14032,6 +14034,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14047,6 +14050,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -15525,6 +15529,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -11230,6 +11230,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11244,6 +11245,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11259,6 +11261,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11274,6 +11277,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12770,6 +12774,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) ===================================== testsuite/tests/typecheck/should_compile/T25094.hs ===================================== @@ -0,0 +1,98 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,4 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) - +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/10ee25c405dde42326eb4ebc82b948f36b748eff...63830f452c2b3f4c375fe0ea20acedc926ea00df -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/10ee25c405dde42326eb4ebc82b948f36b748eff...63830f452c2b3f4c375fe0ea20acedc926ea00df You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 12:08:13 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 25 Jul 2024 08:08:13 -0400 Subject: [Git][ghc/ghc][wip/clc275] 69 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a2402db2e3c_17463b44f7b4820a0@gitlab.mail> Andreas Klebinger pushed to branch wip/clc275 at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 7e319bde by Ben Gamari at 2024-07-25T13:51:31+02:00 base: Add `HasCallStack` constraint to `ioError` As proposed in core-libraries-committee#275. - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/35d4819a5bb61428b5029cd9f35a5e8d16b699ae...7e319bde57290fdb58abde2a83b36cf3383518ca -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/35d4819a5bb61428b5029cd9f35a5e8d16b699ae...7e319bde57290fdb58abde2a83b36cf3383518ca You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 12:13:24 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Thu, 25 Jul 2024 08:13:24 -0400 Subject: [Git][ghc/ghc][wip/andreask/aarch64_reg_graph] 13 commits: haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` Message-ID: <66a2416444df5_17463b53e3f087228@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/aarch64_reg_graph at Glasgow Haskell Compiler / GHC Commits: 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - configure.ac - docs/users_guide/9.12.1-notes.rst - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/driver/testlib.py - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d6b318359d603d00c1738f29d696d234a3ce7c97...3f89ab92da74c4ed45da68fe92ff81e7b9caa53d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d6b318359d603d00c1738f29d696d234a3ce7c97...3f89ab92da74c4ed45da68fe92ff81e7b9caa53d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 12:55:48 2024 From: gitlab at gitlab.haskell.org (Andrei Borzenkov (@sand-witch)) Date: Thu, 25 Jul 2024 08:55:48 -0400 Subject: [Git][ghc/ghc][wip/sand-witch/types-in-terms] Just a temporary change to fix #25103 Message-ID: <66a24b54d421a_74d0ac3af012338@gitlab.mail> Andrei Borzenkov pushed to branch wip/sand-witch/types-in-terms at Glasgow Haskell Compiler / GHC Commits: 3aa6107b by Andrei Borzenkov at 2024-07-25T16:55:27+04:00 Just a temporary change to fix #25103 - - - - - 2 changed files: - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs Changes: ===================================== compiler/GHC/Parser.y ===================================== @@ -2804,8 +2804,7 @@ infixexp2 :: { ECP } -- View patterns and function arrows | infixexp '->' infixexp2 - { ECP $ - withArrowTag $ \tag -> + { withArrowTag $ \tag -> unECP $1 >>= \ $1 -> unECP $3 >>= \ $3 -> let arr = HsUnrestrictedArrow (epUniTok $2) ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -2112,8 +2112,8 @@ nukeArrowTag tag k = case tag of ViewPatTag -> k FunArrTag -> k -withArrowTag :: DisambECP b => (forall lhs. DisambECP lhs => ArrowTag lhs b -> PV r) -> PV r -withArrowTag cont = do +withArrowTag :: (forall lhs b. (DisambECP lhs, DisambECP b) => ArrowTag lhs b -> PV (LocatedA b)) -> ECP +withArrowTag cont = ECP $ do vpEnabled <- getBit ViewPatternsBit rtaEnabled <- getBit RequiredTypeArgumentsBit if | vpEnabled -> cont ViewPatTag View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3aa6107baf7976b4c13f525e9541d83ca5dbec69 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3aa6107baf7976b4c13f525e9541d83ca5dbec69 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 14:03:36 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 25 Jul 2024 10:03:36 -0400 Subject: [Git][ghc/ghc][wip/T25096] Fix nasty bug in occurrence analyser Message-ID: <66a25b38b371a_74d0a46160820429@gitlab.mail> Simon Peyton Jones pushed to branch wip/T25096 at Glasgow Haskell Compiler / GHC Commits: 9fc828bc by Simon Peyton Jones at 2024-07-25T15:03:15+01:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 14 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9fc828bc130c08425917af61f899b985c4f29a7f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9fc828bc130c08425917af61f899b985c4f29a7f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 16:38:51 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Thu, 25 Jul 2024 12:38:51 -0400 Subject: [Git][ghc/ghc][wip/T24978] 110 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a27f9b755a4_1a07821a00541419e@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 6bb487d1 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Refactor UnivCo Addresses #24978 - - - - - 1c90856d by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Wibbles - - - - - fb0c7a30 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Wibble - - - - - 596428d6 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Put [Coercion] in UnivCo - - - - - 9fc9da4e by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Wibble - - - - - f451607e by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Wibbles - - - - - 7cadd5b8 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Add Given builtin deductions Addresses #24845. Needs documentation - - - - - 4e1cdbb4 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Onward with AxiomRule ..won't compile - - - - - 40b83152 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 Progress - - - - - 373a90e7 by Simon Peyton Jones at 2024-07-25T15:10:10+01:00 More WIP does not compile - - - - - 4bdf9d43 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 More - - - - - 251dab54 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Big reorg of the file - - - - - 9be75f54 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Add axiomrules to the list - - - - - 301049df by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 More updates - - - - - c08533be by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Wibbles - - - - - e1b50556 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Wibble - - - - - ebff569d by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 More Refactor CoAxRule - - - - - cfc653c4 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Fix glitch - - - - - cb9443fa by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Complete family-matching stuff - - - - - eafc134f by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Docs - - - - - 024d0da4 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Wibble imports again - - - - - 05a39aa7 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Wibble - - - - - 4d38c9da by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Do proper eqType in findMatchingIrreds I believe that the four calls of `tcEqTypeNoKindCheck` in match_eq_help are bogus; they should be `tcEqType`. The use of `tcEqTypeNoKindCheck` in `match_non_eq` is fine, I think, because `irred` and `irredCtPred` both have type Constraint. Actually even that isn't really true. One might have kind Constraint and the other kind Constraint#. E.g. (a b ~# c d) and (E q ) Maybe that is another bug? Richard replies: Yes I think you're probably right. I could see some ill-typed Core potentially being produced in this way. I think the check for non_eq is OK: I don't think a Constraint# is going to match a regular irred. But maybe it's safer to change it. - - - - - 3d7d0d1a by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Fix egregious bug - - - - - f94e6411 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Comments only - - - - - a68fad19 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Clerical error - - - - - 0f3e3bb3 by Simon Peyton Jones at 2024-07-25T15:10:11+01:00 Another big increment * Combine sfInteractTop, sfInteractInert * Kill off tryFamFamInjectivity (now happens in improveWantedTopFunEqs) - - - - - 70943ed3 by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Add tests for #24845 - - - - - cfb344c3 by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Wibble - - - - - 5ef7f02e by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Accept CountDeps changes - - - - - 261c5d8b by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Fix bug in fundeps - - - - - 6fa7252a by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Big refacor, combining AxInstCo and AxRuleCo - - - - - c33e461b by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Fix typo - - - - - c8d92b6c by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Improve coercionKind - - - - - 9550d306 by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Better coercionKind In particular * Avoid #25066 * Do coercionLKind, coercionRKing by specialisation rather than duplication - - - - - 992ed4e4 by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Wibbles - - - - - ca1f9b32 by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Wibbles - - - - - 5f48c80d by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Typo in coercionKind - - - - - 371b379e by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Fix perf bug - - - - - 1b914e7a by Simon Peyton Jones at 2024-07-25T15:10:31+01:00 Wibbles ... ...including omitting parens around atomic coercion - - - - - 12c8870a by Simon Peyton Jones at 2024-07-25T15:12:43+01:00 Wibbles - - - - - 9d7b70bf by Simon Peyton Jones at 2024-07-25T17:38:21+01:00 Renaming etc - - - - - 10 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8119c093ba8c52c9c22b81ef727022beeff60ecd...9d7b70bff58feca962d24f6a64b32b619cc78b94 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8119c093ba8c52c9c22b81ef727022beeff60ecd...9d7b70bff58feca962d24f6a64b32b619cc78b94 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 18:20:17 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 25 Jul 2024 14:20:17 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a29761ec2a1_1a0782593d14182d4@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: f589d6bb by Torsten Schmits at 2024-07-25T20:19:59+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - 3 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- function to perform typechecking in the appropriate environment. +initWholeCoreBindingsWith :: + (WholeCoreBindings -> IO ([CoreBind], TypeEnv)) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith tc_bindings hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (core_binds, initial_types) <- tc_bindings fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using hsc_env' here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith typecheck hsc_env mod_iface linkable + where + typecheck wcb = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + core_binds <- initIfaceCheck (text "l") hsc_env' $ + typecheckWholeCoreBindings types_var wcb + pure (core_binds, initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith typecheck hsc_env + where + typecheck wcb = do + initial_types <- eps_PTE <$> hscEPS hsc_env + types_var <- newIORef initial_types + core_binds <- initIfaceCheck (text "l") hsc_env $ typecheckWholeCoreBindings types_var wcb + pure (core_binds, initial_types) + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -9,3 +9,4 @@ import GHC.Unit.Module.ModIface initModDetails :: HscEnv -> ModIface -> IO ModDetails initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -293,9 +293,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Succeeded iface <- ldLoadIface opts (text "makima") mod case mi_extra_decls iface of Just extra_decls -> do - details <- initModDetails hsc_env iface t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] _ -> fallback_no_bytecode loc mod | otherwise = fallback_no_bytecode loc mod View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f589d6bb86f6606c9b40d0783d2a4a837f1b11a4 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f589d6bb86f6606c9b40d0783d2a4a837f1b11a4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 18:29:11 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 25 Jul 2024 14:29:11 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a299772d29b_1a07826933b8203b5@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 1656b2c3 by Torsten Schmits at 2024-07-25T20:29:00+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - 3 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- function to perform typechecking in the appropriate environment. +initWholeCoreBindingsWith :: + IO (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, initial_types) <- mk_tc_env + types_var <- newIORef initial_types + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + pure (hsc_env, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -9,3 +9,4 @@ import GHC.Unit.Module.ModIface initModDetails :: HscEnv -> ModIface -> IO ModDetails initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -293,9 +293,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Succeeded iface <- ldLoadIface opts (text "makima") mod case mi_extra_decls iface of Just extra_decls -> do - details <- initModDetails hsc_env iface t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] _ -> fallback_no_bytecode loc mod | otherwise = fallback_no_bytecode loc mod View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1656b2c3fbc8be3363ea10122d001ac8a194966c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1656b2c3fbc8be3363ea10122d001ac8a194966c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 18:36:55 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 25 Jul 2024 14:36:55 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a29b4767b32_1a078279093c2115@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 56b7e6a4 by Torsten Schmits at 2024-07-25T20:36:48+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - 3 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, initial_types) <- mk_tc_env + types_var <- newIORef initial_types + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + pure (hsc_env, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -9,3 +9,4 @@ import GHC.Unit.Module.ModIface initModDetails :: HscEnv -> ModIface -> IO ModDetails initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -293,9 +293,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Succeeded iface <- ldLoadIface opts (text "makima") mod case mi_extra_decls iface of Just extra_decls -> do - details <- initModDetails hsc_env iface t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] _ -> fallback_no_bytecode loc mod | otherwise = fallback_no_bytecode loc mod View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56b7e6a49c72e2f4356e2477740fd8d926e4a0a6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/56b7e6a49c72e2f4356e2477740fd8d926e4a0a6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Thu Jul 25 19:01:07 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Thu, 25 Jul 2024 15:01:07 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a2a0f34a519_1c84dbf91410112d@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: c91ba485 by Torsten Schmits at 2024-07-25T21:00:57+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - 3 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, initial_types) <- mk_tc_env + types_var <- newIORef initial_types + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + pure (hsc_env, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -3,9 +3,6 @@ module GHC.Driver.Main where import GHC.Driver.Env import GHC.Linker.Types import GHC.Prelude -import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModIface -initModDetails :: HscEnv -> ModIface -> IO ModDetails - -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -293,9 +293,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Succeeded iface <- ldLoadIface opts (text "makima") mod case mi_extra_decls iface of Just extra_decls -> do - details <- initModDetails hsc_env iface t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] _ -> fallback_no_bytecode loc mod | otherwise = fallback_no_bytecode loc mod View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c91ba485abf87cfadeaa0ad75172395625baba2c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c91ba485abf87cfadeaa0ad75172395625baba2c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 04:44:36 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Fri, 26 Jul 2024 00:44:36 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Implement MultilineStrings (#24390) Message-ID: <66a329b41e687_3569f9263d9c30868@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: 0006c891 by Brandon Chinn at 2024-07-25T21:44:29-07:00 Implement MultilineStrings (#24390) - - - - - 30 changed files: - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/literals.rst - + docs/users_guide/exts/multiline_strings.rst - libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/driver/T4437.hs - testsuite/tests/interface-stability/template-haskell-exports.stdout - + testsuite/tests/parser/should_fail/MultilineStringsError.hs - + testsuite/tests/parser/should_fail/MultilineStringsError.stderr - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.hs - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.stderr - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.hs - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.stderr - testsuite/tests/parser/should_fail/all.T - + testsuite/tests/parser/should_run/MultilineStrings.hs - + testsuite/tests/parser/should_run/MultilineStrings.stdout - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.hs - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0006c891b23b5feaf1ab25e83e81e11f64ac1887 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0006c891b23b5feaf1ab25e83e81e11f64ac1887 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 05:21:28 2024 From: gitlab at gitlab.haskell.org (Artin Ghasivand (@Ei30metry)) Date: Fri, 26 Jul 2024 01:21:28 -0400 Subject: [Git][ghc/ghc][wip/T24467] Small stuff Message-ID: <66a332582aaa8_3569f9516b7037787@gitlab.mail> Artin Ghasivand pushed to branch wip/T24467 at Glasgow Haskell Compiler / GHC Commits: 21d7e98e by Artin Ghasivand at 2024-07-26T08:50:48+03:30 Small stuff - - - - - 3 changed files: - compiler/GHC/Iface/Decl.hs - compiler/GHC/Iface/Type.hs - ghc/GHCi/UI.hs Changes: ===================================== compiler/GHC/Iface/Decl.hs ===================================== @@ -14,6 +14,7 @@ module GHC.Iface.Decl ( coAxiomToIfaceDecl , tyThingToIfaceDecl -- Converting things to their Iface equivalents , toIfaceBooleanFormula + , tyConToIfaceDecl ) where ===================================== compiler/GHC/Iface/Type.hs ===================================== @@ -26,6 +26,7 @@ module GHC.Iface.Type ( IfaceForAllSpecBndr, IfaceForAllBndr, ForAllTyFlag(..), FunTyFlag(..), ShowForAllFlag(..), ShowSub(..), ShowHowMuch(..), AltPpr(..), + IfaceTySubst, mkIfaceForAllTvBndr, mkIfaceTyConKind, ifaceForAllSpecToBndrs, ifaceForAllSpecToBndr, ===================================== ghc/GHCi/UI.hs ===================================== @@ -46,6 +46,7 @@ import GHC.ByteCode.Types import GHC.Core.DataCon import GHC.Core.ConLike import GHC.Core.PatSyn +import GHC.CoreToIface import GHC.Driver.Flags import GHC.Driver.Errors import GHC.Driver.Errors.Types @@ -69,13 +70,24 @@ import GHC.Driver.Env import GHC.Runtime.Context import GHC.Types.TyThing import GHC.Types.TyThing.Ppr +import GHC.Tc.Utils.Monad import GHC.Core.TyCo.Ppr +import GHC.Core.Type import GHC.Types.SafeHaskell ( getSafeMode ) import GHC.Types.SourceError ( SourceError ) import GHC.Types.Name import GHC.Types.Breakpoint import GHC.Types.Var ( varType ) -import GHC.Iface.Syntax ( showToHeader ) +import GHC.Types.Var.Env ( emptyTidyEnv ) +import GHC.Iface.Syntax ( showToHeader, showToIface, pprIfaceDecl + , IfaceDecl(..), IfaceEqSpec, IfaceConDecls(..) + , IfaceConDecl(..), visibleIfConDecls, IfaceAppArgs + , ) +import GHC.Iface.Decl ( tyConToIfaceDecl ) +import GHC.Iface.Type ( IfaceType (..), IfaceTySubst, mkIfaceTySubst + , substIfaceTyVar, inDomIfaceTySubst + , IfLclName (..), appArgsIfaceTypes + , ifForAllBndrName ) import GHC.Builtin.Names import GHC.Builtin.Types( stringTyCon_RDR ) import GHC.Types.Name.Reader as RdrName ( getGRE_NameQualifier_maybes, getRdrName, greName, globalRdrEnvElts) @@ -126,7 +138,8 @@ import Data.Char import Data.Function import Data.IORef ( IORef, modifyIORef, newIORef, readIORef, writeIORef ) import Data.List ( elemIndices, find, intercalate, intersperse, minimumBy, - isPrefixOf, isSuffixOf, nub, partition, sort, sortBy, (\\) ) + isPrefixOf, isSuffixOf, nub, partition, sort, sortBy, (\\), + delete, union ) import qualified Data.List.NonEmpty as NE import qualified Data.Set as S import Data.Maybe @@ -222,6 +235,7 @@ ghciCommands = map mkCmd [ ("help", keepGoingMulti help, noCompletion), ("history", keepGoingMulti historyCmd, noCompletion), ("info", keepGoingMulti' (info False), completeIdentifier), + ("normalize", keepGoingMulti' normalize, completeIdentifier), ("info!", keepGoingMulti' (info True), completeIdentifier), ("issafe", keepGoing' isSafeCmd, completeModule), ("ignore", keepGoing ignoreCmd, noCompletion), @@ -1613,6 +1627,68 @@ pprInfo (thing, fixity, cls_insts, fam_insts, docs) $$ vcat (map GHC.pprInstance cls_insts) $$ vcat (map GHC.pprFamInst fam_insts) +----------------------------------------------------------------------------- +-- :normalize + +-- NOTE we could also call this :members or something like that. +normalize :: GHC.GhcMonad m => String -> m () +nomralize "" = throwGhcException (CmdLineError "syntax ':n <(constructor arguments)>'") +normalize s = handleSourceError printGhciException $ do + forM_ (map trim $ actArgs s) $ \str -> do + sdoc <- lab str + rendered <- showSDocForUser' sdoc + liftIO (putStrLn rendered) + where + actArgs [] = [] -- FIXME doesn't throw an error when there is no ending parenthesis + actArgs ('(':xs) = + let + (inside,rest) = break (== ')') xs + afterParen = if null rest then [] else tail rest + in + inside : actArgs afterParen + actArgs (_:xs) = actArgs xs + trim = let f = reverse . dropWhile isSpace in f . f + + +-- TODO redefine all these using foldr and an accumulator +buildNormSubst :: IfaceAppArgs -> [IfaceType] -> IfaceTySubst +buildNormSubst args userArgs + = mkIfaceTySubst $ zip (freeVarsOfIfAppArgs args) userArgs + where + freeVarsOfIfAppArgs = freeVarsOfIfTypes . appArgsIfaceTypes + freeVarsOfIfTypes = concatMap freeVarsOfIfType + freeVarsOfIfType (IfaceTyVar l) = [l] + freeVarsOfIfType (IfaceTupleTy _ _ args) = freeVarsOfIfAppArgs args + freeVarsOfIfType (IfaceAppTy _ args) = freeVarsOfIfAppArgs args + freeVarsOfIfType (IfaceFunTy fun_flag _ arg res) = (freeVarsOfIfType arg) `union` (freeVarsOfIfType res) + freeVarsOfIfType (IfaceForAllTy bndr ty) = delete (ifForAllBndrName bndr) (freeVarsOfIfType ty) + freeVarsOfIfType _ = [] + +lab :: GHC.GhcMonad m => String -> m SDoc +lab str = do + (ty,kind) <- GHC.typeKind True str + case splitTyConApp_maybe ty of + Nothing -> throwGhcException (CmdLineError "Something Bad happend!") + Just (head,args) -> do + let ifaceArgs = map toIfaceType args + iDecl = snd $ tyConToIfaceDecl emptyTidyEnv head + pure (enlightenUs iDecl) + where + enlightenUs decl + = vcat [pprIfaceDecl showToIface decl + ,nest 2 $ vcat [text "ifConArgTys:" <+> (nest 2 . vcat) (map (ppr . ifConArgTys) conDecls) + ,text "ifEqSpec:" <+> (nest 2 . vcat) (map (ppr . ifConEqSpec) conDecls) + ,text "ifConUserTvBinders:" <+> (nest 2 . vcat) (map (ppr . ifConUserTvBinders) conDecls) + ,text "ifConExTcvs:" <+> (nest 2 . vcat) (map (ppr . ifConExTCvs) conDecls)] + ,text "free variables:" <+> freeVarsOfIfType (retType (ifName )) + ,text "--------------------------"] + where + conDecls = (visibleIfConDecls . ifCons) decl + retType name binders = undefined + + substIfaceConDecl :: GHC.GhcMonad m => m IfaceTySubst -> IfaceConDecl -> m IfaceConDecl + substIfaceConDecl = undefined + ----------------------------------------------------------------------------- -- :main View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21d7e98ef641860ead1cb62a6e3c61c0c5bda4b1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/21d7e98ef641860ead1cb62a6e3c61c0c5bda4b1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 08:42:04 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 26 Jul 2024 04:42:04 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types Message-ID: <66a3615c21e41_3b23632c2f2c797ac@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - 2e64d2ac by Torsten Schmits at 2024-07-26T04:41:46-04:00 add missing cell in flavours table - - - - - 21 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - docs/users_guide/9.12.1-notes.rst - hadrian/doc/flavours.md - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -177,6 +177,8 @@ regUsageOfInstr platform instr = case instr of interesting _ (RegVirtual _) = True interesting platform (RegReal (RealRegSingle i)) = freeReg platform i +-- Note [AArch64 Register assignments] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Save caller save registers -- This is x0-x18 -- @@ -199,6 +201,8 @@ regUsageOfInstr platform instr = case instr of -- '---------------------------------------------------------------------------------------------------------------------------------------------------------------' -- IR: Indirect result location register, IP: Intra-procedure register, PL: Platform register, FP: Frame pointer, LR: Link register, SP: Stack pointer -- BR: Base, SL: SpLim +-- +-- TODO: The zero register is currently mapped to -1 but should get it's own separate number. callerSavedRegisters :: [Reg] callerSavedRegisters = map regSingle [0..18] ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -316,6 +316,7 @@ pprReg w r = case r of | w == W64 = text "sp" | w == W32 = text "wsp" + -- See Note [AArch64 Register assignments] ppr_reg_no w i | i < 0, w == W32 = text "wzr" | i < 0, w == W64 = text "xzr" ===================================== compiler/GHC/CmmToAsm/AArch64/Regs.hs ===================================== @@ -17,6 +17,7 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform +-- TODO: Should this include the zero register? allMachRegNos :: [RegNo] allMachRegNos = [0..31] ++ [32..63] -- allocatableRegs is allMachRegNos with the fixed-use regs removed. ===================================== compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs ===================================== @@ -183,7 +183,8 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclu ArchPPC -> 26 ArchPPC_64 _ -> 20 ArchARM _ _ _ -> panic "trivColorable ArchARM" - ArchAArch64 -> 28 -- 32 - D1..D4 + ArchAArch64 -> 24 -- 32 - F1 .. F4, D1..D4 - it's odd but see Note [AArch64 Register assignments] for our reg use. + -- Seems we reserve different registers for D1..D4 and F1 .. F4 somehow, we should fix this. ArchAlpha -> panic "trivColorable ArchAlpha" ArchMipseb -> panic "trivColorable ArchMipseb" ArchMipsel -> panic "trivColorable ArchMipsel" ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -78,12 +78,15 @@ Compiler `_). This does not affect existing support of apple systems on x86_64/aarch64. -- The flag :ghc-flag:`-fignore-asserts` will now also enable the +- The flag :ghc-flag:`-fignore-asserts` will now also enable the :extension:`CPP` macro ``__GLASGOW_HASKELL_ASSERTS_IGNORED__`` (`#24967 `_). This enables people to write their own custom assertion functions. See :ref:`assertions`. - + +- Fixed a bug that caused GHC to panic when using the aarch64 ncg and -fregs-graph + on certain programs. (#24941) + GHCi ~~~~ ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== libraries/base/changelog.md ===================================== @@ -14,6 +14,7 @@ * Add `inits1` and `tails1` to `Data.List`, factored from the corresponding functions in `Data.List.NonEmpty` ([CLC proposal #252](https://github.com/haskell/core-libraries-committee/issues/252)) * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) + * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/Data/Functor/Classes.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE Safe #-} @@ -78,12 +79,13 @@ import Data.List.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) -import GHC.Generics (Generic1(..), Generically1(..)) +import GHC.Generics (Generic1(..), Generically1(..), V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..) , (:+:)(..), (:*:)(..), (:.:)(..), URec(..), UAddr, UChar, UDouble, UFloat, UInt, UWord) import GHC.Tuple (Solo (..)) -import GHC.Internal.Read (expectP, list, paren) +import GHC.Internal.Read (expectP, list, paren, readField) +import GHC.Internal.Show (appPrec) -import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) -import GHC.Internal.Text.Read (Read(..), parens, prec, step) +import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec, pfail) +import GHC.Internal.Text.Read (Read(..), parens, prec, step, reset) import GHC.Internal.Text.Read.Lex (Lexeme(..)) import GHC.Internal.Text.Show (showListWith) import Prelude @@ -1123,3 +1125,322 @@ and the corresponding 'Show1' instance as > showsBinaryWith sp (liftShowsPrec sp sl) "Two" d x y -} + +-- | @since base-4.21.0.0 +instance Eq1 V1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 V1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 V1 where + liftShowsPrec _ _ _ = \_ -> showString "V1" + +-- | @since base-4.21.0.0 +instance Read1 V1 where + liftReadsPrec _ _ = readPrec_to_S pfail + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 U1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 U1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 U1 where + liftShowsPrec _ _ _ = \U1 -> showString "U1" + +-- | @since base-4.21.0.0 +instance Read1 U1 where + liftReadPrec _ _ = + parens (expectP (Ident "U1") *> pure U1) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 Par1 where + liftEq eq = \(Par1 a) (Par1 a') -> eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 Par1 where + liftCompare cmp = \(Par1 a) (Par1 a') -> cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 Par1 where + liftShowsPrec sp _ d = \(Par1 { unPar1 = a }) -> + showsSingleFieldRecordWith sp "Par1" "unPar1" d a + +-- | @since base-4.21.0.0 +instance Read1 Par1 where + liftReadPrec rp _ = + readsSingleFieldRecordWith rp "Par1" "unPar1" Par1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (Rec1 f) where + liftEq eq = \(Rec1 a) (Rec1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (Rec1 f) where + liftCompare cmp = \(Rec1 a) (Rec1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (Rec1 f) where + liftShowsPrec sp sl d = \(Rec1 { unRec1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "Rec1" "unRec1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (Rec1 f) where + liftReadPrec rp rl = + readsSingleFieldRecordWith (liftReadPrec rp rl) "Rec1" "unRec1" Rec1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq c => Eq1 (K1 i c) where + liftEq _ = \(K1 a) (K1 a') -> a == a' + +-- | @since base-4.21.0.0 +instance Ord c => Ord1 (K1 i c) where + liftCompare _ = \(K1 a) (K1 a') -> compare a a' + +-- | @since base-4.21.0.0 +instance Show c => Show1 (K1 i c) where + liftShowsPrec _ _ d = \(K1 { unK1 = a }) -> + showsSingleFieldRecordWith showsPrec "K1" "unK1" d a + +-- | @since base-4.21.0.0 +instance Read c => Read1 (K1 i c) where + liftReadPrec _ _ = readData $ + readsSingleFieldRecordWith readPrec "K1" "unK1" K1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (M1 i c f) where + liftEq eq = \(M1 a) (M1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (M1 i c f) where + liftCompare cmp = \(M1 a) (M1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (M1 i c f) where + liftShowsPrec sp sl d = \(M1 { unM1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "M1" "unM1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (M1 i c f) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith (liftReadPrec rp rl) "M1" "unM1" M1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :+: g) where + liftEq eq = \lhs rhs -> case (lhs, rhs) of + (L1 a, L1 a') -> liftEq eq a a' + (R1 b, R1 b') -> liftEq eq b b' + _ -> False + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :+: g) where + liftCompare cmp = \lhs rhs -> case (lhs, rhs) of + (L1 _, R1 _) -> LT + (R1 _, L1 _) -> GT + (L1 a, L1 a') -> liftCompare cmp a a' + (R1 b, R1 b') -> liftCompare cmp b b' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :+: g) where + liftShowsPrec sp sl d = \x -> case x of + L1 a -> showsUnaryWith (liftShowsPrec sp sl) "L1" d a + R1 b -> showsUnaryWith (liftShowsPrec sp sl) "R1" d b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :+: g) where + liftReadPrec rp rl = readData $ + readUnaryWith (liftReadPrec rp rl) "L1" L1 <|> + readUnaryWith (liftReadPrec rp rl) "R1" R1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :*: g) where + liftEq eq = \(f :*: g) (f' :*: g') -> liftEq eq f f' && liftEq eq g g' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :*: g) where + liftCompare cmp = \(f :*: g) (f' :*: g') -> liftCompare cmp f f' <> liftCompare cmp g g' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :*: g) where + liftShowsPrec sp sl d = \(a :*: b) -> + showsBinaryOpWith + (liftShowsPrec sp sl) + (liftShowsPrec sp sl) + 7 + ":*:" + d + a + b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :*: g) where + liftReadPrec rp rl = parens $ prec 6 $ + readBinaryOpWith (liftReadPrec rp rl) (liftReadPrec rp rl) ":*:" (:*:) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where + liftEq eq = \(Comp1 a) (Comp1 a') -> liftEq (liftEq eq) a a' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where + liftCompare cmp = \(Comp1 a) (Comp1 a') -> liftCompare (liftCompare cmp) a a' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :.: g) where + liftShowsPrec sp sl d = \(Comp1 { unComp1 = a }) -> + showsSingleFieldRecordWith + (liftShowsPrec (liftShowsPrec sp sl) (liftShowList sp sl)) + "Comp1" + "unComp1" + d + a + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :.: g) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith + (liftReadPrec (liftReadPrec rp rl) (liftReadListPrec rp rl)) + "Comp1" + "unComp1" + Comp1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 UAddr where + -- NB cannot use eqAddr# because its module isn't safe + liftEq _ = \(UAddr a) (UAddr b) -> UAddr a == UAddr b + +-- | @since base-4.21.0.0 +instance Ord1 UAddr where + liftCompare _ = \(UAddr a) (UAddr b) -> compare (UAddr a) (UAddr b) + +-- | @since base-4.21.0.0 +instance Show1 UAddr where + liftShowsPrec _ _ = showsPrec + +-- NB no Read1 for URec (Ptr ()) because there's no Read for Ptr. + +-- | @since base-4.21.0.0 +instance Eq1 UChar where + liftEq _ = \(UChar a) (UChar b) -> UChar a == UChar b + +-- | @since base-4.21.0.0 +instance Ord1 UChar where + liftCompare _ = \(UChar a) (UChar b) -> compare (UChar a) (UChar b) + +-- | @since base-4.21.0.0 +instance Show1 UChar where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UDouble where + liftEq _ = \(UDouble a) (UDouble b) -> UDouble a == UDouble b + +-- | @since base-4.21.0.0 +instance Ord1 UDouble where + liftCompare _ = \(UDouble a) (UDouble b) -> compare (UDouble a) (UDouble b) + +-- | @since base-4.21.0.0 +instance Show1 UDouble where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UFloat where + liftEq _ = \(UFloat a) (UFloat b) -> UFloat a == UFloat b + +-- | @since base-4.21.0.0 +instance Ord1 UFloat where + liftCompare _ = \(UFloat a) (UFloat b) -> compare (UFloat a) (UFloat b) + +-- | @since base-4.21.0.0 +instance Show1 UFloat where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UInt where + liftEq _ = \(UInt a) (UInt b) -> UInt a == UInt b + +-- | @since base-4.21.0.0 +instance Ord1 UInt where + liftCompare _ = \(UInt a) (UInt b) -> compare (UInt a) (UInt b) + +-- | @since base-4.21.0.0 +instance Show1 UInt where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UWord where + liftEq _ = \(UWord a) (UWord b) -> UWord a == UWord b + +-- | @since base-4.21.0.0 +instance Ord1 UWord where + liftCompare _ = \(UWord a) (UWord b) -> compare (UWord a) (UWord b) + +-- | @since base-4.21.0.0 +instance Show1 UWord where + liftShowsPrec _ _ = showsPrec + +showsSingleFieldRecordWith :: (Int -> a -> ShowS) -> String -> String -> Int -> a -> ShowS +showsSingleFieldRecordWith sp name field d x = + showParen (d > appPrec) $ + showString name . showString " {" . showString field . showString " = " . sp 0 x . showChar '}' + +readsSingleFieldRecordWith :: ReadPrec a -> String -> String -> (a -> t) -> ReadPrec t +readsSingleFieldRecordWith rp name field cons = parens $ prec 11 $ do + expectP $ Ident name + expectP $ Punc "{" + x <- readField field $ reset rp + expectP $ Punc "}" + pure $ cons x + +showsBinaryOpWith + :: (Int -> a -> ShowS) + -> (Int -> b -> ShowS) + -> Int + -> String + -> Int + -> a + -> b + -> ShowS +showsBinaryOpWith sp1 sp2 opPrec name d x y = showParen (d >= opPrec) $ + sp1 opPrec x . showChar ' ' . showString name . showChar ' ' . sp2 opPrec y + +readBinaryOpWith + :: ReadPrec a + -> ReadPrec b + -> String + -> (a -> b -> t) + -> ReadPrec t +readBinaryOpWith rp1 rp2 name cons = + cons <$> step rp1 <* expectP (Symbol name) <*> step rp2 ===================================== libraries/ghc-internal/src/GHC/Internal/Generics.hs ===================================== @@ -735,7 +735,7 @@ import GHC.Internal.Data.Maybe ( Maybe(..), fromMaybe ) import GHC.Internal.Data.Ord ( Down(..) ) import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) -import GHC.Internal.Ptr ( Ptr ) +import GHC.Internal.Ptr ( Ptr(..) ) import GHC.Types -- Needed for instances @@ -746,7 +746,7 @@ import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Internal.Enum ( Bounded, Enum ) import GHC.Internal.Read ( Read(..) ) -import GHC.Internal.Show ( Show(..), showString ) +import GHC.Internal.Show ( Show(..), showString, showChar, showParen, appPrec ) import GHC.Internal.Stack.Types ( SrcLoc(..) ) import GHC.Tuple (Solo (..)) import GHC.Internal.Unicode ( GeneralCategory(..) ) @@ -1037,6 +1037,14 @@ data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# } , Generic1 -- ^ @since base-4.9.0.0 ) +-- | @since base-4.21.0.0 +instance Show (UAddr p) where + -- This Show instance would be equivalent to what deriving Show would generate, + -- but because deriving Show doesn't support Addr# fields we define it manually. + showsPrec d (UAddr x) = + showParen (d > appPrec) + (\y -> showString "UAddr {uAddr# = " (showsPrec 0 (Ptr x) (showChar '}' y))) + -- | Used for marking occurrences of 'Char#' -- -- @since base-4.9.0.0 ===================================== testsuite/tests/codeGen/should_gen_asm/T24941.hs ===================================== @@ -0,0 +1,23 @@ +module T24941 where + +data F = F + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float + + +foo ( F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + x30 x31 + ) + = + + F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + + x30 (x31+1) \ No newline at end of file ===================================== testsuite/tests/codeGen/should_gen_asm/all.T ===================================== @@ -10,3 +10,5 @@ test('memset-unroll', is_amd64_codegen, compile_cmp_asm, ['cmm', '']) test('bytearray-memset-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('bytearray-memcpy-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('T18137', [when(opsys('darwin'), skip), only_ways(llvm_ways)], compile_grep_asm, ['hs', False, '-fllvm -split-sections']) + +test('T24941', [only_ways(['optasm'])], compile, ['-fregs-graph']) ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -14003,6 +14003,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14017,6 +14018,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14032,6 +14034,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14047,6 +14050,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -15525,6 +15529,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -11230,6 +11230,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11244,6 +11245,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11259,6 +11261,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11274,6 +11277,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12770,6 +12774,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6a13e67250ef1b3ea96faef046bc4f15b5ea20ff...2e64d2ac7fd7a832bfe5e19b5475e41fab979d47 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6a13e67250ef1b3ea96faef046bc4f15b5ea20ff...2e64d2ac7fd7a832bfe5e19b5475e41fab979d47 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:05:40 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 26 Jul 2024 06:05:40 -0400 Subject: [Git][ghc/ghc][wip/T24984] 14 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <66a374f459404_1eafdd3e104871982@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 07d80970 by Simon Peyton Jones at 2024-07-26T11:02:57+01:00 Work in progress on rejigging kick-out - - - - - 901d7d53 by Simon Peyton Jones at 2024-07-26T11:02:57+01:00 Wibbles - - - - - 28665ff1 by Simon Peyton Jones at 2024-07-26T11:02:57+01:00 Fix egregious bug in any2 - - - - - 7849c9fc by Simon Peyton Jones at 2024-07-26T11:02:57+01:00 Add a very important rider to (KK3) (Not properly documented yet.) - - - - - da105b1c by Simon Peyton Jones at 2024-07-26T11:02:57+01:00 Documenation of the new plan - - - - - 24 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - compiler/GHC/Utils/Misc.hs - configure.ac - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/driver/testlib.py - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/add92ec7c0f58a4038602e2ffe413ed510690849...da105b1c925779ed01263a4943ff660cb467eeee -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/add92ec7c0f58a4038602e2ffe413ed510690849...da105b1c925779ed01263a4943ff660cb467eeee You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:12:16 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Fri, 26 Jul 2024 06:12:16 -0400 Subject: [Git][ghc/ghc][wip/fabu/T24452-confusing-error] 69 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a37680edd4a_1eafdd4f43687419c@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T24452-confusing-error at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 113ce029 by Fabricio de Sousa Nascimento at 2024-07-26T10:12:10+00:00 compiler: Fix emitting a confusing error for non visible class method Changes the error message when trying to lookup names on GRE that `must_have_parent` but we get an `AmbiguousOccurrence`. The new behavior now points the user to the missing name, instead of the name clash which would be unhelpful in solving their compiling issue. Fixes #24452 - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e82094bb524c7b6df784ef50f751fb9d9fe81e3...113ce02988605109da359248a681aeae988c21e5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e82094bb524c7b6df784ef50f751fb9d9fe81e3...113ce02988605109da359248a681aeae988c21e5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:14:45 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Fri, 26 Jul 2024 06:14:45 -0400 Subject: [Git][ghc/ghc][wip/T24984] Wiblbe Message-ID: <66a37715306c2_1eafdd4ff53875146@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: 62ea54a5 by Simon Peyton Jones at 2024-07-26T11:14:31+01:00 Wiblbe - - - - - 1 changed file: - compiler/GHC/Tc/Solver/InertSet.hs Changes: ===================================== compiler/GHC/Tc/Solver/InertSet.hs ===================================== @@ -1057,7 +1057,17 @@ Proving termination of the extended substitution T is suprisingly tricky. So we must kick out the inert item, even though (fs>=fw). (KK2b) does this by looking for lhs_w under type family applications in rhs_s -Tricky examples in: #19042, #17672 +Tricky examples in: #19042, #17672, #24984. The last (#24984) is particular subtle: + + Inert: [W] g1: F a0 ~ F a1 + [W] g2: F a2 ~ F a1 + [W] g3: F a3 ~ F a1 + +Now we add [W] g4: F a1 ~ F a7. Should we kick out g1,g2,g3? No! The +substitution doesn't need to be idempotent, merely terminating. And in #24984 +it turned out that we kept adding one new constraint and kicking out all the +previous inert ones (and that rewriting led to exponentially big constraints due +to lack of contraint sharing.) So we only want to look /under/ type family applications. The proof is hard. We start by ignoring flavours. Suppose that: * We are adding [lhs_w -fw-> rhs_w] to a well-formed, terminating substitution S. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/62ea54a56fb6a672397374bfa2361743cd6a2c15 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/62ea54a56fb6a672397374bfa2361743cd6a2c15 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:26:52 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Fri, 26 Jul 2024 06:26:52 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] 66 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a379ec56efd_1eafdd76d61c818bf@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 6075c584 by Fabricio de Sousa Nascimento at 2024-07-20T09:05:06+09:00 compiler: Fix emitting a confusing error for non visible class method Changes the error message when trying to lookup names on GRE that `must_have_parent` but we get an `AmbiguousOccurrence`. The new behavior now points the user to the missing name, instead of the name clash which would be unhelpful in solving their compiling issue. Fixes #24452 - - - - - 22d0832a by Fabricio de Sousa Nascimento at 2024-07-26T19:26:28+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2eedafca26daff472cd8b25ef743c598c88f5de7...22d0832ac24ca46195b2999526aa511da4b8368d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2eedafca26daff472cd8b25ef743c598c88f5de7...22d0832ac24ca46195b2999526aa511da4b8368d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:28:42 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Fri, 26 Jul 2024 06:28:42 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] 6 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a37a5a31593_1eafdd77cbbc826d5@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 38510c2e by Fabricio de Sousa Nascimento at 2024-07-26T19:28:33+09:00 compiler: Fix emitting a confusing error for non visible class method Changes the error message when trying to lookup names on GRE that `must_have_parent` but we get an `AmbiguousOccurrence`. The new behavior now points the user to the missing name, instead of the name clash which would be unhelpful in solving their compiling issue. Fixes #24452 - - - - - 284c6564 by Fabricio de Sousa Nascimento at 2024-07-26T19:28:33+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 30 changed files: - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - configure.ac - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T - + testsuite/tests/rename/T24452/AmbigPatSynA.hs - + testsuite/tests/rename/T24452/AmbigPatSynB.hs - + testsuite/tests/rename/T24452/T24452a.hs - + testsuite/tests/rename/T24452/T24452b.hs - + testsuite/tests/rename/T24452/T24452b.stderr - + testsuite/tests/rename/T24452/T24452c.hs - + testsuite/tests/rename/T24452/T24452c.stderr - + testsuite/tests/rename/T24452/T24452d.hs - + testsuite/tests/rename/T24452/T24452d.stderr - + testsuite/tests/rename/T24452/T24452e.hs - + testsuite/tests/rename/T24452/T24452e.stderr - + testsuite/tests/rename/T24452/T24452f.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/22d0832ac24ca46195b2999526aa511da4b8368d...284c6564bd7094f037f7a85a37d48e29915351c2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/22d0832ac24ca46195b2999526aa511da4b8368d...284c6564bd7094f037f7a85a37d48e29915351c2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 10:55:15 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 26 Jul 2024 06:55:15 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/pccdesc Message-ID: <66a380934933d_3d6a74124c8828031@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/pccdesc at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/pccdesc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 13:15:06 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 26 Jul 2024 09:15:06 -0400 Subject: [Git][ghc/ghc][wip/romes/pccdesc] 6 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a3a15a7f701_471bcbff37499048@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/pccdesc at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 452e82df by Rodrigo Mesquita at 2024-07-26T13:14:51+00:00 Refactor ProfilingInfo to preserve Unique information before rendering it - - - - - 3869ecbb by Rodrigo Mesquita at 2024-07-26T13:14:51+00:00 fixup! Refactor ProfilingInfo to preserve Unique information before rendering it - - - - - 24 changed files: - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/Info.hs - compiler/GHC/Cmm/Info/Build.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/StgToCmm/Bind.hs - compiler/GHC/StgToCmm/Closure.hs - configure.ac - libraries/base/changelog.md - libraries/base/src/Data/Functor/Classes.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - + testsuite/tests/perf/should_run/T25055.hs - + testsuite/tests/perf/should_run/T25055.stdout - testsuite/tests/perf/should_run/all.T - + testsuite/tests/typecheck/should_compile/T25094.hs - testsuite/tests/typecheck/should_compile/all.T Changes: ===================================== compiler/GHC/Cmm.hs ===================================== @@ -29,7 +29,7 @@ module GHC.Cmm ( -- * Info Tables CmmTopInfo(..), CmmStackInfo(..), CmmInfoTable(..), topInfoTable, ClosureTypeInfo(..), - ProfilingInfo(..), ConstrDescription, + ProfilingInfo(..), renderProfInfo, ConstrDescription, -- * Statements, expressions and types module GHC.Cmm.Node, @@ -40,8 +40,13 @@ module GHC.Cmm ( ) where import GHC.Prelude +import GHC.Utils.Panic (pprPanic) import GHC.Platform +import GHC.Core.TyCo.Rep +import GHC.Tc.Utils.TcType (tcSplitSigmaTy) +import GHC.Unit.Types (Module) +import GHC.Types.Name (Name, pprFullName, getOccString) import GHC.Types.Id import GHC.Types.CostCentre import GHC.Cmm.CLabel @@ -57,7 +62,6 @@ import GHC.Utils.Outputable import Data.Void (Void) import Data.List (intersperse) import Data.ByteString (ByteString) -import qualified Data.ByteString as BS ----------------------------------------------------------------------------- -- Cmm, GenCmm @@ -233,10 +237,73 @@ data CmmInfoTable instance OutputableP Platform CmmInfoTable where pdoc = pprInfoTable +----------------------------------------------------------------------------- +-- Profiling +----------------------------------------------------------------------------- + data ProfilingInfo = NoProfilingInfo - | ProfilingInfo ByteString ByteString -- closure_type, closure_desc + | ClosureProfilingInfo Module Id -- this_module, closure_id + | DataProfilingInfo Name Name -- datacon_tycon_name, datacon_name + | ParsedProfilingInfo String String + -- ^ Construct profiling info directly with the description and type strings (as in Cmm.Parser) + -- Note that if these strings leak non-deterministic uniques those will + -- ultimately leak into the object files regardless of the renaming pass. + -- In the parser they are stable since they're parsed directly as strings. deriving (Eq, Ord) + +-- | Render the profiling information as strings from a 'ProfilingInfo': +-- the first string is the type and the second is the description. +renderProfInfo :: ProfilingInfo -> Maybe (String {- type -}, String {- description -}) +renderProfInfo NoProfilingInfo = Nothing +renderProfInfo (ClosureProfilingInfo mod_name id) = Just (ty_descr, val_descr) + where + ty_descr = getTyDescription (idType id) + val_descr = closureDescription mod_name (idName id) +renderProfInfo (DataProfilingInfo datacon_tycon_name datacon_name) = Just (ty_descr, val_descr) + where + ty_descr = getOccString datacon_tycon_name + val_descr = getOccString datacon_name +renderProfInfo (ParsedProfilingInfo ty_descr val_descr) = Just (ty_descr, val_descr) + +-- For "global" data constructors the description is simply occurrence +-- name of the data constructor itself. Otherwise it is determined by +-- @closureDescription@ from the let binding information. + +closureDescription + :: Module -- Module + -> Name -- Id of closure binding + -> String + -- Not called for StgRhsCon which have global info tables built in + -- CgConTbls.hs with a description generated from the data constructor +closureDescription mod_name name + = showSDocOneLine defaultSDocContext + (char '<' <> pprFullName mod_name name <> char '>') + +getTyDescription :: Type -> String +getTyDescription ty + = case (tcSplitSigmaTy ty) of { (_, _, tau_ty) -> + case tau_ty of + TyVarTy _ -> "*" + AppTy fun _ -> getTyDescription fun + TyConApp tycon _ -> getOccString tycon + FunTy {} -> '-' : fun_result tau_ty + ForAllTy _ ty -> getTyDescription ty + LitTy n -> getTyLitDescription n + CastTy ty _ -> getTyDescription ty + CoercionTy co -> pprPanic "getTyDescription" (ppr co) + } + where + fun_result (FunTy { ft_res = res }) = '>' : fun_result res + fun_result other = getTyDescription other + +getTyLitDescription :: TyLit -> String +getTyLitDescription l = + case l of + NumTyLit n -> show n + StrTyLit n -> show n + CharTyLit n -> show n + ----------------------------------------------------------------------------- -- Static Data ----------------------------------------------------------------------------- @@ -431,11 +498,11 @@ pprInfoTable platform (CmmInfoTable { cit_lbl = lbl, cit_rep = rep , cit_srt = srt }) = vcat [ text "label: " <> pdoc platform lbl , text "rep: " <> ppr rep - , case prof_info of - NoProfilingInfo -> empty - ProfilingInfo ct cd -> - vcat [ text "type: " <> text (show (BS.unpack ct)) - , text "desc: " <> text (show (BS.unpack cd)) ] + , case renderProfInfo prof_info of + Nothing -> empty + Just (ct, cd) -> + vcat [ text "type: " <> text (show ct) + , text "desc: " <> text (show cd) ] , text "srt: " <> pdoc platform srt ] -- -------------------------------------------------------------------------- ===================================== compiler/GHC/Cmm/Info.hs ===================================== @@ -54,6 +54,7 @@ import GHC.Utils.Misc import GHC.Utils.Outputable import Data.ByteString (ByteString) +import qualified Data.ByteString.Char8 as BS8 -- When we split at proc points, we need an empty info table. mkEmptyContInfoTable :: CLabel -> CmmInfoTable @@ -413,11 +414,12 @@ mkStdInfoTable profile (type_descr, closure_descr) cl_type srt layout_lit ------------------------------------------------------------------------- mkProfLits :: Platform -> ProfilingInfo -> UniqSM ((CmmLit,CmmLit), [RawCmmDecl]) -mkProfLits platform NoProfilingInfo = return ((zeroCLit platform, zeroCLit platform), []) -mkProfLits _ (ProfilingInfo td cd) - = do { (td_lit, td_decl) <- newStringLit td - ; (cd_lit, cd_decl) <- newStringLit cd - ; return ((td_lit,cd_lit), [td_decl,cd_decl]) } +mkProfLits platform profInfo = case renderProfInfo profInfo of + Nothing -> return ((zeroCLit platform, zeroCLit platform), []) + Just (td, cd) + -> do { (td_lit, td_decl) <- newStringLit (BS8.pack td) + ; (cd_lit, cd_decl) <- newStringLit (BS8.pack cd) + ; return ((td_lit,cd_lit), [td_decl,cd_decl]) } newStringLit :: ByteString -> UniqSM (CmmLit, GenCmmDecl RawCmmStatics info stmt) newStringLit bytes ===================================== compiler/GHC/Cmm/Info/Build.hs ===================================== @@ -609,7 +609,6 @@ cafLattice = DataflowLattice Set.empty add let !new' = old `Set.union` new in changedIf (Set.size new' > Set.size old) new' - cafTransfers :: Platform -> LabelSet -> Label -> CLabel -> TransferFun CAFSet cafTransfers platform contLbls entry topLbl block@(BlockCC eNode middle xNode) fBase = ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1328,7 +1328,7 @@ reserveStackFrame psize preg body = do profilingInfo profile desc_str ty_str = if not (profileIsProfiling profile) then NoProfilingInfo - else ProfilingInfo (BS8.pack desc_str) (BS8.pack ty_str) + else ParsedProfilingInfo desc_str ty_str staticClosure :: UnitId -> FastString -> FastString -> [CmmLit] -> CmmParse () staticClosure pkg cl_label info payload ===================================== compiler/GHC/CmmToAsm/Reg/Linear.hs ===================================== @@ -644,7 +644,6 @@ releaseRegs regs = do _ -> loop (delFromUFM assig r) free rs loop assig free regs - -- ----------------------------------------------------------------------------- -- Clobber real registers ===================================== compiler/GHC/Core/Opt/Arity.hs ===================================== @@ -860,7 +860,7 @@ data ArityOpts = ArityOpts -- | The Arity returned is the number of value args the -- expression can be applied to without doing much work -exprEtaExpandArity :: ArityOpts -> CoreExpr -> Maybe SafeArityType +exprEtaExpandArity :: HasDebugCallStack => ArityOpts -> CoreExpr -> Maybe SafeArityType -- exprEtaExpandArity is used when eta expanding -- e ==> \xy -> e x y -- Nothing if the expression has arity 0 ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -2342,34 +2342,44 @@ rebuildCall env (ArgInfo { ai_fun = fun_id, ai_args = rev_args }) (ApplyToVal { sc_arg = arg, sc_env = arg_se , sc_cont = cont, sc_hole_ty = fun_ty }) | fun_id `hasKey` runRWKey - , [ TyArg {}, TyArg {} ] <- rev_args - -- Do this even if (contIsStop cont) + , [ TyArg { as_arg_ty = hole_ty }, TyArg {} ] <- rev_args + -- Do this even if (contIsStop cont), or if seCaseCase is off. -- See Note [No eta-expansion in runRW#] = do { let arg_env = arg_se `setInScopeFromE` env - ty' = contResultType cont + + overall_res_ty = contResultType cont + -- hole_ty is the type of the current runRW# application + (outer_cont, new_runrw_res_ty, inner_cont) + | seCaseCase env = (mkBoringStop overall_res_ty, overall_res_ty, cont) + | otherwise = (cont, hole_ty, mkBoringStop hole_ty) + -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] -- If the argument is a literal lambda already, take a short cut - -- This isn't just efficiency; if we don't do this we get a beta-redex - -- every time, so the simplifier keeps doing more iterations. + -- This isn't just efficiency: + -- * If we don't do this we get a beta-redex every time, so the + -- simplifier keeps doing more iterations. + -- * Even more important: see Note [No eta-expansion in runRW#] ; arg' <- case arg of Lam s body -> do { (env', s') <- simplBinder arg_env s - ; body' <- simplExprC env' body cont + ; body' <- simplExprC env' body inner_cont ; return (Lam s' body') } -- Important: do not try to eta-expand this lambda -- See Note [No eta-expansion in runRW#] + _ -> do { s' <- newId (fsLit "s") ManyTy realWorldStatePrimTy ; let (m,_,_) = splitFunTy fun_ty env' = arg_env `addNewInScopeIds` [s'] cont' = ApplyToVal { sc_dup = Simplified, sc_arg = Var s' - , sc_env = env', sc_cont = cont - , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy ty' } + , sc_env = env', sc_cont = inner_cont + , sc_hole_ty = mkVisFunTy m realWorldStatePrimTy new_runrw_res_ty } -- cont' applies to s', then K ; body' <- simplExprC env' arg cont' ; return (Lam s' body') } - ; let rr' = getRuntimeRep ty' - call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg ty', arg'] - ; return (emptyFloats env, call') } + ; let rr' = getRuntimeRep new_runrw_res_ty + call' = mkApps (Var fun_id) [mkTyArg rr', mkTyArg new_runrw_res_ty, arg'] + ; rebuild env call' outer_cont } ---------- Simplify value arguments -------------------- rebuildCall env fun_info @@ -2382,7 +2392,8 @@ rebuildCall env fun_info -- Strict arguments | isStrictArgInfo fun_info - , seCaseCase env + , seCaseCase env -- Only when case-of-case is on. See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = -- pprTrace "Strict Arg" (ppr arg $$ ppr (seIdSubst env) $$ ppr (seInScope env)) $ simplExprF (arg_se `setInScopeFromE` env) arg (StrictArg { sc_fun = fun_info, sc_fun_ty = fun_ty @@ -3195,7 +3206,9 @@ doCaseToLet scrut case_bndr -------------------------------------------------- reallyRebuildCase env scrut case_bndr alts cont - | not (seCaseCase env) + | not (seCaseCase env) -- Only when case-of-case is on. + -- See GHC.Driver.Config.Core.Opt.Simplify + -- Note [Case-of-case and full laziness] = do { case_expr <- simplAlts env scrut case_bndr alts (mkBoringStop (contHoleType cont)) ; rebuild env case_expr cont } ===================================== compiler/GHC/Core/Type.hs ===================================== @@ -2315,22 +2315,27 @@ buildSynTyCon name binders res_kind roles rhs where is_tau = isTauTy rhs is_fam_free = isFamFreeTy rhs + expanded_rhs = expandTypeSynonyms rhs + is_concrete = uniqSetAll isConcreteTyCon rhs_tycons - -- NB: is_concrete is allowed to be conservative, returning False - -- more often than it could. e.g. + rhs_tycons = tyConsOfType expanded_rhs + -- NB: we look at expanded_rhs e.g. -- type S a b = b -- type family F a -- type T a = S (F a) a - -- We will mark T as not-concrete, even though (since S ignore its first - -- argument, it could be marked concrete. - - is_forgetful = not (all ((`elemVarSet` rhs_tyvars) . binderVar) binders) || - uniqSetAny isForgetfulSynTyCon rhs_tycons - -- NB: is_forgetful is allowed to be conservative, returning True more often - -- than it should. See Note [Forgetful type synonyms] in GHC.Core.TyCon - - rhs_tycons = tyConsOfType rhs - rhs_tyvars = tyCoVarsOfType rhs + -- We want to mark T as concrete, because S ignores its first argument + + is_forgetful = not (all ((`elemVarSet` expanded_rhs_tyvars) . binderVar) binders) + expanded_rhs_tyvars = tyCoVarsOfType expanded_rhs + -- See Note [Forgetful type synonyms] in GHC.Core.TyCon + -- To find out if this TyCon is forgetful, expand the synonyms in its RHS + -- and check that all of the binders are free in the expanded type. + -- We really only need to expand the /forgetful/ synonyms on the RHS, + -- but we don't currently have a function to do that. + -- Failing to expand the RHS led to #25094, e.g. + -- type Bucket a b c = Key (a,b,c) + -- type Key x = Any + -- Here Bucket is definitely forgetful! {- ************************************************************************ ===================================== compiler/GHC/Driver/Config/Core/Opt/Simplify.hs ===================================== @@ -80,6 +80,7 @@ initGentleSimplMode :: DynFlags -> SimplMode initGentleSimplMode dflags = (initSimplMode dflags InitialPhase "Gentle") { -- Don't do case-of-case transformations. -- This makes full laziness work better + -- See Note [Case-of-case and full laziness] sm_case_case = False } @@ -89,3 +90,37 @@ floatEnable dflags = (True, True) -> FloatEnabled (True, False)-> FloatNestedOnly (False, _) -> FloatDisabled + + +{- Note [Case-of-case and full laziness] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Case-of-case can hide opportunities for let-floating (full laziness). +For example + rec { f = \y. case (expensive x) of (a,b) -> blah } +We might hope to float the (expensive x) out of the \y-loop. +But if we inline `expensive` we might get + \y. case (case x of I# x' -> body) of (a,b) -> blah +Now if we do case-of-case we get + \y. case x if I# x2 -> + case body of (a,b) -> blah + +Sadly, at this point `body` mentions `x2`, so we can't float it out of the +\y-loop. + +Solution: don't do case-of-case in the "gentle" simplification phase that +precedes the first float-out transformation. Implementation: + + * `sm_case_case` field in SimplMode + + * Consult `sm_case_case` (via `seCaseCase`) before doing case-of-case + in GHC.Core.Opt.Simplify.Iteration.rebuildCall. + +Wrinkles + +* This applies equally to the case-of-runRW# transformation: + case (runRW# (\s. body)) of (a,b) -> blah + ---> + runRW# (\s. case body of (a,b) -> blah) + Again, don't do this when `sm_case_case` is off. See #25055 for + a motivating example. +-} ===================================== compiler/GHC/StgToCmm/Bind.hs ===================================== @@ -18,7 +18,6 @@ import GHC.Prelude hiding ((<*>)) import GHC.Core ( AltCon(..) ) import GHC.Core.Opt.Arity( isOneShotBndr ) import GHC.Runtime.Heap.Layout -import GHC.Unit.Module import GHC.Stg.Syntax @@ -53,7 +52,6 @@ import GHC.Stg.Utils import GHC.Types.CostCentre import GHC.Types.Id import GHC.Types.Id.Info -import GHC.Types.Name import GHC.Types.Var.Set import GHC.Types.Basic import GHC.Types.Tickish ( tickishIsCode ) @@ -130,10 +128,8 @@ cgTopRhsClosure platform rec id ccs upd_flag args body = gen_code lf_info _closure_label = do { profile <- getProfile - ; let name = idName id ; mod_name <- getModuleName - ; let descr = closureDescription mod_name name - closure_info = mkClosureInfo profile True id lf_info 0 0 descr + ; let closure_info = mkClosureInfo profile True id lf_info 0 0 mod_name -- We don't generate the static closure here, because we might -- want to add references to static closures to it later. The @@ -423,15 +419,13 @@ mkRhsClosure profile _use_ap _check_tags bndr cc fvs upd_flag args body -- MAKE CLOSURE INFO FOR THIS CLOSURE ; mod_name <- getModuleName - ; let name = idName bndr - descr = closureDescription mod_name name - fv_details :: [(NonVoid Id, ByteOff)] + ; let fv_details :: [(NonVoid Id, ByteOff)] header = if isLFThunk lf_info then ThunkHeader else StdHeader (tot_wds, ptr_wds, fv_details) = mkVirtHeapOffsets profile header (addIdReps reduced_fvs) closure_info = mkClosureInfo profile False -- Not static bndr lf_info tot_wds ptr_wds - descr + mod_name -- BUILD ITS INFO TABLE AND CODE ; forkClosureBody $ @@ -478,10 +472,9 @@ cgRhsStdThunk bndr lf_info payload = mkVirtHeapOffsets profile header (addArgReps (nonVoidStgArgs payload)) - descr = closureDescription mod_name (idName bndr) closure_info = mkClosureInfo profile False -- Not static bndr lf_info tot_wds ptr_wds - descr + mod_name -- ; (use_cc, blame_cc) <- chooseDynCostCentres cc [{- no args-}] body ; let use_cc = cccsExpr platform; blame_cc = cccsExpr platform @@ -883,20 +876,3 @@ link_caf node = do ; return (CmmReg (CmmLocal bh)) } ------------------------------------------------------------------------- --- Profiling ------------------------------------------------------------------------- - --- For "global" data constructors the description is simply occurrence --- name of the data constructor itself. Otherwise it is determined by --- @closureDescription@ from the let binding information. - -closureDescription - :: Module -- Module - -> Name -- Id of closure binding - -> String - -- Not called for StgRhsCon which have global info tables built in - -- CgConTbls.hs with a description generated from the data constructor -closureDescription mod_name name - = showSDocOneLine defaultSDocContext - (char '<' <> pprFullName mod_name name <> char '>') ===================================== compiler/GHC/StgToCmm/Closure.hs ===================================== @@ -78,6 +78,7 @@ import GHC.Cmm.Utils import GHC.StgToCmm.Types import GHC.StgToCmm.Sequel +import GHC.Unit.Types (Module) import GHC.Types.CostCentre import GHC.Cmm.BlockId import GHC.Cmm.CLabel @@ -86,8 +87,6 @@ import GHC.Types.Id.Info import GHC.Core.DataCon import GHC.Types.Name import GHC.Core.Type -import GHC.Core.TyCo.Rep -import GHC.Tc.Utils.TcType import GHC.Core.TyCon import GHC.Types.RepType import GHC.Types.Basic @@ -96,7 +95,6 @@ import GHC.Utils.Panic import GHC.Data.Maybe (isNothing) import Data.Coerce (coerce) -import qualified Data.ByteString.Char8 as BS8 import GHC.StgToCmm.Config import GHC.Stg.InferTags.TagSig (isTaggedSig) @@ -701,9 +699,9 @@ mkClosureInfo :: Profile -> Id -> LambdaFormInfo -> Int -> Int -- Total and pointer words - -> String -- String descriptor + -> Module -> ClosureInfo -mkClosureInfo profile is_static id lf_info tot_wds ptr_wds val_descr +mkClosureInfo profile is_static id lf_info tot_wds ptr_wds mod_name = ClosureInfo { closureName = id , closureLFInfo = lf_info , closureInfoLabel = info_lbl -- These three fields are @@ -711,7 +709,7 @@ mkClosureInfo profile is_static id lf_info tot_wds ptr_wds val_descr , closureProf = prof } -- (we don't have an SRT yet) where sm_rep = mkHeapRep profile is_static ptr_wds nonptr_wds (lfClosureType lf_info) - prof = mkProfilingInfo profile id val_descr + prof = mkProfilingInfo profile mod_name id nonptr_wds = tot_wds - ptr_wds info_lbl = mkClosureInfoTableLabel (profilePlatform profile) id lf_info @@ -909,46 +907,24 @@ enterIdLabel platform id c -------------------------------------- -- Profiling -------------------------------------- - +-- -- Profiling requires two pieces of information to be determined for -- each closure's info table --- description and type. - --- The description is stored directly in the @CClosureInfoTable@ when the +-- +-- This information can be constructed from the current module and an Id. +-- We store the latter two in @ProfilingInfo@ and construct the information +-- with @renderProfInfo@ in GHC.Cmm. +-- +-- The description is stored directly in the @ClosureInfoTable@ when the -- info table is built. - +-- -- The type is determined from the type information stored with the @Id@ -- in the closure info using @closureTypeDescr at . -mkProfilingInfo :: Profile -> Id -> String -> ProfilingInfo -mkProfilingInfo profile id val_descr +mkProfilingInfo :: Profile -> Module -> Id -> ProfilingInfo +mkProfilingInfo profile mod_name id | not (profileIsProfiling profile) = NoProfilingInfo - | otherwise = ProfilingInfo ty_descr_w8 (BS8.pack val_descr) - where - ty_descr_w8 = BS8.pack (getTyDescription (idType id)) - -getTyDescription :: Type -> String -getTyDescription ty - = case (tcSplitSigmaTy ty) of { (_, _, tau_ty) -> - case tau_ty of - TyVarTy _ -> "*" - AppTy fun _ -> getTyDescription fun - TyConApp tycon _ -> getOccString tycon - FunTy {} -> '-' : fun_result tau_ty - ForAllTy _ ty -> getTyDescription ty - LitTy n -> getTyLitDescription n - CastTy ty _ -> getTyDescription ty - CoercionTy co -> pprPanic "getTyDescription" (ppr co) - } - where - fun_result (FunTy { ft_res = res }) = '>' : fun_result res - fun_result other = getTyDescription other - -getTyLitDescription :: TyLit -> String -getTyLitDescription l = - case l of - NumTyLit n -> show n - StrTyLit n -> show n - CharTyLit n -> show n + | otherwise = ClosureProfilingInfo mod_name id -------------------------------------- -- CmmInfoTable-related things @@ -970,10 +946,10 @@ mkDataConInfoTable profile data_con mn is_static ptr_wds nonptr_wds -- of the info table of a data constructor. prof | not (profileIsProfiling profile) = NoProfilingInfo - | otherwise = ProfilingInfo ty_descr val_descr + | otherwise = DataProfilingInfo datacon_tycon_name datacon_name - ty_descr = BS8.pack $ occNameString $ getOccName $ dataConTyCon data_con - val_descr = BS8.pack $ occNameString $ getOccName data_con + datacon_tycon_name = getName $ dataConTyCon data_con + datacon_name = getName data_con -- We need a black-hole closure info to pass to @allocDynClosure@ when we -- want to allocate the black hole on entry to a CAF. ===================================== configure.ac ===================================== @@ -97,11 +97,11 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_VAR(GHC,[Use as the bootstrap GHC. [default=autodetect]]) -AC_CHECK_PROG([GHC], [ghc], [ghc]) +AC_ARG_VAR(GHC,[Use as the full path to GHC. [default=autodetect]]) +AC_PATH_PROG([GHC], [ghc]) AC_ARG_WITH([ghc], - AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the bootstrap ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), - AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' instead)])) + AS_HELP_STRING([--with-ghc=PATH], [Use PATH as the full path to ghc (obsolete, use GHC=PATH instead) [default=autodetect]]), + AC_MSG_ERROR([--with-ghc=$withval is obsolete (use './configure GHC=$withval' or 'GHC=$withval ./configure' instead)])) AC_SUBST(WithGhc,$GHC) AC_ARG_ENABLE(bootstrap-with-devel-snapshot, ===================================== libraries/base/changelog.md ===================================== @@ -14,6 +14,7 @@ * Add `inits1` and `tails1` to `Data.List`, factored from the corresponding functions in `Data.List.NonEmpty` ([CLC proposal #252](https://github.com/haskell/core-libraries-committee/issues/252)) * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) + * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/Data/Functor/Classes.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE Safe #-} @@ -78,12 +79,13 @@ import Data.List.NonEmpty (NonEmpty(..)) import GHC.Internal.Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) -import GHC.Generics (Generic1(..), Generically1(..)) +import GHC.Generics (Generic1(..), Generically1(..), V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..) , (:+:)(..), (:*:)(..), (:.:)(..), URec(..), UAddr, UChar, UDouble, UFloat, UInt, UWord) import GHC.Tuple (Solo (..)) -import GHC.Internal.Read (expectP, list, paren) +import GHC.Internal.Read (expectP, list, paren, readField) +import GHC.Internal.Show (appPrec) -import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) -import GHC.Internal.Text.Read (Read(..), parens, prec, step) +import GHC.Internal.Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec, pfail) +import GHC.Internal.Text.Read (Read(..), parens, prec, step, reset) import GHC.Internal.Text.Read.Lex (Lexeme(..)) import GHC.Internal.Text.Show (showListWith) import Prelude @@ -1123,3 +1125,322 @@ and the corresponding 'Show1' instance as > showsBinaryWith sp (liftShowsPrec sp sl) "Two" d x y -} + +-- | @since base-4.21.0.0 +instance Eq1 V1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 V1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 V1 where + liftShowsPrec _ _ _ = \_ -> showString "V1" + +-- | @since base-4.21.0.0 +instance Read1 V1 where + liftReadsPrec _ _ = readPrec_to_S pfail + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 U1 where + liftEq _ = \_ _ -> True + +-- | @since base-4.21.0.0 +instance Ord1 U1 where + liftCompare _ = \_ _ -> EQ + +-- | @since base-4.21.0.0 +instance Show1 U1 where + liftShowsPrec _ _ _ = \U1 -> showString "U1" + +-- | @since base-4.21.0.0 +instance Read1 U1 where + liftReadPrec _ _ = + parens (expectP (Ident "U1") *> pure U1) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 Par1 where + liftEq eq = \(Par1 a) (Par1 a') -> eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 Par1 where + liftCompare cmp = \(Par1 a) (Par1 a') -> cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 Par1 where + liftShowsPrec sp _ d = \(Par1 { unPar1 = a }) -> + showsSingleFieldRecordWith sp "Par1" "unPar1" d a + +-- | @since base-4.21.0.0 +instance Read1 Par1 where + liftReadPrec rp _ = + readsSingleFieldRecordWith rp "Par1" "unPar1" Par1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (Rec1 f) where + liftEq eq = \(Rec1 a) (Rec1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (Rec1 f) where + liftCompare cmp = \(Rec1 a) (Rec1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (Rec1 f) where + liftShowsPrec sp sl d = \(Rec1 { unRec1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "Rec1" "unRec1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (Rec1 f) where + liftReadPrec rp rl = + readsSingleFieldRecordWith (liftReadPrec rp rl) "Rec1" "unRec1" Rec1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq c => Eq1 (K1 i c) where + liftEq _ = \(K1 a) (K1 a') -> a == a' + +-- | @since base-4.21.0.0 +instance Ord c => Ord1 (K1 i c) where + liftCompare _ = \(K1 a) (K1 a') -> compare a a' + +-- | @since base-4.21.0.0 +instance Show c => Show1 (K1 i c) where + liftShowsPrec _ _ d = \(K1 { unK1 = a }) -> + showsSingleFieldRecordWith showsPrec "K1" "unK1" d a + +-- | @since base-4.21.0.0 +instance Read c => Read1 (K1 i c) where + liftReadPrec _ _ = readData $ + readsSingleFieldRecordWith readPrec "K1" "unK1" K1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 f => Eq1 (M1 i c f) where + liftEq eq = \(M1 a) (M1 a') -> liftEq eq a a' + +-- | @since base-4.21.0.0 +instance Ord1 f => Ord1 (M1 i c f) where + liftCompare cmp = \(M1 a) (M1 a') -> liftCompare cmp a a' + +-- | @since base-4.21.0.0 +instance Show1 f => Show1 (M1 i c f) where + liftShowsPrec sp sl d = \(M1 { unM1 = a }) -> + showsSingleFieldRecordWith (liftShowsPrec sp sl) "M1" "unM1" d a + +-- | @since base-4.21.0.0 +instance Read1 f => Read1 (M1 i c f) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith (liftReadPrec rp rl) "M1" "unM1" M1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :+: g) where + liftEq eq = \lhs rhs -> case (lhs, rhs) of + (L1 a, L1 a') -> liftEq eq a a' + (R1 b, R1 b') -> liftEq eq b b' + _ -> False + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :+: g) where + liftCompare cmp = \lhs rhs -> case (lhs, rhs) of + (L1 _, R1 _) -> LT + (R1 _, L1 _) -> GT + (L1 a, L1 a') -> liftCompare cmp a a' + (R1 b, R1 b') -> liftCompare cmp b b' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :+: g) where + liftShowsPrec sp sl d = \x -> case x of + L1 a -> showsUnaryWith (liftShowsPrec sp sl) "L1" d a + R1 b -> showsUnaryWith (liftShowsPrec sp sl) "R1" d b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :+: g) where + liftReadPrec rp rl = readData $ + readUnaryWith (liftReadPrec rp rl) "L1" L1 <|> + readUnaryWith (liftReadPrec rp rl) "R1" R1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :*: g) where + liftEq eq = \(f :*: g) (f' :*: g') -> liftEq eq f f' && liftEq eq g g' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :*: g) where + liftCompare cmp = \(f :*: g) (f' :*: g') -> liftCompare cmp f f' <> liftCompare cmp g g' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :*: g) where + liftShowsPrec sp sl d = \(a :*: b) -> + showsBinaryOpWith + (liftShowsPrec sp sl) + (liftShowsPrec sp sl) + 7 + ":*:" + d + a + b + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :*: g) where + liftReadPrec rp rl = parens $ prec 6 $ + readBinaryOpWith (liftReadPrec rp rl) (liftReadPrec rp rl) ":*:" (:*:) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where + liftEq eq = \(Comp1 a) (Comp1 a') -> liftEq (liftEq eq) a a' + +-- | @since base-4.21.0.0 +instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where + liftCompare cmp = \(Comp1 a) (Comp1 a') -> liftCompare (liftCompare cmp) a a' + +-- | @since base-4.21.0.0 +instance (Show1 f, Show1 g) => Show1 (f :.: g) where + liftShowsPrec sp sl d = \(Comp1 { unComp1 = a }) -> + showsSingleFieldRecordWith + (liftShowsPrec (liftShowsPrec sp sl) (liftShowList sp sl)) + "Comp1" + "unComp1" + d + a + +-- | @since base-4.21.0.0 +instance (Read1 f, Read1 g) => Read1 (f :.: g) where + liftReadPrec rp rl = readData $ + readsSingleFieldRecordWith + (liftReadPrec (liftReadPrec rp rl) (liftReadListPrec rp rl)) + "Comp1" + "unComp1" + Comp1 + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + +-- | @since base-4.21.0.0 +instance Eq1 UAddr where + -- NB cannot use eqAddr# because its module isn't safe + liftEq _ = \(UAddr a) (UAddr b) -> UAddr a == UAddr b + +-- | @since base-4.21.0.0 +instance Ord1 UAddr where + liftCompare _ = \(UAddr a) (UAddr b) -> compare (UAddr a) (UAddr b) + +-- | @since base-4.21.0.0 +instance Show1 UAddr where + liftShowsPrec _ _ = showsPrec + +-- NB no Read1 for URec (Ptr ()) because there's no Read for Ptr. + +-- | @since base-4.21.0.0 +instance Eq1 UChar where + liftEq _ = \(UChar a) (UChar b) -> UChar a == UChar b + +-- | @since base-4.21.0.0 +instance Ord1 UChar where + liftCompare _ = \(UChar a) (UChar b) -> compare (UChar a) (UChar b) + +-- | @since base-4.21.0.0 +instance Show1 UChar where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UDouble where + liftEq _ = \(UDouble a) (UDouble b) -> UDouble a == UDouble b + +-- | @since base-4.21.0.0 +instance Ord1 UDouble where + liftCompare _ = \(UDouble a) (UDouble b) -> compare (UDouble a) (UDouble b) + +-- | @since base-4.21.0.0 +instance Show1 UDouble where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UFloat where + liftEq _ = \(UFloat a) (UFloat b) -> UFloat a == UFloat b + +-- | @since base-4.21.0.0 +instance Ord1 UFloat where + liftCompare _ = \(UFloat a) (UFloat b) -> compare (UFloat a) (UFloat b) + +-- | @since base-4.21.0.0 +instance Show1 UFloat where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UInt where + liftEq _ = \(UInt a) (UInt b) -> UInt a == UInt b + +-- | @since base-4.21.0.0 +instance Ord1 UInt where + liftCompare _ = \(UInt a) (UInt b) -> compare (UInt a) (UInt b) + +-- | @since base-4.21.0.0 +instance Show1 UInt where + liftShowsPrec _ _ = showsPrec + +-- | @since base-4.21.0.0 +instance Eq1 UWord where + liftEq _ = \(UWord a) (UWord b) -> UWord a == UWord b + +-- | @since base-4.21.0.0 +instance Ord1 UWord where + liftCompare _ = \(UWord a) (UWord b) -> compare (UWord a) (UWord b) + +-- | @since base-4.21.0.0 +instance Show1 UWord where + liftShowsPrec _ _ = showsPrec + +showsSingleFieldRecordWith :: (Int -> a -> ShowS) -> String -> String -> Int -> a -> ShowS +showsSingleFieldRecordWith sp name field d x = + showParen (d > appPrec) $ + showString name . showString " {" . showString field . showString " = " . sp 0 x . showChar '}' + +readsSingleFieldRecordWith :: ReadPrec a -> String -> String -> (a -> t) -> ReadPrec t +readsSingleFieldRecordWith rp name field cons = parens $ prec 11 $ do + expectP $ Ident name + expectP $ Punc "{" + x <- readField field $ reset rp + expectP $ Punc "}" + pure $ cons x + +showsBinaryOpWith + :: (Int -> a -> ShowS) + -> (Int -> b -> ShowS) + -> Int + -> String + -> Int + -> a + -> b + -> ShowS +showsBinaryOpWith sp1 sp2 opPrec name d x y = showParen (d >= opPrec) $ + sp1 opPrec x . showChar ' ' . showString name . showChar ' ' . sp2 opPrec y + +readBinaryOpWith + :: ReadPrec a + -> ReadPrec b + -> String + -> (a -> b -> t) + -> ReadPrec t +readBinaryOpWith rp1 rp2 name cons = + cons <$> step rp1 <* expectP (Symbol name) <*> step rp2 ===================================== libraries/ghc-internal/src/GHC/Internal/Generics.hs ===================================== @@ -735,7 +735,7 @@ import GHC.Internal.Data.Maybe ( Maybe(..), fromMaybe ) import GHC.Internal.Data.Ord ( Down(..) ) import GHC.Num.Integer ( Integer, integerToInt ) import GHC.Prim ( Addr#, Char#, Double#, Float#, Int#, Word# ) -import GHC.Internal.Ptr ( Ptr ) +import GHC.Internal.Ptr ( Ptr(..) ) import GHC.Types -- Needed for instances @@ -746,7 +746,7 @@ import GHC.Internal.Base ( Alternative(..), Applicative(..), Functor(..) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Internal.Enum ( Bounded, Enum ) import GHC.Internal.Read ( Read(..) ) -import GHC.Internal.Show ( Show(..), showString ) +import GHC.Internal.Show ( Show(..), showString, showChar, showParen, appPrec ) import GHC.Internal.Stack.Types ( SrcLoc(..) ) import GHC.Tuple (Solo (..)) import GHC.Internal.Unicode ( GeneralCategory(..) ) @@ -1037,6 +1037,14 @@ data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# } , Generic1 -- ^ @since base-4.9.0.0 ) +-- | @since base-4.21.0.0 +instance Show (UAddr p) where + -- This Show instance would be equivalent to what deriving Show would generate, + -- but because deriving Show doesn't support Addr# fields we define it manually. + showsPrec d (UAddr x) = + showParen (d > appPrec) + (\y -> showString "UAddr {uAddr# = " (showsPrec 0 (Ptr x) (showChar '}' y))) + -- | Used for marking occurrences of 'Char#' -- -- @since base-4.9.0.0 ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -14003,6 +14003,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14017,6 +14018,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14032,6 +14034,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -14047,6 +14050,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -15525,6 +15529,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -11230,6 +11230,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11244,6 +11245,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11259,6 +11261,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11274,6 +11277,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12770,6 +12774,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/interface-stability/base-exports.stdout-ws-32 ===================================== @@ -10962,6 +10962,7 @@ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Data.Functor.Identity.Iden instance [safe] Data.Functor.Classes.Eq1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Eq1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Eq1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Eq a => Data.Functor.Classes.Eq1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Eq a, GHC.Classes.Eq b) => Data.Functor.Classes.Eq1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10976,6 +10977,7 @@ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Data.Functor.Identity.Ide instance [safe] Data.Functor.Classes.Ord1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Ord1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Ord1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Classes.Ord a => Data.Functor.Classes.Ord1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Classes.Ord a, GHC.Classes.Ord b) => Data.Functor.Classes.Ord1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -10991,6 +10993,7 @@ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Read1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Read1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Read1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Read.Read a => Data.Functor.Classes.Read1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Read.Read a, GHC.Internal.Read.Read b) => Data.Functor.Classes.Read1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -11006,6 +11009,7 @@ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Data.Functor.Identity.Id instance [safe] Data.Functor.Classes.Show1 [] -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Maybe.Maybe -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Base.NonEmpty -- Defined in ‘Data.Functor.Classes’ +instance [safe] Data.Functor.Classes.Show1 GHC.Internal.Generics.Par1 -- Defined in ‘Data.Functor.Classes’ instance [safe] Data.Functor.Classes.Show1 Solo -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a. GHC.Internal.Show.Show a => Data.Functor.Classes.Show1 ((,) a) -- Defined in ‘Data.Functor.Classes’ instance [safe] forall a b. (GHC.Internal.Show.Show a, GHC.Internal.Show.Show b) => Data.Functor.Classes.Show1 ((,,) a b) -- Defined in ‘Data.Functor.Classes’ @@ -12495,6 +12499,7 @@ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec G instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Float p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Int p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.URec GHC.Types.Word p) -- Defined in ‘GHC.Internal.Generics’ +instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.UAddr p) -- Defined in ‘GHC.Internal.Generics’ instance forall k (p :: k). GHC.Internal.Show.Show (GHC.Internal.Generics.V1 p) -- Defined in ‘GHC.Internal.Generics’ instance GHC.Internal.Show.Show GHC.Internal.IO.Device.SeekMode -- Defined in ‘GHC.Internal.IO.Device’ instance GHC.Internal.Show.Show GHC.Internal.IO.Encoding.Types.CodingProgress -- Defined in ‘GHC.Internal.IO.Encoding.Types’ ===================================== testsuite/tests/perf/should_run/T25055.hs ===================================== @@ -0,0 +1,62 @@ +{-# OPTIONS_GHC -Wall #-} +-- based on https://byorgey.github.io/blog/posts/2024/06/21/cpih-product-divisors.html + + +import Control.Monad +import Control.Monad.ST +import Data.Array.ST +import Data.Array.Unboxed +import Data.Foldable + +-- This repro code turned out to be delicate wrt integer overflow +-- See comments in #25055 +-- So, for reproducibility we use Int32, to make sure the code works on +-- 32 bit machines with no overflow issues +import GHC.Int + +smallest :: Int32 -> UArray Int32 Int32 +smallest maxN = runSTUArray $ do + arr <- newGenArray (2,maxN) initA + for_ [5, 7 .. maxN] $ \k -> do + k' <- readArray arr k + when (k == k') $ do + -- for type Int32 when k = 46349, k * k is negative + -- for_ [k*k, k*(k+2) .. maxN] $ \oddMultipleOfK -> do + for_ [k, k + 2 .. maxN] $ \oddMultipleOfK -> do + modifyArray' arr oddMultipleOfK (min k) + return arr + where + initA i + | even i = return 2 + | i `rem` 3 == 0 = return 3 + | otherwise = return i + +factor :: STUArray s Int32 Int32 -> Int32 -> Int32 -> ST s () +-- With #25055 the program ran slow as it appear below, but +-- fast if you (a) comment out 'let p = smallest maxN ! m' +-- (b) un-comment the commented-out bindings for p and sm +factor countsArr maxN n = go n + where + -- sm = smallest maxN + + go 1 = return () + go m = do + -- let p = sm ! m + let p = smallest maxN ! m + modifyArray' countsArr p (+1) + go (m `div` p) + + +counts :: Int32 -> [Int32] -> UArray Int32 Int32 +counts maxN ns = runSTUArray $ do + cs <- newArray (2,maxN) 0 + for_ ns (factor cs maxN) + return cs + +solve :: [Int32] -> Int32 +solve = product . map (+ 1) . elems . counts 1000000 + +main :: IO () +main = + -- print $ maximum $ elems $ smallest 1000000 + print $ solve [1..100] ===================================== testsuite/tests/perf/should_run/T25055.stdout ===================================== @@ -0,0 +1 @@ +1188495 ===================================== testsuite/tests/perf/should_run/all.T ===================================== @@ -413,3 +413,4 @@ test('T21839r', # perf doesn't regress further, so it is not marked as such. test('T18964', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O']) test('T23021', [collect_stats('bytes allocated', 1), only_ways(['normal'])], compile_and_run, ['-O2']) +test('T25055', [collect_stats('bytes allocated', 2), only_ways(['normal'])], compile_and_run, ['-O2']) ===================================== testsuite/tests/typecheck/should_compile/T25094.hs ===================================== @@ -0,0 +1,98 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MagicHash #-} + +module T29054 where + + +------------------------------------------------------------------------------ +import Control.Monad.ST (ST) +import Data.Maybe (fromMaybe) +import Data.STRef +import GHC.Exts (Any, reallyUnsafePtrEquality#, (==#), isTrue#) +import Unsafe.Coerce +import Control.Monad.ST + +data MutableArray s a = MutableArray + +newArray :: Int -> a -> ST s (MutableArray s a) +newArray = undefined + +readArray :: MutableArray s a -> Int -> ST s a +readArray = undefined + +writeArray :: MutableArray s a -> Int -> a -> ST s () +writeArray = undefined + + +type Key a = Any + +------------------------------------------------------------------------------ +-- Type signatures +emptyRecord :: Key a +deletedRecord :: Key a +keyIsEmpty :: Key a -> Bool +toKey :: a -> Key a +fromKey :: Key a -> a + + +data TombStone = EmptyElement + | DeletedElement + +{-# NOINLINE emptyRecord #-} +emptyRecord = unsafeCoerce EmptyElement + +{-# NOINLINE deletedRecord #-} +deletedRecord = unsafeCoerce DeletedElement + +{-# INLINE keyIsEmpty #-} +keyIsEmpty a = isTrue# (x# ==# 1#) + where + !x# = reallyUnsafePtrEquality# a emptyRecord + +{-# INLINE toKey #-} +toKey = unsafeCoerce + +{-# INLINE fromKey #-} +fromKey = unsafeCoerce + + +type Bucket s k v = Key (Bucket_ s k v) + +------------------------------------------------------------------------------ +data Bucket_ s k v = Bucket { _bucketSize :: {-# UNPACK #-} !Int + , _highwater :: {-# UNPACK #-} !(STRef s Int) + , _keys :: {-# UNPACK #-} !(MutableArray s k) + , _values :: {-# UNPACK #-} !(MutableArray s v) + } + + +------------------------------------------------------------------------------ +emptyWithSize :: Int -> ST s (Bucket s k v) +emptyWithSize !sz = undefined + +------------------------------------------------------------------------------ +expandArray :: a -- ^ default value + -> Int -- ^ new size + -> Int -- ^ number of elements to copy + -> MutableArray s a -- ^ old array + -> ST s (MutableArray s a) +expandArray def !sz !hw !arr = undefined + +------------------------------------------------------------------------------ +growBucketTo :: Int -> Bucket s k v -> ST s (Bucket s k v) +growBucketTo !sz bk | keyIsEmpty bk = emptyWithSize sz + | otherwise = do + if osz >= sz + then return bk + else do + hw <- readSTRef hwRef + k' <- expandArray undefined sz hw keys + v' <- expandArray undefined sz hw values + return $ toKey $ Bucket sz hwRef k' v' + + where + bucket = fromKey bk + osz = _bucketSize bucket + hwRef = _highwater bucket + keys = _keys bucket + values = _values bucket ===================================== testsuite/tests/typecheck/should_compile/all.T ===================================== @@ -919,4 +919,4 @@ test('T23739a', normal, compile, ['']) test('T24810', normal, compile, ['']) test('T24887', normal, compile, ['']) test('T24938a', normal, compile, ['']) - +test('T25094', normal, compile, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0c6fa0b162989d2ff9c6486ef40d7ed7c3326663...3869ecbb1fc3ba6f136fe48c00ef304432162126 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0c6fa0b162989d2ff9c6486ef40d7ed7c3326663...3869ecbb1fc3ba6f136fe48c00ef304432162126 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 13:18:14 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Fri, 26 Jul 2024 09:18:14 -0400 Subject: [Git][ghc/ghc][wip/romes/25052] ghc-internal: No trailing whitespace in exceptions Message-ID: <66a3a21663289_471bcbfeeec995b9@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25052 at Glasgow Haskell Compiler / GHC Commits: c0d24252 by Rodrigo Mesquita at 2024-07-26T14:18:05+01:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 2 changed files: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs - testsuite/tests/driver/T13914/T13914.stdout Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -199,11 +199,14 @@ instance Exception SomeException where fromException = Just backtraceDesired (SomeException e) = backtraceDesired e displayException (SomeException e) = - displayException e ++ "\n" ++ displayContext ?exceptionContext + case displayContext ?exceptionContext of + "" -> displayException e + dc -> displayException e ++ "\n" ++ dc displayContext :: ExceptionContext -> String displayContext (ExceptionContext anns0) = go anns0 where + go [SomeExceptionAnnotation ann] = displayExceptionAnnotation ann go (SomeExceptionAnnotation ann : anns) = displayExceptionAnnotation ann ++ "\n" ++ go anns go [] = "" ===================================== testsuite/tests/driver/T13914/T13914.stdout ===================================== @@ -10,7 +10,6 @@ HasCallStack backtrace: throwIO, called at libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs:453:5 in ghc-internal:GHC.Internal.IO.Exception assert, called at main.hs:3:8 in main:Main - With -fignore-asserts [1 of 2] Compiling Main ( main.hs, main.o ) [Optimisation flags changed] [2 of 2] Linking main [Objects changed] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c0d242527a06756f5baafd05d79e6b26ee3e94f1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c0d242527a06756f5baafd05d79e6b26ee3e94f1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 13:32:50 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 26 Jul 2024 09:32:50 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Fix nasty bug in occurrence analyser Message-ID: <66a3a582371d7_471bcec728c101127@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 025b24e2 by Simon Peyton Jones at 2024-07-26T09:32:35-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 7eb88c41 by Torsten Schmits at 2024-07-26T09:32:35-04:00 add missing cell in flavours table - - - - - 15 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - hadrian/doc/flavours.md - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e64d2ac7fd7a832bfe5e19b5475e41fab979d47...7eb88c410766e043735d6ae7330ccfdb00a87264 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2e64d2ac7fd7a832bfe5e19b5475e41fab979d47...7eb88c410766e043735d6ae7330ccfdb00a87264 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 14:28:11 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 26 Jul 2024 10:28:11 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] avoid case-insensitivity clobber in test Message-ID: <66a3b27ba8521_b221c38789030536@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: b802ba6d by Torsten Schmits at 2024-07-26T16:24:35+02:00 avoid case-insensitivity clobber in test - - - - - 5 changed files: - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,5 +1,5 @@ test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, ignore_stderr ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b802ba6dc7721958cc4a483aae0ab6bd27702702 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b802ba6dc7721958cc4a483aae0ab6bd27702702 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 17:44:24 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 26 Jul 2024 13:44:24 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] compile exe in test with core bindings to avoid recompilation of Hello Message-ID: <66a3e078cc0ef_2093307e3c041070d2@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 26e5520d by Torsten Schmits at 2024-07-26T19:44:17+02:00 compile exe in test with core bindings to avoid recompilation of Hello - - - - - 3 changed files: - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T Changes: ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -5,5 +5,5 @@ include $(TOP)/mk/test.mk T24634: $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello_c.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -2,7 +2,6 @@ test('T24634', [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr ], makefile_test, []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/26e5520db301b01225f36959673af5c9eec24992 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/26e5520db301b01225f36959673af5c9eec24992 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 18:17:33 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 26 Jul 2024 14:17:33 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-squashed] 62 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a3e83d12013_2f40f08dea0563f@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 2f3dc953 by Cheng Shao at 2024-07-26T19:57:04+02:00 Oneshot bytecode linking - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Make.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/79b0072bd6f04e90132b6c2b6e2cf7f9481ec9ac...2f3dc95393cd323d2931575cc8b148e311283b67 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/79b0072bd6f04e90132b6c2b6e2cf7f9481ec9ac...2f3dc95393cd323d2931575cc8b148e311283b67 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 18:25:54 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Fri, 26 Jul 2024 14:25:54 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] 63 commits: compiler: Turn `FinderCache` into a record of operations so that GHC API clients can Message-ID: <66a3ea32d0b90_2f40f0faf8c58f0@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - 2f3dc953 by Cheng Shao at 2024-07-26T19:57:04+02:00 Oneshot bytecode linking - - - - - 918eb44f by Torsten Schmits at 2024-07-26T20:20:13+02:00 Package deps bytecode linking - - - - - 30 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Make.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f06853e2ecdb80d6bcc09833f1c7faf1fbe65685...918eb44ff4694fd5ac26da672b97448dce74c0be -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f06853e2ecdb80d6bcc09833f1c7faf1fbe65685...918eb44ff4694fd5ac26da672b97448dce74c0be You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 18:42:01 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Fri, 26 Jul 2024 14:42:01 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] 5 commits: Instr Haddock Message-ID: <66a3edf979b41_2f40f036420012634@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: 59c11901 by Sven Tennie at 2024-07-26T19:49:11+02:00 Instr Haddock - - - - - 4d5b69d3 by Sven Tennie at 2024-07-26T19:49:30+02:00 Fix logical error There's no REM for any float involved - at any position. - - - - - 606b1d93 by Sven Tennie at 2024-07-26T19:51:32+02:00 Cleanup - - - - - a8796fad by Sven Tennie at 2024-07-26T20:18:37+02:00 Rename DMBSY to FENCE The plan to have one common instruction set with AArch64 didn't work out. That way it's less confusing. - - - - - c5f8ea14 by Sven Tennie at 2024-07-26T20:40:26+02:00 Haddock and remove old comments - - - - - 3 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs - compiler/GHC/CmmToAsm/RV64/Ppr.hs Changes: ===================================== compiler/GHC/CmmToAsm/RV64/CodeGen.hs ===================================== @@ -1592,9 +1592,9 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do -- atomic_thread_fence(memory_order_acquire); -- atomic_thread_fence(memory_order_release); -- atomic_thread_fence(memory_order_seq_cst); - MO_AcquireFence -> pure (unitOL (DMBSY DmbRead DmbReadWrite)) - MO_ReleaseFence -> pure (unitOL (DMBSY DmbReadWrite DmbWrite)) - MO_SeqCstFence -> pure (unitOL (DMBSY DmbReadWrite DmbReadWrite)) + MO_AcquireFence -> pure (unitOL (FENCE FenceRead FenceReadWrite)) + MO_ReleaseFence -> pure (unitOL (FENCE FenceReadWrite FenceWrite)) + MO_SeqCstFence -> pure (unitOL (FENCE FenceReadWrite FenceReadWrite)) MO_Touch -> pure nilOL -- Keep variables live (when using interior pointers) -- Prefetch @@ -1638,12 +1638,12 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do MemOrderRelaxed -> unitOL $ ann moDescr (LDR (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p)) MemOrderAcquire -> toOL [ ann moDescr (LDR (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p)), - DMBSY DmbRead DmbReadWrite + FENCE FenceRead FenceReadWrite ] MemOrderSeqCst -> toOL [ - ann moDescr (DMBSY DmbReadWrite DmbReadWrite), + ann moDescr (FENCE FenceReadWrite FenceReadWrite), LDR (intFormat w) (OpReg w dst) (OpAddr $ AddrReg p), - DMBSY DmbRead DmbReadWrite + FENCE FenceRead FenceReadWrite ] MemOrderRelease -> panic $ "Unexpected MemOrderRelease on an AtomicRead: " ++ show mo dst = getRegisterReg platform (CmmLocal dst_reg) @@ -1663,12 +1663,12 @@ genCCall (PrimTarget mop) dest_regs arg_regs = do let instrs = case ord of MemOrderRelaxed -> unitOL $ ann moDescr (STR fmt_val (OpReg w val) (OpAddr $ AddrReg p)) MemOrderSeqCst -> toOL [ - ann moDescr (DMBSY DmbReadWrite DmbWrite), + ann moDescr (FENCE FenceReadWrite FenceWrite), STR fmt_val (OpReg w val) (OpAddr $ AddrReg p), - DMBSY DmbReadWrite DmbReadWrite + FENCE FenceReadWrite FenceReadWrite ] MemOrderRelease -> toOL [ - ann moDescr (DMBSY DmbReadWrite DmbWrite), + ann moDescr (FENCE FenceReadWrite FenceWrite), STR fmt_val (OpReg w val) (OpAddr $ AddrReg p) ] MemOrderAcquire -> panic $ "Unexpected MemOrderAcquire on an AtomicWrite" ++ show mo @@ -1925,7 +1925,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = STR {} -> 1 LDR {} -> 3 LDRU {} -> 1 - DMBSY {} -> 1 + FENCE {} -> 1 FCVT {} -> 1 SCVTF {} -> 1 FCVTZS {} -> 1 ===================================== compiler/GHC/CmmToAsm/RV64/Instr.hs ===================================== @@ -70,15 +70,12 @@ instance Outputable RegUsage where -- RegUsage = RU [] [] regUsageOfInstr :: Platform -> Instr -> RegUsage regUsageOfInstr platform instr = case instr of - -- 0. Meta Instructions ANN _ i -> regUsageOfInstr platform i COMMENT{} -> usage ([], []) MULTILINE_COMMENT{} -> usage ([], []) PUSH_STACK_FRAME -> usage ([], []) POP_STACK_FRAME -> usage ([], []) DELTA{} -> usage ([], []) - - -- 1. Arithmetic Instructions ------------------------------------------------ ADD dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) MUL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) NEG dst src -> usage (regOp src, regOp dst) @@ -88,9 +85,6 @@ regUsageOfInstr platform instr = case instr of REMU dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) SUB dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) DIVU dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) - - -- 2. Bit Manipulation Instructions ------------------------------------------ - -- 3. Logical and Move Instructions ------------------------------------------ AND dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) OR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) ASR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) @@ -101,24 +95,15 @@ regUsageOfInstr platform instr = case instr of -- ORI's third operand is always an immediate ORI dst src1 _ -> usage (regOp src1, regOp dst) XORI dst src1 _ -> usage (regOp src1, regOp dst) - -- 4. Branch Instructions ---------------------------------------------------- J_TBL _ _ t -> usage ([t], []) B t -> usage (regTarget t, []) BCOND _ l r t -> usage (regTarget t ++ regOp l ++ regOp r, []) BL t ps -> usage (t : ps, callerSavedRegisters) - - -- 5. Atomic Instructions ---------------------------------------------------- - -- 6. Conditional Instructions ----------------------------------------------- CSET dst l r _ -> usage (regOp l ++ regOp r, regOp dst) - -- 7. Load and Store Instructions -------------------------------------------- STR _ src dst -> usage (regOp src ++ regOp dst, []) LDR _ dst src -> usage (regOp src, regOp dst) LDRU _ dst src -> usage (regOp src, regOp dst) - - -- 8. Synchronization Instructions ------------------------------------------- - DMBSY _ _ -> usage ([], []) - - -- 9. Floating Point Instructions -------------------------------------------- + FENCE _ _ -> usage ([], []) FCVT dst src -> usage (regOp src, regOp dst) SCVTF dst src -> usage (regOp src, regOp dst) FCVTZS dst src -> usage (regOp src, regOp dst) @@ -127,7 +112,6 @@ regUsageOfInstr platform instr = case instr of usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) _ -> panic $ "regUsageOfInstr: " ++ instrCon instr - where -- filtering the usage is necessary, otherwise the register -- allocator will try to allocate pre-defined fixed stg @@ -169,14 +153,12 @@ callerSavedRegisters = -- | Apply a given mapping to all the register references in this instruction. patchRegsOfInstr :: Instr -> (Reg -> Reg) -> Instr patchRegsOfInstr instr env = case instr of - -- 0. Meta Instructions ANN d i -> ANN d (patchRegsOfInstr i env) COMMENT{} -> instr MULTILINE_COMMENT{} -> instr PUSH_STACK_FRAME -> instr POP_STACK_FRAME -> instr DELTA{} -> instr - -- 1. Arithmetic Instructions ---------------------------------------------- ADD o1 o2 o3 -> ADD (patchOp o1) (patchOp o2) (patchOp o3) MUL o1 o2 o3 -> MUL (patchOp o1) (patchOp o2) (patchOp o3) NEG o1 o2 -> NEG (patchOp o1) (patchOp o2) @@ -186,10 +168,6 @@ patchRegsOfInstr instr env = case instr of REMU o1 o2 o3 -> REMU (patchOp o1) (patchOp o2) (patchOp o3) SUB o1 o2 o3 -> SUB (patchOp o1) (patchOp o2) (patchOp o3) DIVU o1 o2 o3 -> DIVU (patchOp o1) (patchOp o2) (patchOp o3) - - -- 2. Bit Manipulation Instructions ---------------------------------------- - - -- 3. Logical and Move Instructions ---------------------------------------- AND o1 o2 o3 -> AND (patchOp o1) (patchOp o2) (patchOp o3) OR o1 o2 o3 -> OR (patchOp o1) (patchOp o2) (patchOp o3) ASR o1 o2 o3 -> ASR (patchOp o1) (patchOp o2) (patchOp o3) @@ -200,26 +178,15 @@ patchRegsOfInstr instr env = case instr of -- o3 cannot be a register for ORI (always an immediate) ORI o1 o2 o3 -> ORI (patchOp o1) (patchOp o2) (patchOp o3) XORI o1 o2 o3 -> XORI (patchOp o1) (patchOp o2) (patchOp o3) - - -- 4. Branch Instructions -------------------------------------------------- J_TBL ids mbLbl t -> J_TBL ids mbLbl (env t) B t -> B (patchTarget t) BL t ps -> BL (patchReg t) ps BCOND c o1 o2 t -> BCOND c (patchOp o1) (patchOp o2) (patchTarget t) - - -- 5. Atomic Instructions -------------------------------------------------- - -- 6. Conditional Instructions --------------------------------------------- CSET o l r c -> CSET (patchOp o) (patchOp l) (patchOp r) c - -- 7. Load and Store Instructions ------------------------------------------ STR f o1 o2 -> STR f (patchOp o1) (patchOp o2) - -- STLR f o1 o2 -> STLR f (patchOp o1) (patchOp o2) LDR f o1 o2 -> LDR f (patchOp o1) (patchOp o2) LDRU f o1 o2 -> LDRU f (patchOp o1) (patchOp o2) - - -- 8. Synchronization Instructions ----------------------------------------- - DMBSY o1 o2 -> DMBSY o1 o2 - - -- 9. Floating Point Instructions ------------------------------------------ + FENCE o1 o2 -> FENCE o1 o2 FCVT o1 o2 -> FCVT (patchOp o1) (patchOp o2) SCVTF o1 o2 -> SCVTF (patchOp o1) (patchOp o2) FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) @@ -244,8 +211,6 @@ patchRegsOfInstr instr env = case instr of patchReg :: Reg -> Reg patchReg = env --------------------------------------------------------------------------------- - -- | Checks whether this instruction is a jump/branch instruction. -- -- One that can change the flow of control in a way that the @@ -470,136 +435,131 @@ allocMoreStack platform slots proc@(CmmProc info lbl live (ListGraph code)) = do new_code = concatMap insert_stack_insn code return (CmmProc info lbl live (ListGraph new_code), retargetList) --- ----------------------------------------------------------------------------- --- Machine's assembly language - --- We have a few common "instructions" (nearly all the pseudo-ops) but --- mostly all of 'Instr' is machine-specific. - --- RV64 reference card: https://cs61c.org/sp23/pdfs/resources/reference-card.pdf --- RV64 pseudo instructions: https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md#-a-listing-of-standard-risc-v-pseudoinstructions --- We will target: RV64G(C). That is G = I+A+F+S+D --- I: Integer Multiplication and Division --- A: Atomic Instructions --- F: Single Precision --- D: Double Precision --- C: Compressed (though we won't use that). - --- This most notably leaves out B. (Bit Manipulation) instructions. - data Instr - -- 0. Pseudo Instructions -------------------------------------------------- - -- comment pseudo-op + -- | Comment pseudo-op = COMMENT SDoc + -- | Multi-line comment pseudo-op | MULTILINE_COMMENT SDoc - - -- Annotated instruction. Should print # + -- | Annotated instruction. Should print # | ANN SDoc Instr - - -- location pseudo-op (file, line, col, name) + -- | Location pseudo-op @.loc@ (file, line, col, name) | LOCATION Int Int Int LexicalFastString - - -- some static data spat out during code - -- generation. Will be extracted before - -- pretty-printing. + -- | Static data spat out during code generation. | LDATA Section RawCmmStatics - - -- start a new basic block. Useful during - -- codegen, removed later. Preceding - -- instruction should be a jump, as per the - -- invariants for a BasicBlock (see Cmm). + -- | Start a new basic block. + -- + -- Useful during codegen, removed later. Preceding instruction should be a + -- jump, as per the invariants for a BasicBlock (see Cmm). | NEWBLOCK BlockId - - -- specify current stack offset for - -- benefit of subsequent passes + -- | Specify current stack offset for benefit of subsequent passes | DELTA Int - + -- | Push a minimal stack frame consisting of the return address (RA) and the frame pointer (FP). | PUSH_STACK_FRAME + -- | Pop the minimal stack frame of prior `PUSH_STACK_FRAME`. | POP_STACK_FRAME - - -- == Base Instructions (I) ================================================ - -- 1. Arithmetic Instructions ---------------------------------------------- - -- all of these instructions can also take an immediate, in which case they - -- hafe a suffix I (except for U suffix, where it's IU then. E.g. SLTIU). - | ADD Operand Operand Operand -- rd = rs1 + rs2 - | SUB Operand Operand Operand -- rd = rs1 - rs2 - - | AND Operand Operand Operand -- rd = rs1 & rs2 - | OR Operand Operand Operand -- rd = rs1 | rs2 - -- | XOR Operand Operand Operand -- rd = rs1 ^ rs2 - | LSL {- SLL -} Operand Operand Operand -- rd = rs1 << rs2 (zero ext) - | LSR {- SRL -} Operand Operand Operand -- rd = rs1 >> rs2 (zero ext) - | ASR {- SRA -} Operand Operand Operand -- rd = rs1 >> rs2 (sign ext) - - -- 2. Memory Load/Store Instructions --------------------------------------- - -- Unlike arm, we don't have register shorthands for size. - -- We do however have {L,S}{B,H,W,D}[U] instructions for Load/Store, Byte, Half, Word, Double, (Unsigned). - -- Reusing the arm logic with the _format_ specifier will hopefully work. - | STR Format Operand Operand -- str Xn, address-mode // Xn -> *addr - | LDR Format Operand Operand -- ldr Xn, address-mode // Xn <- *addr (sign-extended) - | LDRU Format Operand Operand -- ldr Xn, address-mode // Xn <- *addr (unsigned) - - -- 3. Control Flow --------------------------------------------------------- - -- B{EQ,GE,GEU,LT,LTU}, these are effectively BCOND from AArch64; - -- however, AArch64 desugars them into CMP + BCOND. So these are a bit more - -- powerful. - -- JAL / JARL are effectively the BL instruction from AArch64. - - | MUL Operand Operand Operand -- rd = rn × rm - - - -- Pseudo/synthesized: - | NEG Operand Operand -- rd = -op2 - - | DIV Operand Operand Operand -- rd = rn ÷ rm - | REM Operand Operand Operand -- rd = rn % rm (signed) - | REMU Operand Operand Operand -- rd = rn % rm (unsigned) - + -- | Arithmetic addition (both integer and floating point) + -- + -- @rd = rs1 + rs2@ + | ADD Operand Operand Operand + -- | Arithmetic subtraction (both integer and floating point) + -- + -- @rd = rs1 - rs2@ + | SUB Operand Operand Operand + -- | Logical AND (integer only) + -- + -- @rd = rs1 & rs2@ + | AND Operand Operand Operand + -- | Logical OR (integer only) + -- + -- @rd = rs1 | rs2@ + | OR Operand Operand Operand + -- | Logical left shift (zero extened, integer only) + -- + -- @rd = rs1 << rs2@ + | LSL {- SLL -} Operand Operand Operand + -- | Logical right shift (zero extened, integer only) + -- + -- @rd = rs1 >> rs2@ + | LSR {- SRL -} Operand Operand Operand + -- | Arithmetic right shift (sign-extened, integer only) + -- + -- @rd = rs1 >> rs2@ + | ASR {- SRA -} Operand Operand Operand + -- | Store to memory (both, integer and floating point) + | STR Format Operand Operand + -- | Load from memory (sign-extended, integer and floating point) + | LDR Format Operand Operand + -- | Load from memory (unsigned, integer and floating point) + | LDRU Format Operand Operand + -- | Arithmetic multiplication (both, integer and floating point) + -- + -- @rd = rn × rm@ + | MUL Operand Operand Operand + -- | Negation (both, integer and floating point) + -- + -- @rd = -op2@ + | NEG Operand Operand + -- | Division (both, integer and floating point) + -- + -- @rd = rn ÷ rm@ + | DIV Operand Operand Operand + -- | Remainder (integer only, signed) + -- + -- @rd = rn % rm@ + | REM Operand Operand Operand -- + -- | Remainder (integer only, unsigned) + -- + -- @rd = |rn % rm|@ + | REMU Operand Operand Operand -- TODO: Rename: MULH + -- | High part of a multiplication that doesn't fit into 64bits (integer only) + -- + -- E.g. for a multiplication with 64bits width: @rd = (rs1 * rs2) >> 64 at . | SMULH Operand Operand Operand - | DIVU Operand Operand Operand -- rd = rn ÷ rm - - -- 2. Bit Manipulation Instructions ---------------------------------------- - - -- 3. Logical and Move Instructions ---------------------------------------- - -- | AND Operand Operand Operand -- rd = rn & op2 - -- | ANDS Operand Operand Operand -- rd = rn & op2 - -- | ASR Operand Operand Operand -- rd = rn ≫ rm or rd = rn ≫ #i, i is 6 bits - | XOR Operand Operand Operand -- rd = rn ⊕ op2 - -- | LSL Operand Operand Operand -- rd = rn ≪ rm or rd = rn ≪ #i, i is 6 bits - -- | LSR Operand Operand Operand -- rd = rn ≫ rm or rd = rn ≫ #i, i is 6 bits - | MOV Operand Operand -- rd = rn or rd = #i - | ORI Operand Operand Operand -- rd = rn | op2 - | XORI Operand Operand Operand -- rd = rn `xor` imm - -- Load and stores. - - -- Conditional instructions - + -- | Unsigned division (integer only) + -- + -- @rd = |rn ÷ rm|@ + | DIVU Operand Operand Operand + -- | XOR (integer only) + -- + -- @rd = rn ⊕ op2@ + | XOR Operand Operand Operand + -- | ORI with immediate (integer only) + -- + -- @rd = rn | op2@ + | ORI Operand Operand Operand + -- | OR with immediate (integer only) + -- + -- @rd = rn ⊕ op2@ + | XORI Operand Operand Operand + -- | Move to register (integer and floating point) + -- + -- @rd = rn@ or @rd = #imm@ + | MOV Operand Operand -- | Pseudo-op for conditional setting of a register. -- -- @if(o2 cond o3) op <- 1 else op <- 0@ | CSET Operand Operand Operand Cond - - -- Branching. -- | A jump instruction with data for switch/jump tables | J_TBL [Maybe BlockId] (Maybe CLabel) Reg -- | Unconditional jump (no linking) | B Target -- | Unconditional jump, links return address (sets @ra@/@x1@) | BL Reg [Reg] - | BCOND Cond Operand Operand Target -- branch with condition. b. - -- | pseudo-op for far branch targets - - -- 8. Synchronization Instructions ----------------------------------------- - | DMBSY DmbType DmbType - -- 9. Floating Point Instructions - -- | Float ConVerT + -- | branch with condition (integer only) + | BCOND Cond Operand Operand Target + -- | Fence instruction + -- + -- Memory barrier. + | FENCE FenceType FenceType + -- | Floating point ConVerT | FCVT Operand Operand - -- | Signed ConVerT Float + -- | Signed floating point ConVerT | SCVTF Operand Operand - -- | Float ConVerT to Zero Signed + -- TODO: Same as SCVTF? + -- | Floating point ConVerT to Zero Signed | FCVTZS Operand Operand - -- | Float ABSolute value + -- | Floating point ABSolute value | FABS Operand Operand -- | Floating-point fused multiply-add instructions -- @@ -609,7 +569,8 @@ data Instr -- - fnmadd: d = - r1 * r2 - r3 | FMA FMASign Operand Operand Operand Operand -data DmbType = DmbRead | DmbWrite | DmbReadWrite +-- | Operand of a FENCE instruction (@r@, @w@ or @rw@) +data FenceType = FenceRead | FenceWrite | FenceReadWrite instrCon :: Instr -> String instrCon i = @@ -649,7 +610,7 @@ instrCon i = B{} -> "B" BL{} -> "BL" BCOND{} -> "BCOND" - DMBSY{} -> "DMBSY" + FENCE{} -> "FENCE" FCVT{} -> "FCVT" SCVTF{} -> "SCVTF" FCVTZS{} -> "FCVTZS" ===================================== compiler/GHC/CmmToAsm/RV64/Ppr.hs ===================================== @@ -268,12 +268,15 @@ pprDataImm p (ImmConstantSum a b) = pprDataImm p a <> char '+' <> pprDataImm p b pprDataImm p (ImmConstantDiff a b) = pprDataImm p a <> char '-' <> lparen <> pprDataImm p b <> rparen +-- | Comment @c@ with @# c@ asmComment :: SDoc -> SDoc asmComment c = text "#" <+> c +-- | Commen @c@ with @// c@ asmDoubleslashComment :: SDoc -> SDoc asmDoubleslashComment c = text "//" <+> c +-- | Comment @c@ with @/* c */@ (multiline comment) asmMultilineComment :: SDoc -> SDoc asmMultilineComment c = text "/*" $+$ c $+$ text "*/" @@ -290,11 +293,15 @@ pprOpImm platform im = case im of ImmCLbl l -> char '=' <> pprAsmLabel platform l _ -> pprPanic "RV64.Ppr.pprOpImm" (text "Unsupported immediate for instruction operands" <> colon <+> (text . show) im) +-- | Negate integer immediate operand +-- +-- This function is partial and will panic if the operand is not an integer. negOp :: Operand -> Operand negOp (OpImm (ImmInt i)) = OpImm (ImmInt (negate i)) negOp (OpImm (ImmInteger i)) = OpImm (ImmInteger (negate i)) negOp op = pprPanic "RV64.negOp" (text $ show op) +-- | Pretty print an operand pprOp :: IsLine doc => Platform -> Operand -> doc pprOp plat op = case op of OpReg w r -> pprReg w r @@ -302,6 +309,10 @@ pprOp plat op = case op of OpAddr (AddrRegImm r1 im) -> pprOpImm plat im <> char '(' <> pprReg W64 r1 <> char ')' OpAddr (AddrReg r1) -> text "0(" <+> pprReg W64 r1 <+> char ')' +-- | Pretty print register with calling convention name +-- +-- This representation makes it easier to reason about the emitted assembly +-- code. pprReg :: forall doc. IsLine doc => Width -> Reg -> doc pprReg w r = case r of RegReal (RealRegSingle i) -> ppr_reg_no i @@ -414,6 +425,9 @@ isLabel :: Target -> Bool isLabel (TBlock _) = True isLabel _ = False +-- | Get the pretty-printed label from a `Target` +-- +-- This function is partial and will panic if the `Target` is not a label. getLabel :: (IsLine doc) => Platform -> Target -> doc getLabel platform (TBlock bid) = pprBlockId platform bid where @@ -421,9 +435,12 @@ getLabel platform (TBlock bid) = pprBlockId platform bid pprBlockId platform bid = pprAsmLabel platform (mkLocalBlockLabel (getUnique bid)) getLabel _platform _other = panic "Cannot turn this into a label" +-- | Pretty-print an `Instr` +-- +-- This function is partial and will panic if the `Instr` is not supported. This +-- can happen due to invalid operands or unexpected meta instructions. pprInstr :: IsDoc doc => Platform -> Instr -> doc pprInstr platform instr = case instr of - -- Meta Instructions --------------------------------------------------------- -- see Note [dualLine and dualDoc] in GHC.Utils.Outputable COMMENT s -> dualDoc (asmComment s) empty MULTILINE_COMMENT s -> dualDoc (asmMultilineComment s) empty @@ -435,8 +452,6 @@ pprInstr platform instr = case instr of NEWBLOCK _ -> panic "PprInstr: NEWBLOCK" LDATA _ _ -> panic "pprInstr: LDATA" - -- Pseudo Instructions ------------------------------------------------------- - PUSH_STACK_FRAME -> lines_ [ text "\taddi sp, sp, -16" , text "\tsd x1, 8(sp)" -- store RA , text "\tsd x8, 0(sp)" -- store FP/s0 @@ -445,9 +460,7 @@ pprInstr platform instr = case instr of POP_STACK_FRAME -> lines_ [ text "\tld x8, 0(sp)" -- restore FP/s0 , text "\tld x1, 8(sp)" -- restore RA , text "\taddi sp, sp, 16" ] - -- =========================================================================== - -- AArch64 Instruction Set - -- 1. Arithmetic Instructions ------------------------------------------------ + ADD o1 o2 o3 | isFloatOp o1 && isFloatOp o2 && isFloatOp o3 -> op3 (text "\tfadd." <> if isSingleOp o1 then text "s" else text "d") o1 o2 o3 -- This case is used for sign extension: SEXT.W op @@ -464,7 +477,7 @@ pprInstr platform instr = case instr of -- TODO: This must (likely) be refined regarding width -> op3 (text "\tfdiv." <> if isSingleOp o1 then text "s" else text "d") o1 o2 o3 DIV o1 o2 o3 -> op3 (text "\tdiv") o1 o2 o3 - REM o1 o2 o3 | isFloatOp o1 && isFloatOp o2 && isFloatOp o3 + REM o1 o2 o3 | isFloatOp o1 || isFloatOp o2 || isFloatOp o3 -> panic "pprInstr - REM not implemented for floats (yet)" REM o1 o2 o3 -> op3 (text "\trem") o1 o2 o3 REMU o1 o2 o3 -> op3 (text "\tremu") o1 o2 o3 @@ -474,10 +487,6 @@ pprInstr platform instr = case instr of | isImmOp o3 -> op3 (text "\taddi") o1 o2 (negOp o3) | otherwise -> op3 (text "\tsub") o1 o2 o3 DIVU o1 o2 o3 -> op3 (text "\tdivu") o1 o2 o3 - - -- 2. Bit Manipulation Instructions ------------------------------------------ - - -- 3. Logical and Move Instructions ------------------------------------------ AND o1 o2 o3 | isImmOp o3 -> op3 (text "\tandi") o1 o2 o3 | otherwise -> op3 (text "\tand") o1 o2 o3 OR o1 o2 o3 -> op3 (text "\tor") o1 o2 o3 @@ -516,7 +525,6 @@ pprInstr platform instr = case instr of ORI o1 o2 o3 -> op3 (text "\tori") o1 o2 o3 XORI o1 o2 o3 -> op3 (text "\txori") o1 o2 o3 - -- 4. Branch Instructions ---------------------------------------------------- J_TBL _ _ r -> pprInstr platform (B (TReg r)) B l | isLabel l -> line $ text "\tjal" <+> pprOp platform x0 <> comma <+> getLabel platform l B (TReg r) -> line $ text "\tjalr" <+> pprOp platform x0 <> comma <+> pprReg W64 r <> comma <+> text "0" @@ -528,8 +536,6 @@ pprInstr platform instr = case instr of BCOND _ _ _ (TReg _) -> panic "RV64.ppr: No conditional branching to registers!" - -- 5. Atomic Instructions ---------------------------------------------------- - -- 6. Conditional Instructions ----------------------------------------------- CSET o l r c -> case c of EQ | isIntOp l && isIntOp r -> lines_ [ subFor l r , text "\tseqz" <+> pprOp platform o <> comma <+> pprOp platform o] @@ -568,10 +574,6 @@ pprInstr platform instr = case instr of binOp :: (IsLine doc) => String -> doc binOp op = text op <+> pprOp platform o <> comma <+> pprOp platform l <> comma <+> pprOp platform r - -- 7. Load and Store Instructions -------------------------------------------- - -- NOTE: GHC may do whacky things where it only load the lower part of an - -- address. Not observing the correct size when loading will lead - -- inevitably to crashes. STR II8 o1 o2 -> op2 (text "\tsb") o1 o2 STR II16 o1 o2 -> op2 (text "\tsh") o1 o2 STR II32 o1 o2 -> op2 (text "\tsw") o1 o2 @@ -585,14 +587,6 @@ pprInstr platform instr = case instr of ] LDR _f o1 (OpImm (ImmCLbl lbl)) -> - -- fixing this is _really_ annoyin we need to generate code like: - -- 1: auipc x16, %pcrel_hi() - -- addi x16, x16, %pcrel_lo(1b) - -- I really dislike this (refer back to label 1 syntax from the assembler.) - -- - -- So we'll go with pseudo ops. la and li it is. - -- op_adrp o1 (text "%pcrel_hi(" <> pprAsmLabel platform lbl <> text ")") $$ - -- op_add o1 (text "%pcrel_lo(" <> pprAsmLabel platform lbl <> text ")") line $ text "\tla" <+> pprOp platform o1 <> comma <+> pprAsmLabel platform lbl LDR II8 o1 o2 -> op2 (text "\tlb") o1 o2 @@ -613,10 +607,8 @@ pprInstr platform instr = case instr of LDRU FF64 o1 o2@(OpAddr (AddrRegImm _ _)) -> op2 (text "\tfld") o1 o2 LDRU f o1 o2 -> pprPanic "Unsupported unsigned load" ((text.show) f <+> pprOp platform o1 <+> pprOp platform o2) - -- 8. Synchronization Instructions ------------------------------------------- - DMBSY r w -> line $ text "\tfence" <+> pprDmbType r <> char ',' <+> pprDmbType w + FENCE r w -> line $ text "\tfence" <+> pprFenceType r <> char ',' <+> pprFenceType w - -- 9. Floating Point Instructions -------------------------------------------- FCVT o1@(OpReg W32 _) o2@(OpReg W64 _) -> op2 (text "\tfcvt.s.d") o1 o2 FCVT o1@(OpReg W64 _) o2@(OpReg W32 _) -> op2 (text "\tfcvt.d.s") o1 o2 FCVT o1 o2 -> pprPanic "RV64.pprInstr - impossible float conversion" $ @@ -649,9 +641,9 @@ pprInstr platform instr = case instr of where op2 op o1 o2 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2 op3 op o1 o2 o3 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2 <> comma <+> pprOp platform o3 op4 op o1 o2 o3 o4 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2 <> comma <+> pprOp platform o3 <> comma <+> pprOp platform o4 - pprDmbType DmbRead = text "r" - pprDmbType DmbWrite = text "w" - pprDmbType DmbReadWrite = text "rw" + pprFenceType FenceRead = text "r" + pprFenceType FenceWrite = text "w" + pprFenceType FenceReadWrite = text "rw" floatPrecission o | isSingleOp o = text "s" | isDoubleOp o = text "d" | otherwise = pprPanic "Impossible floating point precission: " (pprOp platform o) @@ -661,6 +653,10 @@ floatOpPrecision _p l r | isFloatOp l && isFloatOp r && isSingleOp l && isSingle floatOpPrecision _p l r | isFloatOp l && isFloatOp r && isDoubleOp l && isDoubleOp r = "d" -- double precision floatOpPrecision p l r = pprPanic "Cannot determine floating point precission" (text "op1" <+> pprOp p l <+> text "op2" <+> pprOp p r) +-- | Pretty print a conditional branch +-- +-- This function is partial and will panic if the conditional is not supported; +-- i.e. if its floating point related. pprBcond :: (IsLine doc) => Cond -> doc pprBcond c = text "b" <> pprCond c where View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f90036f37886edbe1aae4ceedbc3a0cda3c93f73...c5f8ea14f7da40922ac5f23b61dad4c935ab1a8b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f90036f37886edbe1aae4ceedbc3a0cda3c93f73...c5f8ea14f7da40922ac5f23b61dad4c935ab1a8b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 18:58:51 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Fri, 26 Jul 2024 14:58:51 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] Format with Ormolu Message-ID: <66a3f1eb46f6b_2f40f059a380195f7@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: 45c672c0 by Sven Tennie at 2024-07-26T20:44:58+02:00 Format with Ormolu Better have some formatting than choas... :) - - - - - 2 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45c672c085cce573c24d048ab018c895d4acb2a3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/45c672c085cce573c24d048ab018c895d4acb2a3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Fri Jul 26 21:43:48 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Fri, 26 Jul 2024 17:43:48 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Fix nasty bug in occurrence analyser Message-ID: <66a41894d1179_9acdd315704964a7@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 3d2cde64 by Simon Peyton Jones at 2024-07-26T17:43:33-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 944992e7 by Torsten Schmits at 2024-07-26T17:43:33-04:00 add missing cell in flavours table - - - - - 15 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - hadrian/doc/flavours.md - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7eb88c410766e043735d6ae7330ccfdb00a87264...944992e7512ab89a02f270819e559e402c2cf2ed -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7eb88c410766e043735d6ae7330ccfdb00a87264...944992e7512ab89a02f270819e559e402c2cf2ed You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 04:14:51 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 27 Jul 2024 00:14:51 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Fix nasty bug in occurrence analyser Message-ID: <66a4743b301bd_49552a37f8c8582@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 2bb3db36 by Simon Peyton Jones at 2024-07-27T00:14:34-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - f6ac3d94 by Torsten Schmits at 2024-07-27T00:14:34-04:00 add missing cell in flavours table - - - - - 15 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - hadrian/doc/flavours.md - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/944992e7512ab89a02f270819e559e402c2cf2ed...f6ac3d94d595a8b5b751464f1f23d1c16a60a7c5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/944992e7512ab89a02f270819e559e402c2cf2ed...f6ac3d94d595a8b5b751464f1f23d1c16a60a7c5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 07:44:08 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Sat, 27 Jul 2024 03:44:08 -0400 Subject: [Git][ghc/ghc][wip/supersven/ghc-9.10-riscv-ncg] 2 commits: Rename registers Message-ID: <66a4a5483276d_4955217236ec10183a@gitlab.mail> Sven Tennie pushed to branch wip/supersven/ghc-9.10-riscv-ncg at Glasgow Haskell Compiler / GHC Commits: 61b85d44 by Sven Tennie at 2024-07-27T09:43:11+02:00 Rename registers - - - - - 21d88a0a by Sven Tennie at 2024-07-27T09:43:39+02:00 Format comment - - - - - 4 changed files: - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs - compiler/GHC/CmmToAsm/RV64/Ppr.hs - compiler/GHC/CmmToAsm/RV64/Regs.hs Changes: ===================================== compiler/GHC/CmmToAsm/RV64/CodeGen.hs ===================================== @@ -205,7 +205,7 @@ genSwitch config expr targets = do `appOL` t_code `appOL` toOL [ COMMENT (ftext "Jump table for switch"), - annExpr expr (LSL (OpReg (formatToWidth fmt1) reg) (OpReg (formatToWidth fmt1) reg) (OpImm (ImmInt 3))), + annExpr expr (SLL (OpReg (formatToWidth fmt1) reg) (OpReg (formatToWidth fmt1) reg) (OpImm (ImmInt 3))), ADD (OpReg W64 tmp) (OpReg (formatToWidth fmt1) reg) (OpReg (formatToWidth fmt2) tableReg), LDRU II64 (OpReg W64 tmp) (OpAddr (AddrRegImm tmp (ImmInt 0))), J_TBL ids (Just lbl) tmp @@ -681,9 +681,9 @@ getRegister' config plat expr = `appOL` toOL [ ann (text "MO_SS_Conv: narrow register signed" <+> ppr reg <+> ppr from <> text "->" <> ppr to) - (LSL (OpReg to dst) (OpReg from reg) (OpImm (ImmInt shift))), + (SLL (OpReg to dst) (OpReg from reg) (OpImm (ImmInt shift))), -- signed right shift - ASR (OpReg to dst) (OpReg to dst) (OpImm (ImmInt shift)) + SRA (OpReg to dst) (OpReg to dst) (OpImm (ImmInt shift)) ] `appOL` truncateReg from to dst | otherwise = @@ -745,7 +745,7 @@ getRegister' config plat expr = (intFormat w) ( \dst -> code_x - `snocOL` annExpr expr (LSL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n))) + `snocOL` annExpr expr (SLL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n))) `appOL` truncateReg w w dst ) CmmMachOp (MO_Shl w) [x, CmmLit (CmmInt n _)] @@ -758,7 +758,7 @@ getRegister' config plat expr = (intFormat w) ( \dst -> code_x - `snocOL` annExpr expr (LSL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n))) + `snocOL` annExpr expr (SLL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n))) `appOL` truncateReg w w dst ) CmmMachOp (MO_S_Shr w) [x, CmmLit (CmmInt n _)] | fitsIn12bitImm n -> do @@ -768,7 +768,7 @@ getRegister' config plat expr = $ Any (intFormat w) ( \dst -> - code_x `appOL` code_x' `snocOL` annExpr expr (ASR (OpReg w dst) (OpReg w reg_x') (OpImm (ImmInteger n))) + code_x `appOL` code_x' `snocOL` annExpr expr (SRA (OpReg w dst) (OpReg w reg_x') (OpImm (ImmInteger n))) ) CmmMachOp (MO_S_Shr w) [x, y] -> do (reg_x, format_x, code_x) <- getSomeReg x @@ -778,36 +778,36 @@ getRegister' config plat expr = $ Any (intFormat w) ( \dst -> - code_x `appOL` code_x' `appOL` code_y `snocOL` annExpr expr (ASR (OpReg w dst) (OpReg w reg_x') (OpReg w reg_y)) + code_x `appOL` code_x' `appOL` code_y `snocOL` annExpr expr (SRA (OpReg w dst) (OpReg w reg_x') (OpReg w reg_y)) ) CmmMachOp (MO_U_Shr w) [x, CmmLit (CmmInt n _)] | w == W8, 0 <= n, n < 8 -> do (reg_x, format_x, code_x) <- getSomeReg x - return $ Any (intFormat w) (\dst -> code_x `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (LSR (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) + return $ Any (intFormat w) (\dst -> code_x `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (SRL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) CmmMachOp (MO_U_Shr w) [x, CmmLit (CmmInt n _)] | w == W16, 0 <= n, n < 16 -> do (reg_x, format_x, code_x) <- getSomeReg x - return $ Any (intFormat w) (\dst -> code_x `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (LSR (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) + return $ Any (intFormat w) (\dst -> code_x `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (SRL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) CmmMachOp (MO_U_Shr w) [x, y] | w == W8 || w == W16 -> do (reg_x, format_x, code_x) <- getSomeReg x (reg_y, _format_y, code_y) <- getSomeReg y - return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (LSR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y))) + return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `appOL` truncateReg (formatToWidth format_x) w reg_x `snocOL` annExpr expr (SRL (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y))) CmmMachOp (MO_U_Shr w) [x, CmmLit (CmmInt n _)] | w == W32, 0 <= n, n < 32 -> do (reg_x, _format_x, code_x) <- getSomeReg x - return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (LSR (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) + return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SRL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) CmmMachOp (MO_U_Shr w) [x, CmmLit (CmmInt n _)] | w == W64, 0 <= n, n < 64 -> do (reg_x, _format_x, code_x) <- getSomeReg x - return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (LSR (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) + return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SRL (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)))) -- 3. Logic &&, || CmmMachOp (MO_And w) [CmmReg reg, CmmLit (CmmInt n _)] @@ -928,9 +928,9 @@ getRegister' config plat expr = MO_And w -> bitOp w (\d x y -> unitOL $ annExpr expr (AND d x y)) MO_Or w -> bitOp w (\d x y -> unitOL $ annExpr expr (OR d x y)) MO_Xor w -> bitOp w (\d x y -> unitOL $ annExpr expr (XOR d x y)) - MO_Shl w -> intOp False w (\d x y -> unitOL $ annExpr expr (LSL d x y)) - MO_U_Shr w -> intOp False w (\d x y -> unitOL $ annExpr expr (LSR d x y)) - MO_S_Shr w -> intOp True w (\d x y -> unitOL $ annExpr expr (ASR d x y)) + MO_Shl w -> intOp False w (\d x y -> unitOL $ annExpr expr (SLL d x y)) + MO_U_Shr w -> intOp False w (\d x y -> unitOL $ annExpr expr (SRL d x y)) + MO_S_Shr w -> intOp True w (\d x y -> unitOL $ annExpr expr (SRA d x y)) op -> pprPanic "getRegister' (unhandled dyadic CmmMachOp): " $ pprMachOp op <+> text "in" <+> pdoc plat expr -- Generic ternary case. @@ -992,9 +992,9 @@ getRegister' config plat expr = `appOL` code_y `appOL` signExtend (formatToWidth format_y) W64 reg_y reg_y `appOL` toOL - [ annExpr expr (SMULH (OpReg w hi) (OpReg w reg_x) (OpReg w reg_y)), + [ annExpr expr (MULH (OpReg w hi) (OpReg w reg_x) (OpReg w reg_y)), MUL (OpReg w lo) (OpReg w reg_x) (OpReg w reg_y), - ASR (OpReg w lo) (OpReg w lo) (OpImm (ImmInt (widthInBits W64 - 1))), + SRA (OpReg w lo) (OpReg w lo) (OpImm (ImmInt (widthInBits W64 - 1))), ann (text "Set flag if result of MULH contains more than sign bits.") (XOR (OpReg w hi) (OpReg w hi) (OpReg w lo)), @@ -1078,9 +1078,9 @@ signExtend w w' r r' = toOL [ ann (text "narrow register signed" <+> ppr r <> char ':' <> ppr w <> text "->" <> ppr r <> char ':' <> ppr w') - (LSL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), + (SLL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), -- signed (arithmetic) right shift - ASR (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) + SRA (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) ] where shift = 64 - widthInBits w @@ -1105,9 +1105,9 @@ signExtendAdjustPrecission w w' r r' toOL [ ann (text "narrow register signed" <+> ppr r <> char ':' <> ppr w <> text "->" <> ppr r <> char ':' <> ppr w') - (LSL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), + (SLL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), -- signed (arithmetic) right shift - ASR (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) + SRA (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) ] where shift = 64 - widthInBits w' @@ -1115,9 +1115,9 @@ signExtendAdjustPrecission w w' r r' = toOL [ ann (text "sign extend register" <+> ppr r <> char ':' <> ppr w <> text "->" <> ppr r <> char ':' <> ppr w') - (LSL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), + (SLL (OpReg w' r') (OpReg w r) (OpImm (ImmInt shift))), -- signed (arithmetic) right shift - ASR (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) + SRA (OpReg w' r') (OpReg w' r') (OpImm (ImmInt shift)) ] where shift = 64 - widthInBits w @@ -1135,9 +1135,9 @@ truncateReg w w' r = toOL [ ann (text "truncate register" <+> ppr r <+> ppr w <> text "->" <> ppr w') - (LSL (OpReg w' r) (OpReg w r) (OpImm (ImmInt shift))), + (SLL (OpReg w' r) (OpReg w r) (OpImm (ImmInt shift))), -- SHL ignores signedness! - LSR (OpReg w' r) (OpReg w r) (OpImm (ImmInt shift)) + SRL (OpReg w' r) (OpReg w r) (OpImm (ImmInt shift)) ] where shift = 64 - widthInBits w' @@ -1986,7 +1986,7 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = POP_STACK_FRAME -> 4 ADD {} -> 1 MUL {} -> 1 - SMULH {} -> 1 + MULH {} -> 1 NEG {} -> 1 DIV {} -> 1 REM {} -> 1 @@ -1995,10 +1995,10 @@ makeFarBranches {- only used when debugging -} _platform statics basic_blocks = DIVU {} -> 1 AND {} -> 1 OR {} -> 1 - ASR {} -> 1 + SRA {} -> 1 XOR {} -> 1 - LSL {} -> 1 - LSR {} -> 1 + SLL {} -> 1 + SRL {} -> 1 MOV {} -> 2 ORI {} -> 1 XORI {} -> 1 ===================================== compiler/GHC/CmmToAsm/RV64/Instr.hs ===================================== @@ -75,7 +75,7 @@ regUsageOfInstr platform instr = case instr of ADD dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) MUL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) NEG dst src -> usage (regOp src, regOp dst) - SMULH dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + MULH dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) DIV dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) REM dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) REMU dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) @@ -83,10 +83,10 @@ regUsageOfInstr platform instr = case instr of DIVU dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) AND dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) OR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) - ASR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + SRA dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) XOR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) - LSL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) - LSR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + SLL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + SRL dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) MOV dst src -> usage (regOp src, regOp dst) -- ORI's third operand is always an immediate ORI dst src1 _ -> usage (regOp src1, regOp dst) @@ -159,7 +159,7 @@ patchRegsOfInstr instr env = case instr of ADD o1 o2 o3 -> ADD (patchOp o1) (patchOp o2) (patchOp o3) MUL o1 o2 o3 -> MUL (patchOp o1) (patchOp o2) (patchOp o3) NEG o1 o2 -> NEG (patchOp o1) (patchOp o2) - SMULH o1 o2 o3 -> SMULH (patchOp o1) (patchOp o2) (patchOp o3) + MULH o1 o2 o3 -> MULH (patchOp o1) (patchOp o2) (patchOp o3) DIV o1 o2 o3 -> DIV (patchOp o1) (patchOp o2) (patchOp o3) REM o1 o2 o3 -> REM (patchOp o1) (patchOp o2) (patchOp o3) REMU o1 o2 o3 -> REMU (patchOp o1) (patchOp o2) (patchOp o3) @@ -167,10 +167,10 @@ patchRegsOfInstr instr env = case instr of DIVU o1 o2 o3 -> DIVU (patchOp o1) (patchOp o2) (patchOp o3) AND o1 o2 o3 -> AND (patchOp o1) (patchOp o2) (patchOp o3) OR o1 o2 o3 -> OR (patchOp o1) (patchOp o2) (patchOp o3) - ASR o1 o2 o3 -> ASR (patchOp o1) (patchOp o2) (patchOp o3) + SRA o1 o2 o3 -> SRA (patchOp o1) (patchOp o2) (patchOp o3) XOR o1 o2 o3 -> XOR (patchOp o1) (patchOp o2) (patchOp o3) - LSL o1 o2 o3 -> LSL (patchOp o1) (patchOp o2) (patchOp o3) - LSR o1 o2 o3 -> LSR (patchOp o1) (patchOp o2) (patchOp o3) + SLL o1 o2 o3 -> SLL (patchOp o1) (patchOp o2) (patchOp o3) + SRL o1 o2 o3 -> SRL (patchOp o1) (patchOp o2) (patchOp o3) MOV o1 o2 -> MOV (patchOp o1) (patchOp o2) -- o3 cannot be a register for ORI (always an immediate) ORI o1 o2 o3 -> ORI (patchOp o1) (patchOp o2) (patchOp o3) @@ -479,15 +479,15 @@ data Instr | -- | Logical left shift (zero extened, integer only) -- -- @rd = rs1 << rs2@ - LSL {- SLL -} Operand Operand Operand + SLL Operand Operand Operand | -- | Logical right shift (zero extened, integer only) -- -- @rd = rs1 >> rs2@ - LSR {- SRL -} Operand Operand Operand + SRL Operand Operand Operand | -- | Arithmetic right shift (sign-extened, integer only) -- -- @rd = rs1 >> rs2@ - ASR {- SRA -} Operand Operand Operand + SRA Operand Operand Operand | -- | Store to memory (both, integer and floating point) STR Format Operand Operand | -- | Load from memory (sign-extended, integer and floating point) @@ -514,12 +514,10 @@ data Instr -- -- @rd = |rn % rm|@ REMU Operand Operand Operand - | -- TODO: Rename: MULH - - -- | High part of a multiplication that doesn't fit into 64bits (integer only) + | -- | High part of a multiplication that doesn't fit into 64bits (integer only) -- -- E.g. for a multiplication with 64bits width: @rd = (rs1 * rs2) >> 64 at . - SMULH Operand Operand Operand + MULH Operand Operand Operand | -- | Unsigned division (integer only) -- -- @rd = |rn ÷ rm|@ @@ -596,14 +594,14 @@ instrCon i = DIV {} -> "DIV" REM {} -> "REM" REMU {} -> "REMU" - SMULH {} -> "SMULH" + MULH {} -> "MULH" SUB {} -> "SUB" DIVU {} -> "DIVU" AND {} -> "AND" - ASR {} -> "ASR" + SRA {} -> "SRA" XOR {} -> "XOR" - LSL {} -> "LSL" - LSR {} -> "LSR" + SLL {} -> "SLL" + SRL {} -> "SRL" MOV {} -> "MOV" ORI {} -> "ORI" XORI {} -> "ORI" ===================================== compiler/GHC/CmmToAsm/RV64/Ppr.hs ===================================== @@ -483,7 +483,7 @@ pprInstr platform instr = case instr of MUL o1 o2 o3 | isFloatOp o1 && isFloatOp o2 && isFloatOp o3 -> op3 (text "\tfmul." <> if isSingleOp o1 then text "s" else text "d") o1 o2 o3 | otherwise -> op3 (text "\tmul") o1 o2 o3 - SMULH o1 o2 o3 -> op3 (text "\tmulh") o1 o2 o3 + MULH o1 o2 o3 -> op3 (text "\tmulh") o1 o2 o3 NEG o1 o2 | isFloatOp o1 && isFloatOp o2 && isSingleOp o2 -> op2 (text "\tfneg.s") o1 o2 NEG o1 o2 | isFloatOp o1 && isFloatOp o2 && isDoubleOp o2 -> op2 (text "\tfneg.d") o1 o2 NEG o1 o2 -> op2 (text "\tneg") o1 o2 @@ -506,11 +506,11 @@ pprInstr platform instr = case instr of | isImmOp o3 -> op3 (text "\tandi") o1 o2 o3 | otherwise -> op3 (text "\tand") o1 o2 o3 OR o1 o2 o3 -> op3 (text "\tor") o1 o2 o3 - ASR o1 o2 o3 | isImmOp o3 -> op3 (text "\tsrai") o1 o2 o3 - ASR o1 o2 o3 -> op3 (text "\tsra") o1 o2 o3 + SRA o1 o2 o3 | isImmOp o3 -> op3 (text "\tsrai") o1 o2 o3 + SRA o1 o2 o3 -> op3 (text "\tsra") o1 o2 o3 XOR o1 o2 o3 -> op3 (text "\txor") o1 o2 o3 - LSL o1 o2 o3 -> op3 (text "\tsll") o1 o2 o3 - LSR o1 o2 o3 -> op3 (text "\tsrl") o1 o2 o3 + SLL o1 o2 o3 -> op3 (text "\tsll") o1 o2 o3 + SRL o1 o2 o3 -> op3 (text "\tsrl") o1 o2 o3 MOV o1 o2 | isFloatOp o1 && isFloatOp o2 && isDoubleOp o2 -> op2 (text "\tfmv.d") o1 o2 -- fmv.d rd, rs is pseudo op fsgnj.d rd, rs, rs | isFloatOp o1 && isFloatOp o2 && isSingleOp o2 -> op2 (text "\tfmv.s") o1 o2 -- fmv.s rd, rs is pseudo op fsgnj.s rd, rs, rs ===================================== compiler/GHC/CmmToAsm/RV64/Regs.hs ===================================== @@ -125,13 +125,10 @@ allFpArgRegs = map regSingle [fa0RegNo .. fa7RegNo] -- * Addressing modes --- TODO: AddReg seems to be just a special case of AddrRegImm. Maybe we should --- replace it with AddrRegImm having an Imm of 0. - -- | Addressing modes data AddrMode - = -- | A register plus some integer, e.g. @8(sp)@ or @-16(sp)@. The offset - -- needs to fit into 12bits. + = -- | A register plus some immediate integer, e.g. @8(sp)@ or @-16(sp)@. The + -- offset needs to fit into 12bits. AddrRegImm Reg Imm | -- | A register AddrReg Reg View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/45c672c085cce573c24d048ab018c895d4acb2a3...21d88a0a9476597aa7cf33d024358a876ba5625a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/45c672c085cce573c24d048ab018c895d4acb2a3...21d88a0a9476597aa7cf33d024358a876ba5625a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 08:45:34 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 27 Jul 2024 04:45:34 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Fix nasty bug in occurrence analyser Message-ID: <66a4b3aedf959_185b3a160f08572d5@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 517d89c4 by Simon Peyton Jones at 2024-07-27T04:45:01-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 96f19ddd by Torsten Schmits at 2024-07-27T04:45:02-04:00 add missing cell in flavours table - - - - - 15 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - hadrian/doc/flavours.md - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f6ac3d94d595a8b5b751464f1f23d1c16a60a7c5...96f19ddde4297e7faec781bc1cd6a2f8e9283950 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f6ac3d94d595a8b5b751464f1f23d1c16a60a7c5...96f19ddde4297e7faec781bc1cd6a2f8e9283950 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 12:56:14 2024 From: gitlab at gitlab.haskell.org (Artin Ghasivand (@Ei30metry)) Date: Sat, 27 Jul 2024 08:56:14 -0400 Subject: [Git][ghc/ghc][wip/T24467] 2 commits: Delete redundant stuff Message-ID: <66a4ee6eca914_185b3aa3ff0c655da@gitlab.mail> Artin Ghasivand pushed to branch wip/T24467 at Glasgow Haskell Compiler / GHC Commits: cad0cc5e by Artin Ghasivand at 2024-07-26T09:03:06+03:30 Delete redundant stuff - - - - - 33c3106f by Artin Ghasivand at 2024-07-27T16:25:58+03:30 Some progress - - - - - 3 changed files: - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/TyCon.hs - ghc/GHCi/UI.hs Changes: ===================================== compiler/GHC/Core/DataCon.hs ===================================== @@ -27,6 +27,9 @@ module GHC.Core.DataCon ( -- ** Type construction mkHsSrcBang, mkDataCon, fIRST_TAG, + -- ** Creating an instantiated dummy data constructor for the normalize command + normalizeDataConAt, + -- ** Type deconstruction dataConRepType, dataConInstSig, dataConFullSig, dataConName, dataConIdentity, dataConTag, dataConTagZ, @@ -484,7 +487,7 @@ data DataCon -- The next two fields give the type context of the data constructor -- (aside from the GADT constraints, - -- which are given by the dcExpSpec) + -- which are given by the dcEqSpec) -- In GADT form, this is *exactly* what the programmer writes, even if -- the context constrains only universally quantified variables -- MkT :: forall a b. (a ~ b, Ord b) => a -> T a b @@ -1910,6 +1913,38 @@ dataConUserTyVarsNeedWrapper dc@(MkData { dcUnivTyVars = univ_tvs -- Worker tyvars Wrapper tyvars +{- Note [Creating dummy constructors for the normalize command] + +-} +-- See Note [Why do we normalize a DataCon instead of an IfaceConDecl] +-- FIXME better name +normalizeDataConAt :: [Type] -> DataCon -> DataCon +normalizeDataConAt args con@(MkData { dcUnivTyVars = univ_tvs + , dcExTyCoVars = ex_tvs + , dcEqSpec = eq_spec + , dcOtherTheta = other_theta + , dcStupidTheta = stupid_theta + , dcOrigArgTys = orig_arg_tys + , dcOrigResTy = orig_res_ty }) + = con { dcUnivTyVars = i_univ_ty_vars + , dcExTyCoVars = i_ex_tyco_vars + , dcEqSpec = i_eq_spec + , dcOtherTheta = i_other_theta + , dcStupidTheta = i_stupid_theta + , dcOrigArgTys = i_arg_tys + , dcOrigResTy = i_res_ty } + where + univ_subst = zipTvSubst univ_tvs args + i_eq_spec = eq_spec + i_univ_ty_vars = filter (flip elemSubst univ_subst) univ_tvs + i_other_theta = substTheta subst other_theta + i_stupid_theta = substTheta subst stupid_theta + i_arg_tys = substScaledTys subst orig_arg_tys + i_res_ty = substTy subst orig_res_ty + (subst,i_ex_tyco_vars) = substVarBndrs univ_subst ex_tvs + + + {- %************************************************************************ %* * ===================================== compiler/GHC/Core/TyCon.hs ===================================== @@ -100,6 +100,7 @@ module GHC.Core.TyCon( synTyConDefn_maybe, synTyConRhs_maybe, famTyConFlav_maybe, algTyConRhs, + algTyConFlavour, -- FIXME newTyConRhs, newTyConEtadArity, newTyConEtadRhs, unwrapNewTyCon_maybe, unwrapNewTyConEtad_maybe, newTyConDataCon_maybe, @@ -1252,6 +1253,11 @@ isNoParent :: AlgTyConFlav -> Bool isNoParent (VanillaAlgTyCon {}) = True isNoParent _ = False +algTyConFlavour :: TyCon -> AlgTyConFlav +algTyConFlavour tc@(TyCon { tyConDetails = details }) + | AlgTyCon {algTcFlavour = flavour} <- details = flavour + | otherwise = pprPanic "algTyConFlavour" (ppr tc) + -------------------- data Injectivity ===================================== ghc/GHCi/UI.hs ===================================== @@ -44,6 +44,7 @@ import GHCi.RemoteTypes import GHCi.BreakArray( breakOn, breakOff ) import GHC.ByteCode.Types import GHC.Core.DataCon +import GHC.Core.TyCon import GHC.Core.ConLike import GHC.Core.PatSyn import GHC.CoreToIface @@ -70,7 +71,6 @@ import GHC.Driver.Env import GHC.Runtime.Context import GHC.Types.TyThing import GHC.Types.TyThing.Ppr -import GHC.Tc.Utils.Monad import GHC.Core.TyCo.Ppr import GHC.Core.Type import GHC.Types.SafeHaskell ( getSafeMode ) @@ -78,7 +78,7 @@ import GHC.Types.SourceError ( SourceError ) import GHC.Types.Name import GHC.Types.Breakpoint import GHC.Types.Var ( varType ) -import GHC.Types.Var.Env ( emptyTidyEnv ) +import GHC.Types.Var.Env ( emptyTidyEnv, TidyEnv ) import GHC.Iface.Syntax ( showToHeader, showToIface, pprIfaceDecl , IfaceDecl(..), IfaceEqSpec, IfaceConDecls(..) , IfaceConDecl(..), visibleIfConDecls, IfaceAppArgs @@ -1630,7 +1630,6 @@ pprInfo (thing, fixity, cls_insts, fam_insts, docs) ----------------------------------------------------------------------------- -- :normalize --- NOTE we could also call this :members or something like that. normalize :: GHC.GhcMonad m => String -> m () nomralize "" = throwGhcException (CmdLineError "syntax ':n <(constructor arguments)>'") normalize s = handleSourceError printGhciException $ do @@ -1649,45 +1648,36 @@ normalize s = handleSourceError printGhciException $ do actArgs (_:xs) = actArgs xs trim = let f = reverse . dropWhile isSpace in f . f - --- TODO redefine all these using foldr and an accumulator -buildNormSubst :: IfaceAppArgs -> [IfaceType] -> IfaceTySubst -buildNormSubst args userArgs - = mkIfaceTySubst $ zip (freeVarsOfIfAppArgs args) userArgs - where - freeVarsOfIfAppArgs = freeVarsOfIfTypes . appArgsIfaceTypes - freeVarsOfIfTypes = concatMap freeVarsOfIfType - freeVarsOfIfType (IfaceTyVar l) = [l] - freeVarsOfIfType (IfaceTupleTy _ _ args) = freeVarsOfIfAppArgs args - freeVarsOfIfType (IfaceAppTy _ args) = freeVarsOfIfAppArgs args - freeVarsOfIfType (IfaceFunTy fun_flag _ arg res) = (freeVarsOfIfType arg) `union` (freeVarsOfIfType res) - freeVarsOfIfType (IfaceForAllTy bndr ty) = delete (ifForAllBndrName bndr) (freeVarsOfIfType ty) - freeVarsOfIfType _ = [] - -lab :: GHC.GhcMonad m => String -> m SDoc lab str = do (ty,kind) <- GHC.typeKind True str case splitTyConApp_maybe ty of Nothing -> throwGhcException (CmdLineError "Something Bad happend!") - Just (head,args) -> do - let ifaceArgs = map toIfaceType args - iDecl = snd $ tyConToIfaceDecl emptyTidyEnv head - pure (enlightenUs iDecl) - where - enlightenUs decl - = vcat [pprIfaceDecl showToIface decl - ,nest 2 $ vcat [text "ifConArgTys:" <+> (nest 2 . vcat) (map (ppr . ifConArgTys) conDecls) - ,text "ifEqSpec:" <+> (nest 2 . vcat) (map (ppr . ifConEqSpec) conDecls) - ,text "ifConUserTvBinders:" <+> (nest 2 . vcat) (map (ppr . ifConUserTvBinders) conDecls) - ,text "ifConExTcvs:" <+> (nest 2 . vcat) (map (ppr . ifConExTCvs) conDecls)] - ,text "free variables:" <+> freeVarsOfIfType (retType (ifName )) - ,text "--------------------------"] - where - conDecls = (visibleIfConDecls . ifCons) decl - retType name binders = undefined + Just (head,args) -> pure . pprIfaceDecl showToIface $ toNormalizedIfaceDecl head args kind - substIfaceConDecl :: GHC.GhcMonad m => m IfaceTySubst -> IfaceConDecl -> m IfaceConDecl - substIfaceConDecl = undefined +-- TODO we may also need to apply the substitution to our TyCon. +-- NOTE we'll have to make sure that stheta in TyCon and stheta in DataCon are the same. +toNormalizedIfaceDecl :: TyCon -> [Type] -> Kind -> IfaceDecl +toNormalizedIfaceDecl tyCon args resKind = (snd . tyConToIfaceDecl emptyTidyEnv) newTyCon + where + dataCons = tyConDataCons tyCon + normalizedCons = map (normalizeDataConAt args) dataCons + newRhs = mkDataTyConRhs normalizedCons + newKind = mkTyConKind (tyConBinders tyCon) resKind + newStupidTheta = tyConStupidTheta tyCon -- FIXME + newRoles = tyConRoles tyCon -- FIXME + newCType = tyConCType_maybe tyCon + flavour = algTyConFlavour tyCon + newTyCon + = mkAlgTyCon (tyConName tyCon) (tyConBinders tyCon) resKind newRoles + newCType newStupidTheta newRhs flavour + (isGadtSyntaxTyCon tyCon) + + +{- Note [Why do we normalize a DataCon instead of an IfaceConDecl] +TODO +summary because we'll have to reduce and do all other sorts of stuff. Otherwise +we'll have to convert back and forth between IfaceConDecl and DataCon. +-} ----------------------------------------------------------------------------- -- :main View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/21d7e98ef641860ead1cb62a6e3c61c0c5bda4b1...33c3106f1ec75c057b17cf2f7675c20809a89c40 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/21d7e98ef641860ead1cb62a6e3c61c0c5bda4b1...33c3106f1ec75c057b17cf2f7675c20809a89c40 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 13:45:38 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 27 Jul 2024 09:45:38 -0400 Subject: [Git][ghc/ghc][master] Fix -freg-graphs for FP and AARch64 NCG (#24941). Message-ID: <66a4fa017f136_4cf8627fc90748f9@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - 7 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - docs/users_guide/9.12.1-notes.rst - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -177,6 +177,8 @@ regUsageOfInstr platform instr = case instr of interesting _ (RegVirtual _) = True interesting platform (RegReal (RealRegSingle i)) = freeReg platform i +-- Note [AArch64 Register assignments] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Save caller save registers -- This is x0-x18 -- @@ -199,6 +201,8 @@ regUsageOfInstr platform instr = case instr of -- '---------------------------------------------------------------------------------------------------------------------------------------------------------------' -- IR: Indirect result location register, IP: Intra-procedure register, PL: Platform register, FP: Frame pointer, LR: Link register, SP: Stack pointer -- BR: Base, SL: SpLim +-- +-- TODO: The zero register is currently mapped to -1 but should get it's own separate number. callerSavedRegisters :: [Reg] callerSavedRegisters = map regSingle [0..18] ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -316,6 +316,7 @@ pprReg w r = case r of | w == W64 = text "sp" | w == W32 = text "wsp" + -- See Note [AArch64 Register assignments] ppr_reg_no w i | i < 0, w == W32 = text "wzr" | i < 0, w == W64 = text "xzr" ===================================== compiler/GHC/CmmToAsm/AArch64/Regs.hs ===================================== @@ -17,6 +17,7 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform +-- TODO: Should this include the zero register? allMachRegNos :: [RegNo] allMachRegNos = [0..31] ++ [32..63] -- allocatableRegs is allMachRegNos with the fixed-use regs removed. ===================================== compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs ===================================== @@ -183,7 +183,8 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclu ArchPPC -> 26 ArchPPC_64 _ -> 20 ArchARM _ _ _ -> panic "trivColorable ArchARM" - ArchAArch64 -> 28 -- 32 - D1..D4 + ArchAArch64 -> 24 -- 32 - F1 .. F4, D1..D4 - it's odd but see Note [AArch64 Register assignments] for our reg use. + -- Seems we reserve different registers for D1..D4 and F1 .. F4 somehow, we should fix this. ArchAlpha -> panic "trivColorable ArchAlpha" ArchMipseb -> panic "trivColorable ArchMipseb" ArchMipsel -> panic "trivColorable ArchMipsel" ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -78,12 +78,15 @@ Compiler `_). This does not affect existing support of apple systems on x86_64/aarch64. -- The flag :ghc-flag:`-fignore-asserts` will now also enable the +- The flag :ghc-flag:`-fignore-asserts` will now also enable the :extension:`CPP` macro ``__GLASGOW_HASKELL_ASSERTS_IGNORED__`` (`#24967 `_). This enables people to write their own custom assertion functions. See :ref:`assertions`. - + +- Fixed a bug that caused GHC to panic when using the aarch64 ncg and -fregs-graph + on certain programs. (#24941) + GHCi ~~~~ ===================================== testsuite/tests/codeGen/should_gen_asm/T24941.hs ===================================== @@ -0,0 +1,23 @@ +module T24941 where + +data F = F + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float + + +foo ( F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + x30 x31 + ) + = + + F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + + x30 (x31+1) \ No newline at end of file ===================================== testsuite/tests/codeGen/should_gen_asm/all.T ===================================== @@ -10,3 +10,5 @@ test('memset-unroll', is_amd64_codegen, compile_cmp_asm, ['cmm', '']) test('bytearray-memset-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('bytearray-memcpy-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('T18137', [when(opsys('darwin'), skip), only_ways(llvm_ways)], compile_grep_asm, ['hs', False, '-fllvm -split-sections']) + +test('T24941', [only_ways(['optasm'])], compile, ['-fregs-graph']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f89ab92da74c4ed45da68fe92ff81e7b9caa53d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f89ab92da74c4ed45da68fe92ff81e7b9caa53d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 13:46:15 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 27 Jul 2024 09:46:15 -0400 Subject: [Git][ghc/ghc][master] Fix nasty bug in occurrence analyser Message-ID: <66a4fa273a1db_4cf8615250c780d1@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 14 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6b4c1c9be71fc6fe4688337752ffa4ad84180d9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f6b4c1c9be71fc6fe4688337752ffa4ad84180d9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sat Jul 27 13:46:40 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sat, 27 Jul 2024 09:46:40 -0400 Subject: [Git][ghc/ghc][master] add missing cell in flavours table Message-ID: <66a4fa409b88e_4cf863af78c81330@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - 1 changed file: - hadrian/doc/flavours.md Changes: ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/646ee207d81b5a5c245351c318fcc6f34e1d23a1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/646ee207d81b5a5c245351c318fcc6f34e1d23a1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 09:48:58 2024 From: gitlab at gitlab.haskell.org (Artin Ghasivand (@Ei30metry)) Date: Sun, 28 Jul 2024 05:48:58 -0400 Subject: [Git][ghc/ghc][wip/T24467] Argument types are being reduced now Message-ID: <66a6140a61183_1ccf3ccd01f476574@gitlab.mail> Artin Ghasivand pushed to branch wip/T24467 at Glasgow Haskell Compiler / GHC Commits: 319543bd by Artin Ghasivand at 2024-07-28T13:18:17+03:30 Argument types are being reduced now - - - - - 2 changed files: - compiler/GHC/Core/DataCon.hs - ghc/GHCi/UI.hs Changes: ===================================== compiler/GHC/Core/DataCon.hs ===================================== @@ -87,6 +87,8 @@ import {-# SOURCE #-} GHC.Types.TyThing import GHC.Types.FieldLabel import GHC.Types.SourceText import GHC.Core.Class +import {-# SOURCE #-} GHC.Core.FamInstEnv +import GHC.Core.Reduction import GHC.Types.Name import GHC.Builtin.Names import GHC.Core.Predicate @@ -103,6 +105,7 @@ import GHC.Data.Graph.UnVar -- UnVarSet and operations import {-# SOURCE #-} GHC.Tc.Utils.TcType ( ConcreteTyVars ) + import GHC.Utils.Outputable import GHC.Utils.Misc import GHC.Utils.Panic @@ -1918,33 +1921,33 @@ dataConUserTyVarsNeedWrapper dc@(MkData { dcUnivTyVars = univ_tvs -} -- See Note [Why do we normalize a DataCon instead of an IfaceConDecl] -- FIXME better name -normalizeDataConAt :: [Type] -> DataCon -> DataCon -normalizeDataConAt args con@(MkData { dcUnivTyVars = univ_tvs - , dcExTyCoVars = ex_tvs - , dcEqSpec = eq_spec - , dcOtherTheta = other_theta - , dcStupidTheta = stupid_theta - , dcOrigArgTys = orig_arg_tys - , dcOrigResTy = orig_res_ty }) +normalizeDataConAt :: FamInstEnvs -> [Type] -> DataCon -> DataCon +normalizeDataConAt famEnv args con@(MkData { dcUnivTyVars = univ_tvs + , dcExTyCoVars = ex_tvs + , dcEqSpec = eq_spec + , dcOtherTheta = other_theta + , dcStupidTheta = stupid_theta + , dcOrigArgTys = orig_arg_tys + , dcOrigResTy = orig_res_ty }) = con { dcUnivTyVars = i_univ_ty_vars , dcExTyCoVars = i_ex_tyco_vars - , dcEqSpec = i_eq_spec + , dcEqSpec = eq_spec , dcOtherTheta = i_other_theta , dcStupidTheta = i_stupid_theta , dcOrigArgTys = i_arg_tys , dcOrigResTy = i_res_ty } where univ_subst = zipTvSubst univ_tvs args - i_eq_spec = eq_spec + i_eq_spec = filter undefined eq_spec -- (elem x "things in scope") i_univ_ty_vars = filter (flip elemSubst univ_subst) univ_tvs i_other_theta = substTheta subst other_theta i_stupid_theta = substTheta subst stupid_theta - i_arg_tys = substScaledTys subst orig_arg_tys + i_arg_tys = map (mapScaledType (reductionReducedType . normaliseType famEnv Nominal)) + $ substScaledTys subst orig_arg_tys i_res_ty = substTy subst orig_res_ty (subst,i_ex_tyco_vars) = substVarBndrs univ_subst ex_tvs - {- %************************************************************************ %* * ===================================== ghc/GHCi/UI.hs ===================================== @@ -45,6 +45,7 @@ import GHCi.BreakArray( breakOn, breakOff ) import GHC.ByteCode.Types import GHC.Core.DataCon import GHC.Core.TyCon +import GHC.Core.FamInstEnv import GHC.Core.ConLike import GHC.Core.PatSyn import GHC.CoreToIface @@ -55,7 +56,7 @@ import GHC.Driver.Phases import GHC.Driver.Session as DynFlags import GHC.Driver.Ppr hiding (printForUser) import GHC.Utils.Error hiding (traceCmd) -import GHC.Driver.Monad ( modifySession ) +import GHC.Driver.Monad ( modifySession, withSession ) import GHC.Driver.Make ( newIfaceCache, ModIfaceCache(..) ) import GHC.Driver.Config.Parser (initParserOpts) import GHC.Driver.Config.Diagnostic @@ -64,7 +65,7 @@ import GHC ( LoadHowMuch(..), Target(..), TargetId(..), Resume, SingleStep, Ghc, GetDocsFailure(..), pushLogHookM, getModuleGraph, handleSourceError, ms_mod ) -import GHC.Driver.Main (hscParseModuleWithLocation, hscParseStmtWithLocation) +import GHC.Driver.Main (hscParseModuleWithLocation, hscParseStmtWithLocation, getHscEnv) import GHC.Hs.ImpExp import GHC.Hs import GHC.Driver.Env @@ -108,6 +109,8 @@ import GHC.Utils.Logger -- Other random utilities import GHC.Types.Basic hiding ( isTopLevel ) +import GHC.Tc.Instance.Family +import GHC.Tc.Utils.Monad ( initTcInteractive ) import GHC.Settings.Config import GHC.Data.Graph.Directed import GHC.Utils.Encoding @@ -1648,31 +1651,38 @@ normalize s = handleSourceError printGhciException $ do actArgs (_:xs) = actArgs xs trim = let f = reverse . dropWhile isSpace in f . f +lab :: GHC.GhcMonad m => String -> m SDoc lab str = do (ty,kind) <- GHC.typeKind True str + rendered <- showSDocForUser' (ppr kind) + liftIO (putStrLn rendered) case splitTyConApp_maybe ty of Nothing -> throwGhcException (CmdLineError "Something Bad happend!") - Just (head,args) -> pure . pprIfaceDecl showToIface $ toNormalizedIfaceDecl head args kind + Just (head,args) -> do + (_,famInstEnvs) <- withSession $ \hsc_env0 -> do + hsc_env <- GHC.getSession + liftIO $ initTcInteractive hsc_env tcGetFamInstEnvs + case famInstEnvs of + Just fie -> pure . pprIfaceDecl showToIface $ toNormalizedIfaceDecl fie head args kind + Nothing -> throwGhcException (CmdLineError "Couldn't retrieve family instances") --- TODO we may also need to apply the substitution to our TyCon. -- NOTE we'll have to make sure that stheta in TyCon and stheta in DataCon are the same. -toNormalizedIfaceDecl :: TyCon -> [Type] -> Kind -> IfaceDecl -toNormalizedIfaceDecl tyCon args resKind = (snd . tyConToIfaceDecl emptyTidyEnv) newTyCon +toNormalizedIfaceDecl :: FamInstEnvs -> TyCon -> [Type] -> Kind -> IfaceDecl +toNormalizedIfaceDecl famInstEnvs tyCon args resKind = (snd . tyConToIfaceDecl emptyTidyEnv) newTyCon where dataCons = tyConDataCons tyCon - normalizedCons = map (normalizeDataConAt args) dataCons + normalizedCons = map (normalizeDataConAt famInstEnvs args) dataCons newRhs = mkDataTyConRhs normalizedCons - newKind = mkTyConKind (tyConBinders tyCon) resKind - newStupidTheta = tyConStupidTheta tyCon -- FIXME + newStupidTheta = tyConStupidTheta tyCon newRoles = tyConRoles tyCon -- FIXME newCType = tyConCType_maybe tyCon + newTyConBinders = drop (length args) (tyConBinders tyCon) flavour = algTyConFlavour tyCon newTyCon - = mkAlgTyCon (tyConName tyCon) (tyConBinders tyCon) resKind newRoles + = mkAlgTyCon (tyConName tyCon) newTyConBinders resKind newRoles newCType newStupidTheta newRhs flavour (isGadtSyntaxTyCon tyCon) - {- Note [Why do we normalize a DataCon instead of an IfaceConDecl] TODO summary because we'll have to reduce and do all other sorts of stuff. Otherwise View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/319543bde563a4d99cdb05c23f52a46137dd12a8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/319543bde563a4d99cdb05c23f52a46137dd12a8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 11:52:04 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Sun, 28 Jul 2024 07:52:04 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 3 commits: use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a630e48de38_38b50e2f475c10026b@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 47f8895d by Torsten Schmits at 2024-07-28T13:51:51+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - c403fde2 by Torsten Schmits at 2024-07-28T13:51:51+02:00 avoid case-insensitivity clobber in test - - - - - 4d5349bd by Torsten Schmits at 2024-07-28T13:51:51+02:00 compile exe in test with core bindings to avoid recompilation of Hello - - - - - 9 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, IORef TypeEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, types_var, initial_types) <- mk_tc_env + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', types_var, initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + types_var <- newIORef initial_types + pure (hsc_env, types_var, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -3,9 +3,6 @@ module GHC.Driver.Main where import GHC.Driver.Env import GHC.Linker.Types import GHC.Prelude -import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModIface -initModDetails :: HscEnv -> ModIface -> IO ModDetails - -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -293,9 +293,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Succeeded iface <- ldLoadIface opts (text "makima") mod case mi_extra_decls iface of Just extra_decls -> do - details <- initModDetails hsc_env iface t <- getCurrentTime - initWholeCoreBindings hsc_env iface details $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] _ -> fallback_no_bytecode loc mod | otherwise = fallback_no_bytecode loc mod ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,7 @@ test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/26e5520db301b01225f36959673af5c9eec24992...4d5349bd5721aff30f0c2a1d76c622abb1e71247 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/26e5520db301b01225f36959673af5c9eec24992...4d5349bd5721aff30f0c2a1d76c622abb1e71247 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 11:53:02 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Sun, 28 Jul 2024 07:53:02 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-squashed] Oneshot bytecode linking Message-ID: <66a6311e8b043_38b50e2b0cc810086d@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: 64a16717 by Cheng Shao at 2024-07-28T13:52:52+02:00 Oneshot bytecode linking - - - - - 15 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - + testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -292,6 +294,8 @@ import GHC.Types.TypeEnv import System.IO import {-# SOURCE #-} GHC.Driver.Pipeline import Data.Time +import Data.Traversable +import qualified Data.ByteString as BS import System.IO.Unsafe ( unsafeInterleaveIO ) import GHC.Iface.Env ( trace_if ) @@ -989,30 +993,70 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = LM utc_time this_mod <$> mapM go uls +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, IORef TypeEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do + -- If a module is compiled with -fbyte-code-and-object-code and it + -- makes use of foreign stubs, then the interface file will also + -- contain serialized stub dynamic objects, and we can simply write + -- them to temporary objects and refer to them as unlinked items + -- directly. + stub_uls <- for (mi_stub_objs mod_iface) $ \stub_obj -> do + f <- newTempName (hsc_logger hsc_env) (hsc_tmpfs hsc_env) (tmpDir (hsc_dflags hsc_env)) TFL_GhcSession "dyn_o" + BS.writeFile f stub_obj + pure $ DotO f + bytecode_uls <- for uls go + pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - -- MP: The NoStubs here is only from (I think) the TH `qAddForeignFilePath` feature but it's a bit unclear what to do - -- with these files, do we have to read and serialise the foreign file? I will leave it for now until someone - -- reports a bug. - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, types_var, initial_types) <- mk_tc_env + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', types_var, initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + types_var <- newIORef initial_types + pure (hsc_env, types_var, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2044,7 +2088,10 @@ generateByteCode hsc_env cgguts mod_location = do stub_o <- case hasStub of Nothing -> return [] Just stub_c -> do - stub_o <- compileForeign hsc_env LangC stub_c + -- Always compile foreign stubs as shared objects so + -- they can be properly loaded later when the bytecode + -- is loaded. + stub_o <- compileForeign (hscUpdateFlags setDynamicNow hsc_env) LangC stub_c return [DotO stub_o] let hs_unlinked = [BCOs comp_bc spt_entries] ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Driver/Pipeline.hs ===================================== @@ -796,7 +796,7 @@ hscBackendPipeline pipe_env hsc_env mod_sum result = HscUpdate iface -> return (iface, emptyHomeModInfoLinkable) HscRecomp {} -> (,) <$> liftIO (mkFullIface hsc_env (hscs_partial_iface result) Nothing Nothing) <*> pure emptyHomeModInfoLinkable -- TODO: Why is there not a linkable? - -- Interpreter -> (,) <$> use (T_IO (mkFullIface hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing + -- Interpreter -> (,) <$> use (T_IO (mkFullIfaceWithForeignStubs hsc_env (hscs_partial_iface result) Nothing)) <*> pure Nothing hscGenBackendPipeline :: P m => PipeEnv ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -582,9 +582,23 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do do output_fn <- phaseOutputFilenameNew next_phase pipe_env hsc_env (Just location) (outputFilename, mStub, foreign_files, stg_infos, cg_infos) <- - hscGenHardCode hsc_env cgguts mod_location output_fn - final_iface <- mkFullIface hsc_env partial_iface stg_infos cg_infos + + -- When compiling with -fprefer-byte-code, always + -- compile foreign stubs as shared objects to ensure + -- they can be properly loaded. + let hsc_env_stub + | gopt Opt_WriteIfSimplifiedCore dflags = hscUpdateFlags setDynamicNow hsc_env + | otherwise = hsc_env + stub_o <- mapM (compileStub hsc_env_stub) mStub + foreign_os <- + mapM (uncurry (compileForeign hsc_env_stub)) foreign_files + let fos = maybe [] return stub_o ++ foreign_os + iface_fos + | gopt Opt_WriteIfSimplifiedCore dflags = fos + | otherwise = [] + + final_iface <- mkFullIfaceWithForeignStubs hsc_env partial_iface stg_infos cg_infos iface_fos -- See Note [Writing interface files] hscMaybeWriteIface logger dflags False final_iface mb_old_iface_hash mod_location @@ -596,12 +610,6 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do else return emptyHomeModInfoLinkable - - stub_o <- mapM (compileStub hsc_env) mStub - foreign_os <- - mapM (uncurry (compileForeign hsc_env)) foreign_files - let fos = (maybe [] return stub_o ++ foreign_os) - -- This is awkward, no linkable is produced here because we still -- have some way to do before the object file is produced -- In future we can split up the driver logic more so that this function ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Iface/Make.hs ===================================== @@ -12,6 +12,7 @@ module GHC.Iface.Make ( mkPartialIface , mkFullIface + , mkFullIfaceWithForeignStubs , mkIfaceTc , mkIfaceExports ) @@ -88,6 +89,8 @@ import GHC.Unit.Module.ModGuts import GHC.Unit.Module.ModSummary import GHC.Unit.Module.Deps +import qualified Data.ByteString as BS +import Data.Traversable import Data.Function import Data.List ( sortBy ) import Data.Ord @@ -126,23 +129,30 @@ mkPartialIface hsc_env core_prog mod_details mod_summary import_decls = mkIface_ hsc_env this_mod core_prog hsc_src used_th deps rdr_env import_decls fix_env warns hpc_info self_trust safe_mode usages docs mod_summary mod_details +-- | Backwards compat interface for 'mkFullIfaceWithForeignStubs'. +mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface +mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = + mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos [] + -- | Fully instantiate an interface. Adds fingerprints and potentially code -- generator produced information. -- -- CmmCgInfos is not available when not generating code (-fno-code), or when not -- generating interface pragmas (-fomit-interface-pragmas). See also -- Note [Conveying CAF-info and LFInfo between modules] in GHC.StgToCmm.Types. -mkFullIface :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> IO ModIface -mkFullIface hsc_env partial_iface mb_stg_infos mb_cmm_infos = do +mkFullIfaceWithForeignStubs :: HscEnv -> PartialModIface -> Maybe StgCgInfos -> Maybe CmmCgInfos -> [FilePath] -> IO ModIface +mkFullIfaceWithForeignStubs hsc_env partial_iface mb_stg_infos mb_cmm_infos fos = do let decls | gopt Opt_OmitInterfacePragmas (hsc_dflags hsc_env) = mi_decls partial_iface | otherwise = updateDecl (mi_decls partial_iface) mb_stg_infos mb_cmm_infos + stub_objs <- for fos BS.readFile + full_iface <- {-# SCC "addFingerprints" #-} - addFingerprints hsc_env (set_mi_decls decls partial_iface) + addFingerprints hsc_env $ set_mi_stub_objs stub_objs $ set_mi_decls decls partial_iface -- Debug printing let unit_state = hsc_units hsc_env ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -52,10 +52,14 @@ import Control.Applicative import qualified Data.Set as Set import qualified Data.Map as M -import Data.List (isSuffixOf) import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -70,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -140,7 +145,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do -- 3. For each dependent module, find its linkable -- This will either be in the HPT or (in the case of one-shot -- compilation) we may need to use maybe_getFileLinkable - lnks_needed <- mapM (get_linkable (ldObjSuffix opts)) mods_needed + lnks_needed <- mapM get_linkable mods_needed return $ LinkDeps { ldNeededLinkables = lnks_needed @@ -266,7 +271,7 @@ get_link_deps opts pls maybe_normal_osuf span mods = do then homeModInfoByteCode hmi <|> homeModInfoObject hmi else homeModInfoObject hmi <|> homeModInfoByteCode hmi - get_linkable osuf mod -- A home-package module + get_linkable mod -- A home-package module | Just mod_info <- lookupHugByModule mod (ue_home_unit_graph unit_env) = adjust_linkable (expectJust "getLinkDeps" (homeModLinkable mod_info)) | otherwise @@ -283,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "makima") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do @@ -300,9 +319,13 @@ get_link_deps opts pls maybe_normal_osuf span mods = do return lnk adjust_ul new_osuf (DotO file) = do - massert (osuf `isSuffixOf` file) - let file_base = fromJust (stripExtension osuf file) - new_file = file_base <.> new_osuf + -- file may already has new_osuf suffix. One example + -- is when we load bytecode from whole core bindings, + -- then the corresponding foreign stub objects are + -- compiled as shared objects and file may already has + -- .dyn_o suffix. And it's okay as long as the file to + -- load is already there. + let new_file = file -<.> new_osuf ok <- doesFileExist new_file if (not ok) then dieWith opts span $ ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== compiler/GHC/Unit/Module/ModIface.hs ===================================== @@ -22,6 +22,7 @@ module GHC.Unit.Module.ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -56,6 +57,7 @@ module GHC.Unit.Module.ModIface , set_mi_rules , set_mi_decls , set_mi_extra_decls + , set_mi_stub_objs , set_mi_top_env , set_mi_hpc , set_mi_trust @@ -119,6 +121,7 @@ import GHC.Utils.Binary import Control.DeepSeq import Control.Exception import qualified GHC.Data.Strict as Strict +import Data.ByteString (ByteString) {- Note [Interface file stages] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -282,6 +285,13 @@ data ModIface_ (phase :: ModIfacePhase) -- combined with mi_decls allows us to restart code generation. -- See Note [Interface Files with Core Definitions] and Note [Interface File with Core: Sharing RHSs] + mi_stub_objs_ :: ![ByteString], + -- ^ Serialized foreign stub dynamic objects when + -- compiled with -fbyte-code-and-object-code, empty + -- and unused in other cases. This is required to make + -- whole core bindings properly work with foreign + -- stubs (see #24634). + mi_top_env_ :: !(Maybe IfaceTopEnv), -- ^ Just enough information to reconstruct the top level environment in -- the /original source/ code for this module. which @@ -453,6 +463,7 @@ instance Binary ModIface where mi_anns_ = anns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_insts_ = insts, mi_fam_insts_ = fam_insts, mi_rules_ = rules, @@ -497,6 +508,7 @@ instance Binary ModIface where lazyPut bh anns put_ bh decls put_ bh extra_decls + put_ bh stub_objs put_ bh insts put_ bh fam_insts lazyPut bh rules @@ -529,6 +541,7 @@ instance Binary ModIface where anns <- {-# SCC "bin_anns" #-} lazyGet bh decls <- {-# SCC "bin_tycldecls" #-} get bh extra_decls <- get bh + stub_objs <- get bh insts <- {-# SCC "bin_insts" #-} get bh fam_insts <- {-# SCC "bin_fam_insts" #-} get bh rules <- {-# SCC "bin_rules" #-} lazyGet bh @@ -558,6 +571,7 @@ instance Binary ModIface where mi_warns_ = warns, mi_decls_ = decls, mi_extra_decls_ = extra_decls, + mi_stub_objs_ = stub_objs, mi_top_env_ = Nothing, mi_insts_ = insts, mi_fam_insts_ = fam_insts, @@ -611,6 +625,7 @@ emptyPartialModIface mod mi_rules_ = [], mi_decls_ = [], mi_extra_decls_ = Nothing, + mi_stub_objs_ = [], mi_top_env_ = Nothing, mi_hpc_ = False, mi_trust_ = noIfaceTrustInfo, @@ -664,7 +679,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) rnf (PrivateModIface { mi_module_, mi_sig_of_, mi_hsc_src_, mi_hi_bytes_, mi_deps_, mi_usages_ , mi_exports_, mi_used_th_, mi_fixities_, mi_warns_, mi_anns_ - , mi_decls_, mi_extra_decls_, mi_top_env_, mi_insts_ + , mi_decls_, mi_extra_decls_, mi_stub_objs_, mi_top_env_, mi_insts_ , mi_fam_insts_, mi_rules_, mi_hpc_, mi_trust_, mi_trust_pkg_ , mi_complete_matches_, mi_docs_, mi_final_exts_ , mi_ext_fields_, mi_src_hash_ }) @@ -681,6 +696,7 @@ instance ( NFData (IfaceBackendExts (phase :: ModIfacePhase)) `seq` rnf mi_anns_ `seq` rnf mi_decls_ `seq` rnf mi_extra_decls_ + `seq` rnf mi_stub_objs_ `seq` rnf mi_top_env_ `seq` rnf mi_insts_ `seq` rnf mi_fam_insts_ @@ -844,6 +860,9 @@ set_mi_decls val iface = clear_mi_hi_bytes $ iface { mi_decls_ = val } set_mi_extra_decls :: Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> ModIface_ phase -> ModIface_ phase set_mi_extra_decls val iface = clear_mi_hi_bytes $ iface { mi_extra_decls_ = val } +set_mi_stub_objs :: [ByteString] -> ModIface_ phase -> ModIface_ phase +set_mi_stub_objs stub_objs iface = clear_mi_hi_bytes $ iface { mi_stub_objs_ = stub_objs } + set_mi_top_env :: Maybe IfaceTopEnv -> ModIface_ phase -> ModIface_ phase set_mi_top_env val iface = clear_mi_hi_bytes $ iface { mi_top_env_ = val } @@ -940,6 +959,7 @@ However, with the pragma, the correct core is generated: {-# INLINE mi_anns #-} {-# INLINE mi_decls #-} {-# INLINE mi_extra_decls #-} +{-# INLINE mi_stub_objs #-} {-# INLINE mi_top_env #-} {-# INLINE mi_insts #-} {-# INLINE mi_fam_insts #-} @@ -957,7 +977,7 @@ However, with the pragma, the correct core is generated: pattern ModIface :: Module -> Maybe Module -> HscSource -> Dependencies -> [Usage] -> [IfaceExport] -> Bool -> [(OccName, Fixity)] -> IfaceWarnings -> - [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> + [IfaceAnnotation] -> [IfaceDeclExts phase] -> Maybe [IfaceBindingX IfaceMaybeRhs IfaceTopBndrInfo] -> [ByteString] -> Maybe IfaceTopEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> AnyHpcUsage -> IfaceTrustInfo -> Bool -> [IfaceCompleteMatch] -> Maybe Docs -> IfaceBackendExts phase -> ExtensibleFields -> Fingerprint -> IfaceBinHandle phase -> @@ -975,6 +995,7 @@ pattern ModIface , mi_anns , mi_decls , mi_extra_decls + , mi_stub_objs , mi_top_env , mi_insts , mi_fam_insts @@ -1001,6 +1022,7 @@ pattern ModIface , mi_anns_ = mi_anns , mi_decls_ = mi_decls , mi_extra_decls_ = mi_extra_decls + , mi_stub_objs_ = mi_stub_objs , mi_top_env_ = mi_top_env , mi_insts_ = mi_insts , mi_fam_insts_ = mi_fam_insts ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -2,8 +2,8 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -bytecode-capi: - $(TEST_HC) -c hello.c +T24634: + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -0,0 +1,3 @@ +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) +[3 of 3] Linking Main +42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,7 +1,7 @@ test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), - req_interp, - expect_broken(24634), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), + req_c, + req_th, ], makefile_test, - ['']) + []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64a16717711cf9f944fbf67a1354e480216f8a91 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/64a16717711cf9f944fbf67a1354e480216f8a91 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 11:53:37 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Sun, 28 Jul 2024 07:53:37 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/oneshot-bytecode-pkgdeps] 2 commits: use the EPS type env when typechecking core bindings in oneshot mode Message-ID: <66a6314156bf9_38b50e2b0cc81010d@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/oneshot-bytecode-pkgdeps at Glasgow Haskell Compiler / GHC Commits: 765e1353 by Torsten Schmits at 2024-07-28T13:53:30+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - fa879f12 by Torsten Schmits at 2024-07-28T13:53:30+02:00 avoid case-insensitivity clobber in test - - - - - 8 changed files: - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Linker/Deps.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -992,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, IORef TypeEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1008,22 +1015,47 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, types_var, initial_types) <- mk_tc_env + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', types_var, initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + types_var <- newIORef initial_types + pure (hsc_env, types_var, initial_types) + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -3,9 +3,6 @@ module GHC.Driver.Main where import GHC.Driver.Env import GHC.Linker.Types import GHC.Prelude -import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModIface -initModDetails :: HscEnv -> ModIface -> IO ModDetails - -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -217,9 +217,8 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Just lnk -> adjust_linkable lnk LinkByteCodeModule iface wcb -> do - details <- initModDetails (ldHscEnv opts) iface t <- getCurrentTime - initWholeCoreBindings (ldHscEnv opts) iface details $ LM t (mi_module iface) [CoreBindings wcb] + initWholeCoreBindingsEps (ldHscEnv opts) iface $ LM t (mi_module iface) [CoreBindings wcb] -- See Note [Using Byte Code rather than Object Code for Template Haskell] homeModLinkable :: HomeModInfo -> Maybe Linkable ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,5 +1,5 @@ test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, ignore_stderr ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/08655002a3f2e6c89b87c3b3eb1c6888a3326c92...fa879f120d15eac9bb78652f31dd86af1c3f1fb0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/08655002a3f2e6c89b87c3b3eb1c6888a3326c92...fa879f120d15eac9bb78652f31dd86af1c3f1fb0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 11:54:02 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Sun, 28 Jul 2024 07:54:02 -0400 Subject: [Git][ghc/ghc][wip/torsten.schmits/package-deps-bytecode-squashed] 2 commits: Oneshot bytecode linking Message-ID: <66a6315a46c1e_38b50e287fd01012e0@gitlab.mail> Torsten Schmits pushed to branch wip/torsten.schmits/package-deps-bytecode-squashed at Glasgow Haskell Compiler / GHC Commits: a47981bd by Cheng Shao at 2024-07-28T13:53:57+02:00 Oneshot bytecode linking - - - - - 908ed174 by Torsten Schmits at 2024-07-28T13:53:57+02:00 Package deps bytecode linking - - - - - 30 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Module/ModIface.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - + testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h - + testsuite/tests/th/cross-package/Cross.hs - + testsuite/tests/th/cross-package/CrossDep.hs - + testsuite/tests/th/cross-package/CrossDepApi.hs - + testsuite/tests/th/cross-package/CrossLocal.hs - + testsuite/tests/th/cross-package/CrossNum.hs - + testsuite/tests/th/cross-package/CrossNum.hs-boot - + testsuite/tests/th/cross-package/CrossObj.hs - + testsuite/tests/th/cross-package/CrossPackage.stdout - + testsuite/tests/th/cross-package/Makefile - + testsuite/tests/th/cross-package/all.T - + testsuite/tests/th/cross-package/dep.conf - + testsuite/tests/th/cross-package/obj.conf - + testsuite/tests/th/cross-package/prep.bash - + testsuite/tests/th/cross-package/run.bash The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/918eb44ff4694fd5ac26da672b97448dce74c0be...908ed174cfab250ba373ba39c37d7b077235d3fb -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/918eb44ff4694fd5ac26da672b97448dce74c0be...908ed174cfab250ba373ba39c37d7b077235d3fb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 14:28:16 2024 From: gitlab at gitlab.haskell.org (Vladislav Zavialov (@int-index)) Date: Sun, 28 Jul 2024 10:28:16 -0400 Subject: [Git][ghc/ghc][wip/sand-witch/types-in-terms] 79 commits: Bump array submodule Message-ID: <66a65580da177_38b50e99da401079a4@gitlab.mail> Vladislav Zavialov pushed to branch wip/sand-witch/types-in-terms at Glasgow Haskell Compiler / GHC Commits: 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - c6a7dad9 by Andrei Borzenkov at 2024-07-28T16:20:37+03:00 Type syntax in expressions (24159, 24572, 24226) This patch extends the grammar of expressions with syntax that is typically found only in types: * function types (a -> b), (a ->. b), (a %m -> b) * constrained types (ctx => t) * forall-quantification (forall tvs. t) The new forms are guarded behind the RequiredTypeArguments extension, as specified in GHC Proposal #281. Examples: {-# LANGUAGE RequiredTypeArguments #-} e1 = f (Int -> String) -- function type e2 = f (Int %1 -> String) -- linear function type e3 = f (forall a. Bounded a => a) -- forall type, constraint The GHC AST and the TH AST have been extended as follows: syntax | HsExpr | TH.Exp ---------------+----------+-------------- a -> b | HsFunArr | ConE (->) a %m -> b | HsFunArr | ConE FUN ctx => t | HsQual | ConstrainedE forall a. t | HsForAll | ForallE forall a -> t | HsForAll | ForallVisE Additionally, a new warning flag -Wview-pattern-signatures has been introduced to aid with migration to the new precedence of (e -> p :: t). Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - 27 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3aa6107baf7976b4c13f525e9541d83ca5dbec69...c6a7dad9f36a8d646d721bb8a4b803c12dbb404d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3aa6107baf7976b4c13f525e9541d83ca5dbec69...c6a7dad9f36a8d646d721bb8a4b803c12dbb404d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 18:52:28 2024 From: gitlab at gitlab.haskell.org (Krzysztof Gogolewski (@monoidal)) Date: Sun, 28 Jul 2024 14:52:28 -0400 Subject: [Git][ghc/ghc][wip/kill-parallel-haskell] 177 commits: JS: establish single source of truth for symbols Message-ID: <66a6936c89c48_3b905c3fc5dc239c3@gitlab.mail> Krzysztof Gogolewski pushed to branch wip/kill-parallel-haskell at Glasgow Haskell Compiler / GHC Commits: 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - 22 changed files: - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/PrimOps.hs - compiler/GHC/Builtin/Types.hs - compiler/GHC/Builtin/Utils.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Instr.hs - compiler/GHC/Cmm/CLabel.hs - compiler/GHC/Cmm/DebugBlock.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7b07781ffcba87b68b509d0bd64c273fa1e1c2c8...ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7b07781ffcba87b68b509d0bd64c273fa1e1c2c8...ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Sun Jul 28 21:30:44 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 28 Jul 2024 17:30:44 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: Fix nasty bug in occurrence analyser Message-ID: <66a6b8842b6be_7373d25348880024@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - a4b07a2c by Arnaud Spiwack at 2024-07-28T17:30:20-04:00 Add tests for 25081 - - - - - 0844f774 by Arnaud Spiwack at 2024-07-28T17:30:20-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 22 changed files: - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - docs/users_guide/phases.rst - hadrian/doc/flavours.md - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -502,6 +502,32 @@ tcGuardStmt _ stmt _ _ -- coercion matching stuff in them. It's hard to avoid the -- potential for non-trivial coercions in tcMcStmt +{- +Note [Binding in list comprehension isn't linear] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In principle, [ y | () <- xs, y <- [0,1]] could be linear in `xs`. +But, the way the desugaring works, we get something like + +case xs of + () : xs ' -> letrec next_stmt = … xs' … + +In the current typing rules for letrec in Core, next_stmt is necessarily of +multiplicity Many and so is every free variable, including xs'. Which, in turns, +requires xs to be of multiplicity Many. + +Rodrigo Mesquita worked out, in his master thesis, how to make letrecs having +non-Many multiplicities. But it's a fair bit of work to implement. + +Since nobody actually cares about [ y | () <- xs, y <- [0,1]] being linear, then +we just conservatively make it unrestricted instead. + +If we're to change that, we have to be careful that [ y | _ <- xs, y <- [0,1]] +isn't linear in `xs` since the elements of `xs` are ignored. So we'd still have +to call `tcScalingUsage` on `xs` in `tcLcStmt`, we'd just have to create a fresh +multiplicity variable. We'd also use the same multiplicity variable in the call +to `tcCheckPat` instead of `unrestricted`. +-} + tcLcStmt :: TyCon -- The list type constructor ([]) -> TcExprStmtChecker @@ -513,20 +539,24 @@ tcLcStmt _ _ (LastStmt x body noret _) elt_ty thing_inside -- A generator, pat <- rhs tcLcStmt m_tc ctxt (BindStmt _ pat rhs) elt_ty thing_inside = do { pat_ty <- newFlexiTyVarTy liftedTypeKind - ; rhs' <- tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) + -- About the next `tcScalingUsage ManyTy` and unrestricted + -- see Note [Binding in list comprehension isn't linear] + ; rhs' <- tcScalingUsage ManyTy $ tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) ; (pat', thing) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ + tcScalingUsage ManyTy $ thing_inside elt_ty ; return (mkTcBindStmt pat' rhs', thing) } -- A boolean guard tcLcStmt _ _ (BodyStmt _ rhs _ _) elt_ty thing_inside = do { rhs' <- tcCheckMonoExpr rhs boolTy - ; thing <- thing_inside elt_ty + ; thing <- tcScalingUsage ManyTy $ thing_inside elt_ty ; return (BodyStmt boolTy rhs' noSyntaxExpr noSyntaxExpr, thing) } -- ParStmt: See notes with tcMcStmt and Note [Scoping in parallel list comprehensions] tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside - = do { env <- getLocalRdrEnv + = tcScalingUsage ManyTy $ -- parallel list comprehension never desugars to something linear. + do { env <- getLocalRdrEnv ; (pairs', thing) <- loop env [] bndr_stmts_s ; return (ParStmt unitTy pairs' noExpr noSyntaxExpr, thing) } where @@ -552,7 +582,8 @@ tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts , trS_bndrs = bindersMap , trS_by = by, trS_using = using }) elt_ty thing_inside - = do { let (bndr_names, n_bndr_names) = unzip bindersMap + = tcScalingUsage ManyTy $ -- Transform statements are too complex: just make everything multiplicity Many + do { let (bndr_names, n_bndr_names) = unzip bindersMap unused_ty = pprPanic "tcLcStmt: inner ty" (ppr bindersMap) -- The inner 'stmts' lack a LastStmt, so the element type -- passed in to tcStmtsAndThen is never looked at ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== docs/users_guide/phases.rst ===================================== @@ -515,14 +515,6 @@ defined by your local GHC installation, the following trick is useful: Only defined when :ghc-flag:`-fignore-asserts` is specified. This can be used to create your own assertions, see :ref:`assertions` -``__PARALLEL_HASKELL__`` - .. index:: - single: __PARALLEL_HASKELL__ - - Only defined when ``-parallel`` is in use! This symbol is defined - when pre-processing Haskell (input) and pre-processing C (GHC - output). - ``os_HOST_OS=1`` This define allows conditional compilation based on the Operating System, where⟨os⟩ is the name of the current Operating System (eg. ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/linear/should_compile/LinearListComprehension.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE LinearTypes #-} + +module LinearListComprehension where + +-- Probably nobody actually cares if monad comprehension realised that it can be +-- linear in the first statement. But it can, so we might as well. + +guard :: a %1 -> (a %1 -> Bool) %1 -> [Int] +guard x g = [ y | g x, y <- [0,1] ] + +-- This isn't correct syntax, but a singleton list comprehension would +-- presumably work too +-- last :: a %1 -> [a] +-- last x = [ x | ] ===================================== testsuite/tests/linear/should_compile/all.T ===================================== @@ -45,3 +45,4 @@ test('LinearRecUpd', normal, compile, ['']) test('T23814', normal, compile, ['']) test('LinearLet', normal, compile, ['']) test('LinearLetPoly', normal, compile, ['']) +test('LinearListComprehension', normal, compile, ['-dlinear-core-lint']) ===================================== testsuite/tests/linear/should_fail/T25081.hs ===================================== @@ -0,0 +1,37 @@ +{-# LANGUAGE LinearTypes #-} +{-# LANGUAGE ParallelListComp #-} +{-# LANGUAGE TransformListComp #-} + +module T25081 where + +dup_last :: a %1 -> [a] +dup_last x = [ x | _ <- [0,1]] + +dup_bind :: a %1 -> [()] +dup_bind x = [ () | _ <- [0,1], _ <- [x]] + +dup_guard :: a %1 -> (a %1 -> Bool) -> [()] +dup_guard x g = [ () | _ <- [0,1], g x ] + +guard_last :: a %1 -> [a] +guard_last x = [ x | False] + +guard_bind :: a %1 -> [()] +guard_bind x = [ () | False, _ <- [x]] + +guard_guard :: a %1 -> (a %1 -> Bool) %1 -> [()] +guard_guard x g = [ () | False, g x ] + +-- This could, in principle, be linear. But see Note [Binding in list +-- comprehension isn't linear] in GHC.Tc.Gen.Match. +first_bind :: [()] %1 -> [Int] +first_bind xs = [ y | () <- xs, y <- [0,1]] + +parallel :: a %1 -> [(a, Bool)] +parallel x = [(y,z) | y <- [x] | z <- [True]] + +parallel_guard :: a %1 -> (a %1 -> Bool) -> [(Int, Bool)] +parallel_guard x g = [(y, z) | g x, y <- [0,1] | z <- [True, False]] + +transform :: a %1 -> (a %1 -> Bool) -> [a] +transform x g = [y | g x, y <- [0, 1], then take 2] ===================================== testsuite/tests/linear/should_fail/T25081.stderr ===================================== @@ -0,0 +1,65 @@ +T25081.hs:8:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_last’: dup_last x = [x | _ <- [0, 1]] + +T25081.hs:11:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_bind’: + dup_bind x = [() | _ <- [0, 1], _ <- [x]] + +T25081.hs:14:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_guard’: + dup_guard x g = [() | _ <- [0, 1], g x] + +T25081.hs:17:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_last’: guard_last x = [x | False] + +T25081.hs:20:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_bind’: + guard_bind x = [() | False, _ <- [x]] + +T25081.hs:23:13: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:23:15: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘g’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:28:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘xs’ + • In an equation for ‘first_bind’: + first_bind xs = [y | () <- xs, y <- [0, 1]] + +T25081.hs:31:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel’: + parallel x = [(y, z) | y <- [x] | z <- [True]] + +T25081.hs:34:16: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel_guard’: + parallel_guard x g + = [(y, z) | g x, y <- [0, 1] | z <- [True, False]] + +T25081.hs:37:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘transform’: + transform x g = [y | g x, y <- [0, 1], then take 2] + ===================================== testsuite/tests/linear/should_fail/all.T ===================================== @@ -51,3 +51,4 @@ test('LinearLet7', normal, compile_fail, ['']) test('LinearLet8', normal, compile_fail, ['']) test('LinearLet9', normal, compile_fail, ['']) test('LinearLet10', normal, compile_fail, ['']) +test('T25081', normal, compile_fail, ['']) ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96f19ddde4297e7faec781bc1cd6a2f8e9283950...0844f77469755f3dd72db9f1648b04e5ae2c994b -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96f19ddde4297e7faec781bc1cd6a2f8e9283950...0844f77469755f3dd72db9f1648b04e5ae2c994b You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 02:20:47 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 28 Jul 2024 22:20:47 -0400 Subject: [Git][ghc/ghc][master] users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro Message-ID: <66a6fc7fcd4af_7373dd70e6011227e@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - 1 changed file: - docs/users_guide/phases.rst Changes: ===================================== docs/users_guide/phases.rst ===================================== @@ -515,14 +515,6 @@ defined by your local GHC installation, the following trick is useful: Only defined when :ghc-flag:`-fignore-asserts` is specified. This can be used to create your own assertions, see :ref:`assertions` -``__PARALLEL_HASKELL__`` - .. index:: - single: __PARALLEL_HASKELL__ - - Only defined when ``-parallel`` is in use! This symbol is defined - when pre-processing Haskell (input) and pre-processing C (GHC - output). - ``os_HOST_OS=1`` This define allows conditional compilation based on the Operating System, where⟨os⟩ is the name of the current Operating System (eg. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 02:21:30 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Sun, 28 Jul 2024 22:21:30 -0400 Subject: [Git][ghc/ghc][master] 2 commits: Add tests for 25081 Message-ID: <66a6fcaaefee4_7373def2ff411714f@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 6 changed files: - compiler/GHC/Tc/Gen/Match.hs - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T Changes: ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -502,6 +502,32 @@ tcGuardStmt _ stmt _ _ -- coercion matching stuff in them. It's hard to avoid the -- potential for non-trivial coercions in tcMcStmt +{- +Note [Binding in list comprehension isn't linear] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In principle, [ y | () <- xs, y <- [0,1]] could be linear in `xs`. +But, the way the desugaring works, we get something like + +case xs of + () : xs ' -> letrec next_stmt = … xs' … + +In the current typing rules for letrec in Core, next_stmt is necessarily of +multiplicity Many and so is every free variable, including xs'. Which, in turns, +requires xs to be of multiplicity Many. + +Rodrigo Mesquita worked out, in his master thesis, how to make letrecs having +non-Many multiplicities. But it's a fair bit of work to implement. + +Since nobody actually cares about [ y | () <- xs, y <- [0,1]] being linear, then +we just conservatively make it unrestricted instead. + +If we're to change that, we have to be careful that [ y | _ <- xs, y <- [0,1]] +isn't linear in `xs` since the elements of `xs` are ignored. So we'd still have +to call `tcScalingUsage` on `xs` in `tcLcStmt`, we'd just have to create a fresh +multiplicity variable. We'd also use the same multiplicity variable in the call +to `tcCheckPat` instead of `unrestricted`. +-} + tcLcStmt :: TyCon -- The list type constructor ([]) -> TcExprStmtChecker @@ -513,20 +539,24 @@ tcLcStmt _ _ (LastStmt x body noret _) elt_ty thing_inside -- A generator, pat <- rhs tcLcStmt m_tc ctxt (BindStmt _ pat rhs) elt_ty thing_inside = do { pat_ty <- newFlexiTyVarTy liftedTypeKind - ; rhs' <- tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) + -- About the next `tcScalingUsage ManyTy` and unrestricted + -- see Note [Binding in list comprehension isn't linear] + ; rhs' <- tcScalingUsage ManyTy $ tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) ; (pat', thing) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ + tcScalingUsage ManyTy $ thing_inside elt_ty ; return (mkTcBindStmt pat' rhs', thing) } -- A boolean guard tcLcStmt _ _ (BodyStmt _ rhs _ _) elt_ty thing_inside = do { rhs' <- tcCheckMonoExpr rhs boolTy - ; thing <- thing_inside elt_ty + ; thing <- tcScalingUsage ManyTy $ thing_inside elt_ty ; return (BodyStmt boolTy rhs' noSyntaxExpr noSyntaxExpr, thing) } -- ParStmt: See notes with tcMcStmt and Note [Scoping in parallel list comprehensions] tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside - = do { env <- getLocalRdrEnv + = tcScalingUsage ManyTy $ -- parallel list comprehension never desugars to something linear. + do { env <- getLocalRdrEnv ; (pairs', thing) <- loop env [] bndr_stmts_s ; return (ParStmt unitTy pairs' noExpr noSyntaxExpr, thing) } where @@ -552,7 +582,8 @@ tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts , trS_bndrs = bindersMap , trS_by = by, trS_using = using }) elt_ty thing_inside - = do { let (bndr_names, n_bndr_names) = unzip bindersMap + = tcScalingUsage ManyTy $ -- Transform statements are too complex: just make everything multiplicity Many + do { let (bndr_names, n_bndr_names) = unzip bindersMap unused_ty = pprPanic "tcLcStmt: inner ty" (ppr bindersMap) -- The inner 'stmts' lack a LastStmt, so the element type -- passed in to tcStmtsAndThen is never looked at ===================================== testsuite/tests/linear/should_compile/LinearListComprehension.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE LinearTypes #-} + +module LinearListComprehension where + +-- Probably nobody actually cares if monad comprehension realised that it can be +-- linear in the first statement. But it can, so we might as well. + +guard :: a %1 -> (a %1 -> Bool) %1 -> [Int] +guard x g = [ y | g x, y <- [0,1] ] + +-- This isn't correct syntax, but a singleton list comprehension would +-- presumably work too +-- last :: a %1 -> [a] +-- last x = [ x | ] ===================================== testsuite/tests/linear/should_compile/all.T ===================================== @@ -45,3 +45,4 @@ test('LinearRecUpd', normal, compile, ['']) test('T23814', normal, compile, ['']) test('LinearLet', normal, compile, ['']) test('LinearLetPoly', normal, compile, ['']) +test('LinearListComprehension', normal, compile, ['-dlinear-core-lint']) ===================================== testsuite/tests/linear/should_fail/T25081.hs ===================================== @@ -0,0 +1,37 @@ +{-# LANGUAGE LinearTypes #-} +{-# LANGUAGE ParallelListComp #-} +{-# LANGUAGE TransformListComp #-} + +module T25081 where + +dup_last :: a %1 -> [a] +dup_last x = [ x | _ <- [0,1]] + +dup_bind :: a %1 -> [()] +dup_bind x = [ () | _ <- [0,1], _ <- [x]] + +dup_guard :: a %1 -> (a %1 -> Bool) -> [()] +dup_guard x g = [ () | _ <- [0,1], g x ] + +guard_last :: a %1 -> [a] +guard_last x = [ x | False] + +guard_bind :: a %1 -> [()] +guard_bind x = [ () | False, _ <- [x]] + +guard_guard :: a %1 -> (a %1 -> Bool) %1 -> [()] +guard_guard x g = [ () | False, g x ] + +-- This could, in principle, be linear. But see Note [Binding in list +-- comprehension isn't linear] in GHC.Tc.Gen.Match. +first_bind :: [()] %1 -> [Int] +first_bind xs = [ y | () <- xs, y <- [0,1]] + +parallel :: a %1 -> [(a, Bool)] +parallel x = [(y,z) | y <- [x] | z <- [True]] + +parallel_guard :: a %1 -> (a %1 -> Bool) -> [(Int, Bool)] +parallel_guard x g = [(y, z) | g x, y <- [0,1] | z <- [True, False]] + +transform :: a %1 -> (a %1 -> Bool) -> [a] +transform x g = [y | g x, y <- [0, 1], then take 2] ===================================== testsuite/tests/linear/should_fail/T25081.stderr ===================================== @@ -0,0 +1,65 @@ +T25081.hs:8:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_last’: dup_last x = [x | _ <- [0, 1]] + +T25081.hs:11:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_bind’: + dup_bind x = [() | _ <- [0, 1], _ <- [x]] + +T25081.hs:14:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_guard’: + dup_guard x g = [() | _ <- [0, 1], g x] + +T25081.hs:17:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_last’: guard_last x = [x | False] + +T25081.hs:20:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_bind’: + guard_bind x = [() | False, _ <- [x]] + +T25081.hs:23:13: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:23:15: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘g’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:28:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘xs’ + • In an equation for ‘first_bind’: + first_bind xs = [y | () <- xs, y <- [0, 1]] + +T25081.hs:31:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel’: + parallel x = [(y, z) | y <- [x] | z <- [True]] + +T25081.hs:34:16: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel_guard’: + parallel_guard x g + = [(y, z) | g x, y <- [0, 1] | z <- [True, False]] + +T25081.hs:37:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘transform’: + transform x g = [y | g x, y <- [0, 1], then take 2] + ===================================== testsuite/tests/linear/should_fail/all.T ===================================== @@ -51,3 +51,4 @@ test('LinearLet7', normal, compile_fail, ['']) test('LinearLet8', normal, compile_fail, ['']) test('LinearLet9', normal, compile_fail, ['']) test('LinearLet10', normal, compile_fail, ['']) +test('T25081', normal, compile_fail, ['']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e...23f50640e705c132f1a0689d4850866d0f0d76a6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ec2eafdb65c47c55c4c56fc9d0f42f8696a0be4e...23f50640e705c132f1a0689d4850866d0f0d76a6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 03:40:24 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Sun, 28 Jul 2024 23:40:24 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] add location information to expanded expression Message-ID: <66a70f28549bb_7373d13a71f81259bb@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 13149cd7 by Apoorv Ingle at 2024-07-28T22:39:55-05:00 add location information to expanded expression - - - - - 7 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -476,7 +476,7 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` -data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern HsDoFlavour -- ^ which kind of do-block did this statement come from @@ -494,7 +494,7 @@ isHsThingRnPat _ = False data XXExprGhcRn = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages - , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_expanded :: LHsExpr GhcRn -- The expanded thing can be user written or compiler generated , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded @@ -519,7 +519,7 @@ mkPopErrCtxtExprAt loc a = L loc $ mkPopErrCtxtExpr a -- expanded expressions. mkExpandedExpr :: HsExpr GhcRn -- ^ source expression - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr , xrn_expanded = eExpr @@ -532,7 +532,7 @@ mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ source statement do flavour -> Bool -- ^ should this be type checked using tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav , xrn_expanded = eExpr @@ -542,7 +542,7 @@ mkExpandedPatRn :: LPat GhcRn -- ^ source pattern -> HsDoFlavour -- ^ source statement do flavour -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt , xrn_expanded = eExpr @@ -553,17 +553,17 @@ mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = Or -- expanded expression and associate it with a provided location mkExpandedStmtAt :: Bool -- ^ Wrap this expansion with a pop? - -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ the flavour of the statement -> Bool -- ^ should type check with tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr +mkExpandedStmtAt addPop oStmt flav doTcApp eExpr | addPop - = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + = L (noAnnSrcSpan generatedSrcSpan) (mkPopErrCtxtExpr (L (noAnnSrcSpan generatedSrcSpan) + $ mkExpandedStmt oStmt flav doTcApp eExpr)) | otherwise - = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr + = L (noAnnSrcSpan generatedSrcSpan) (mkExpandedStmt oStmt flav doTcApp eExpr) data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -572,7 +572,7 @@ data XXExprGhcTc | ExpandedThingTc -- See Note [Rebindable syntax and XXExprGhcRn] -- See Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do` { xtc_orig :: HsThingRn -- The original user written thing - , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression + , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression | ConLikeTc -- Result of typechecking a data-con -- See Note [Typechecking data constructors] in @@ -607,7 +607,7 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement - -> HsDoFlavour + -> HsDoFlavour -- ^ the flavour of this statement -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x _)) +repE e@(XExpr (ExpandedThingRn o (L _ x) _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -360,7 +360,7 @@ rnExpr (HsUnboundVar _ v) rnExpr (HsOverLabel src v) = do { (from_label, fvs) <- lookupSyntaxName fromLabelClassOpName ; return ( mkExpandedExpr (HsOverLabel src v) $ - HsAppType noExtField (genLHsVar from_label) hs_ty_arg + wrapGenSpan (HsAppType noExtField (genLHsVar from_label) hs_ty_arg) , fvs ) } where hs_ty_arg = mkEmptyWildCardBndrs $ wrapGenSpan $ @@ -435,7 +435,7 @@ rnExpr (HsGetField _ e f) ; let f' = rnDotFieldOcc f ; return ( mkExpandedExpr (HsGetField noExtField e f') - (mkGetField getField e (fmap (unLoc . dfoLabel) f')) + (wrapGenSpan (mkGetField getField e (fmap (unLoc . dfoLabel) f'))) , fv_e `plusFV` fv_getField ) } rnExpr (HsProjection _ fs) @@ -444,7 +444,7 @@ rnExpr (HsProjection _ fs) ; let fs' = fmap rnDotFieldOcc fs ; return ( mkExpandedExpr (HsProjection noExtField fs') - (mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')) + (wrapGenSpan ((mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')))) , unitFV circ `plusFV` fv_getField) } ------------------------------------------ @@ -516,7 +516,7 @@ rnExpr (ExplicitList _ exps) lit_n = mkIntegralLit (length exps) hs_lit = genHsIntegralLit lit_n exp_list = genHsApps' (L (noAnnSrcSpan loc) from_list_n_name) [hs_lit, wrapGenSpan rn_list] - ; return ( mkExpandedExpr rn_list exp_list + ; return ( mkExpandedExpr rn_list (wrapGenSpan exp_list) , fvs `plusFV` fvs') } } rnExpr (ExplicitTuple _ tup_args boxity) @@ -578,7 +578,7 @@ rnExpr (RecordUpd { rupd_expr = L l expr, rupd_flds = rbinds }) , olRecUpdFields = us } ; return ( mkExpandedExpr (RecordUpd noExtField (L l e) upd_flds) - (mkRecordDotUpd getField setField (L l e) us) + (wrapGenSpan $ mkRecordDotUpd getField setField (L l e) us) , plusFVs [fv_getField, fv_setField, fv_e, fv_us] ) } rnExpr (HsRecSel x _) = dataConCantHappen x @@ -669,17 +669,17 @@ rnSection :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) -- See Note [Parsing sections] in GHC.Parser -- Also see Note [Handling overloaded and rebindable constructs] -rnSection section@(SectionR x op expr) +rnSection section@(SectionR x op@(L op_loc _) expr@(L expr_loc _)) -- See Note [Left and right sections] = do { (op', fvs_op) <- rnLExpr op ; (expr', fvs_expr) <- rnLExpr expr ; checkSectionPrec InfixR section op' expr' ; let rn_section = SectionR x op' expr' - ds_section = genHsApps rightSectionName [op',expr'] + ds_section = L (combineSrcSpansA op_loc expr_loc) (genHsApps rightSectionName [op',expr']) ; return ( mkExpandedExpr rn_section ds_section , fvs_op `plusFV` fvs_expr) } -rnSection section@(SectionL x expr op) +rnSection section@(SectionL x expr@(L expr_loc _) op@(L op_loc _)) -- See Note [Left and right sections] = do { (expr', fvs_expr) <- rnLExpr expr ; (op', fvs_op) <- rnLExpr op @@ -691,7 +691,7 @@ rnSection section@(SectionL x expr op) | postfix_ops = HsApp noExtField op' expr' | otherwise = genHsApps leftSectionName [wrapGenSpan $ HsApp noExtField op' expr'] - ; return ( mkExpandedExpr rn_section ds_section + ; return ( mkExpandedExpr rn_section (L (combineSrcSpansA expr_loc op_loc) ds_section) , fvs_op `plusFV` fvs_expr) } rnSection other = pprPanic "rnSection" (ppr other) @@ -2806,7 +2806,7 @@ rnHsIf p b1 b2 -> return (rn_if, fvs_if) Just ite_name -- Rebindable-syntax case - -> do { let ds_if = genHsApps ite_name [p', b1', b2'] + -> do { let ds_if = wrapGenSpan (genHsApps ite_name [p', b1', b2']) fvs = plusFVs [fvs_if, unitFV ite_name] ; return (mkExpandedExpr rn_if ds_if, fvs) } } ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -815,9 +815,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args -- Rule IARG from Fig 4 of the QL paper: go1 pos acc fun_ty (EValArg { ea_arg = arg, ea_ctxt = ctxt } : rest_args) - = do { let herald = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> ExpectedFunTySyntaxOp DoOrigin tc_fun - _ -> ExpectedFunTyArg (HsExprTcThing tc_fun) (unLoc arg) + = do { let herald = ExpectedFunTyArg (HsExprTcThing tc_fun) (unLoc arg) ; (wrap, arg_ty, res_ty) <- -- NB: matchActualFunTy does the rep-poly check. -- For example, suppose we have f :: forall r (a::TYPE r). a -> Int @@ -874,7 +872,7 @@ looks_like_type_arg _ = False addArgCtxt :: AppCtxt -> LHsExpr GhcRn -> TcM a -> TcM a --- There are four cases: +-- There are three cases: -- 1. In the normal case, we add an informative context -- "In the third argument of f, namely blah" -- 2. If we are deep inside generated code (`isGeneratedCode` is `True`) @@ -883,18 +881,10 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- "In the expression: arg" -- Unless the arg is also a generated thing, in which case do nothing. -- See Note [Rebindable syntax and XXExprGhcRn] in GHC.Hs.Expr --- 3. We are in an expanded `do`-block's non-bind statement +-- 3. We are in an expanded `do`-block's statement -- we simply add the statement context -- "In the statement of the `do`-block .." --- 4. We are in an expanded do block's bind statement --- a. Then either we are typechecking the first argument of the bind which is user located --- so we set the location to be that of the argument --- b. Or, we are typechecking the second argument which would be a generated lambda --- so we set the location to be whatever the location in the context is -- See Note [Expanding HsDo with XXExprGhcRn] in GHC.Tc.Gen.Do --- For future: we need a cleaner way of doing this bit of adding the right error context. --- There is a delicate dance of looking at source locations and reconstructing --- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of @@ -903,18 +893,10 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc - | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) - -> setSrcSpan loc $ - addStmtCtxt stmt flav $ - thing_inside - | otherwise -- This arg is the first argument to generated (>>=) - -> setSrcSpanA arg_loc $ - addStmtCtxt stmt flav $ - thing_inside VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav $ + setSrcSpanA arg_loc $ thing_inside _ -> setSrcSpanA arg_loc $ ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -73,13 +73,13 @@ expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L _ (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = return $ mkExpandedStmtAt addPop loc stmt flav False body + = return $ mkExpandedStmtAt addPop stmt flav False (L body_loc body) | SyntaxExprRn ret <- ret_expr -- @@ -87,18 +87,18 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- return e ~~> return e -- to make T18324 work = do let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtAt addPop loc stmt flav False expansion + return $ mkExpandedStmtAt addPop stmt flav False (L body_loc expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion + return $ mkExpandedStmtAt addPop stmt doFlavour False (wrapGenSpan expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L _ (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -112,12 +112,12 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' @@ -127,7 +127,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_o let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts @@ -216,7 +216,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) { xarg_app_arg_one = mb_fail_op , app_arg_pattern = pat , arg_expr = (L rhs_loc rhs) }) = - do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + do let xx_expr = mkExpandedStmtAt addPop stmt doFlavour False (L rhs_loc rhs) traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) return ((pat, mb_fail_op) , xx_expr) @@ -247,7 +247,7 @@ expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (p -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = +mk_failable_expr addPop doFlav mb_stmt lpat@(L _ pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM @@ -262,21 +262,21 @@ mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr _ -> return $ case mb_stmt of Nothing -> genHsLamDoExp doFlav [lpat] expr - Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False - (unLoc $ (genHsLamDoExp doFlav [lpat] - $ wrapGenSpan (mkPopErrCtxtExpr expr))) - else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op + Just stmt -> mkExpandedStmtAt addPop stmt doFlav False + (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)) + else mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) - -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags - return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ - (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr - , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" - ]) + return $ wrapGenSpan (HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ + (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr + , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" + ])) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ @@ -285,7 +285,7 @@ mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op = mkExpandedPatRn pat doFlav mb_stmt $ - genHsApp fail_op (mk_fail_msg_expr dflags pat) + wrapGenSpan (genHsApp fail_op (mk_fail_msg_expr dflags pat)) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -621,7 +621,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Typecheck the expanded expression. ; expr' <- addErrCtxt err_ctxt $ - tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty) + tcExpr (mkExpandedExpr expr (wrapGenSpan ds_expr)) (Check ds_res_ty) -- NB: it's important to use ds_res_ty and not res_ty here. -- Test case: T18802b. @@ -714,7 +714,7 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty +tcXExpr xe@(ExpandedThingRn o (L _ e') doTcApp) res_ty | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 = setSrcSpanA loc $ addStmtCtxt (unLoc s) flav $ ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -325,8 +325,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e _)) ctxt args - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) + go (XExpr (ExpandedThingRn o (L l e) _)) _ args + = go e (VAExpansion o (locA l) (locA l)) (EWrap (EExpand o) : args) -- See Note [Desugar OpApp in the typechecker] @@ -335,7 +335,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] , mkEValArg (VACall op 1 generatedSrcSpan) arg1 : mkEValArg (VACall op 2 generatedSrcSpan) arg2 -- generatedSrcSpan because this the span of the call, - -- and its hard to say exactly what that is + -- Exand its hard to say exactly what that is : EWrap (EExpand (OrigExpr e)) : args ) @@ -555,20 +555,25 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt flav - thing_inside addHeadCtxt fun_ctxt thing_inside + | isGeneratedSrcSpan fun_loc + = case fun_ctxt of + VAExpansion (OrigStmt (L loc stmt) flav) _ _ + -> do setSrcSpanA loc $ + addStmtCtxt stmt flav $ + thing_inside + VAExpansion (OrigPat (L loc _) _ _) _ _ + -> setSrcSpanA loc $ thing_inside + _ -> thing_inside + | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt: fun_loc" (ppr fun_loc) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ - -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/13149cd7b388f12d311ae44ec4c74df41983b3e8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/13149cd7b388f12d311ae44ec4c74df41983b3e8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 07:57:50 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Mon, 29 Jul 2024 03:57:50 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a74b7ea271c_3154f11e21e81976c@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: d69b4227 by Fabricio de Sousa Nascimento at 2024-07-29T16:57:29+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 17 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,285 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming the LHS on type class Instances] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming the LHS of type class Instances is similar to [Renaming children on +export lists] as they both rely on the [Configurable GRE lookup priority]. + +One main difference is that we require parents to match on LHS names in type +classes, while on export lists, we may sometimes export a name with a different +parent than it was declared, for example PatternSynonyms (see [Typing Pattern +Synonym Exports]). + +Another difference is in the presence of ambiguous names. Because we are strict +on the parent, we won't report a name clash in the example bellow (see #24452), +as it would lead to a confusing error. + + module Ambiguous where + + import Control.Applicative (Alternative) + import qualified Data.Map as Map (empty) + import qualified Data.Set as Set (empty) + + instance Alternative Foo where + empty = undefined + +Note that the solution to this error would be to import the correct `empty` from +Applicative. + import Control.Applicative (Alternative, empty) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) +{-# INLINEABLE lookupInstanceDeclarationSubBndr #-} + +-- For details, see Note [Renaming children on export lists] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g +{-# INLINEABLE lookupChildExportListSubBndr #-} + +{- Note [Picking and disambiguating children candidates] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The goal of `pick_matching_gres` is to pick one occurrence to rename, and fail +at any ambiguity. Note that failing to reject a program with multiple +parent matches can cause #25014. + + module Ambig1 where + data family T a + data instance T Bool = MkT + + module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT + + module Program (T(MkT)) where -- Ambig1 or Ambig2? + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + +Even when we don't find matching parents, we need to consider matching names +without a parent, for example for pattern synonyms bellow. + + module M (Maybe (Empty)) where + class Empty a where + isEmpty :: a -> Bool + + instance Empty (Maybe a) where + isEmpty Nothing = True + + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) +-} +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | length matching_parent_gres == 1 = + MatchingParentOccurrence (head matching_parent_gres) + | length no_parent_gres == 1 = + NoParentOccurrence (head no_parent_gres) + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | not $ null matching_parent_gres = + AmbiguousOccurrence (NE.fromList matching_parent_gres) + | otherwise = + -- no_parent_gres won't be empty due to the conditions above + AmbiguousOccurrence (NE.fromList no_parent_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused ghc to not being able to find the +correct identifier. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] + +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +bellow, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +970,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +977,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2287,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,65 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicate. +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +The strategy for renaming, is to first establish all the possible namespaces +that an identifier might be in, then for each namespace in turn, +tries to find the correct identifier there returning the +first positive result or the first terminating error. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +731,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,6 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d69b4227064944970ad776939c058a64be00f409 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d69b4227064944970ad776939c058a64be00f409 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 09:24:51 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Mon, 29 Jul 2024 05:24:51 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/fix-25119 Message-ID: <66a75fe3e1129_3154f16045a0318b8@gitlab.mail> Matthew Pickering pushed new branch wip/fix-25119 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fix-25119 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 10:23:48 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Mon, 29 Jul 2024 06:23:48 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] Apply 12 suggestion(s) to 2 file(s) Message-ID: <66a76db4588ab_852ee16402c4243@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: d6590865 by Fabricio Nascimento at 2024-07-29T10:23:44+00:00 Apply 12 suggestion(s) to 2 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 2 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -691,7 +691,7 @@ parent than it was declared, for example PatternSynonyms (see [Typing Pattern Synonym Exports]). Another difference is in the presence of ambiguous names. Because we are strict -on the parent, we won't report a name clash in the example bellow (see #24452), +on the parent, we won't report a name clash in the example below (see #24452), as it would lead to a confusing error. module Ambiguous where @@ -734,7 +734,6 @@ lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = return $ Left (UnknownSubordinate doc) AmbiguousOccurrence _ -> return $ Left (UnknownSubordinate doc) -{-# INLINEABLE lookupInstanceDeclarationSubBndr #-} -- For details, see Note [Renaming children on export lists] lookupChildExportListSubBndr :: DeprecationWarnings @@ -760,7 +759,6 @@ lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do success_found_child warn_if_deprec g = do addUsedGRE warn_if_deprec g return $ FoundChild g -{-# INLINEABLE lookupChildExportListSubBndr #-} {- Note [Picking and disambiguating children candidates] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -781,7 +779,7 @@ parent matches can cause #25014. import Ambig2 (T(MkT)) Even when we don't find matching parents, we need to consider matching names -without a parent, for example for pattern synonyms bellow. +without a parent, for example for pattern synonyms below. module M (Maybe (Empty)) where class Empty a where @@ -813,16 +811,17 @@ pick_matching_gres parent rdr_name lookup_method = do traceTc "pick_matching_gres original_gres:" (ppr original_gres) return (picked_gres, original_gres) where + See Note [Renaming child GREs] for what's happening here pick_gres :: [GlobalRdrElt] -> DisambigInfo pick_gres gres - | length matching_parent_gres == 1 = - MatchingParentOccurrence (head matching_parent_gres) + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre | length no_parent_gres == 1 = NoParentOccurrence (head no_parent_gres) | null no_parent_gres && null matching_parent_gres = NoOccurrence - | not $ null matching_parent_gres = - AmbiguousOccurrence (NE.fromList matching_parent_gres) + | gre:gres <- matching_parent_gres = + AmbiguousOccurrence (gre NE.:| gres) | otherwise = -- no_parent_gres won't be empty due to the conditions above AmbiguousOccurrence (NE.fromList no_parent_gres) @@ -853,7 +852,7 @@ When GHC does not find a matching name on GREs after disambiguation `Not in scope: ...` (NoOccurence). In some cases we can offer a better error by looking at the original GRE matches before disambiguation and attempt to surface problems that could have caused ghc to not being able to find the -correct identifier. +correct identifier. This is what error_no_occurrence_after_disambiguation does. 1. For example where the name exists for a different parent. @@ -907,10 +906,10 @@ error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gr {- Note [Disambiguating GREs by parent] - +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Names can occur on GRE with or without Parent. When renaming an identifier for example the `foo` on export `A (foo)` on the export list of the program -bellow, we have the following types of matches: +below, we have the following types of matches: {-# LANGUAGE DuplicateRecordFields #-} module Matches (A (foo, Pat, bar)) where ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -691,7 +691,7 @@ in a children export list under a parent. pattern Px{x} <- Point x _ -To makes matter more complicate. +To makes matter more complicated: 1. Some type constructors are parsed as variables (-.->) for example. 2. All data constructors are parsed as type constructors 3. When there is ambiguity, we default type constructors to data @@ -700,10 +700,12 @@ constructors. 4. Pattern synonyms are very flexible in which parents they can be exported with (see [Typing Pattern Synonym Exports]). -The strategy for renaming, is to first establish all the possible namespaces -that an identifier might be in, then for each namespace in turn, -tries to find the correct identifier there returning the -first positive result or the first terminating error. +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. For more details see [Renaming the LHS on type class Instances], View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d6590865e8ef662c029393a9b2ab5412576877d9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d6590865e8ef662c029393a9b2ab5412576877d9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 10:46:13 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Mon, 29 Jul 2024 06:46:13 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a772f53aba7_852ee33f2e81043f@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: fb6e1275 by Fabricio de Sousa Nascimento at 2024-07-29T19:45:49+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 17 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,284 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming the LHS on type class Instances] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming the LHS of type class Instances is similar to [Renaming children on +export lists] as they both rely on the [Configurable GRE lookup priority]. + +One main difference is that we require parents to match on LHS names in type +classes, while on export lists, we may sometimes export a name with a different +parent than it was declared, for example PatternSynonyms (see [Typing Pattern +Synonym Exports]). + +Another difference is in the presence of ambiguous names. Because we are strict +on the parent, we won't report a name clash in the example below (see #24452), +as it would lead to a confusing error. + + module Ambiguous where + + import Control.Applicative (Alternative) + import qualified Data.Map as Map (empty) + import qualified Data.Set as Set (empty) + + instance Alternative Foo where + empty = undefined + +Note that the solution to this error would be to import the correct `empty` from +Applicative. + import Control.Applicative (Alternative, empty) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see Note [Renaming children on export lists] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +{- Note [Picking and disambiguating children candidates] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The goal of `pick_matching_gres` is to pick one occurrence to rename, and fail +at any ambiguity. Note that failing to reject a program with multiple +parent matches can cause #25014. + + module Ambig1 where + data family T a + data instance T Bool = MkT + + module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT + + module Program (T(MkT)) where -- Ambig1 or Ambig2? + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + +Even when we don't find matching parents, we need to consider matching names +without a parent, for example for pattern synonyms below. + + module M (Maybe (Empty)) where + class Empty a where + isEmpty :: a -> Bool + + instance Empty (Maybe a) where + isEmpty Nothing = True + + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) +-} +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for what's happening here + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre + | length no_parent_gres == 1 = + NoParentOccurrence (head no_parent_gres) + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | gre:gres <- matching_parent_gres = + AmbiguousOccurrence (gre NE.:| gres) + | otherwise = + -- no_parent_gres won't be empty due to the conditions above + AmbiguousOccurrence (NE.fromList no_parent_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused ghc to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +969,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +976,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2286,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,6 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb6e1275fa14c9e97fde121fbe32e0c028d61b07 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb6e1275fa14c9e97fde121fbe32e0c028d61b07 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 11:03:45 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 07:03:45 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 7 commits: Refactor ProfilingInfo to preserve Unique information before rendering it Message-ID: <66a777119ed71_852ee4cf89c11316@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 8aba0515 by Rodrigo Mesquita at 2024-07-26T14:26:05+01:00 Refactor ProfilingInfo to preserve Unique information before rendering it - - - - - 2dd3da96 by Rodrigo Mesquita at 2024-07-26T14:26:05+01:00 Rename Profiling Info now that names are preserved - - - - - 79275e2d by Rodrigo Mesquita at 2024-07-26T14:26:05+01:00 Update standalone check scripts - - - - - 8140fd3b by Rodrigo Mesquita at 2024-07-26T14:26:19+01:00 Revert "Rename Profiling Info now that names are preserved" This reverts commit 2dd3da96b7e771ae272791a00d7fb55313401c9e. - - - - - 879ccfcb by Rodrigo Mesquita at 2024-07-26T14:26:28+01:00 Revert "Refactor ProfilingInfo to preserve Unique information before rendering it" This reverts commit 8aba0515bb744ca5add6a4c3c9c7760e226e0b31. - - - - - eecf110c by Rodrigo Mesquita at 2024-07-26T14:36:34+01:00 Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled - - - - - e6081ac2 by Rodrigo Mesquita at 2024-07-26T15:14:02+01:00 Update abi test with decrementing uniques - - - - - 4 changed files: - .gitlab/ci.sh - compiler/GHC/Types/Name.hs - testsuite/tests/determinism/object/check-standalone.sh - testsuite/tests/determinism/object/check.sh Changes: ===================================== .gitlab/ci.sh ===================================== @@ -701,6 +701,12 @@ function cabal_abi_test() { if [ -z "$OUT" ]; then fail "OUT not set" fi + if [ -z "$REVERSE_UNIQUES" ]; then + EXTRA_OPTS="" + else + # Count uniques in reverse one of the runs to get more non-determinism exposed + EXTRA_OPTS="-dinitial-unique=16777215 -dunique-increment=-1" + fi cp -r libraries/Cabal $DIR pushd $DIR @@ -711,6 +717,8 @@ function cabal_abi_test() { run "$HC" \ -hidir tmp -odir tmp -fforce-recomp -haddock \ -iCabal/Cabal/src -XNoPolyKinds Distribution.Simple -j"$cores" \ + -fobject-determinism \ + $EXTRA_OPTS \ "$@" 2>&1 | tee $OUT/log summarise_hi_files summarise_o_files @@ -784,6 +792,8 @@ function check_objects(){ fail "Mismatched object: $dump" fi done + + fail "Some objects are mismatched, but theres no diff with --all-headers or --disassemble-all. Perhaps try objdump -s" fi } @@ -798,7 +808,7 @@ function run_abi_test() { fi mkdir -p out OUT="$PWD/out/run1" DIR=$(mktemp -d XXXX-looooooooong) cabal_abi_test -O0 - OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) cabal_abi_test -O0 + OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) REVERSE_UNIQUES="yes" cabal_abi_test -O0 check_interfaces out/run1 out/run2 abis "Mismatched ABI hash" check_interfaces out/run1 out/run2 interfaces "Mismatched interface hashes" check_objects out/run1 out/run2 ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -716,7 +716,7 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) {-# SPECIALISE pprName :: Name -> SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable --- | Print fully qualified name (with unit-id, module and unique) +-- | Print fully qualified name (with unit-id, module but no unique) pprFullName :: Module -> Name -> SDoc pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = let mod = case sort of @@ -727,8 +727,6 @@ pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = in ftext (unitIdFS (moduleUnitId mod)) <> colon <> ftext (moduleNameFS $ moduleName mod) <> dot <> ftext (occNameFS occ) - <> char '_' <> pprUniqueAlways uniq - -- | Print a ticky ticky styled name -- ===================================== testsuite/tests/determinism/object/check-standalone.sh ===================================== @@ -8,8 +8,8 @@ fi rm -rf objs1 objs2 cabal get Cabal-3.12.0.0 -cabal build -w $1 --ghc-options="-fforce-recomp -j4 -ddump-to-file -fobject-determinism" --ghc-options=-odir=out1 Cabal +cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -fobject-determinism -dumpdir=dumpout1 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out1 --ghc-options=-hidir=hiout1 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out1 Cabal -cabal build -w $1 --ghc-options="-fforce-recomp -j4 -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism" --ghc-options=-odir=out2 Cabal +cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism -dumpdir=dumpout2 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out2 --ghc-options=-hidir=hiout2 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out2 Cabal -./check.sh linux +./check.sh "$1" ===================================== testsuite/tests/determinism/object/check.sh ===================================== @@ -4,12 +4,15 @@ if test -z "$1" then - echo "Usage: ./check.sh # example ./check.sh darwin" + echo "Usage: ./check.sh " exit 1 fi +UNAME=$(uname) +COMPILER="$1" + # On darwin we need to pass -m to objdump on Mach-O files -if test $1 == "darwin" +if test $UNAME == "Darwin" then OBJDUMP="objdump -m" else @@ -67,7 +70,7 @@ else OBJS=$(find . -type f) popd >/dev/null - compareHis "/home/matt/ghc-rodrigo/_build/stage1/bin/ghc" "$OBJS" + compareHis "$COMPILER" "$OBJS" exit 1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1eaee52f5ef7229abcf136e5fd33189cadc82f6...e6081ac247b42abfc13497b06791bf5d8646de72 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1eaee52f5ef7229abcf136e5fd33189cadc82f6...e6081ac247b42abfc13497b06791bf5d8646de72 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 11:49:07 2024 From: gitlab at gitlab.haskell.org (Andreas Klebinger (@AndreasK)) Date: Mon, 29 Jul 2024 07:49:07 -0400 Subject: [Git][ghc/ghc][wip/andreask/keep_rules_docs] 8 commits: Fix -freg-graphs for FP and AARch64 NCG (#24941). Message-ID: <66a781b3ca471_38eca3156724545cb@gitlab.mail> Andreas Klebinger pushed to branch wip/andreask/keep_rules_docs at Glasgow Haskell Compiler / GHC Commits: 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 09d195d0 by Andreas Klebinger at 2024-07-29T13:31:30+02:00 Add since annotation for -fkeep-auto-rules. This partially addresses #25082. - - - - - c79bd6d6 by Andreas Klebinger at 2024-07-29T13:32:20+02:00 Mention `-fkeep-auto-rules` in release notes. It was added earlier but hadn't appeared in any release notes yet. Partially addresses #25082. - - - - - 30 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - docs/users_guide/9.12.1-notes.rst - docs/users_guide/phases.rst - docs/users_guide/using-optimisation.rst - hadrian/doc/flavours.md - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - + testsuite/tests/simplCore/should_run/T25096.hs - + testsuite/tests/simplCore/should_run/T25096.stdout - testsuite/tests/simplCore/should_run/all.T Changes: ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -177,6 +177,8 @@ regUsageOfInstr platform instr = case instr of interesting _ (RegVirtual _) = True interesting platform (RegReal (RealRegSingle i)) = freeReg platform i +-- Note [AArch64 Register assignments] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Save caller save registers -- This is x0-x18 -- @@ -199,6 +201,8 @@ regUsageOfInstr platform instr = case instr of -- '---------------------------------------------------------------------------------------------------------------------------------------------------------------' -- IR: Indirect result location register, IP: Intra-procedure register, PL: Platform register, FP: Frame pointer, LR: Link register, SP: Stack pointer -- BR: Base, SL: SpLim +-- +-- TODO: The zero register is currently mapped to -1 but should get it's own separate number. callerSavedRegisters :: [Reg] callerSavedRegisters = map regSingle [0..18] ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -316,6 +316,7 @@ pprReg w r = case r of | w == W64 = text "sp" | w == W32 = text "wsp" + -- See Note [AArch64 Register assignments] ppr_reg_no w i | i < 0, w == W32 = text "wzr" | i < 0, w == W64 = text "xzr" ===================================== compiler/GHC/CmmToAsm/AArch64/Regs.hs ===================================== @@ -17,6 +17,7 @@ import GHC.Utils.Outputable import GHC.Utils.Panic import GHC.Platform +-- TODO: Should this include the zero register? allMachRegNos :: [RegNo] allMachRegNos = [0..31] ++ [32..63] -- allocatableRegs is allMachRegNos with the fixed-use regs removed. ===================================== compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs ===================================== @@ -183,7 +183,8 @@ trivColorable platform virtualRegSqueeze realRegSqueeze RcDouble conflicts exclu ArchPPC -> 26 ArchPPC_64 _ -> 20 ArchARM _ _ _ -> panic "trivColorable ArchARM" - ArchAArch64 -> 28 -- 32 - D1..D4 + ArchAArch64 -> 24 -- 32 - F1 .. F4, D1..D4 - it's odd but see Note [AArch64 Register assignments] for our reg use. + -- Seems we reserve different registers for D1..D4 and F1 .. F4 somehow, we should fix this. ArchAlpha -> panic "trivColorable ArchAlpha" ArchMipseb -> panic "trivColorable ArchMipseb" ArchMipsel -> panic "trivColorable ArchMipsel" ===================================== compiler/GHC/Core/Opt/DmdAnal.hs ===================================== @@ -1039,10 +1039,10 @@ dmdTransform env var sd TopLevel | isInterestingTopLevelFn var -- Top-level things will be used multiple times or not at - -- all anyway, hence the multDmd below: It means we don't + -- all anyway, hence the `floatifyDmd`: it means we don't -- have to track whether @var@ is used strictly or at most - -- once, because ultimately it never will. - -> addVarDmd fn_ty var (C_0N `multDmd` (C_11 :* sd)) -- discard strictness + -- once, because ultimately it never will + -> addVarDmd fn_ty var (floatifyDmd (C_11 :* sd)) | otherwise -> fn_ty -- don't bother tracking; just annotate with 'topDmd' later -- Everything else: ===================================== compiler/GHC/Core/Opt/OccurAnal.hs ===================================== @@ -1035,8 +1035,6 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs | otherwise = (adj_rhs_uds : adj_unf_uds : adj_rule_uds, final_bndr_with_rules, final_rhs ) where - is_join_point = isJoinPoint mb_join - --------- Right hand side --------- -- For join points, set occ_encl to OccVanilla, via setTailCtxt. If we have -- join j = Just (f x) in ... @@ -1044,12 +1042,9 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs -- let y = f x in join j = Just y in ... -- That's that OccRhs would do; but there's no point because -- j will never be scrutinised. - env1 | is_join_point = setTailCtxt env - | otherwise = setNonTailCtxt rhs_ctxt env -- Zap occ_join_points + rhs_env = mkRhsOccEnv env NonRecursive rhs_ctxt mb_join bndr rhs rhs_ctxt = mkNonRecRhsCtxt lvl bndr unf - -- See Note [Sources of one-shot information] - rhs_env = addOneShotsFromDmd bndr env1 -- See Note [Join arity prediction based on joinRhsArity] -- Match join arity O from mb_join_arity with manifest join arity M as -- returned by of occAnalLamTail. It's totally OK for them to mismatch; @@ -1059,16 +1054,15 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs final_bndr_with_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] | otherwise = bndr `setIdSpecialisation` mkRuleInfo rules' - `setIdUnfolding` unf2 + `setIdUnfolding` unf1 final_bndr_no_rules | noBinderSwaps env = bndr -- See Note [Unfoldings and rules] - | otherwise = bndr `setIdUnfolding` unf2 + | otherwise = bndr `setIdUnfolding` unf1 --------- Unfolding --------- -- See Note [Join points and unfoldings/rules] unf = idUnfolding bndr WTUD unf_tuds unf1 = occAnalUnfolding rhs_env unf - unf2 = markNonRecUnfoldingOneShots mb_join unf1 adj_unf_uds = adjustTailArity mb_join unf_tuds --------- Rules --------- @@ -1143,10 +1137,8 @@ occAnalRec !_ lvl | isDeadOcc occ -- Check for dead code: see Note [Dead code] = WUD body_uds binds | otherwise - = let (tagged_bndr, mb_join) = tagNonRecBinder lvl occ bndr + = let (bndr', mb_join) = tagNonRecBinder lvl occ bndr !(WUD rhs_uds' rhs') = adjustNonRecRhs mb_join wtuds - !unf' = markNonRecUnfoldingOneShots mb_join (idUnfolding tagged_bndr) - !bndr' = tagged_bndr `setIdUnfolding` unf' in WUD (body_uds `andUDs` rhs_uds') (NonRec bndr' rhs' : binds) where @@ -1751,10 +1743,9 @@ makeNode !env imp_rule_edges bndr_set (bndr, rhs) -- Instead, do the occAnalLamTail call here and postpone adjustTailUsage -- until occAnalRec. In effect, we pretend that the RHS becomes a -- non-recursive join point and fix up later with adjustTailUsage. - rhs_env | isJoinId bndr = setTailCtxt env - | otherwise = setNonTailCtxt OccRhs env - -- If bndr isn't an /existing/ join point, it's safe to zap the - -- occ_join_points, because they can't occur in RHS. + rhs_env = mkRhsOccEnv env Recursive OccRhs (idJoinPointHood bndr) bndr rhs + -- If bndr isn't an /existing/ join point (so idJoinPointHood = NotJoinPoint), + -- it's safe to zap the occ_join_points, because they can't occur in RHS. WTUD (TUD rhs_ja unadj_rhs_uds) rhs' = occAnalLamTail rhs_env rhs -- The corresponding call to adjustTailUsage is in occAnalRec and tagRecBinders @@ -2168,7 +2159,7 @@ occAnalLamTail env expr in WTUD (TUD (joinRhsArity expr) usage) expr' occ_anal_lam_tail :: OccEnv -> CoreExpr -> WithUsageDetails CoreExpr --- Does not markInsidLam etc for the outmost batch of lambdas +-- Does not markInsideLam etc for the outmost batch of lambdas occ_anal_lam_tail env expr@(Lam {}) = go env [] expr where @@ -2309,20 +2300,8 @@ occAnalRule env rule@(Rule { ru_bndrs = bndrs, ru_args = args, ru_rhs = rhs }) occAnalRule _ other_rule = (other_rule, emptyDetails, TUD 0 emptyDetails) -{- Note [Join point RHSs] -~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider - x = e - join j = Just x - -We want to inline x into j right away, so we don't want to give -the join point a RhsCtxt (#14137). It's not a huge deal, because -the FloatIn pass knows to float into join point RHSs; and the simplifier -does not float things out of join point RHSs. But it's a simple, cheap -thing to do. See #14137. - -Note [Occurrences in stable unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Occurrences in stable unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider f p = BIG {-# INLINE g #-} @@ -2358,16 +2337,32 @@ So we have a fast-path that keeps the old tree if the occ_bs_env is empty. This just saves a bit of allocation and reconstruction; not a big deal. -This fast path exposes a tricky cornder, though (#22761). Supose we have +Two tricky corners: + +* Dead bindings (#22761). Supose we have Unfolding = \x. let y = foo in x+1 -which includes a dead binding for `y`. In occAnalUnfolding we occ-anal -the unfolding and produce /no/ occurrences of `foo` (since `y` is -dead). But if we discard the occ-analysed syntax tree (which we do on -our fast path), and use the old one, we still /have/ an occurrence of -`foo` -- and that can lead to out-of-scope variables (#22761). + which includes a dead binding for `y`. In occAnalUnfolding we occ-anal + the unfolding and produce /no/ occurrences of `foo` (since `y` is + dead). But if we discard the occ-analysed syntax tree (which we do on + our fast path), and use the old one, we still /have/ an occurrence of + `foo` -- and that can lead to out-of-scope variables (#22761). + + Solution: always keep occ-analysed trees in unfoldings and rules, so they + have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + +* One-shot binders. Consider + {- f has Stable unfolding \p q -> blah + Demand on f is LC(L,C(1,!P(L)); that is, one-shot in its second ar -} + f = \x y. blah + + Now we `mkRhsOccEnv` will build an OccEnv for f's RHS that has + occ_one_shots = [NoOneShortInfo, OneShotLam] + This will put OneShotLam on the \y. And it'll put it on the \q. But the + noBinderSwap check will mean that we discard this new occ-anal'd unfolding + and keep the old one, with no OneShotInfo. -Solution: always keep occ-analysed trees in unfoldings and rules, so they -have no dead code. See Note [OccInfo in unfoldings and rules] in GHC.Core. + This looks a little inconsistent, but the Stable unfolding is just used for + inlinings; OneShotInfo isn't a lot of use here. Note [Cascading inlines] ~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2598,7 +2593,7 @@ occAnalArgs !env fun args !one_shots | otherwise = case one_shots of [] -> (env_args, []) -- Fast path; one_shots is often empty - (os : one_shots') -> (addOneShots os env_args, one_shots') + (os : one_shots') -> (setOneShots os env_args, one_shots') {- Applications are dealt with specially because we want @@ -2910,42 +2905,125 @@ setScrutCtxt !env alts -- non-default alternative. That in turn influences -- pre/postInlineUnconditionally. Grep for "occ_int_cxt"! +{- Note [The OccEnv for a right hand side] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +How do we create the OccEnv for a RHS (in mkRhsOccEnv)? + +For a non-join point binding, x = rhs + + * occ_encl: set to OccRhs; but see `mkNonRecRhsCtxt` for wrinkles + + * occ_join_points: zap them! + + * occ_one_shots: initialise from the idDemandInfo; + see Note [Sources of one-shot information] + +For a join point binding, j x = rhs + + * occ_encl: Consider + x = e + join j = Just x + We want to inline x into j right away, so we don't want to give the join point + a OccRhs (#14137); we want OccVanilla. It's not a huge deal, because the + FloatIn pass knows to float into join point RHSs; and the simplifier does not + float things out of join point RHSs. But it's a simple, cheap thing to do. + + * occ_join_points: no need to zap. + + * occ_one_shots: we start with one-shot-info from the context, which indeed + applies to the /body/ of the join point, after walking past the binders. + So we add to the front a OneShotInfo for each value-binder of the join + point: see `extendOneShotsForJoinPoint`. (Failing to account for the join-point + binders caused #25096.) + + For the join point binders themselves, of a /non-recursive/ join point, + we make the binder a OneShotLam. Again see `extendOneShotsForJoinPoint`. + + These one-shot infos then get attached to the binder by `occAnalLamTail`. +-} + setNonTailCtxt :: OccEncl -> OccEnv -> OccEnv setNonTailCtxt ctxt !env = env { occ_encl = ctxt , occ_one_shots = [] - , occ_join_points = zapped_jp_env } - where - -- zapped_jp_env is basically just emptyVarEnv (hence zapped). See (W3) of - -- Note [Occurrence analysis for join points] Zapping improves efficiency, - -- slightly, if you accidentally introduce a bug, in which you zap [jx :-> uds] and - -- then find an occurrence of jx anyway, you might lose those uds, and - -- that might mean we don't record all occurrencs, and that means we - -- duplicate a redex.... a very nasty bug (which I encountered!). Hence - -- this DEBUG code which doesn't remove jx from the envt; it just gives it - -- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch - -- this bug before it does any damage. -#ifdef DEBUG - zapped_jp_env = mapVarEnv (\ _ -> emptyVarEnv) (occ_join_points env) -#else - zapped_jp_env = emptyVarEnv -#endif + , occ_join_points = zapJoinPointInfo (occ_join_points env) } setTailCtxt :: OccEnv -> OccEnv -setTailCtxt !env - = env { occ_encl = OccVanilla } +setTailCtxt !env = env { occ_encl = OccVanilla } -- Preserve occ_one_shots, occ_join points -- Do not use OccRhs for the RHS of a join point (which is a tail ctxt): - -- see Note [Join point RHSs] -addOneShots :: OneShots -> OccEnv -> OccEnv -addOneShots os !env +mkRhsOccEnv :: OccEnv -> RecFlag -> OccEncl -> JoinPointHood -> Id -> CoreExpr -> OccEnv +-- See Note [The OccEnv for a right hand side] +-- For a join point: +-- - Keep occ_one_shots, occ_joinPoints from the context +-- - But push enough OneShotInfo onto occ_one_shots to account +-- for the join-point value binders +-- - Set occ_encl to OccVanilla +-- For non-join points +-- - Zap occ_one_shots and occ_join_points +-- - Set occ_encl to specified OccEncl +mkRhsOccEnv env@(OccEnv { occ_one_shots = ctxt_one_shots, occ_join_points = ctxt_join_points }) + is_rec encl jp_hood bndr rhs + | JoinPoint join_arity <- jp_hood + = env { occ_encl = OccVanilla + , occ_one_shots = extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + , occ_join_points = ctxt_join_points } + + | otherwise + = env { occ_encl = encl + , occ_one_shots = argOneShots (idDemandInfo bndr) + -- argOneShots: see Note [Sources of one-shot information] + , occ_join_points = zapJoinPointInfo ctxt_join_points } + +zapJoinPointInfo :: JoinPointInfo -> JoinPointInfo +-- (zapJoinPointInfo jp_info) basically just returns emptyVarEnv (hence zapped). +-- See (W3) of Note [Occurrence analysis for join points] +-- +-- Zapping improves efficiency, slightly, if you accidentally introduce a bug, +-- in which you zap [jx :-> uds] and then find an occurrence of jx anyway, you +-- might lose those uds, and that might mean we don't record all occurrencs, and +-- that means we duplicate a redex.... a very nasty bug (which I encountered!). +-- Hence this DEBUG code which doesn't remove jx from the envt; it just gives it +-- emptyDetails, which in turn causes a panic in mkOneOcc. That will catch this +-- bug before it does any damage. +#ifdef DEBUG +zapJoinPointInfo jp_info = mapVarEnv (\ _ -> emptyVarEnv) jp_info +#else +zapJoinPointInfo _ = emptyVarEnv +#endif + +extendOneShotsForJoinPoint + :: RecFlag -> JoinArity -> CoreExpr + -> [OneShotInfo] -> [OneShotInfo] +-- Push enough OneShortInfos on the front of ctxt_one_shots +-- to account for the value lambdas of the join point +extendOneShotsForJoinPoint is_rec join_arity rhs ctxt_one_shots + = go join_arity rhs + where + -- For a /non-recursive/ join point we can mark all + -- its join-lambda as one-shot; and it's a good idea to do so + -- But not so for recursive ones + os = case is_rec of + NonRecursive -> OneShotLam + Recursive -> NoOneShotInfo + + go 0 _ = ctxt_one_shots + go n (Lam b rhs) + | isId b = os : go (n-1) rhs + | otherwise = go (n-1) rhs + go _ _ = [] -- Not enough lambdas. This can legitimately happen. + -- e.g. let j = case ... in j True + -- This will become an arity-1 join point after the + -- simplifier has eta-expanded it; but it may not have + -- enough lambdas /yet/. (Lint checks that JoinIds do + -- have enough lambdas.) + +setOneShots :: OneShots -> OccEnv -> OccEnv +setOneShots os !env | null os = env -- Fast path for common case | otherwise = env { occ_one_shots = os } -addOneShotsFromDmd :: Id -> OccEnv -> OccEnv -addOneShotsFromDmd bndr = addOneShots (argOneShots (idDemandInfo bndr)) - isRhsEnv :: OccEnv -> Bool isRhsEnv (OccEnv { occ_encl = cxt }) = case cxt of OccRhs -> True @@ -3732,17 +3810,10 @@ adjustNonRecRhs :: JoinPointHood -> WithUsageDetails CoreExpr -- ^ This function concentrates shared logic between occAnalNonRecBind and the -- AcyclicSCC case of occAnalRec. --- * It applies 'markNonRecJoinOneShots' to the RHS --- * and returns the adjusted rhs UsageDetails combined with the body usage +-- It returns the adjusted rhs UsageDetails combined with the body usage adjustNonRecRhs mb_join_arity rhs_wuds@(WTUD _ rhs) - = WUD rhs_uds' rhs' - where - --------- Marking (non-rec) join binders one-shot --------- - !rhs' | JoinPoint ja <- mb_join_arity = markNonRecJoinOneShots ja rhs - | otherwise = rhs + = WUD (adjustTailUsage mb_join_arity rhs_wuds) rhs - --------- Adjusting right-hand side usage --------- - rhs_uds' = adjustTailUsage mb_join_arity rhs_wuds adjustTailUsage :: JoinPointHood -> WithTailUsageDetails CoreExpr -- Rhs usage, AFTER occAnalLamTail @@ -3760,33 +3831,6 @@ adjustTailArity :: JoinPointHood -> TailUsageDetails -> UsageDetails adjustTailArity mb_rhs_ja (TUD ja usage) = markAllNonTailIf (mb_rhs_ja /= JoinPoint ja) usage -markNonRecJoinOneShots :: JoinArity -> CoreExpr -> CoreExpr --- For a /non-recursive/ join point we can mark all --- its join-lambda as one-shot; and it's a good idea to do so -markNonRecJoinOneShots join_arity rhs - = go join_arity rhs - where - go 0 rhs = rhs - go n (Lam b rhs) = Lam (if isId b then setOneShotLambda b else b) - (go (n-1) rhs) - go _ rhs = rhs -- Not enough lambdas. This can legitimately happen. - -- e.g. let j = case ... in j True - -- This will become an arity-1 join point after the - -- simplifier has eta-expanded it; but it may not have - -- enough lambdas /yet/. (Lint checks that JoinIds do - -- have enough lambdas.) - -markNonRecUnfoldingOneShots :: JoinPointHood -> Unfolding -> Unfolding --- ^ Apply 'markNonRecJoinOneShots' to a stable unfolding -markNonRecUnfoldingOneShots mb_join_arity unf - | JoinPoint ja <- mb_join_arity - , CoreUnfolding{uf_src=src,uf_tmpl=tmpl} <- unf - , isStableSource src - , let !tmpl' = markNonRecJoinOneShots ja tmpl - = unf{uf_tmpl=tmpl'} - | otherwise - = unf - type IdWithOccInfo = Id tagLamBinders :: UsageDetails -- Of scope ===================================== compiler/GHC/Core/Opt/SetLevels.hs ===================================== @@ -1874,7 +1874,6 @@ cloneLetVars is_rec env@(LE { le_subst = subst, le_lvl_env = lvl_env, le_env = id_env }) dest_lvl vs = do { let vs1 = map zap vs - -- See Note [Zapping the demand info] ; (subst', vs2) <- case is_rec of NonRecursive -> cloneBndrs subst vs1 Recursive -> cloneRecIdBndrs subst vs1 @@ -1887,9 +1886,12 @@ cloneLetVars is_rec ; return (env', vs2) } where zap :: Var -> Var - zap v | isId v = zap_join (zapIdDemandInfo v) + -- See Note [Floatifying demand info when floating] + -- and Note [Zapping JoinId when floating] + zap v | isId v = zap_join (floatifyIdDemandInfo v) | otherwise = v + -- See Note [Zapping JoinId when floating] zap_join | isTopLvl dest_lvl = zapJoinId | otherwise = id @@ -1898,16 +1900,38 @@ add_id id_env (v, v1) | isTyVar v = delVarEnv id_env v | otherwise = extendVarEnv id_env v ([v1], assert (not (isCoVar v1)) $ Var v1) -{- -Note [Zapping the demand info] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -VERY IMPORTANT: we must zap the demand info if the thing is going to -float out, because it may be less demanded than at its original -binding site. Eg - f :: Int -> Int - f x = let v = 3*4 in v+x -Here v is strict; but if we float v to top level, it isn't any more. - -Similarly, if we're floating a join point, it won't be one anymore, so we zap -join point information as well. +{- Note [Zapping JoinId when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +If we are floating a join point, it won't be one anymore, so we zap +the join point information. + +Note [Floatifying demand info when floating] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When floating we must lazify the outer demand info on the Id +because it may be less demanded than at its original binding site. +For example: + f :: Int -> Int + f x = let v = 3*4 in v+x +Here v is strict and used at most once; but if we float v to top level, +that isn't true any more. Specifically, we lose track of v's cardinality info: + * if `f` is called multiple times, then `v` is used more than once + * if `f` is never called, then `v` is never evaluated. + +But NOTE that we only need to adjust the /top-level/ cardinality info. +For example + let x = (e1,e2) + in ...(case x of (a,b) -> a+b)... +If we float x outwards, it may no longer be strict, but IF it is ever +evaluated THEN its components will be evaluated. So we to lazify and +many-ify its demand-info, not discard it entirely. + +Same if we have + let f = \x y . blah + in ...(f a b)...(f c d)... +Here `f` will get a demand like SC(S,C(1,L)). If we float it out, we can +keep that `1C` called-once inner demand. It's only the outer strictness +that we kill. + +Conclusion: to floatify a demand, just do `multDmd C_0N` to reflect the +fact that `v` may be used any number of times, from zero upwards. -} ===================================== compiler/GHC/Core/Opt/Simplify/Iteration.hs ===================================== @@ -971,7 +971,7 @@ addLetBndrInfo new_bndr new_arity_type new_unf -- Demand info: Note [Setting the demand info] info3 | isEvaldUnfolding new_unf - = zapDemandInfo info2 `orElse` info2 + = lazifyDemandInfo info2 `orElse` info2 | otherwise = info2 ===================================== compiler/GHC/Core/Opt/Specialise.hs ===================================== @@ -1485,11 +1485,12 @@ specBind top_lvl env (NonRec fn rhs) do_body -- This is important: see Note [Update unfolding after specialisation] -- And in any case cloneBndrSM discards non-Stable unfoldings - fn3 = zapIdDemandInfo fn2 + fn3 = floatifyIdDemandInfo fn2 -- We zap the demand info because the binding may float, -- which would invalidate the demand info (see #17810 for example). -- Destroying demand info is not terrible; specialisation is -- always followed soon by demand analysis. + -- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels body_env2 = body_env1 `bringFloatedDictsIntoScope` ud_binds rhs_uds `extendInScope` fn3 ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -502,6 +502,32 @@ tcGuardStmt _ stmt _ _ -- coercion matching stuff in them. It's hard to avoid the -- potential for non-trivial coercions in tcMcStmt +{- +Note [Binding in list comprehension isn't linear] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In principle, [ y | () <- xs, y <- [0,1]] could be linear in `xs`. +But, the way the desugaring works, we get something like + +case xs of + () : xs ' -> letrec next_stmt = … xs' … + +In the current typing rules for letrec in Core, next_stmt is necessarily of +multiplicity Many and so is every free variable, including xs'. Which, in turns, +requires xs to be of multiplicity Many. + +Rodrigo Mesquita worked out, in his master thesis, how to make letrecs having +non-Many multiplicities. But it's a fair bit of work to implement. + +Since nobody actually cares about [ y | () <- xs, y <- [0,1]] being linear, then +we just conservatively make it unrestricted instead. + +If we're to change that, we have to be careful that [ y | _ <- xs, y <- [0,1]] +isn't linear in `xs` since the elements of `xs` are ignored. So we'd still have +to call `tcScalingUsage` on `xs` in `tcLcStmt`, we'd just have to create a fresh +multiplicity variable. We'd also use the same multiplicity variable in the call +to `tcCheckPat` instead of `unrestricted`. +-} + tcLcStmt :: TyCon -- The list type constructor ([]) -> TcExprStmtChecker @@ -513,20 +539,24 @@ tcLcStmt _ _ (LastStmt x body noret _) elt_ty thing_inside -- A generator, pat <- rhs tcLcStmt m_tc ctxt (BindStmt _ pat rhs) elt_ty thing_inside = do { pat_ty <- newFlexiTyVarTy liftedTypeKind - ; rhs' <- tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) + -- About the next `tcScalingUsage ManyTy` and unrestricted + -- see Note [Binding in list comprehension isn't linear] + ; rhs' <- tcScalingUsage ManyTy $ tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) ; (pat', thing) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ + tcScalingUsage ManyTy $ thing_inside elt_ty ; return (mkTcBindStmt pat' rhs', thing) } -- A boolean guard tcLcStmt _ _ (BodyStmt _ rhs _ _) elt_ty thing_inside = do { rhs' <- tcCheckMonoExpr rhs boolTy - ; thing <- thing_inside elt_ty + ; thing <- tcScalingUsage ManyTy $ thing_inside elt_ty ; return (BodyStmt boolTy rhs' noSyntaxExpr noSyntaxExpr, thing) } -- ParStmt: See notes with tcMcStmt and Note [Scoping in parallel list comprehensions] tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside - = do { env <- getLocalRdrEnv + = tcScalingUsage ManyTy $ -- parallel list comprehension never desugars to something linear. + do { env <- getLocalRdrEnv ; (pairs', thing) <- loop env [] bndr_stmts_s ; return (ParStmt unitTy pairs' noExpr noSyntaxExpr, thing) } where @@ -552,7 +582,8 @@ tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts , trS_bndrs = bindersMap , trS_by = by, trS_using = using }) elt_ty thing_inside - = do { let (bndr_names, n_bndr_names) = unzip bindersMap + = tcScalingUsage ManyTy $ -- Transform statements are too complex: just make everything multiplicity Many + do { let (bndr_names, n_bndr_names) = unzip bindersMap unused_ty = pprPanic "tcLcStmt: inner ty" (ppr bindersMap) -- The inner 'stmts' lack a LastStmt, so the element type -- passed in to tcStmtsAndThen is never looked at ===================================== compiler/GHC/Types/Demand.hs ===================================== @@ -38,7 +38,7 @@ module GHC.Types.Demand ( -- *** Demands used in PrimOp signatures lazyApply1Dmd, lazyApply2Dmd, strictOnceApply1Dmd, strictManyApply1Dmd, -- ** Other @Demand@ operations - oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, + oneifyCard, oneifyDmd, strictifyDmd, strictifyDictDmd, lazifyDmd, floatifyDmd, peelCallDmd, peelManyCalls, mkCalledOnceDmd, mkCalledOnceDmds, strictCallArity, mkWorkerDemand, subDemandIfEvaluated, -- ** Extracting one-shot information @@ -608,22 +608,22 @@ multCard (Card a) (Card b) -- -- Examples (using Note [Demand notation]): -- --- * 'seq' puts demand @1A@ on its first argument: It evaluates the argument --- strictly (@1@), but not any deeper (@A@). --- * 'fst' puts demand @1P(1L,A)@ on its argument: It evaluates the argument +-- * 'seq' puts demand `1A` on its first argument: It evaluates the argument +-- strictly (`1`), but not any deeper (`A`). +-- * 'fst' puts demand `1P(1L,A)` on its argument: It evaluates the argument -- pair strictly and the first component strictly, but no nested info --- beyond that (@L@). Its second argument is not used at all. --- * '$' puts demand @1C(1,L)@ on its first argument: It calls (@C@) the --- argument function with one argument, exactly once (@1@). No info --- on how the result of that call is evaluated (@L@). --- * 'maybe' puts demand @MC(M,L)@ on its second argument: It evaluates +-- beyond that (`L`). Its second argument is not used at all. +-- * '$' puts demand `1C(1,L)` on its first argument: It calls (`C`) the +-- argument function with one argument, exactly once (`1`). No info +-- on how the result of that call is evaluated (`L`). +-- * 'maybe' puts demand `MC(M,L)` on its second argument: It evaluates -- the argument function at most once ((M)aybe) and calls it once when -- it is evaluated. --- * @fst p + fst p@ puts demand @SP(SL,A)@ on @p@: It's @1P(1L,A)@ --- multiplied by two, so we get @S@ (used at least once, possibly multiple +-- * `fst p + fst p` puts demand `SP(SL,A)` on `p`: It's `1P(1L,A)` +-- multiplied by two, so we get `S` (used at least once, possibly multiple -- times). -- --- This data type is quite similar to @'Scaled' 'SubDemand'@, but it's scaled +-- This data type is quite similar to `'Scaled' 'SubDemand'`, but it's scaled -- by 'Card', which is an /interval/ on 'Multiplicity', the upper bound of -- which could be used to infer uniqueness types. Also we treat 'AbsDmd' and -- 'BotDmd' specially, as the concept of a 'SubDemand' doesn't apply when there @@ -1013,6 +1013,11 @@ strictifyDictDmd _ dmd = dmd lazifyDmd :: Demand -> Demand lazifyDmd = multDmd C_01 +-- | Adjust the demand on a binding that may float outwards +-- See Note [Floatifying demand info when floating] +floatifyDmd :: Demand -> Demand +floatifyDmd = multDmd C_0N + -- | Wraps the 'SubDemand' with a one-shot call demand: @d@ -> @C(1,d)@. mkCalledOnceDmd :: SubDemand -> SubDemand mkCalledOnceDmd sd = mkCall C_11 sd @@ -2651,7 +2656,12 @@ So, L can denote a 'Card', polymorphic 'SubDemand' or polymorphic 'Demand', but it's always clear from context which "overload" is meant. It's like return-type inference of e.g. 'read'. -Examples are in the haddock for 'Demand'. +Examples are in the haddock for 'Demand'. Here are some more: + SA Strict, but does not look at subcomponents (`seq`) + SP(L,L) Strict boxed pair, components lazy + S!P(L,L) Strict unboxed pair, components lazy + LP(SA,SA) Lazy pair, but if it is evaluated will evaluated its components + LC(1C(L)) Lazy, but if called will apply the result exactly once This is the syntax for demand signatures: ===================================== compiler/GHC/Types/Id.hs ===================================== @@ -54,7 +54,7 @@ module GHC.Types.Id ( setIdExported, setIdNotExported, globaliseId, localiseId, setIdInfo, lazySetIdInfo, modifyIdInfo, maybeModifyIdInfo, - zapLamIdInfo, zapIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, + zapLamIdInfo, floatifyIdDemandInfo, zapIdUsageInfo, zapIdUsageEnvInfo, zapIdUsedOnceInfo, zapIdTailCallInfo, zapFragileIdInfo, zapIdDmdSig, zapStableUnfolding, transferPolyIdInfo, scaleIdBy, scaleVarBy, @@ -969,12 +969,11 @@ setIdOneShotInfo id one_shot = modifyIdInfo (`setOneShotInfo` one_shot) id updOneShotInfo :: Id -> OneShotInfo -> Id -- Combine the info in the Id with new info updOneShotInfo id one_shot - | do_upd = setIdOneShotInfo id one_shot - | otherwise = id - where - do_upd = case (idOneShotInfo id, one_shot) of - (NoOneShotInfo, _) -> True - (OneShotLam, _) -> False + | OneShotLam <- one_shot + , NoOneShotInfo <- idOneShotInfo id + = setIdOneShotInfo id OneShotLam + | otherwise + = id -- The OneShotLambda functions simply fiddle with the IdInfo flag -- But watch out: this may change the type of something else @@ -991,8 +990,9 @@ zapLamIdInfo = zapInfo zapLamInfo zapFragileIdInfo :: Id -> Id zapFragileIdInfo = zapInfo zapFragileInfo -zapIdDemandInfo :: Id -> Id -zapIdDemandInfo = zapInfo zapDemandInfo +floatifyIdDemandInfo :: Id -> Id +-- See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels +floatifyIdDemandInfo = zapInfo floatifyDemandInfo zapIdUsageInfo :: Id -> Id zapIdUsageInfo = zapInfo zapUsageInfo ===================================== compiler/GHC/Types/Id/Info.hs ===================================== @@ -35,7 +35,8 @@ module GHC.Types.Id.Info ( -- ** Zapping various forms of Info zapLamInfo, zapFragileInfo, - zapDemandInfo, zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, + lazifyDemandInfo, floatifyDemandInfo, + zapUsageInfo, zapUsageEnvInfo, zapUsedOnceInfo, zapTailCallInfo, zapCallArityInfo, trimUnfolding, -- ** The ArityInfo type @@ -855,11 +856,21 @@ zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand}) is_safe_dmd dmd = not (isStrUsedDmd dmd) --- | Remove all demand info on the 'IdInfo' -zapDemandInfo :: IdInfo -> Maybe IdInfo -zapDemandInfo info = Just (info {demandInfo = topDmd}) - --- | Remove usage (but not strictness) info on the 'IdInfo' +-- | Lazify (remove the top-level demand, only) the demand in `IdInfo` +-- Keep nested demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +lazifyDemandInfo :: IdInfo -> Maybe IdInfo +lazifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = lazifyDmd dmd }) + +-- | Floatify the demand in `IdInfo` +-- But keep /nested/ demands; see Note [Floatifying demand info when floating] +-- in GHC.Core.Opt.SetLevels +floatifyDemandInfo :: IdInfo -> Maybe IdInfo +floatifyDemandInfo info@(IdInfo { demandInfo = dmd }) + = Just (info {demandInfo = floatifyDmd dmd }) + +-- | Remove usage (but not strictness) info on the `IdInfo` zapUsageInfo :: IdInfo -> Maybe IdInfo zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) ===================================== compiler/GHC/Utils/Outputable.hs ===================================== @@ -1261,7 +1261,7 @@ data BindingSite data JoinPointHood = JoinPoint {-# UNPACK #-} !Int -- The JoinArity (but an Int here because - | NotJoinPoint -- synonym JoinArity is defined in Types.Basic + | NotJoinPoint -- synonym JoinArity is defined in Types.Basic) deriving( Eq ) isJoinPoint :: JoinPointHood -> Bool ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -78,12 +78,18 @@ Compiler `_). This does not affect existing support of apple systems on x86_64/aarch64. -- The flag :ghc-flag:`-fignore-asserts` will now also enable the +- The flag :ghc-flag:`-fignore-asserts` will now also enable the :extension:`CPP` macro ``__GLASGOW_HASKELL_ASSERTS_IGNORED__`` (`#24967 `_). This enables people to write their own custom assertion functions. See :ref:`assertions`. - + +- The flag :ghc-flag:`-fkeep-auto-rules` that forces GHC to keep auto generated + specialization rules was added. It was actually added ghc-9.10.1 already but + mistakenly not mentioned in the 9.10.1 changelog. + +- Fixed a bug that caused GHC to panic when using the aarch64 ncg and -fregs-graph + on certain programs. (#24941) GHCi ~~~~ ===================================== docs/users_guide/phases.rst ===================================== @@ -515,14 +515,6 @@ defined by your local GHC installation, the following trick is useful: Only defined when :ghc-flag:`-fignore-asserts` is specified. This can be used to create your own assertions, see :ref:`assertions` -``__PARALLEL_HASKELL__`` - .. index:: - single: __PARALLEL_HASKELL__ - - Only defined when ``-parallel`` is in use! This symbol is defined - when pre-processing Haskell (input) and pre-processing C (GHC - output). - ``os_HOST_OS=1`` This define allows conditional compilation based on the Operating System, where⟨os⟩ is the name of the current Operating System (eg. ===================================== docs/users_guide/using-optimisation.rst ===================================== @@ -664,10 +664,11 @@ as such you shouldn't need to set any of them explicitly. A flag :category: :default: off + :since: 9.10.1 The type-class specialiser and call-pattern specialisation both generate so-called "auto" RULES. These rules are usually exposed - to importing modules in the interface file. But an auto rule is the + to importing modules in the interface file. But when an auto rule is the sole reason for keeping a function alive, both the rule and the function are discarded, by default. That reduces code bloat, but risks the same function being specialised again in an importing module. ===================================== hadrian/doc/flavours.md ===================================== @@ -108,6 +108,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH release (same as perf with -haddock) + -O
    -H64m -O
    -H64m ===================================== testsuite/tests/codeGen/should_gen_asm/T24941.hs ===================================== @@ -0,0 +1,23 @@ +module T24941 where + +data F = F + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float !Float !Float !Float !Float !Float !Float !Float !Float + !Float !Float + + +foo ( F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + x30 x31 + ) + = + + F + x00 x01 x02 x03 x04 x05 x06 x07 x08 x09 + x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 + x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 + + x30 (x31+1) \ No newline at end of file ===================================== testsuite/tests/codeGen/should_gen_asm/all.T ===================================== @@ -10,3 +10,5 @@ test('memset-unroll', is_amd64_codegen, compile_cmp_asm, ['cmm', '']) test('bytearray-memset-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('bytearray-memcpy-unroll', is_amd64_codegen, compile_grep_asm, ['hs', True, '']) test('T18137', [when(opsys('darwin'), skip), only_ways(llvm_ways)], compile_grep_asm, ['hs', False, '-fllvm -split-sections']) + +test('T24941', [only_ways(['optasm'])], compile, ['-fregs-graph']) ===================================== testsuite/tests/linear/should_compile/LinearListComprehension.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE LinearTypes #-} + +module LinearListComprehension where + +-- Probably nobody actually cares if monad comprehension realised that it can be +-- linear in the first statement. But it can, so we might as well. + +guard :: a %1 -> (a %1 -> Bool) %1 -> [Int] +guard x g = [ y | g x, y <- [0,1] ] + +-- This isn't correct syntax, but a singleton list comprehension would +-- presumably work too +-- last :: a %1 -> [a] +-- last x = [ x | ] ===================================== testsuite/tests/linear/should_compile/all.T ===================================== @@ -45,3 +45,4 @@ test('LinearRecUpd', normal, compile, ['']) test('T23814', normal, compile, ['']) test('LinearLet', normal, compile, ['']) test('LinearLetPoly', normal, compile, ['']) +test('LinearListComprehension', normal, compile, ['-dlinear-core-lint']) ===================================== testsuite/tests/linear/should_fail/T25081.hs ===================================== @@ -0,0 +1,37 @@ +{-# LANGUAGE LinearTypes #-} +{-# LANGUAGE ParallelListComp #-} +{-# LANGUAGE TransformListComp #-} + +module T25081 where + +dup_last :: a %1 -> [a] +dup_last x = [ x | _ <- [0,1]] + +dup_bind :: a %1 -> [()] +dup_bind x = [ () | _ <- [0,1], _ <- [x]] + +dup_guard :: a %1 -> (a %1 -> Bool) -> [()] +dup_guard x g = [ () | _ <- [0,1], g x ] + +guard_last :: a %1 -> [a] +guard_last x = [ x | False] + +guard_bind :: a %1 -> [()] +guard_bind x = [ () | False, _ <- [x]] + +guard_guard :: a %1 -> (a %1 -> Bool) %1 -> [()] +guard_guard x g = [ () | False, g x ] + +-- This could, in principle, be linear. But see Note [Binding in list +-- comprehension isn't linear] in GHC.Tc.Gen.Match. +first_bind :: [()] %1 -> [Int] +first_bind xs = [ y | () <- xs, y <- [0,1]] + +parallel :: a %1 -> [(a, Bool)] +parallel x = [(y,z) | y <- [x] | z <- [True]] + +parallel_guard :: a %1 -> (a %1 -> Bool) -> [(Int, Bool)] +parallel_guard x g = [(y, z) | g x, y <- [0,1] | z <- [True, False]] + +transform :: a %1 -> (a %1 -> Bool) -> [a] +transform x g = [y | g x, y <- [0, 1], then take 2] ===================================== testsuite/tests/linear/should_fail/T25081.stderr ===================================== @@ -0,0 +1,65 @@ +T25081.hs:8:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_last’: dup_last x = [x | _ <- [0, 1]] + +T25081.hs:11:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_bind’: + dup_bind x = [() | _ <- [0, 1], _ <- [x]] + +T25081.hs:14:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_guard’: + dup_guard x g = [() | _ <- [0, 1], g x] + +T25081.hs:17:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_last’: guard_last x = [x | False] + +T25081.hs:20:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_bind’: + guard_bind x = [() | False, _ <- [x]] + +T25081.hs:23:13: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:23:15: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘g’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:28:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘xs’ + • In an equation for ‘first_bind’: + first_bind xs = [y | () <- xs, y <- [0, 1]] + +T25081.hs:31:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel’: + parallel x = [(y, z) | y <- [x] | z <- [True]] + +T25081.hs:34:16: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel_guard’: + parallel_guard x g + = [(y, z) | g x, y <- [0, 1] | z <- [True, False]] + +T25081.hs:37:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘transform’: + transform x g = [y | g x, y <- [0, 1], then take 2] + ===================================== testsuite/tests/linear/should_fail/all.T ===================================== @@ -51,3 +51,4 @@ test('LinearLet7', normal, compile_fail, ['']) test('LinearLet8', normal, compile_fail, ['']) test('LinearLet9', normal, compile_fail, ['']) test('LinearLet10', normal, compile_fail, ['']) +test('T25081', normal, compile_fail, ['']) ===================================== testsuite/tests/simplCore/should_compile/T21286.stderr ===================================== @@ -7,10 +7,10 @@ Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) +Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC/T21286 g @Int (T21286) -Rule fired: SPEC/T21286 g @Int (T21286) Rule fired: ==# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) Rule fired: tagToEnum# (BUILTIN) ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -88,7 +88,7 @@ Roman.foo_go [InlPrag=[2]] :: Maybe Int -> Maybe Int -> Int GHC.Types.I# ww }}] Roman.foo_go - = \ (u :: Maybe Int) (ds :: Maybe Int) -> + = \ (u :: Maybe Int) (ds [OS=OneShot] :: Maybe Int) -> case Roman.$wgo u ds of ww { __DEFAULT -> GHC.Types.I# ww } -- RHS size: {terms: 2, types: 0, coercions: 0, joins: 0/0} ===================================== testsuite/tests/simplCore/should_run/T25096.hs ===================================== @@ -0,0 +1,20 @@ +module Main where + +import System.IO.Unsafe +import Control.Monad + +main :: IO () +main = do + foo "test" 10 + +foo :: String -> Int -> IO () +foo x n = go n + where + oops = unsafePerformIO (putStrLn "Once" >> pure (cycle x)) + + go 0 = return () + go n = do + -- `oops` should be shared between loop iterations + let p = take n oops + let !_ = unsafePerformIO (putStrLn p >> pure ()) + go (n-1) ===================================== testsuite/tests/simplCore/should_run/T25096.stdout ===================================== @@ -0,0 +1,11 @@ +Once +testtestte +testtestt +testtest +testtes +testte +testt +test +tes +te +t ===================================== testsuite/tests/simplCore/should_run/all.T ===================================== @@ -115,3 +115,4 @@ test('T23134', normal, compile_and_run, ['-O0 -fcatch-nonexhaustive-cases']) test('T23289', normal, compile_and_run, ['']) test('T23056', [only_ways(['ghci-opt'])], ghci_script, ['T23056.script']) test('T24725', normal, compile_and_run, ['-O -dcore-lint']) +test('T25096', normal, compile_and_run, ['-O -dcore-lint']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d06718cccf14d7bb1409d7cd5ce249434b4d23ef...c79bd6d692dced825229a7da17e54ea07c8083c5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d06718cccf14d7bb1409d7cd5ce249434b4d23ef...c79bd6d692dced825229a7da17e54ea07c8083c5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:30:26 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 29 Jul 2024 08:30:26 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] add location information to expanded expression Message-ID: <66a78b627ba3e_2af917147490757b6@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 58397ef7 by Apoorv Ingle at 2024-07-29T07:29:57-05:00 add location information to expanded expression - - - - - 7 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -476,7 +476,7 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` -data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern HsDoFlavour -- ^ which kind of do-block did this statement come from @@ -494,7 +494,7 @@ isHsThingRnPat _ = False data XXExprGhcRn = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages - , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_expanded :: LHsExpr GhcRn -- The expanded thing can be user written or compiler generated , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded @@ -519,7 +519,7 @@ mkPopErrCtxtExprAt loc a = L loc $ mkPopErrCtxtExpr a -- expanded expressions. mkExpandedExpr :: HsExpr GhcRn -- ^ source expression - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr , xrn_expanded = eExpr @@ -532,7 +532,7 @@ mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ source statement do flavour -> Bool -- ^ should this be type checked using tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav , xrn_expanded = eExpr @@ -542,7 +542,7 @@ mkExpandedPatRn :: LPat GhcRn -- ^ source pattern -> HsDoFlavour -- ^ source statement do flavour -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt , xrn_expanded = eExpr @@ -553,17 +553,17 @@ mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = Or -- expanded expression and associate it with a provided location mkExpandedStmtAt :: Bool -- ^ Wrap this expansion with a pop? - -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ the flavour of the statement -> Bool -- ^ should type check with tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr +mkExpandedStmtAt addPop oStmt flav doTcApp eExpr | addPop - = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + = L (noAnnSrcSpan generatedSrcSpan) (mkPopErrCtxtExpr (L (noAnnSrcSpan generatedSrcSpan) + $ mkExpandedStmt oStmt flav doTcApp eExpr)) | otherwise - = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr + = L (noAnnSrcSpan generatedSrcSpan) (mkExpandedStmt oStmt flav doTcApp eExpr) data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -572,7 +572,7 @@ data XXExprGhcTc | ExpandedThingTc -- See Note [Rebindable syntax and XXExprGhcRn] -- See Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do` { xtc_orig :: HsThingRn -- The original user written thing - , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression + , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression | ConLikeTc -- Result of typechecking a data-con -- See Note [Typechecking data constructors] in @@ -607,7 +607,7 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement - -> HsDoFlavour + -> HsDoFlavour -- ^ the flavour of this statement -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x _)) +repE e@(XExpr (ExpandedThingRn o (L _ x) _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -360,7 +360,7 @@ rnExpr (HsUnboundVar _ v) rnExpr (HsOverLabel src v) = do { (from_label, fvs) <- lookupSyntaxName fromLabelClassOpName ; return ( mkExpandedExpr (HsOverLabel src v) $ - HsAppType noExtField (genLHsVar from_label) hs_ty_arg + wrapGenSpan (HsAppType noExtField (genLHsVar from_label) hs_ty_arg) , fvs ) } where hs_ty_arg = mkEmptyWildCardBndrs $ wrapGenSpan $ @@ -435,7 +435,7 @@ rnExpr (HsGetField _ e f) ; let f' = rnDotFieldOcc f ; return ( mkExpandedExpr (HsGetField noExtField e f') - (mkGetField getField e (fmap (unLoc . dfoLabel) f')) + (wrapGenSpan (mkGetField getField e (fmap (unLoc . dfoLabel) f'))) , fv_e `plusFV` fv_getField ) } rnExpr (HsProjection _ fs) @@ -444,7 +444,7 @@ rnExpr (HsProjection _ fs) ; let fs' = fmap rnDotFieldOcc fs ; return ( mkExpandedExpr (HsProjection noExtField fs') - (mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')) + (wrapGenSpan ((mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')))) , unitFV circ `plusFV` fv_getField) } ------------------------------------------ @@ -516,7 +516,7 @@ rnExpr (ExplicitList _ exps) lit_n = mkIntegralLit (length exps) hs_lit = genHsIntegralLit lit_n exp_list = genHsApps' (L (noAnnSrcSpan loc) from_list_n_name) [hs_lit, wrapGenSpan rn_list] - ; return ( mkExpandedExpr rn_list exp_list + ; return ( mkExpandedExpr rn_list (wrapGenSpan exp_list) , fvs `plusFV` fvs') } } rnExpr (ExplicitTuple _ tup_args boxity) @@ -578,7 +578,7 @@ rnExpr (RecordUpd { rupd_expr = L l expr, rupd_flds = rbinds }) , olRecUpdFields = us } ; return ( mkExpandedExpr (RecordUpd noExtField (L l e) upd_flds) - (mkRecordDotUpd getField setField (L l e) us) + (wrapGenSpan $ mkRecordDotUpd getField setField (L l e) us) , plusFVs [fv_getField, fv_setField, fv_e, fv_us] ) } rnExpr (HsRecSel x _) = dataConCantHappen x @@ -669,17 +669,17 @@ rnSection :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) -- See Note [Parsing sections] in GHC.Parser -- Also see Note [Handling overloaded and rebindable constructs] -rnSection section@(SectionR x op expr) +rnSection section@(SectionR x op@(L op_loc _) expr@(L expr_loc _)) -- See Note [Left and right sections] = do { (op', fvs_op) <- rnLExpr op ; (expr', fvs_expr) <- rnLExpr expr ; checkSectionPrec InfixR section op' expr' ; let rn_section = SectionR x op' expr' - ds_section = genHsApps rightSectionName [op',expr'] + ds_section = L (combineSrcSpansA op_loc expr_loc) (genHsApps rightSectionName [op',expr']) ; return ( mkExpandedExpr rn_section ds_section , fvs_op `plusFV` fvs_expr) } -rnSection section@(SectionL x expr op) +rnSection section@(SectionL x expr@(L expr_loc _) op@(L op_loc _)) -- See Note [Left and right sections] = do { (expr', fvs_expr) <- rnLExpr expr ; (op', fvs_op) <- rnLExpr op @@ -691,7 +691,7 @@ rnSection section@(SectionL x expr op) | postfix_ops = HsApp noExtField op' expr' | otherwise = genHsApps leftSectionName [wrapGenSpan $ HsApp noExtField op' expr'] - ; return ( mkExpandedExpr rn_section ds_section + ; return ( mkExpandedExpr rn_section (L (combineSrcSpansA expr_loc op_loc) ds_section) , fvs_op `plusFV` fvs_expr) } rnSection other = pprPanic "rnSection" (ppr other) @@ -2806,7 +2806,7 @@ rnHsIf p b1 b2 -> return (rn_if, fvs_if) Just ite_name -- Rebindable-syntax case - -> do { let ds_if = genHsApps ite_name [p', b1', b2'] + -> do { let ds_if = wrapGenSpan (genHsApps ite_name [p', b1', b2']) fvs = plusFVs [fvs_if, unitFV ite_name] ; return (mkExpandedExpr rn_if ds_if, fvs) } } ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -815,9 +815,7 @@ tcInstFun do_ql inst_final (tc_fun, fun_ctxt) fun_sigma rn_args -- Rule IARG from Fig 4 of the QL paper: go1 pos acc fun_ty (EValArg { ea_arg = arg, ea_ctxt = ctxt } : rest_args) - = do { let herald = case fun_ctxt of - VAExpansion (OrigStmt{}) _ _ -> ExpectedFunTySyntaxOp DoOrigin tc_fun - _ -> ExpectedFunTyArg (HsExprTcThing tc_fun) (unLoc arg) + = do { let herald = ExpectedFunTyArg (HsExprTcThing tc_fun) (unLoc arg) ; (wrap, arg_ty, res_ty) <- -- NB: matchActualFunTy does the rep-poly check. -- For example, suppose we have f :: forall r (a::TYPE r). a -> Int @@ -874,7 +872,7 @@ looks_like_type_arg _ = False addArgCtxt :: AppCtxt -> LHsExpr GhcRn -> TcM a -> TcM a --- There are four cases: +-- There are three cases: -- 1. In the normal case, we add an informative context -- "In the third argument of f, namely blah" -- 2. If we are deep inside generated code (`isGeneratedCode` is `True`) @@ -883,18 +881,10 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- "In the expression: arg" -- Unless the arg is also a generated thing, in which case do nothing. -- See Note [Rebindable syntax and XXExprGhcRn] in GHC.Hs.Expr --- 3. We are in an expanded `do`-block's non-bind statement +-- 3. We are in an expanded `do`-block's statement -- we simply add the statement context -- "In the statement of the `do`-block .." --- 4. We are in an expanded do block's bind statement --- a. Then either we are typechecking the first argument of the bind which is user located --- so we set the location to be that of the argument --- b. Or, we are typechecking the second argument which would be a generated lambda --- so we set the location to be whatever the location in the context is -- See Note [Expanding HsDo with XXExprGhcRn] in GHC.Tc.Gen.Do --- For future: we need a cleaner way of doing this bit of adding the right error context. --- There is a delicate dance of looking at source locations and reconstructing --- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of @@ -903,18 +893,10 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc - | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) - -> setSrcSpan loc $ - addStmtCtxt stmt flav $ - thing_inside - | otherwise -- This arg is the first argument to generated (>>=) - -> setSrcSpanA arg_loc $ - addStmtCtxt stmt flav $ - thing_inside VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav $ + setSrcSpanA arg_loc $ thing_inside _ -> setSrcSpanA arg_loc $ ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -73,13 +73,13 @@ expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L _ (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = return $ mkExpandedStmtAt addPop loc stmt flav False body + = return $ mkExpandedStmtAt addPop stmt flav False (L body_loc body) | SyntaxExprRn ret <- ret_expr -- @@ -87,18 +87,18 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- return e ~~> return e -- to make T18324 work = do let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtAt addPop loc stmt flav False expansion + return $ mkExpandedStmtAt addPop stmt flav False (L body_loc expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion + return $ mkExpandedStmtAt addPop stmt doFlavour False (wrapGenSpan expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L _ (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -112,12 +112,12 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' @@ -127,7 +127,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_o let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts @@ -216,7 +216,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) { xarg_app_arg_one = mb_fail_op , app_arg_pattern = pat , arg_expr = (L rhs_loc rhs) }) = - do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + do let xx_expr = mkExpandedStmtAt addPop stmt doFlavour False (L rhs_loc rhs) traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) return ((pat, mb_fail_op) , xx_expr) @@ -247,7 +247,7 @@ expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (p -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = +mk_failable_expr addPop doFlav mb_stmt lpat@(L _ pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM @@ -262,21 +262,21 @@ mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr _ -> return $ case mb_stmt of Nothing -> genHsLamDoExp doFlav [lpat] expr - Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False - (unLoc $ (genHsLamDoExp doFlav [lpat] - $ wrapGenSpan (mkPopErrCtxtExpr expr))) - else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op + Just stmt -> mkExpandedStmtAt addPop stmt doFlav False + (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)) + else mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) - -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags - return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ - (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr - , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" - ]) + return $ wrapGenSpan (HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ + (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr + , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" + ])) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ @@ -285,7 +285,7 @@ mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op = mkExpandedPatRn pat doFlav mb_stmt $ - genHsApp fail_op (mk_fail_msg_expr dflags pat) + wrapGenSpan (genHsApp fail_op (mk_fail_msg_expr dflags pat)) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -621,7 +621,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Typecheck the expanded expression. ; expr' <- addErrCtxt err_ctxt $ - tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty) + tcExpr (mkExpandedExpr expr (wrapGenSpan ds_expr)) (Check ds_res_ty) -- NB: it's important to use ds_res_ty and not res_ty here. -- Test case: T18802b. @@ -714,7 +714,7 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty +tcXExpr xe@(ExpandedThingRn o (L _ e') doTcApp) res_ty | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 = setSrcSpanA loc $ addStmtCtxt (unLoc s) flav $ ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -325,8 +325,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e _)) ctxt args - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) + go (XExpr (ExpandedThingRn o (L l e) _)) _ args + = go e (VAExpansion o (locA l) (locA l)) (EWrap (EExpand o) : args) -- See Note [Desugar OpApp in the typechecker] @@ -335,7 +335,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] , mkEValArg (VACall op 1 generatedSrcSpan) arg1 : mkEValArg (VACall op 2 generatedSrcSpan) arg2 -- generatedSrcSpan because this the span of the call, - -- and its hard to say exactly what that is + -- Exand its hard to say exactly what that is : EWrap (EExpand (OrigExpr e)) : args ) @@ -555,20 +555,25 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt flav - thing_inside addHeadCtxt fun_ctxt thing_inside + | isGeneratedSrcSpan fun_loc + = case fun_ctxt of + VAExpansion (OrigStmt (L loc stmt) flav) _ _ + -> do setSrcSpanA loc $ + addStmtCtxt stmt flav $ + thing_inside + VAExpansion (OrigPat (L loc _) _ _) _ _ + -> setSrcSpanA loc $ thing_inside + _ -> thing_inside + | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt: fun_loc" (ppr fun_loc) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ - -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58397ef79fdbcf14c1b3364136dae79eb6d6ec63 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/58397ef79fdbcf14c1b3364136dae79eb6d6ec63 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:43:23 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 29 Jul 2024 08:43:23 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 22 commits: testsuite: Delay querying ghc-pkg to find .so dirs until test is run Message-ID: <66a78e6bd6c9f_2af9172f792078121@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - eb7bec5e by Cheng Shao at 2024-07-29T14:43:11+02:00 compiler: always generate dynamic stub objects when generating bytecode When foreign stub objects are compiled during bytecode generation (e.g. when using whole core bindings), ensure they are dynamic so they can be properly loaded. - - - - - 022f398b by Cheng Shao at 2024-07-29T14:43:11+02:00 compiler: generate stub objects before writing iface This commit promotes foreign stub compilation a bit earlier before we actually write iface, to make it possible to actually serialize them into the final iface when compiling with `-fwrite-if-simplified-core`. Also ensures dynamic stub objects are generated if we're compiling with `-fwrite-if-simplified-core`. - - - - - 18f16947 by Cheng Shao at 2024-07-29T14:43:11+02:00 compiler: add mi_stub_objs to ModIface This commit adds the mi_stub_objs field to ModIface, representing serialized foreign stub dynamic objects that can be reloaded later when compiling a downstream module with `-fprefer-byte-code` that loads whole core bindings from an upstream module that requires foreign stubs, see #24634 for such an example. - - - - - 27c4425a by Cheng Shao at 2024-07-29T14:43:11+02:00 compiler: serialize foreign stub dynamic objects in interface file when compiling with -fwrite-if-simplified-core This commit makes the compiler serialize foreign stub dynamic objects in mi_stub_objs when compiling with -fwrite-if-simplified-core. This is needed when we compile a downstream module with -fprefer-byte-code, in which case we want to make use of whole core bindings in upstream modules instead of having to load their dynamic objects, but the foreign stub information has been lost across different ghc invocations previously. Hence the fix in this commit. See #24634 for such an example. - - - - - 25607288 by Cheng Shao at 2024-07-29T14:43:11+02:00 testsuite: fix T24634 This commit fixes T24634 and marks it as unbroken. - - - - - d81b690a by Cheng Shao at 2024-07-29T14:43:11+02:00 WIP: oneshot bytecode support - - - - - d611fb1d by Torsten Schmits at 2024-07-29T14:43:11+02:00 use the EPS type env when typechecking core bindings in oneshot mode - - - - - 64eaa44d by Torsten Schmits at 2024-07-29T14:43:11+02:00 avoid case-insensitivity clobber in test - - - - - f6b3008c by Torsten Schmits at 2024-07-29T14:43:11+02:00 compile exe in test with core bindings to avoid recompilation of Hello - - - - - 30 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Unit/Module/Location.hs - compiler/GHC/Unit/Module/ModIface.hs - compiler/GHC/Utils/Outputable.hs - configure.ac - docs/users_guide/9.12.1-notes.rst The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4d5349bd5721aff30f0c2a1d76c622abb1e71247...f6b3008c5a6e84dc229a058ec0bf49b269477e7e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4d5349bd5721aff30f0c2a1d76c622abb1e71247...f6b3008c5a6e84dc229a058ec0bf49b269477e7e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:52:17 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 08:52:17 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66a790816bb67_2af917427c1480230@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: c40c60b9 by Rodrigo Mesquita at 2024-07-29T12:52:12+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: John Ericson <git at johnericson.me> - - - - - 1 changed file: - compiler/GHC/Hs/Basic.hs Changes: ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary, Eq +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataTypeable #-} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c40c60b9a53bb2b509f94a97e0d955c7b9a88664 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c40c60b9a53bb2b509f94a97e0d955c7b9a88664 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:52:28 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 08:52:28 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66a7908c42841_2af91742731881039@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: 7f7a2ffb by Rodrigo Mesquita at 2024-07-29T12:52:25+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: John Ericson <git at johnericson.me> - - - - - 1 changed file: - compiler/Language/Haskell/Syntax/Basic.hs Changes: ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -135,4 +135,4 @@ data FixityDirection deriving (Eq, Data) data Fixity = Fixity Int FixityDirection - deriving Data + deriving (Eq, Data) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7f7a2ffb2833c05a3b5099fcb299710dc14148c9 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7f7a2ffb2833c05a3b5099fcb299710dc14148c9 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:52:36 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 08:52:36 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66a790941f929_2af9174272dc818b2@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: 72b3c782 by Rodrigo Mesquita at 2024-07-29T12:52:31+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: John Ericson <git at johnericson.me> - - - - - 1 changed file: - compiler/GHC/Hs/Basic.hs Changes: ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -29,8 +29,6 @@ instance Outputable FixityDirection where instance Outputable Fixity where ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 instance Binary Fixity where put_ bh (Fixity aa ab) = do View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72b3c782c5542acf8e4780b07c329863aee30f1c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72b3c782c5542acf8e4780b07c329863aee30f1c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 12:54:22 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 08:54:22 -0400 Subject: [Git][ghc/ghc][wip/kirchner/ttg-zurich] TTG HsCmdArrForm: use Fixity via extension point Message-ID: <66a790feb7072_2af9175d1c408265d@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kirchner/ttg-zurich at Glasgow Haskell Compiler / GHC Commits: e633ed46 by romes at 2024-07-29T13:54:04+01:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 20 changed files: - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - utils/check-exact/ExactPrint.hs Changes: ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,56 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving (Eq, Data) ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3469,7 +3469,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3483,7 +3483,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e633ed4600aed7f9391d24554e3a189b896fbb77 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e633ed4600aed7f9391d24554e3a189b896fbb77 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 14:46:48 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 10:46:48 -0400 Subject: [Git][ghc/ghc][wip/romes/pccdesc] 7 commits: Fix -freg-graphs for FP and AARch64 NCG (#24941). Message-ID: <66a7ab58e6b4f_3956c23bb8fc221d@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/pccdesc at Glasgow Haskell Compiler / GHC Commits: 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 10e34701 by Rodrigo Mesquita at 2024-07-29T15:46:38+01:00 distinct-constructor-tables determinism - - - - - 30 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Stg/Debug.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Utils.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/IPE.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Outputable.hs - docs/users_guide/9.12.1-notes.rst - docs/users_guide/phases.rst - hadrian/doc/flavours.md - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T - testsuite/tests/simplCore/should_compile/T21286.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3869ecbb1fc3ba6f136fe48c00ef304432162126...10e34701cf07bd55cf357eb6527fc8a1e3f285f5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3869ecbb1fc3ba6f136fe48c00ef304432162126...10e34701cf07bd55cf357eb6527fc8a1e3f285f5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 14:59:52 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 29 Jul 2024 10:59:52 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] add location information to expanded expression Message-ID: <66a7ae68b17dd_3956c253b3a825566@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: dc9ab2da by Apoorv Ingle at 2024-07-29T09:59:33-05:00 add location information to expanded expression - - - - - 7 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -476,7 +476,7 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` -data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern HsDoFlavour -- ^ which kind of do-block did this statement come from @@ -494,7 +494,7 @@ isHsThingRnPat _ = False data XXExprGhcRn = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages - , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_expanded :: LHsExpr GhcRn -- The expanded thing can be user written or compiler generated , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded @@ -519,7 +519,7 @@ mkPopErrCtxtExprAt loc a = L loc $ mkPopErrCtxtExpr a -- expanded expressions. mkExpandedExpr :: HsExpr GhcRn -- ^ source expression - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr , xrn_expanded = eExpr @@ -532,7 +532,7 @@ mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ source statement do flavour -> Bool -- ^ should this be type checked using tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav , xrn_expanded = eExpr @@ -542,7 +542,7 @@ mkExpandedPatRn :: LPat GhcRn -- ^ source pattern -> HsDoFlavour -- ^ source statement do flavour -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt , xrn_expanded = eExpr @@ -553,17 +553,17 @@ mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = Or -- expanded expression and associate it with a provided location mkExpandedStmtAt :: Bool -- ^ Wrap this expansion with a pop? - -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ the flavour of the statement -> Bool -- ^ should type check with tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr +mkExpandedStmtAt addPop oStmt flav doTcApp eExpr | addPop - = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + = L (noAnnSrcSpan generatedSrcSpan) (mkPopErrCtxtExpr (L (noAnnSrcSpan generatedSrcSpan) + $ mkExpandedStmt oStmt flav doTcApp eExpr)) | otherwise - = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr + = L (noAnnSrcSpan generatedSrcSpan) (mkExpandedStmt oStmt flav doTcApp eExpr) data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -572,7 +572,7 @@ data XXExprGhcTc | ExpandedThingTc -- See Note [Rebindable syntax and XXExprGhcRn] -- See Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do` { xtc_orig :: HsThingRn -- The original user written thing - , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression + , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression | ConLikeTc -- Result of typechecking a data-con -- See Note [Typechecking data constructors] in @@ -607,7 +607,7 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement - -> HsDoFlavour + -> HsDoFlavour -- ^ the flavour of this statement -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x _)) +repE e@(XExpr (ExpandedThingRn o (L _ x) _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -360,7 +360,7 @@ rnExpr (HsUnboundVar _ v) rnExpr (HsOverLabel src v) = do { (from_label, fvs) <- lookupSyntaxName fromLabelClassOpName ; return ( mkExpandedExpr (HsOverLabel src v) $ - HsAppType noExtField (genLHsVar from_label) hs_ty_arg + wrapGenSpan (HsAppType noExtField (genLHsVar from_label) hs_ty_arg) , fvs ) } where hs_ty_arg = mkEmptyWildCardBndrs $ wrapGenSpan $ @@ -435,7 +435,7 @@ rnExpr (HsGetField _ e f) ; let f' = rnDotFieldOcc f ; return ( mkExpandedExpr (HsGetField noExtField e f') - (mkGetField getField e (fmap (unLoc . dfoLabel) f')) + (wrapGenSpan (mkGetField getField e (fmap (unLoc . dfoLabel) f'))) , fv_e `plusFV` fv_getField ) } rnExpr (HsProjection _ fs) @@ -444,7 +444,7 @@ rnExpr (HsProjection _ fs) ; let fs' = fmap rnDotFieldOcc fs ; return ( mkExpandedExpr (HsProjection noExtField fs') - (mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')) + (wrapGenSpan ((mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')))) , unitFV circ `plusFV` fv_getField) } ------------------------------------------ @@ -516,7 +516,7 @@ rnExpr (ExplicitList _ exps) lit_n = mkIntegralLit (length exps) hs_lit = genHsIntegralLit lit_n exp_list = genHsApps' (L (noAnnSrcSpan loc) from_list_n_name) [hs_lit, wrapGenSpan rn_list] - ; return ( mkExpandedExpr rn_list exp_list + ; return ( mkExpandedExpr rn_list (wrapGenSpan exp_list) , fvs `plusFV` fvs') } } rnExpr (ExplicitTuple _ tup_args boxity) @@ -578,7 +578,7 @@ rnExpr (RecordUpd { rupd_expr = L l expr, rupd_flds = rbinds }) , olRecUpdFields = us } ; return ( mkExpandedExpr (RecordUpd noExtField (L l e) upd_flds) - (mkRecordDotUpd getField setField (L l e) us) + (wrapGenSpan $ mkRecordDotUpd getField setField (L l e) us) , plusFVs [fv_getField, fv_setField, fv_e, fv_us] ) } rnExpr (HsRecSel x _) = dataConCantHappen x @@ -669,17 +669,17 @@ rnSection :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) -- See Note [Parsing sections] in GHC.Parser -- Also see Note [Handling overloaded and rebindable constructs] -rnSection section@(SectionR x op expr) +rnSection section@(SectionR x op@(L op_loc _) expr@(L expr_loc _)) -- See Note [Left and right sections] = do { (op', fvs_op) <- rnLExpr op ; (expr', fvs_expr) <- rnLExpr expr ; checkSectionPrec InfixR section op' expr' ; let rn_section = SectionR x op' expr' - ds_section = genHsApps rightSectionName [op',expr'] + ds_section = L (combineSrcSpansA op_loc expr_loc) (genHsApps rightSectionName [op',expr']) ; return ( mkExpandedExpr rn_section ds_section , fvs_op `plusFV` fvs_expr) } -rnSection section@(SectionL x expr op) +rnSection section@(SectionL x expr@(L expr_loc _) op@(L op_loc _)) -- See Note [Left and right sections] = do { (expr', fvs_expr) <- rnLExpr expr ; (op', fvs_op) <- rnLExpr op @@ -691,7 +691,7 @@ rnSection section@(SectionL x expr op) | postfix_ops = HsApp noExtField op' expr' | otherwise = genHsApps leftSectionName [wrapGenSpan $ HsApp noExtField op' expr'] - ; return ( mkExpandedExpr rn_section ds_section + ; return ( mkExpandedExpr rn_section (L (combineSrcSpansA expr_loc op_loc) ds_section) , fvs_op `plusFV` fvs_expr) } rnSection other = pprPanic "rnSection" (ppr other) @@ -2806,7 +2806,7 @@ rnHsIf p b1 b2 -> return (rn_if, fvs_if) Just ite_name -- Rebindable-syntax case - -> do { let ds_if = genHsApps ite_name [p', b1', b2'] + -> do { let ds_if = wrapGenSpan (genHsApps ite_name [p', b1', b2']) fvs = plusFVs [fvs_if, unitFV ite_name] ; return (mkExpandedExpr rn_if ds_if, fvs) } } ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -874,7 +874,7 @@ looks_like_type_arg _ = False addArgCtxt :: AppCtxt -> LHsExpr GhcRn -> TcM a -> TcM a --- There are four cases: +-- There are three cases: -- 1. In the normal case, we add an informative context -- "In the third argument of f, namely blah" -- 2. If we are deep inside generated code (`isGeneratedCode` is `True`) @@ -883,18 +883,10 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- "In the expression: arg" -- Unless the arg is also a generated thing, in which case do nothing. -- See Note [Rebindable syntax and XXExprGhcRn] in GHC.Hs.Expr --- 3. We are in an expanded `do`-block's non-bind statement +-- 3. We are in an expanded `do`-block's statement -- we simply add the statement context -- "In the statement of the `do`-block .." --- 4. We are in an expanded do block's bind statement --- a. Then either we are typechecking the first argument of the bind which is user located --- so we set the location to be that of the argument --- b. Or, we are typechecking the second argument which would be a generated lambda --- so we set the location to be whatever the location in the context is -- See Note [Expanding HsDo with XXExprGhcRn] in GHC.Tc.Gen.Do --- For future: we need a cleaner way of doing this bit of adding the right error context. --- There is a delicate dance of looking at source locations and reconstructing --- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of @@ -903,18 +895,10 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc - | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) - -> setSrcSpan loc $ - addStmtCtxt stmt flav $ - thing_inside - | otherwise -- This arg is the first argument to generated (>>=) - -> setSrcSpanA arg_loc $ - addStmtCtxt stmt flav $ - thing_inside VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav $ + setSrcSpanA arg_loc $ thing_inside _ -> setSrcSpanA arg_loc $ ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -73,13 +73,13 @@ expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L _ (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = return $ mkExpandedStmtAt addPop loc stmt flav False body + = return $ mkExpandedStmtAt addPop stmt flav False (L body_loc body) | SyntaxExprRn ret <- ret_expr -- @@ -87,18 +87,18 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- return e ~~> return e -- to make T18324 work = do let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtAt addPop loc stmt flav False expansion + return $ mkExpandedStmtAt addPop stmt flav False (L body_loc expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion + return $ mkExpandedStmtAt addPop stmt doFlavour False (wrapGenSpan expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L _ (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -112,12 +112,12 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' @@ -127,7 +127,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_o let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts @@ -216,7 +216,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) { xarg_app_arg_one = mb_fail_op , app_arg_pattern = pat , arg_expr = (L rhs_loc rhs) }) = - do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + do let xx_expr = mkExpandedStmtAt addPop stmt doFlavour False (L rhs_loc rhs) traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) return ((pat, mb_fail_op) , xx_expr) @@ -247,7 +247,7 @@ expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (p -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = +mk_failable_expr addPop doFlav mb_stmt lpat@(L _ pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM @@ -262,21 +262,21 @@ mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr _ -> return $ case mb_stmt of Nothing -> genHsLamDoExp doFlav [lpat] expr - Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False - (unLoc $ (genHsLamDoExp doFlav [lpat] - $ wrapGenSpan (mkPopErrCtxtExpr expr))) - else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op + Just stmt -> mkExpandedStmtAt addPop stmt doFlav False + (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)) + else mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) - -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags - return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ - (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr - , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" - ]) + return $ wrapGenSpan (HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ + (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr + , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" + ])) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ @@ -285,7 +285,7 @@ mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op = mkExpandedPatRn pat doFlav mb_stmt $ - genHsApp fail_op (mk_fail_msg_expr dflags pat) + wrapGenSpan (genHsApp fail_op (mk_fail_msg_expr dflags pat)) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -621,7 +621,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Typecheck the expanded expression. ; expr' <- addErrCtxt err_ctxt $ - tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty) + tcExpr (mkExpandedExpr expr (wrapGenSpan ds_expr)) (Check ds_res_ty) -- NB: it's important to use ds_res_ty and not res_ty here. -- Test case: T18802b. @@ -714,7 +714,7 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty +tcXExpr xe@(ExpandedThingRn o (L _ e') doTcApp) res_ty | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 = setSrcSpanA loc $ addStmtCtxt (unLoc s) flav $ ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -325,8 +325,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e _)) ctxt args - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) + go (XExpr (ExpandedThingRn o (L l e) _)) _ args + = go e (VAExpansion o (locA l) (locA l)) (EWrap (EExpand o) : args) -- See Note [Desugar OpApp in the typechecker] @@ -335,7 +335,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] , mkEValArg (VACall op 1 generatedSrcSpan) arg1 : mkEValArg (VACall op 2 generatedSrcSpan) arg2 -- generatedSrcSpan because this the span of the call, - -- and its hard to say exactly what that is + -- Exand its hard to say exactly what that is : EWrap (EExpand (OrigExpr e)) : args ) @@ -555,20 +555,25 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt flav - thing_inside addHeadCtxt fun_ctxt thing_inside + | isGeneratedSrcSpan fun_loc + = case fun_ctxt of + VAExpansion (OrigStmt (L loc stmt) flav) _ _ + -> do setSrcSpanA loc $ + addStmtCtxt stmt flav $ + thing_inside + VAExpansion (OrigPat (L loc _) _ _) _ _ + -> setSrcSpanA loc $ thing_inside + _ -> thing_inside + | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt: fun_loc" (ppr fun_loc) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ - -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dc9ab2dae0f8b2d3b3fbdea5e6cad089e6f739c6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dc9ab2dae0f8b2d3b3fbdea5e6cad089e6f739c6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:27:25 2024 From: gitlab at gitlab.haskell.org (Sven Tennie (@supersven)) Date: Mon, 29 Jul 2024 11:27:25 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/supersven/add-LLVMAS-target Message-ID: <66a7b4dd43697_3956c27561ec3191a@gitlab.mail> Sven Tennie pushed new branch wip/supersven/add-LLVMAS-target at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/supersven/add-LLVMAS-target You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:49:12 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 11:49:12 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 2 commits: distinct-constructor-tables determinism Message-ID: <66a7b9f8579e_3956c29ce6cc41145@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: 866f021e by Rodrigo Mesquita at 2024-07-29T15:45:43+01:00 distinct-constructor-tables determinism - - - - - 3efabb93 by Rodrigo Mesquita at 2024-07-29T16:49:04+01:00 Rename deterministically CmmGroups in generateCgIPEStub - - - - - 6 changed files: - compiler/GHC/Driver/GenerateCgIPEStub.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Stg/Debug.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Utils.hs - compiler/GHC/Types/IPE.hs Changes: ===================================== compiler/GHC/Driver/GenerateCgIPEStub.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Unit.Module (moduleNameString) import qualified GHC.Utils.Logger as Logger import GHC.Utils.Outputable (ppr) import GHC.Types.Unique.DSM +import GHC.Cmm.UniqueRenamer {- Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)] @@ -199,9 +200,10 @@ generateCgIPEStub , Map CmmInfoTable (Maybe IpeSourceLocation) , IPEStats , DUniqSupply + , DetUniqFM ) -> Stream IO CmmGroupSRTs CmmCgInfos -generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus) = do +generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus, detRnEnv) = do let dflags = hsc_dflags hsc_env platform = targetPlatform dflags logger = hsc_logger hsc_env @@ -213,9 +215,9 @@ generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesW let denv' = denv {provInfoTables = Map.mapKeys cit_lbl infoTablesWithTickishes} ((mIpeStub, ipeCmmGroup), _) = runC (initStgToCmmConfig dflags this_mod) fstate cgState $ getCmm (initInfoTableProv initStats (Map.keys infoTablesWithTickishes) denv') - -- TODO: Renaming here + (_detRnEnv', rn_ipeCmmGroup) = detRenameCmmGroup detRnEnv ipeCmmGroup - (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus (removeDeterm ipeCmmGroup) + (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus rn_ipeCmmGroup Stream.yield ipeCmmGroupSRTs ipeStub <- ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -215,6 +215,7 @@ import GHC.Cmm.Info.Build import GHC.Cmm.Pipeline import GHC.Cmm.Info import GHC.Cmm.Parser +import GHC.Cmm.UniqueRenamer import GHC.Unit import GHC.Unit.Env @@ -299,7 +300,6 @@ import GHC.Stg.InferTags.TagSig (seqTagSig) import GHC.StgToCmm.Utils (IPEStats) import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import GHC.Types.Unique.DSM import GHC.Cmm.Config (CmmConfig) {- ********************************************************************** @@ -2172,11 +2172,11 @@ doCodeGen hsc_env this_mod denv data_tycons putDumpFileMaybe logger Opt_D_dump_stg_final "Final STG:" FormatSTG (pprGenStgTopBindings stg_ppr_opts stg_binds_w_fvs) - let stg_to_cmm dflags mod = case stgToCmmHook hooks of - Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) - Just h -> h (initStgToCmmConfig dflags mod) + let stg_to_cmm dflags mod a b c d e = case stgToCmmHook hooks of + Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) a b c d e + Just h -> (,emptyDetUFM) <$> h (initStgToCmmConfig dflags mod) a b c d e - let cmm_stream :: Stream IO CmmGroup ModuleLFInfos + let cmm_stream :: Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) -- See Note [Forcing of stg_binds] cmm_stream = stg_binds_w_fvs `seqList` {-# SCC "StgToCmm" #-} stg_to_cmm dflags this_mod denv data_tycons cost_centre_info stg_binds_w_fvs hpc_info @@ -2198,11 +2198,11 @@ doCodeGen hsc_env this_mod denv data_tycons pipeline_stream :: Stream IO CmmGroupSRTs CmmCgInfos pipeline_stream = do - ((mod_srt_info, ipes, ipe_stats, dus), lf_infos) <- + ((mod_srt_info, ipes, ipe_stats, dus), (lf_infos, detRnEnv)) <- {-# SCC "cmmPipeline" #-} Stream.mapAccumL_ (pipeline_action logger cmm_config) (emptySRT this_mod, M.empty, mempty, initDUniqSupply 'u' 1) ppr_stream1 let nonCaffySet = srtMapNonCAFs (moduleSRTMap mod_srt_info) - cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus) + cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus, detRnEnv) return cmmCgInfos pipeline_action ===================================== compiler/GHC/Stg/Debug.hs ===================================== @@ -11,6 +11,7 @@ import GHC.Prelude import GHC.Stg.Syntax +import GHC.Types.Unique.DFM import GHC.Types.Id import GHC.Types.Tickish import GHC.Core.DataCon @@ -166,13 +167,13 @@ numberDataCon dc ts = do env <- lift get mcc <- asks rSpan let !mbest_span = (\(SpanWithLabel rss l) -> (rss, l)) <$> (selectTick ts <|> mcc) - let !dcMap' = alterUniqMap (maybe (Just ((0, mbest_span) :| [] )) - (\xs@((k, _):|_) -> Just $! ((k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc + let !dcMap' = alterUDFM (maybe (Just (dc, (0, mbest_span) :| [] )) + (\(_dc, xs@((k, _):|_)) -> Just $! (dc, (k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc lift $ put (env { provDC = dcMap' }) - let r = lookupUniqMap dcMap' dc + let r = lookupUDFM dcMap' dc return $ case r of Nothing -> NoNumber - Just res -> Numbered (fst (NE.head res)) + Just (_, res) -> Numbered (fst (NE.head res)) selectTick :: [StgTickish] -> Maybe SpanWithLabel selectTick [] = Nothing ===================================== compiler/GHC/StgToCmm.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Id.Info import GHC.Types.RepType import GHC.Types.Basic import GHC.Types.Var.Set ( isEmptyDVarSet ) +import GHC.Types.Unique.DFM import GHC.Types.Unique.FM import GHC.Types.Name.Env @@ -60,7 +61,6 @@ import GHC.Utils.TmpFs import GHC.Data.Stream import GHC.Data.OrdList -import GHC.Types.Unique.Map import Control.Monad (when,void, forM_) import GHC.Utils.Misc @@ -77,10 +77,11 @@ codeGen :: Logger -> CollectedCCs -- (Local/global) cost-centres needing declaring/registering. -> [CgStgTopBinding] -- Bindings to convert -> HpcInfo - -> Stream IO CmmGroup ModuleLFInfos -- Output as a stream, so codegen can + -> Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) + -- Output as a stream, so codegen can -- be interleaved with output -codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons +codeGen logger tmpfs cfg (InfoTableProvMap denv _ _) data_tycons cost_centre_info stg_binds hpc_info = do { -- cg: run the code generator, and yield the resulting CmmGroup -- Using an IORef to store the state is a bit crude, but otherwise @@ -139,7 +140,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons -- Emit special info tables for everything used in this module -- This will only do something if `-fdistinct-info-tables` is turned on. - ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (nonDetEltsUFM denv) + ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (eltsUDFM denv) ; final_state <- liftIO (readIORef cgref) ; let cg_id_infos = cgs_binds final_state @@ -160,7 +161,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons ; rn_mapping <- liftIO (readIORef uniqRnRef) ; liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping) - ; return generatedInfo + ; return (generatedInfo, rn_mapping) } --------------------------------------------------------------- ===================================== compiler/GHC/StgToCmm/Utils.hs ===================================== @@ -90,7 +90,7 @@ import GHC.Types.Unique.Map import Data.Maybe import qualified Data.List.NonEmpty as NE import GHC.Core.DataCon -import GHC.Types.Unique.FM +import GHC.Types.Unique.DFM import GHC.Data.Maybe import Control.Monad import qualified Data.Map.Strict as Map @@ -673,7 +673,7 @@ pprIPEStats (IPEStats{..}) = -- for stack info tables skipped during 'generateCgIPEStub'. As the fold -- progresses, counts of tables per closure type will be accumulated. convertInfoProvMap :: StgToCmmConfig -> Module -> InfoTableProvMap -> IPEStats -> [CmmInfoTable] -> (IPEStats, [InfoProvEnt]) -convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTableToSourceLocationMap) initStats cmits = +convertInfoProvMap cfg this_mod (InfoTableProvMap dcenv denv infoTableToSourceLocationMap) initStats cmits = foldl' convertInfoProvMap' (initStats, []) cmits where convertInfoProvMap' :: (IPEStats, [InfoProvEnt]) -> CmmInfoTable -> (IPEStats, [InfoProvEnt]) @@ -694,7 +694,7 @@ convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTable lookupDataConMap = (closureIpeStats cn,) <$> do UsageSite _ n <- hasIdLabelInfo cl >>= getConInfoTableLocation -- This is a bit grimy, relies on the DataCon and Name having the same Unique, which they do - (dc, ns) <- hasHaskellName cl >>= lookupUFM_Directly dcenv . getUnique + (dc, ns) <- hasHaskellName cl >>= lookupUDFM_Directly dcenv . getUnique -- Lookup is linear but lists will be small (< 100) return $ (InfoProvEnt cl cn (tyString (dataConTyCon dc)) this_mod (join $ lookup n (NE.toList ns))) ===================================== compiler/GHC/Types/IPE.hs ===================================== @@ -13,6 +13,7 @@ import GHC.Data.FastString import GHC.Types.SrcLoc import GHC.Core.DataCon +import GHC.Types.Unique.DFM import GHC.Types.Unique.Map import GHC.Core.Type import Data.List.NonEmpty @@ -38,7 +39,7 @@ type ClosureMap = UniqMap Name -- The binding -- the constructor was used at, if possible and a string which names -- the source location. This is the same information as is the payload -- for the 'GHC.Core.SourceNote' constructor. -type DCMap = UniqMap DataCon (NonEmpty (Int, Maybe IpeSourceLocation)) +type DCMap = UniqDFM DataCon (DataCon, NonEmpty (Int, Maybe IpeSourceLocation)) type InfoTableToSourceLocationMap = Map.Map CLabel (Maybe IpeSourceLocation) @@ -49,4 +50,4 @@ data InfoTableProvMap = InfoTableProvMap } emptyInfoTableProvMap :: InfoTableProvMap -emptyInfoTableProvMap = InfoTableProvMap emptyUniqMap emptyUniqMap Map.empty +emptyInfoTableProvMap = InfoTableProvMap emptyUDFM emptyUniqMap Map.empty View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6081ac247b42abfc13497b06791bf5d8646de72...3efabb930efc29d6d25ccabff8c1c05e25f5d0e8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6081ac247b42abfc13497b06791bf5d8646de72...3efabb930efc29d6d25ccabff8c1c05e25f5d0e8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:51:15 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 11:51:15 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 5 commits: Don't print unique in pprFullName Message-ID: <66a7ba734840f_3956c29d0abc418d@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: bfa28094 by Rodrigo Mesquita at 2024-07-29T16:51:04+01:00 Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled - - - - - 5132b57f by Rodrigo Mesquita at 2024-07-29T16:51:04+01:00 Update abi test with decrementing uniques - - - - - 6675b41c by Rodrigo Mesquita at 2024-07-29T16:51:04+01:00 distinct-constructor-tables determinism - - - - - f9e4651d by Rodrigo Mesquita at 2024-07-29T16:51:04+01:00 Rename deterministically CmmGroups in generateCgIPEStub - - - - - 3759003a by Rodrigo Mesquita at 2024-07-29T16:51:04+01:00 Twekas to script check - - - - - 9 changed files: - .gitlab/ci.sh - compiler/GHC/Driver/GenerateCgIPEStub.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Stg/Debug.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Utils.hs - compiler/GHC/Types/IPE.hs - compiler/GHC/Types/Name.hs - testsuite/tests/determinism/object/check-standalone.sh Changes: ===================================== .gitlab/ci.sh ===================================== @@ -701,6 +701,12 @@ function cabal_abi_test() { if [ -z "$OUT" ]; then fail "OUT not set" fi + if [ -z "$REVERSE_UNIQUES" ]; then + EXTRA_OPTS="" + else + # Count uniques in reverse one of the runs to get more non-determinism exposed + EXTRA_OPTS="-dinitial-unique=16777215 -dunique-increment=-1" + fi cp -r libraries/Cabal $DIR pushd $DIR @@ -711,6 +717,8 @@ function cabal_abi_test() { run "$HC" \ -hidir tmp -odir tmp -fforce-recomp -haddock \ -iCabal/Cabal/src -XNoPolyKinds Distribution.Simple -j"$cores" \ + -fobject-determinism \ + $EXTRA_OPTS \ "$@" 2>&1 | tee $OUT/log summarise_hi_files summarise_o_files @@ -784,6 +792,8 @@ function check_objects(){ fail "Mismatched object: $dump" fi done + + fail "Some objects are mismatched, but theres no diff with --all-headers or --disassemble-all. Perhaps try objdump -s" fi } @@ -798,7 +808,7 @@ function run_abi_test() { fi mkdir -p out OUT="$PWD/out/run1" DIR=$(mktemp -d XXXX-looooooooong) cabal_abi_test -O0 - OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) cabal_abi_test -O0 + OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) REVERSE_UNIQUES="yes" cabal_abi_test -O0 check_interfaces out/run1 out/run2 abis "Mismatched ABI hash" check_interfaces out/run1 out/run2 interfaces "Mismatched interface hashes" check_objects out/run1 out/run2 ===================================== compiler/GHC/Driver/GenerateCgIPEStub.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Unit.Module (moduleNameString) import qualified GHC.Utils.Logger as Logger import GHC.Utils.Outputable (ppr) import GHC.Types.Unique.DSM +import GHC.Cmm.UniqueRenamer {- Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)] @@ -199,9 +200,10 @@ generateCgIPEStub , Map CmmInfoTable (Maybe IpeSourceLocation) , IPEStats , DUniqSupply + , DetUniqFM ) -> Stream IO CmmGroupSRTs CmmCgInfos -generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus) = do +generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus, detRnEnv) = do let dflags = hsc_dflags hsc_env platform = targetPlatform dflags logger = hsc_logger hsc_env @@ -213,9 +215,9 @@ generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesW let denv' = denv {provInfoTables = Map.mapKeys cit_lbl infoTablesWithTickishes} ((mIpeStub, ipeCmmGroup), _) = runC (initStgToCmmConfig dflags this_mod) fstate cgState $ getCmm (initInfoTableProv initStats (Map.keys infoTablesWithTickishes) denv') - -- TODO: Renaming here + (_detRnEnv', rn_ipeCmmGroup) = detRenameCmmGroup detRnEnv ipeCmmGroup - (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus (removeDeterm ipeCmmGroup) + (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus rn_ipeCmmGroup Stream.yield ipeCmmGroupSRTs ipeStub <- ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -215,6 +215,7 @@ import GHC.Cmm.Info.Build import GHC.Cmm.Pipeline import GHC.Cmm.Info import GHC.Cmm.Parser +import GHC.Cmm.UniqueRenamer import GHC.Unit import GHC.Unit.Env @@ -299,7 +300,6 @@ import GHC.Stg.InferTags.TagSig (seqTagSig) import GHC.StgToCmm.Utils (IPEStats) import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import GHC.Types.Unique.DSM import GHC.Cmm.Config (CmmConfig) {- ********************************************************************** @@ -2172,11 +2172,11 @@ doCodeGen hsc_env this_mod denv data_tycons putDumpFileMaybe logger Opt_D_dump_stg_final "Final STG:" FormatSTG (pprGenStgTopBindings stg_ppr_opts stg_binds_w_fvs) - let stg_to_cmm dflags mod = case stgToCmmHook hooks of - Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) - Just h -> h (initStgToCmmConfig dflags mod) + let stg_to_cmm dflags mod a b c d e = case stgToCmmHook hooks of + Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) a b c d e + Just h -> (,emptyDetUFM) <$> h (initStgToCmmConfig dflags mod) a b c d e - let cmm_stream :: Stream IO CmmGroup ModuleLFInfos + let cmm_stream :: Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) -- See Note [Forcing of stg_binds] cmm_stream = stg_binds_w_fvs `seqList` {-# SCC "StgToCmm" #-} stg_to_cmm dflags this_mod denv data_tycons cost_centre_info stg_binds_w_fvs hpc_info @@ -2198,11 +2198,11 @@ doCodeGen hsc_env this_mod denv data_tycons pipeline_stream :: Stream IO CmmGroupSRTs CmmCgInfos pipeline_stream = do - ((mod_srt_info, ipes, ipe_stats, dus), lf_infos) <- + ((mod_srt_info, ipes, ipe_stats, dus), (lf_infos, detRnEnv)) <- {-# SCC "cmmPipeline" #-} Stream.mapAccumL_ (pipeline_action logger cmm_config) (emptySRT this_mod, M.empty, mempty, initDUniqSupply 'u' 1) ppr_stream1 let nonCaffySet = srtMapNonCAFs (moduleSRTMap mod_srt_info) - cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus) + cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus, detRnEnv) return cmmCgInfos pipeline_action ===================================== compiler/GHC/Stg/Debug.hs ===================================== @@ -11,6 +11,7 @@ import GHC.Prelude import GHC.Stg.Syntax +import GHC.Types.Unique.DFM import GHC.Types.Id import GHC.Types.Tickish import GHC.Core.DataCon @@ -166,13 +167,13 @@ numberDataCon dc ts = do env <- lift get mcc <- asks rSpan let !mbest_span = (\(SpanWithLabel rss l) -> (rss, l)) <$> (selectTick ts <|> mcc) - let !dcMap' = alterUniqMap (maybe (Just ((0, mbest_span) :| [] )) - (\xs@((k, _):|_) -> Just $! ((k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc + let !dcMap' = alterUDFM (maybe (Just (dc, (0, mbest_span) :| [] )) + (\(_dc, xs@((k, _):|_)) -> Just $! (dc, (k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc lift $ put (env { provDC = dcMap' }) - let r = lookupUniqMap dcMap' dc + let r = lookupUDFM dcMap' dc return $ case r of Nothing -> NoNumber - Just res -> Numbered (fst (NE.head res)) + Just (_, res) -> Numbered (fst (NE.head res)) selectTick :: [StgTickish] -> Maybe SpanWithLabel selectTick [] = Nothing ===================================== compiler/GHC/StgToCmm.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Id.Info import GHC.Types.RepType import GHC.Types.Basic import GHC.Types.Var.Set ( isEmptyDVarSet ) +import GHC.Types.Unique.DFM import GHC.Types.Unique.FM import GHC.Types.Name.Env @@ -60,7 +61,6 @@ import GHC.Utils.TmpFs import GHC.Data.Stream import GHC.Data.OrdList -import GHC.Types.Unique.Map import Control.Monad (when,void, forM_) import GHC.Utils.Misc @@ -77,10 +77,11 @@ codeGen :: Logger -> CollectedCCs -- (Local/global) cost-centres needing declaring/registering. -> [CgStgTopBinding] -- Bindings to convert -> HpcInfo - -> Stream IO CmmGroup ModuleLFInfos -- Output as a stream, so codegen can + -> Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) + -- Output as a stream, so codegen can -- be interleaved with output -codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons +codeGen logger tmpfs cfg (InfoTableProvMap denv _ _) data_tycons cost_centre_info stg_binds hpc_info = do { -- cg: run the code generator, and yield the resulting CmmGroup -- Using an IORef to store the state is a bit crude, but otherwise @@ -139,7 +140,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons -- Emit special info tables for everything used in this module -- This will only do something if `-fdistinct-info-tables` is turned on. - ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (nonDetEltsUFM denv) + ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (eltsUDFM denv) ; final_state <- liftIO (readIORef cgref) ; let cg_id_infos = cgs_binds final_state @@ -160,7 +161,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons ; rn_mapping <- liftIO (readIORef uniqRnRef) ; liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping) - ; return generatedInfo + ; return (generatedInfo, rn_mapping) } --------------------------------------------------------------- ===================================== compiler/GHC/StgToCmm/Utils.hs ===================================== @@ -90,7 +90,7 @@ import GHC.Types.Unique.Map import Data.Maybe import qualified Data.List.NonEmpty as NE import GHC.Core.DataCon -import GHC.Types.Unique.FM +import GHC.Types.Unique.DFM import GHC.Data.Maybe import Control.Monad import qualified Data.Map.Strict as Map @@ -673,7 +673,7 @@ pprIPEStats (IPEStats{..}) = -- for stack info tables skipped during 'generateCgIPEStub'. As the fold -- progresses, counts of tables per closure type will be accumulated. convertInfoProvMap :: StgToCmmConfig -> Module -> InfoTableProvMap -> IPEStats -> [CmmInfoTable] -> (IPEStats, [InfoProvEnt]) -convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTableToSourceLocationMap) initStats cmits = +convertInfoProvMap cfg this_mod (InfoTableProvMap dcenv denv infoTableToSourceLocationMap) initStats cmits = foldl' convertInfoProvMap' (initStats, []) cmits where convertInfoProvMap' :: (IPEStats, [InfoProvEnt]) -> CmmInfoTable -> (IPEStats, [InfoProvEnt]) @@ -694,7 +694,7 @@ convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTable lookupDataConMap = (closureIpeStats cn,) <$> do UsageSite _ n <- hasIdLabelInfo cl >>= getConInfoTableLocation -- This is a bit grimy, relies on the DataCon and Name having the same Unique, which they do - (dc, ns) <- hasHaskellName cl >>= lookupUFM_Directly dcenv . getUnique + (dc, ns) <- hasHaskellName cl >>= lookupUDFM_Directly dcenv . getUnique -- Lookup is linear but lists will be small (< 100) return $ (InfoProvEnt cl cn (tyString (dataConTyCon dc)) this_mod (join $ lookup n (NE.toList ns))) ===================================== compiler/GHC/Types/IPE.hs ===================================== @@ -13,6 +13,7 @@ import GHC.Data.FastString import GHC.Types.SrcLoc import GHC.Core.DataCon +import GHC.Types.Unique.DFM import GHC.Types.Unique.Map import GHC.Core.Type import Data.List.NonEmpty @@ -38,7 +39,7 @@ type ClosureMap = UniqMap Name -- The binding -- the constructor was used at, if possible and a string which names -- the source location. This is the same information as is the payload -- for the 'GHC.Core.SourceNote' constructor. -type DCMap = UniqMap DataCon (NonEmpty (Int, Maybe IpeSourceLocation)) +type DCMap = UniqDFM DataCon (DataCon, NonEmpty (Int, Maybe IpeSourceLocation)) type InfoTableToSourceLocationMap = Map.Map CLabel (Maybe IpeSourceLocation) @@ -49,4 +50,4 @@ data InfoTableProvMap = InfoTableProvMap } emptyInfoTableProvMap :: InfoTableProvMap -emptyInfoTableProvMap = InfoTableProvMap emptyUniqMap emptyUniqMap Map.empty +emptyInfoTableProvMap = InfoTableProvMap emptyUDFM emptyUniqMap Map.empty ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -716,9 +716,9 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) {-# SPECIALISE pprName :: Name -> SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable --- | Print fully qualified name (with unit-id, module and unique) +-- | Print fully qualified name (with unit-id, module but no unique) pprFullName :: Module -> Name -> SDoc -pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = +pprFullName this_mod Name{n_sort = sort, n_occ = occ} = let mod = case sort of WiredIn m _ _ -> m External m -> m @@ -727,8 +727,6 @@ pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = in ftext (unitIdFS (moduleUnitId mod)) <> colon <> ftext (moduleNameFS $ moduleName mod) <> dot <> ftext (occNameFS occ) - <> char '_' <> pprUniqueAlways uniq - -- | Print a ticky ticky styled name -- ===================================== testsuite/tests/determinism/object/check-standalone.sh ===================================== @@ -8,8 +8,8 @@ fi rm -rf objs1 objs2 cabal get Cabal-3.12.0.0 -cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -fobject-determinism -dumpdir=dumpout1 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out1 --ghc-options=-hidir=hiout1 Cabal +cabal build --enable-profiling --profiling-detail=late --enable-debug-info -w "$1" --ghc-options="-finfo-table-map -fdistinct-constructor-tables -fforce-recomp -j12 -ddump-to-file -fobject-determinism -dumpdir=dumpout1 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out1 --ghc-options=-hidir=hiout1 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out1 Cabal -cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism -dumpdir=dumpout2 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out2 --ghc-options=-hidir=hiout2 Cabal +cabal build --enable-profiling --profiling-detail=late --enable-debug-info -w "$1" --ghc-options="-finfo-table-map -fdistinct-constructor-tables -fforce-recomp -j12 -ddump-to-file -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism -dumpdir=dumpout2 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out2 --ghc-options=-hidir=hiout2 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out2 Cabal ./check.sh "$1" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3efabb930efc29d6d25ccabff8c1c05e25f5d0e8...3759003a5225cd193d5707c045a9659e81267f77 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3efabb930efc29d6d25ccabff8c1c05e25f5d0e8...3759003a5225cd193d5707c045a9659e81267f77 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:52:09 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Mon, 29 Jul 2024 11:52:09 -0400 Subject: [Git][ghc/ghc][wip/romes/12935] 6 commits: Don't print unique in pprFullName Message-ID: <66a7baa99e287_3956c2bacea842597@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/12935 at Glasgow Haskell Compiler / GHC Commits: eecf110c by Rodrigo Mesquita at 2024-07-26T14:36:34+01:00 Don't print unique in pprFullName This unique was leaking as part of the profiling description in info tables when profiling was enabled - - - - - e6081ac2 by Rodrigo Mesquita at 2024-07-26T15:14:02+01:00 Update abi test with decrementing uniques - - - - - 866f021e by Rodrigo Mesquita at 2024-07-29T15:45:43+01:00 distinct-constructor-tables determinism - - - - - 3efabb93 by Rodrigo Mesquita at 2024-07-29T16:49:04+01:00 Rename deterministically CmmGroups in generateCgIPEStub - - - - - 70a2efdb by Rodrigo Mesquita at 2024-07-29T16:50:35+01:00 fixup! Don't print unique in pprFullName - - - - - cb65deac by Rodrigo Mesquita at 2024-07-29T16:50:55+01:00 Twekas to script check - - - - - 9 changed files: - .gitlab/ci.sh - compiler/GHC/Driver/GenerateCgIPEStub.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Stg/Debug.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/StgToCmm/Utils.hs - compiler/GHC/Types/IPE.hs - compiler/GHC/Types/Name.hs - testsuite/tests/determinism/object/check-standalone.sh Changes: ===================================== .gitlab/ci.sh ===================================== @@ -701,6 +701,12 @@ function cabal_abi_test() { if [ -z "$OUT" ]; then fail "OUT not set" fi + if [ -z "$REVERSE_UNIQUES" ]; then + EXTRA_OPTS="" + else + # Count uniques in reverse one of the runs to get more non-determinism exposed + EXTRA_OPTS="-dinitial-unique=16777215 -dunique-increment=-1" + fi cp -r libraries/Cabal $DIR pushd $DIR @@ -711,6 +717,8 @@ function cabal_abi_test() { run "$HC" \ -hidir tmp -odir tmp -fforce-recomp -haddock \ -iCabal/Cabal/src -XNoPolyKinds Distribution.Simple -j"$cores" \ + -fobject-determinism \ + $EXTRA_OPTS \ "$@" 2>&1 | tee $OUT/log summarise_hi_files summarise_o_files @@ -784,6 +792,8 @@ function check_objects(){ fail "Mismatched object: $dump" fi done + + fail "Some objects are mismatched, but theres no diff with --all-headers or --disassemble-all. Perhaps try objdump -s" fi } @@ -798,7 +808,7 @@ function run_abi_test() { fi mkdir -p out OUT="$PWD/out/run1" DIR=$(mktemp -d XXXX-looooooooong) cabal_abi_test -O0 - OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) cabal_abi_test -O0 + OUT="$PWD/out/run2" DIR=$(mktemp -d XXXX-short) REVERSE_UNIQUES="yes" cabal_abi_test -O0 check_interfaces out/run1 out/run2 abis "Mismatched ABI hash" check_interfaces out/run1 out/run2 interfaces "Mismatched interface hashes" check_objects out/run1 out/run2 ===================================== compiler/GHC/Driver/GenerateCgIPEStub.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Unit.Module (moduleNameString) import qualified GHC.Utils.Logger as Logger import GHC.Utils.Outputable (ppr) import GHC.Types.Unique.DSM +import GHC.Cmm.UniqueRenamer {- Note [Stacktraces from Info Table Provenance Entries (IPE based stack unwinding)] @@ -199,9 +200,10 @@ generateCgIPEStub , Map CmmInfoTable (Maybe IpeSourceLocation) , IPEStats , DUniqSupply + , DetUniqFM ) -> Stream IO CmmGroupSRTs CmmCgInfos -generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus) = do +generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesWithTickishes, initStats, dus, detRnEnv) = do let dflags = hsc_dflags hsc_env platform = targetPlatform dflags logger = hsc_logger hsc_env @@ -213,9 +215,9 @@ generateCgIPEStub hsc_env this_mod denv (nonCaffySet, moduleLFInfos, infoTablesW let denv' = denv {provInfoTables = Map.mapKeys cit_lbl infoTablesWithTickishes} ((mIpeStub, ipeCmmGroup), _) = runC (initStgToCmmConfig dflags this_mod) fstate cgState $ getCmm (initInfoTableProv initStats (Map.keys infoTablesWithTickishes) denv') - -- TODO: Renaming here + (_detRnEnv', rn_ipeCmmGroup) = detRenameCmmGroup detRnEnv ipeCmmGroup - (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus (removeDeterm ipeCmmGroup) + (_, _, ipeCmmGroupSRTs) <- liftIO $ cmmPipeline logger cmm_cfg (emptySRT this_mod) dus rn_ipeCmmGroup Stream.yield ipeCmmGroupSRTs ipeStub <- ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -215,6 +215,7 @@ import GHC.Cmm.Info.Build import GHC.Cmm.Pipeline import GHC.Cmm.Info import GHC.Cmm.Parser +import GHC.Cmm.UniqueRenamer import GHC.Unit import GHC.Unit.Env @@ -299,7 +300,6 @@ import GHC.Stg.InferTags.TagSig (seqTagSig) import GHC.StgToCmm.Utils (IPEStats) import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import GHC.Types.Unique.DSM import GHC.Cmm.Config (CmmConfig) {- ********************************************************************** @@ -2172,11 +2172,11 @@ doCodeGen hsc_env this_mod denv data_tycons putDumpFileMaybe logger Opt_D_dump_stg_final "Final STG:" FormatSTG (pprGenStgTopBindings stg_ppr_opts stg_binds_w_fvs) - let stg_to_cmm dflags mod = case stgToCmmHook hooks of - Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) - Just h -> h (initStgToCmmConfig dflags mod) + let stg_to_cmm dflags mod a b c d e = case stgToCmmHook hooks of + Nothing -> StgToCmm.codeGen logger tmpfs (initStgToCmmConfig dflags mod) a b c d e + Just h -> (,emptyDetUFM) <$> h (initStgToCmmConfig dflags mod) a b c d e - let cmm_stream :: Stream IO CmmGroup ModuleLFInfos + let cmm_stream :: Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) -- See Note [Forcing of stg_binds] cmm_stream = stg_binds_w_fvs `seqList` {-# SCC "StgToCmm" #-} stg_to_cmm dflags this_mod denv data_tycons cost_centre_info stg_binds_w_fvs hpc_info @@ -2198,11 +2198,11 @@ doCodeGen hsc_env this_mod denv data_tycons pipeline_stream :: Stream IO CmmGroupSRTs CmmCgInfos pipeline_stream = do - ((mod_srt_info, ipes, ipe_stats, dus), lf_infos) <- + ((mod_srt_info, ipes, ipe_stats, dus), (lf_infos, detRnEnv)) <- {-# SCC "cmmPipeline" #-} Stream.mapAccumL_ (pipeline_action logger cmm_config) (emptySRT this_mod, M.empty, mempty, initDUniqSupply 'u' 1) ppr_stream1 let nonCaffySet = srtMapNonCAFs (moduleSRTMap mod_srt_info) - cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus) + cmmCgInfos <- generateCgIPEStub hsc_env this_mod denv (nonCaffySet, lf_infos, ipes, ipe_stats, dus, detRnEnv) return cmmCgInfos pipeline_action ===================================== compiler/GHC/Stg/Debug.hs ===================================== @@ -11,6 +11,7 @@ import GHC.Prelude import GHC.Stg.Syntax +import GHC.Types.Unique.DFM import GHC.Types.Id import GHC.Types.Tickish import GHC.Core.DataCon @@ -166,13 +167,13 @@ numberDataCon dc ts = do env <- lift get mcc <- asks rSpan let !mbest_span = (\(SpanWithLabel rss l) -> (rss, l)) <$> (selectTick ts <|> mcc) - let !dcMap' = alterUniqMap (maybe (Just ((0, mbest_span) :| [] )) - (\xs@((k, _):|_) -> Just $! ((k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc + let !dcMap' = alterUDFM (maybe (Just (dc, (0, mbest_span) :| [] )) + (\(_dc, xs@((k, _):|_)) -> Just $! (dc, (k + 1, mbest_span) `NE.cons` xs))) (provDC env) dc lift $ put (env { provDC = dcMap' }) - let r = lookupUniqMap dcMap' dc + let r = lookupUDFM dcMap' dc return $ case r of Nothing -> NoNumber - Just res -> Numbered (fst (NE.head res)) + Just (_, res) -> Numbered (fst (NE.head res)) selectTick :: [StgTickish] -> Maybe SpanWithLabel selectTick [] = Nothing ===================================== compiler/GHC/StgToCmm.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Id.Info import GHC.Types.RepType import GHC.Types.Basic import GHC.Types.Var.Set ( isEmptyDVarSet ) +import GHC.Types.Unique.DFM import GHC.Types.Unique.FM import GHC.Types.Name.Env @@ -60,7 +61,6 @@ import GHC.Utils.TmpFs import GHC.Data.Stream import GHC.Data.OrdList -import GHC.Types.Unique.Map import Control.Monad (when,void, forM_) import GHC.Utils.Misc @@ -77,10 +77,11 @@ codeGen :: Logger -> CollectedCCs -- (Local/global) cost-centres needing declaring/registering. -> [CgStgTopBinding] -- Bindings to convert -> HpcInfo - -> Stream IO CmmGroup ModuleLFInfos -- Output as a stream, so codegen can + -> Stream IO CmmGroup (ModuleLFInfos, DetUniqFM) + -- Output as a stream, so codegen can -- be interleaved with output -codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons +codeGen logger tmpfs cfg (InfoTableProvMap denv _ _) data_tycons cost_centre_info stg_binds hpc_info = do { -- cg: run the code generator, and yield the resulting CmmGroup -- Using an IORef to store the state is a bit crude, but otherwise @@ -139,7 +140,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons -- Emit special info tables for everything used in this module -- This will only do something if `-fdistinct-info-tables` is turned on. - ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (nonDetEltsUFM denv) + ; mapM_ (\(dc, ns) -> forM_ ns $ \(k, _ss) -> cg (cgDataCon (UsageSite (stgToCmmThisModule cfg) k) dc)) (eltsUDFM denv) ; final_state <- liftIO (readIORef cgref) ; let cg_id_infos = cgs_binds final_state @@ -160,7 +161,7 @@ codeGen logger tmpfs cfg (InfoTableProvMap (UniqMap denv) _ _) data_tycons ; rn_mapping <- liftIO (readIORef uniqRnRef) ; liftIO $ debugTraceMsg logger 3 (text "DetRnM mapping:" <+> ppr rn_mapping) - ; return generatedInfo + ; return (generatedInfo, rn_mapping) } --------------------------------------------------------------- ===================================== compiler/GHC/StgToCmm/Utils.hs ===================================== @@ -90,7 +90,7 @@ import GHC.Types.Unique.Map import Data.Maybe import qualified Data.List.NonEmpty as NE import GHC.Core.DataCon -import GHC.Types.Unique.FM +import GHC.Types.Unique.DFM import GHC.Data.Maybe import Control.Monad import qualified Data.Map.Strict as Map @@ -673,7 +673,7 @@ pprIPEStats (IPEStats{..}) = -- for stack info tables skipped during 'generateCgIPEStub'. As the fold -- progresses, counts of tables per closure type will be accumulated. convertInfoProvMap :: StgToCmmConfig -> Module -> InfoTableProvMap -> IPEStats -> [CmmInfoTable] -> (IPEStats, [InfoProvEnt]) -convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTableToSourceLocationMap) initStats cmits = +convertInfoProvMap cfg this_mod (InfoTableProvMap dcenv denv infoTableToSourceLocationMap) initStats cmits = foldl' convertInfoProvMap' (initStats, []) cmits where convertInfoProvMap' :: (IPEStats, [InfoProvEnt]) -> CmmInfoTable -> (IPEStats, [InfoProvEnt]) @@ -694,7 +694,7 @@ convertInfoProvMap cfg this_mod (InfoTableProvMap (UniqMap dcenv) denv infoTable lookupDataConMap = (closureIpeStats cn,) <$> do UsageSite _ n <- hasIdLabelInfo cl >>= getConInfoTableLocation -- This is a bit grimy, relies on the DataCon and Name having the same Unique, which they do - (dc, ns) <- hasHaskellName cl >>= lookupUFM_Directly dcenv . getUnique + (dc, ns) <- hasHaskellName cl >>= lookupUDFM_Directly dcenv . getUnique -- Lookup is linear but lists will be small (< 100) return $ (InfoProvEnt cl cn (tyString (dataConTyCon dc)) this_mod (join $ lookup n (NE.toList ns))) ===================================== compiler/GHC/Types/IPE.hs ===================================== @@ -13,6 +13,7 @@ import GHC.Data.FastString import GHC.Types.SrcLoc import GHC.Core.DataCon +import GHC.Types.Unique.DFM import GHC.Types.Unique.Map import GHC.Core.Type import Data.List.NonEmpty @@ -38,7 +39,7 @@ type ClosureMap = UniqMap Name -- The binding -- the constructor was used at, if possible and a string which names -- the source location. This is the same information as is the payload -- for the 'GHC.Core.SourceNote' constructor. -type DCMap = UniqMap DataCon (NonEmpty (Int, Maybe IpeSourceLocation)) +type DCMap = UniqDFM DataCon (DataCon, NonEmpty (Int, Maybe IpeSourceLocation)) type InfoTableToSourceLocationMap = Map.Map CLabel (Maybe IpeSourceLocation) @@ -49,4 +50,4 @@ data InfoTableProvMap = InfoTableProvMap } emptyInfoTableProvMap :: InfoTableProvMap -emptyInfoTableProvMap = InfoTableProvMap emptyUniqMap emptyUniqMap Map.empty +emptyInfoTableProvMap = InfoTableProvMap emptyUDFM emptyUniqMap Map.empty ===================================== compiler/GHC/Types/Name.hs ===================================== @@ -716,9 +716,9 @@ pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) {-# SPECIALISE pprName :: Name -> SDoc #-} {-# SPECIALISE pprName :: Name -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable --- | Print fully qualified name (with unit-id, module and unique) +-- | Print fully qualified name (with unit-id, module but no unique) pprFullName :: Module -> Name -> SDoc -pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = +pprFullName this_mod Name{n_sort = sort, n_occ = occ} = let mod = case sort of WiredIn m _ _ -> m External m -> m @@ -727,8 +727,6 @@ pprFullName this_mod Name{n_sort = sort, n_uniq = uniq, n_occ = occ} = in ftext (unitIdFS (moduleUnitId mod)) <> colon <> ftext (moduleNameFS $ moduleName mod) <> dot <> ftext (occNameFS occ) - <> char '_' <> pprUniqueAlways uniq - -- | Print a ticky ticky styled name -- ===================================== testsuite/tests/determinism/object/check-standalone.sh ===================================== @@ -8,8 +8,8 @@ fi rm -rf objs1 objs2 cabal get Cabal-3.12.0.0 -cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -fobject-determinism -dumpdir=dumpout1 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out1 --ghc-options=-hidir=hiout1 Cabal +cabal build --enable-profiling --profiling-detail=late --enable-debug-info -w "$1" --ghc-options="-finfo-table-map -fdistinct-constructor-tables -fforce-recomp -j12 -ddump-to-file -fobject-determinism -dumpdir=dumpout1 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out1 --ghc-options=-hidir=hiout1 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out1 Cabal -cabal build --enable-profiling -w "$1" --ghc-options="-fforce-recomp -j12 -ddump-to-file -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism -dumpdir=dumpout2 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out2 --ghc-options=-hidir=hiout2 Cabal +cabal build --enable-profiling --profiling-detail=late --enable-debug-info -w "$1" --ghc-options="-finfo-table-map -fdistinct-constructor-tables -fforce-recomp -j12 -ddump-to-file -dinitial-unique=16777215 -dunique-increment=-1 -fobject-determinism -dumpdir=dumpout2 -ddump-simpl -ddump-stg-final -ddump-cmm" --ghc-options=-odir=out2 --ghc-options=-hidir=hiout2 Cabal # cabal build -w $1 --ghc-options="-fforce-recomp -j4" --ghc-options=-odir=out2 Cabal ./check.sh "$1" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3759003a5225cd193d5707c045a9659e81267f77...cb65deac230dd2881c5a4107339ebee6000abbae -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3759003a5225cd193d5707c045a9659e81267f77...cb65deac230dd2881c5a4107339ebee6000abbae You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:52:57 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 29 Jul 2024 11:52:57 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] 7 commits: The X86 SIMD patch. Message-ID: <66a7bad9b3893_3956c2aae3e44328a@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 14a66cff by sheaf at 2024-07-29T17:52:01+02:00 The X86 SIMD patch. This commit adds support for 128 bit wide SIMD vectors and vector operations to GHC's X86 native code generator. Main changes: - Introduction of vector formats (`GHC.CmmToAsm.Format`) - Introduction of 128-bit virtual register (`GHC.Platform.Reg`), and removal of unused Float virtual register. - Refactor of `GHC.Platform.Reg.Class.RegClass`: it now only contains two classes, `RcInteger` (for general purpose registers) and `RcFloatOrVector` (for registers that can be used for scalar floating point values as well as vectors). - Modify `GHC.CmmToAsm.X86.Instr.regUsageOfInstr` to keep track of which format each register is used at, so that the register allocator can know if it needs to spill the entire vector register or just the lower 64 bits. - Modify spill/load/reg-2-reg code to account for vector registers (`GHC.CmmToAsm.X86.Instr.{mkSpillInstr, mkLoadInstr, mkRegRegMoveInstr, takeRegRegMoveInstr}`). - Modify the register allocator code (`GHC.CmmToAsm.Reg.*`) to propagate the format we are storing in any given register, for instance changing `Reg` to `RegFormat` or `GlobalReg` to `GlobalRegUse`. - Add logic to lower vector `MachOp`s to X86 assembly (see `GHC.CmmToAsm.X86.CodeGen`) - Minor cleanups to genprimopcode, to remove the llvm_only attribute which is no longer applicable. Tests for this feature are provided in the "testsuite/tests/simd" directory. Fixes #7741 Keeping track of register formats adds a small memory overhead to the register allocator (in particular, regUsageOfInstr now allocates more to keep track of the `Format` each register is used at). This explains the following metric increases. ------------------------- Metric Increase: T12707 T13035 T13379 T3294 T4801 T5321FD T5321Fun T783 ------------------------- - - - - - 6fb4eb55 by sheaf at 2024-07-29T17:52:01+02:00 Use xmm registers in genapply This commit updates genapply to use xmm, ymm and zmm registers, for stg_ap_v16/stg_ap_v32/stg_ap_v64, respectively. It also updates the Cmm lexer and parser to produce Cmm vectors rather than 128/256/512 bit wide scalars for V16/V32/V64, removing bits128, bits256 and bits512 in favour of vectors. The Cmm Lint check is weakened for vectors, as (in practice, e.g. on X86) it is okay to use a single vector register to hold multiple different types of data, and we don't know just from seeing e.g. "XMM1" how to interpret the 128 bits of data within. Fixes #25062 - - - - - 5cd87e19 by sheaf at 2024-07-29T17:52:01+02:00 Add vector fused multiply-add operations This commit adds fused multiply add operations such as `fmaddDoubleX2#`. These are handled both in the X86 NCG and the LLVM backends. - - - - - e19cdc1b by sheaf at 2024-07-29T17:52:02+02:00 Add vector shuffle primops This adds vector shuffle primops, such as ``` shuffleFloatX4# :: FloatX4# -> FloatX4# -> (# Int#, Int#, Int#, Int# #) -> FloatX4# ``` which shuffle the components of the input two vectors into the output vector. NB: the indices must be compile time literals, to match the X86 SHUFPD instruction immediate and the LLVM shufflevector instruction. These are handled in the X86 NCG and the LLVM backend. Tested in simd009. - - - - - 74fb37d1 by sheaf at 2024-07-29T17:52:02+02:00 Add Broadcast MachOps This adds proper MachOps for broadcast instructions, allowing us to produce better code for broadcasting a value than simply packing that value (doing many vector insertions in a row). These are lowered in the X86 NCG and LLVM backends. In the LLVM backend, it uses the previously introduced shuffle instructions. - - - - - 9de5c813 by sheaf at 2024-07-29T17:52:02+02:00 Fix treatment of signed zero in vector negation This commit fixes the handling of signed zero in floating-point vector negation. A slight hack was introduced to work around the fact that Cmm doesn't currently have a notion of signed floating point literals (see get_float_broadcast_value_reg). This can be removed once CmmFloat can express the value -0.0. The simd006 test has been updated to use a stricter notion of equality of floating-point values, which ensure the validity of this change. - - - - - a61eab22 by sheaf at 2024-07-29T17:52:03+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in the X86, AArch64 and PowerPC NCGs, as well as in the LLVM backend. - - - - - 30 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/CallConv.hs - compiler/GHC/Cmm/Graph.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Lint.hs - compiler/GHC/Cmm/Liveness.hs - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/ProcPoint.hs - compiler/GHC/Cmm/Reg.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/Cmm/Type.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Config.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/PPC.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0b74c5c83dfb886c869930e149218758057d7ba...a61eab2270bce88b4317807cd9c3ab414a3fbf84 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0b74c5c83dfb886c869930e149218758057d7ba...a61eab2270bce88b4317807cd9c3ab414a3fbf84 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:54:42 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 29 Jul 2024 11:54:42 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] Deleted 1 commit: add location information to expanded expression Message-ID: <66a7bb429981_3956c2da38b0439af@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: dc9ab2da by Apoorv Ingle at 2024-07-29T09:59:33-05:00 add location information to expanded expression - - - - - 7 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -476,7 +476,7 @@ type instance XXExpr GhcTc = XXExprGhcTc -- | The different source constructs that we use to instantiate the "original" field -- in an `XXExprGhcRn original expansion` -- See Note [Handling overloaded and rebindable constructs] in `GHC.Rename.Expr` -data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression +data HsThingRn = OrigExpr (HsExpr GhcRn) -- ^ The source, user written, expression | OrigStmt (ExprLStmt GhcRn) HsDoFlavour -- ^ which kind of do-block did this statement come from | OrigPat (LPat GhcRn) -- ^ The source, user written, pattern HsDoFlavour -- ^ which kind of do-block did this statement come from @@ -494,7 +494,7 @@ isHsThingRnPat _ = False data XXExprGhcRn = ExpandedThingRn { xrn_orig :: HsThingRn -- The original source thing to be used for error messages - , xrn_expanded :: HsExpr GhcRn -- The compiler generated expanded thing + , xrn_expanded :: LHsExpr GhcRn -- The expanded thing can be user written or compiler generated , xrn_doTcApp :: Bool } -- A Hint to the type checker of how to proceed -- True <=> use GHC.Tc.Gen.Expr.tcApp on xrn_expanded -- False <=> use GHC.Tc.Gen.Expr.tcExpr on xrn_expanded @@ -519,7 +519,7 @@ mkPopErrCtxtExprAt loc a = L loc $ mkPopErrCtxtExpr a -- expanded expressions. mkExpandedExpr :: HsExpr GhcRn -- ^ source expression - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedExpr oExpr eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigExpr oExpr , xrn_expanded = eExpr @@ -532,7 +532,7 @@ mkExpandedStmt :: ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ source statement do flavour -> Bool -- ^ should this be type checked using tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmt oStmt flav doTcApp eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigStmt oStmt flav , xrn_expanded = eExpr @@ -542,7 +542,7 @@ mkExpandedPatRn :: LPat GhcRn -- ^ source pattern -> HsDoFlavour -- ^ source statement do flavour -> Maybe (ExprLStmt GhcRn) -- ^ pattern statement origin - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> HsExpr GhcRn -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = OrigPat oPat flav mb_stmt , xrn_expanded = eExpr @@ -553,17 +553,17 @@ mkExpandedPatRn oPat flav mb_stmt eExpr = XExpr (ExpandedThingRn { xrn_orig = Or -- expanded expression and associate it with a provided location mkExpandedStmtAt :: Bool -- ^ Wrap this expansion with a pop? - -> SrcSpanAnnA -- ^ Location for the expansion expression -> ExprLStmt GhcRn -- ^ source statement -> HsDoFlavour -- ^ the flavour of the statement -> Bool -- ^ should type check with tcApp? - -> HsExpr GhcRn -- ^ expanded expression + -> LHsExpr GhcRn -- ^ expanded expression -> LHsExpr GhcRn -- ^ suitably wrapped located 'XXExprGhcRn' -mkExpandedStmtAt addPop loc oStmt flav doTcApp eExpr +mkExpandedStmtAt addPop oStmt flav doTcApp eExpr | addPop - = mkPopErrCtxtExprAt loc (L loc $ mkExpandedStmt oStmt flav doTcApp eExpr) + = L (noAnnSrcSpan generatedSrcSpan) (mkPopErrCtxtExpr (L (noAnnSrcSpan generatedSrcSpan) + $ mkExpandedStmt oStmt flav doTcApp eExpr)) | otherwise - = L loc $ mkExpandedStmt oStmt flav doTcApp eExpr + = L (noAnnSrcSpan generatedSrcSpan) (mkExpandedStmt oStmt flav doTcApp eExpr) data XXExprGhcTc = WrapExpr -- Type and evidence application and abstractions @@ -572,7 +572,7 @@ data XXExprGhcTc | ExpandedThingTc -- See Note [Rebindable syntax and XXExprGhcRn] -- See Note [Expanding HsDo with XXExprGhcRn] in `GHC.Tc.Gen.Do` { xtc_orig :: HsThingRn -- The original user written thing - , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression + , xtc_expanded :: HsExpr GhcTc } -- The expanded typechecked expression | ConLikeTc -- Result of typechecking a data-con -- See Note [Typechecking data constructors] in @@ -607,7 +607,7 @@ mkExpandedExprTc oExpr eExpr = XExpr (ExpandedThingTc (OrigExpr oExpr) eExpr) -- expanded typechecked expression. mkExpandedStmtTc :: ExprLStmt GhcRn -- ^ source do statement - -> HsDoFlavour + -> HsDoFlavour -- ^ the flavour of this statement -> HsExpr GhcTc -- ^ expanded typechecked expression -> HsExpr GhcTc -- ^ suitably wrapped 'XXExprGhcRn' mkExpandedStmtTc oStmt flav eExpr = XExpr (ExpandedThingTc (OrigStmt oStmt flav) eExpr) ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -1683,7 +1683,7 @@ repE (HsProjection _ xs) = repProjection (fmap (field_label . unLoc . dfoLabel . repE (HsEmbTy _ t) = do t1 <- repLTy (hswc_body t) rep2 typeEName [unC t1] -repE e@(XExpr (ExpandedThingRn o x _)) +repE e@(XExpr (ExpandedThingRn o (L _ x) _)) | OrigExpr e <- o = do { rebindable_on <- lift $ xoptM LangExt.RebindableSyntax ; if rebindable_on -- See Note [Quotation and rebindable syntax] ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -360,7 +360,7 @@ rnExpr (HsUnboundVar _ v) rnExpr (HsOverLabel src v) = do { (from_label, fvs) <- lookupSyntaxName fromLabelClassOpName ; return ( mkExpandedExpr (HsOverLabel src v) $ - HsAppType noExtField (genLHsVar from_label) hs_ty_arg + wrapGenSpan (HsAppType noExtField (genLHsVar from_label) hs_ty_arg) , fvs ) } where hs_ty_arg = mkEmptyWildCardBndrs $ wrapGenSpan $ @@ -435,7 +435,7 @@ rnExpr (HsGetField _ e f) ; let f' = rnDotFieldOcc f ; return ( mkExpandedExpr (HsGetField noExtField e f') - (mkGetField getField e (fmap (unLoc . dfoLabel) f')) + (wrapGenSpan (mkGetField getField e (fmap (unLoc . dfoLabel) f'))) , fv_e `plusFV` fv_getField ) } rnExpr (HsProjection _ fs) @@ -444,7 +444,7 @@ rnExpr (HsProjection _ fs) ; let fs' = fmap rnDotFieldOcc fs ; return ( mkExpandedExpr (HsProjection noExtField fs') - (mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')) + (wrapGenSpan ((mkProjection getField circ (fmap (fmap (unLoc . dfoLabel)) fs')))) , unitFV circ `plusFV` fv_getField) } ------------------------------------------ @@ -516,7 +516,7 @@ rnExpr (ExplicitList _ exps) lit_n = mkIntegralLit (length exps) hs_lit = genHsIntegralLit lit_n exp_list = genHsApps' (L (noAnnSrcSpan loc) from_list_n_name) [hs_lit, wrapGenSpan rn_list] - ; return ( mkExpandedExpr rn_list exp_list + ; return ( mkExpandedExpr rn_list (wrapGenSpan exp_list) , fvs `plusFV` fvs') } } rnExpr (ExplicitTuple _ tup_args boxity) @@ -578,7 +578,7 @@ rnExpr (RecordUpd { rupd_expr = L l expr, rupd_flds = rbinds }) , olRecUpdFields = us } ; return ( mkExpandedExpr (RecordUpd noExtField (L l e) upd_flds) - (mkRecordDotUpd getField setField (L l e) us) + (wrapGenSpan $ mkRecordDotUpd getField setField (L l e) us) , plusFVs [fv_getField, fv_setField, fv_e, fv_us] ) } rnExpr (HsRecSel x _) = dataConCantHappen x @@ -669,17 +669,17 @@ rnSection :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) -- See Note [Parsing sections] in GHC.Parser -- Also see Note [Handling overloaded and rebindable constructs] -rnSection section@(SectionR x op expr) +rnSection section@(SectionR x op@(L op_loc _) expr@(L expr_loc _)) -- See Note [Left and right sections] = do { (op', fvs_op) <- rnLExpr op ; (expr', fvs_expr) <- rnLExpr expr ; checkSectionPrec InfixR section op' expr' ; let rn_section = SectionR x op' expr' - ds_section = genHsApps rightSectionName [op',expr'] + ds_section = L (combineSrcSpansA op_loc expr_loc) (genHsApps rightSectionName [op',expr']) ; return ( mkExpandedExpr rn_section ds_section , fvs_op `plusFV` fvs_expr) } -rnSection section@(SectionL x expr op) +rnSection section@(SectionL x expr@(L expr_loc _) op@(L op_loc _)) -- See Note [Left and right sections] = do { (expr', fvs_expr) <- rnLExpr expr ; (op', fvs_op) <- rnLExpr op @@ -691,7 +691,7 @@ rnSection section@(SectionL x expr op) | postfix_ops = HsApp noExtField op' expr' | otherwise = genHsApps leftSectionName [wrapGenSpan $ HsApp noExtField op' expr'] - ; return ( mkExpandedExpr rn_section ds_section + ; return ( mkExpandedExpr rn_section (L (combineSrcSpansA expr_loc op_loc) ds_section) , fvs_op `plusFV` fvs_expr) } rnSection other = pprPanic "rnSection" (ppr other) @@ -2806,7 +2806,7 @@ rnHsIf p b1 b2 -> return (rn_if, fvs_if) Just ite_name -- Rebindable-syntax case - -> do { let ds_if = genHsApps ite_name [p', b1', b2'] + -> do { let ds_if = wrapGenSpan (genHsApps ite_name [p', b1', b2']) fvs = plusFVs [fvs_if, unitFV ite_name] ; return (mkExpandedExpr rn_if ds_if, fvs) } } ===================================== compiler/GHC/Tc/Gen/App.hs ===================================== @@ -874,7 +874,7 @@ looks_like_type_arg _ = False addArgCtxt :: AppCtxt -> LHsExpr GhcRn -> TcM a -> TcM a --- There are four cases: +-- There are three cases: -- 1. In the normal case, we add an informative context -- "In the third argument of f, namely blah" -- 2. If we are deep inside generated code (`isGeneratedCode` is `True`) @@ -883,18 +883,10 @@ addArgCtxt :: AppCtxt -> LHsExpr GhcRn -- "In the expression: arg" -- Unless the arg is also a generated thing, in which case do nothing. -- See Note [Rebindable syntax and XXExprGhcRn] in GHC.Hs.Expr --- 3. We are in an expanded `do`-block's non-bind statement +-- 3. We are in an expanded `do`-block's statement -- we simply add the statement context -- "In the statement of the `do`-block .." --- 4. We are in an expanded do block's bind statement --- a. Then either we are typechecking the first argument of the bind which is user located --- so we set the location to be that of the argument --- b. Or, we are typechecking the second argument which would be a generated lambda --- so we set the location to be whatever the location in the context is -- See Note [Expanding HsDo with XXExprGhcRn] in GHC.Tc.Gen.Do --- For future: we need a cleaner way of doing this bit of adding the right error context. --- There is a delicate dance of looking at source locations and reconstructing --- whether the piece of code is a `do`-expanded code or some other expanded code. addArgCtxt ctxt (L arg_loc arg) thing_inside = do { in_generated_code <- inGeneratedCode ; case ctxt of @@ -903,18 +895,10 @@ addArgCtxt ctxt (L arg_loc arg) thing_inside addErrCtxt (funAppCtxt fun arg arg_no) $ thing_inside - VAExpansion (OrigStmt (L _ stmt@(BindStmt {})) flav) _ loc - | isGeneratedSrcSpan (locA arg_loc) -- This arg is the second argument to generated (>>=) - -> setSrcSpan loc $ - addStmtCtxt stmt flav $ - thing_inside - | otherwise -- This arg is the first argument to generated (>>=) - -> setSrcSpanA arg_loc $ - addStmtCtxt stmt flav $ - thing_inside VAExpansion (OrigStmt (L loc stmt) flav) _ _ -> setSrcSpanA loc $ addStmtCtxt stmt flav $ + setSrcSpanA arg_loc $ thing_inside _ -> setSrcSpanA arg_loc $ ===================================== compiler/GHC/Tc/Gen/Do.hs ===================================== @@ -73,13 +73,13 @@ expand_do_stmts _ _ (stmt@(L _ (ParStmt {})):_) = pprPanic "expand_do_stmts: ParStmt" $ ppr stmt -- handeled by `GHC.Tc.Gen.Match.tcLcStmt` -expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_expr))] +expand_do_stmts addPop flav [stmt@(L _ (LastStmt _ (L body_loc body) _ ret_expr))] -- See Note [Expanding HsDo with XXExprGhcRn] Equation (5) below -- last statement of a list comprehension, needs to explicitly return it -- See `checkLastStmt` and `Syntax.Expr.StmtLR.LastStmt` | NoSyntaxExprRn <- ret_expr -- Last statement is just body if we are not in ListComp context. See Syntax.Expr.LastStmt - = return $ mkExpandedStmtAt addPop loc stmt flav False body + = return $ mkExpandedStmtAt addPop stmt flav False (L body_loc body) | SyntaxExprRn ret <- ret_expr -- @@ -87,18 +87,18 @@ expand_do_stmts addPop flav [stmt@(L loc (LastStmt _ (L body_loc body) _ ret_exp -- return e ~~> return e -- to make T18324 work = do let expansion = genHsApp ret (L body_loc body) - return $ mkExpandedStmtAt addPop loc stmt flav False expansion + return $ mkExpandedStmtAt addPop stmt flav False (L body_loc expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (LetStmt _ bs)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (LetStmt _ bs)) : lstmts) = -- See Note [Expanding HsDo with XXExprGhcRn] Equation (3) below -- stmts ~~> stmts' -- ------------------------------------------------ -- let x = e ; stmts ~~> let x = e in stmts' do expand_stmts <- expand_do_stmts True doFlavour lstmts let expansion = genHsLet bs expand_stmts - return $ mkExpandedStmtAt addPop loc stmt doFlavour False expansion + return $ mkExpandedStmtAt addPop stmt doFlavour False (wrapGenSpan expansion) -expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) +expand_do_stmts addPop doFlavour (stmt@(L _ (BindStmt xbsrn pat e)): lstmts) | SyntaxExprRn bind_op <- xbsrn_bindOp xbsrn , fail_op <- xbsrn_failOp xbsrn -- See Note [Expanding HsDo with XXExprGhcRn] Equation (2) below @@ -112,12 +112,12 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BindStmt xbsrn pat e)): lstmts) let expansion = genHsExpApps bind_op -- (>>=) [ e , failable_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) | otherwise = pprPanic "expand_do_stmts: The impossible happened, missing bind operator from renamer" (text "stmt" <+> ppr stmt) -expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = +expand_do_stmts addPop doFlavour (stmt@(L _ (BodyStmt _ e (SyntaxExprRn then_op) _)) : lstmts) = -- See Note [BodyStmt] in Language.Haskell.Syntax.Expr -- See Note [Expanding HsDo with XXExprGhcRn] Equation (1) below -- stmts ~~> stmts' @@ -127,7 +127,7 @@ expand_do_stmts addPop doFlavour (stmt@(L loc (BodyStmt _ e (SyntaxExprRn then_o let expansion = genHsExpApps then_op -- (>>) [ e , expand_stmts_expr ] - return $ mkExpandedStmtAt addPop loc stmt doFlavour True expansion + return $ mkExpandedStmtAt addPop stmt doFlavour True (wrapGenSpan expansion) expand_do_stmts _ doFlavour ((L loc (RecStmt { recS_stmts = L stmts_loc rec_stmts @@ -216,7 +216,7 @@ expand_do_stmts addPop doFlavour ((L _ (XStmtLR (ApplicativeStmt _ args mb_join) { xarg_app_arg_one = mb_fail_op , app_arg_pattern = pat , arg_expr = (L rhs_loc rhs) }) = - do let xx_expr = mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) stmt doFlavour False rhs + do let xx_expr = mkExpandedStmtAt addPop stmt doFlavour False (L rhs_loc rhs) traceTc "do_arg" (text "OneArg" <+> vcat [ppr pat, ppr xx_expr]) return ((pat, mb_fail_op) , xx_expr) @@ -247,7 +247,7 @@ expand_do_stmts _ _ stmts = pprPanic "expand_do_stmts: impossible happened" $ (p -- checks the pattern `pat` for irrefutability which decides if we need to wrap it with a fail block mk_failable_expr :: Bool -> HsDoFlavour -> Maybe (ExprLStmt GhcRn) -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) -mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = +mk_failable_expr addPop doFlav mb_stmt lpat@(L _ pat) expr fail_op = do { is_strict <- xoptM LangExt.Strict ; rdrEnv <- getGlobalRdrEnv ; comps <- getCompleteMatchesTcM @@ -262,21 +262,21 @@ mk_failable_expr addPop doFlav mb_stmt lpat@(L loc pat) expr fail_op = (WildPat{}) -> return $ genHsLamDoExp doFlav [L noSrcSpanA pat] expr _ -> return $ case mb_stmt of Nothing -> genHsLamDoExp doFlav [lpat] expr - Just s -> mkExpandedStmtAt addPop (noAnnSrcSpan generatedSrcSpan) s doFlav False - (unLoc $ (genHsLamDoExp doFlav [lpat] - $ wrapGenSpan (mkPopErrCtxtExpr expr))) - else L loc <$> mk_fail_block doFlav mb_stmt lpat expr fail_op + Just stmt -> mkExpandedStmtAt addPop stmt doFlav False + (genHsLamDoExp doFlav [lpat] + $ wrapGenSpan (mkPopErrCtxtExpr expr)) + else mk_fail_block doFlav mb_stmt lpat expr fail_op } -- makes the fail block with a given fail_op mk_fail_block :: HsDoFlavour -> Maybe (ExprLStmt GhcRn) - -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (HsExpr GhcRn) + -> LPat GhcRn -> LHsExpr GhcRn -> FailOperator GhcRn -> TcM (LHsExpr GhcRn) mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = do dflags <- getDynFlags - return $ HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ - (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr - , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" - ]) + return $ wrapGenSpan (HsLam noAnn LamCases $ mkMatchGroup (doExpansionOrigin doFlav) -- \ + (wrapGenSpan [ genHsCaseAltDoExp doFlav pat e -- pat -> expr + , fail_alt_case dflags pat fail_op -- _ -> fail "fail pattern" + ])) where fail_alt_case :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> LMatch GhcRn (LHsExpr GhcRn) fail_alt_case dflags pat fail_op = genHsCaseAltDoExp doFlav (L ploc $ WildPat noExtField) $ @@ -285,7 +285,7 @@ mk_fail_block doFlav mb_stmt pat@(L ploc _) e (Just (SyntaxExprRn fail_op)) = fail_op_expr :: DynFlags -> LPat GhcRn -> HsExpr GhcRn -> HsExpr GhcRn fail_op_expr dflags pat fail_op = mkExpandedPatRn pat doFlav mb_stmt $ - genHsApp fail_op (mk_fail_msg_expr dflags pat) + wrapGenSpan (genHsApp fail_op (mk_fail_msg_expr dflags pat)) mk_fail_msg_expr :: DynFlags -> LPat GhcRn -> LHsExpr GhcRn mk_fail_msg_expr dflags pat ===================================== compiler/GHC/Tc/Gen/Expr.hs ===================================== @@ -621,7 +621,7 @@ tcExpr expr@(RecordUpd { rupd_expr = record_expr -- Typecheck the expanded expression. ; expr' <- addErrCtxt err_ctxt $ - tcExpr (mkExpandedExpr expr ds_expr) (Check ds_res_ty) + tcExpr (mkExpandedExpr expr (wrapGenSpan ds_expr)) (Check ds_res_ty) -- NB: it's important to use ds_res_ty and not res_ty here. -- Test case: T18802b. @@ -714,7 +714,7 @@ tcXExpr (PopErrCtxt (L loc e)) res_ty setSrcSpanA loc $ tcExpr e res_ty -tcXExpr xe@(ExpandedThingRn o e' doTcApp) res_ty +tcXExpr xe@(ExpandedThingRn o (L _ e') doTcApp) res_ty | OrigPat (L loc _) flav (Just s) <- o -- testcase T16628 = setSrcSpanA loc $ addStmtCtxt (unLoc s) flav $ ===================================== compiler/GHC/Tc/Gen/Head.hs ===================================== @@ -325,8 +325,8 @@ splitHsApps e = go e (top_ctxt 0 e) [] HsQuasiQuote _ _ (L l _) -> set l ctxt -- l :: SrcAnn NoEpAnns -- See Note [Looking through ExpandedThingRn] - go (XExpr (ExpandedThingRn o e _)) ctxt args - = go e (VAExpansion o (appCtxtLoc ctxt) (appCtxtLoc ctxt)) + go (XExpr (ExpandedThingRn o (L l e) _)) _ args + = go e (VAExpansion o (locA l) (locA l)) (EWrap (EExpand o) : args) -- See Note [Desugar OpApp in the typechecker] @@ -335,7 +335,7 @@ splitHsApps e = go e (top_ctxt 0 e) [] , mkEValArg (VACall op 1 generatedSrcSpan) arg1 : mkEValArg (VACall op 2 generatedSrcSpan) arg2 -- generatedSrcSpan because this the span of the call, - -- and its hard to say exactly what that is + -- Exand its hard to say exactly what that is : EWrap (EExpand (OrigExpr e)) : args ) @@ -555,20 +555,25 @@ tcInferAppHead_maybe fun _ -> return Nothing addHeadCtxt :: AppCtxt -> TcM a -> TcM a -addHeadCtxt (VAExpansion (OrigStmt (L loc stmt) flav) _ _) thing_inside = - do setSrcSpanA loc $ - addStmtCtxt stmt flav - thing_inside addHeadCtxt fun_ctxt thing_inside + | isGeneratedSrcSpan fun_loc + = case fun_ctxt of + VAExpansion (OrigStmt (L loc stmt) flav) _ _ + -> do setSrcSpanA loc $ + addStmtCtxt stmt flav $ + thing_inside + VAExpansion (OrigPat (L loc _) _ _) _ _ + -> setSrcSpanA loc $ thing_inside + _ -> thing_inside + | not (isGoodSrcSpan fun_loc) -- noSrcSpan => no arguments = thing_inside -- => context is already set | otherwise = setSrcSpan fun_loc $ - do case fun_ctxt of + do traceTc "addHeadCtxt: fun_loc" (ppr fun_loc) + case fun_ctxt of VAExpansion (OrigExpr orig) _ _ -> addExprCtxt orig thing_inside - VAExpansion (OrigPat _ flav (Just (L loc stmt))) _ _ - -> setSrcSpanA loc $ addStmtCtxt stmt flav thing_inside _ -> thing_inside where fun_loc = appCtxtLoc fun_ctxt View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dc9ab2dae0f8b2d3b3fbdea5e6cad089e6f739c6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dc9ab2dae0f8b2d3b3fbdea5e6cad089e6f739c6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:55:55 2024 From: gitlab at gitlab.haskell.org (Apoorv Ingle (@ani)) Date: Mon, 29 Jul 2024 11:55:55 -0400 Subject: [Git][ghc/ghc][wip/expansions-appdo] 11 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a7bb8b6c106_3956c2da0db8441f0@gitlab.mail> Apoorv Ingle pushed to branch wip/expansions-appdo at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - c533d25f by Apoorv Ingle at 2024-07-29T10:55:45-05:00 Make ApplicativeDo work with HsExpansions testcase added: T24406 Issues Fixed: #24406, #16135 Code Changes: - Remove `XStmtLR GhcTc` as `XStmtLR GhcRn` is now compiled to `HsExpr GhcTc` - The expanded statements are guided by `GHC.Hs.Expr.TcFunInfo` which is used to decide if the `XExpr GhcRn` is to be typechecked using `tcApp` or `tcExpr` Note [Expanding HsDo with XXExprGhcRn] explains the change in more detail - - - - - 30 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/GuardedRHSs.hs - compiler/GHC/HsToCore/ListComp.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Do.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Demand.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c4e6483e261251e271737d01adbb031218c2f915...c533d25fb9c0b4cc70668794f97a2a367f60fabc -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c4e6483e261251e271737d01adbb031218c2f915...c533d25fb9c0b4cc70668794f97a2a367f60fabc You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:57:29 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 29 Jul 2024 11:57:29 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Add tests for 25081 Message-ID: <66a7bbe94d869_3956c2eebd444458b@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 46d7ce1d by romes at 2024-07-29T11:57:11-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 9f8319aa by Matthew Pickering at 2024-07-29T11:57:12-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 27 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T - utils/check-exact/ExactPrint.hs Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 } , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } - , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 + , "Linux_Alpine" : { "( >= 3.12 && < 3.20 )": alpine3_12 , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } @@ -242,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 } + , "unknown_versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,56 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Gen/Match.hs ===================================== @@ -502,6 +502,32 @@ tcGuardStmt _ stmt _ _ -- coercion matching stuff in them. It's hard to avoid the -- potential for non-trivial coercions in tcMcStmt +{- +Note [Binding in list comprehension isn't linear] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In principle, [ y | () <- xs, y <- [0,1]] could be linear in `xs`. +But, the way the desugaring works, we get something like + +case xs of + () : xs ' -> letrec next_stmt = … xs' … + +In the current typing rules for letrec in Core, next_stmt is necessarily of +multiplicity Many and so is every free variable, including xs'. Which, in turns, +requires xs to be of multiplicity Many. + +Rodrigo Mesquita worked out, in his master thesis, how to make letrecs having +non-Many multiplicities. But it's a fair bit of work to implement. + +Since nobody actually cares about [ y | () <- xs, y <- [0,1]] being linear, then +we just conservatively make it unrestricted instead. + +If we're to change that, we have to be careful that [ y | _ <- xs, y <- [0,1]] +isn't linear in `xs` since the elements of `xs` are ignored. So we'd still have +to call `tcScalingUsage` on `xs` in `tcLcStmt`, we'd just have to create a fresh +multiplicity variable. We'd also use the same multiplicity variable in the call +to `tcCheckPat` instead of `unrestricted`. +-} + tcLcStmt :: TyCon -- The list type constructor ([]) -> TcExprStmtChecker @@ -513,20 +539,24 @@ tcLcStmt _ _ (LastStmt x body noret _) elt_ty thing_inside -- A generator, pat <- rhs tcLcStmt m_tc ctxt (BindStmt _ pat rhs) elt_ty thing_inside = do { pat_ty <- newFlexiTyVarTy liftedTypeKind - ; rhs' <- tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) + -- About the next `tcScalingUsage ManyTy` and unrestricted + -- see Note [Binding in list comprehension isn't linear] + ; rhs' <- tcScalingUsage ManyTy $ tcCheckMonoExpr rhs (mkTyConApp m_tc [pat_ty]) ; (pat', thing) <- tcCheckPat (StmtCtxt ctxt) pat (unrestricted pat_ty) $ + tcScalingUsage ManyTy $ thing_inside elt_ty ; return (mkTcBindStmt pat' rhs', thing) } -- A boolean guard tcLcStmt _ _ (BodyStmt _ rhs _ _) elt_ty thing_inside = do { rhs' <- tcCheckMonoExpr rhs boolTy - ; thing <- thing_inside elt_ty + ; thing <- tcScalingUsage ManyTy $ thing_inside elt_ty ; return (BodyStmt boolTy rhs' noSyntaxExpr noSyntaxExpr, thing) } -- ParStmt: See notes with tcMcStmt and Note [Scoping in parallel list comprehensions] tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside - = do { env <- getLocalRdrEnv + = tcScalingUsage ManyTy $ -- parallel list comprehension never desugars to something linear. + do { env <- getLocalRdrEnv ; (pairs', thing) <- loop env [] bndr_stmts_s ; return (ParStmt unitTy pairs' noExpr noSyntaxExpr, thing) } where @@ -552,7 +582,8 @@ tcLcStmt m_tc ctxt (ParStmt _ bndr_stmts_s _ _) elt_ty thing_inside tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts , trS_bndrs = bindersMap , trS_by = by, trS_using = using }) elt_ty thing_inside - = do { let (bndr_names, n_bndr_names) = unzip bindersMap + = tcScalingUsage ManyTy $ -- Transform statements are too complex: just make everything multiplicity Many + do { let (bndr_names, n_bndr_names) = unzip bindersMap unused_ty = pprPanic "tcLcStmt: inner ty" (ppr bindersMap) -- The inner 'stmts' lack a LastStmt, so the element type -- passed in to tcStmtsAndThen is never looked at ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving (Eq, Data) ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/linear/should_compile/LinearListComprehension.hs ===================================== @@ -0,0 +1,14 @@ +{-# LANGUAGE LinearTypes #-} + +module LinearListComprehension where + +-- Probably nobody actually cares if monad comprehension realised that it can be +-- linear in the first statement. But it can, so we might as well. + +guard :: a %1 -> (a %1 -> Bool) %1 -> [Int] +guard x g = [ y | g x, y <- [0,1] ] + +-- This isn't correct syntax, but a singleton list comprehension would +-- presumably work too +-- last :: a %1 -> [a] +-- last x = [ x | ] ===================================== testsuite/tests/linear/should_compile/all.T ===================================== @@ -45,3 +45,4 @@ test('LinearRecUpd', normal, compile, ['']) test('T23814', normal, compile, ['']) test('LinearLet', normal, compile, ['']) test('LinearLetPoly', normal, compile, ['']) +test('LinearListComprehension', normal, compile, ['-dlinear-core-lint']) ===================================== testsuite/tests/linear/should_fail/T25081.hs ===================================== @@ -0,0 +1,37 @@ +{-# LANGUAGE LinearTypes #-} +{-# LANGUAGE ParallelListComp #-} +{-# LANGUAGE TransformListComp #-} + +module T25081 where + +dup_last :: a %1 -> [a] +dup_last x = [ x | _ <- [0,1]] + +dup_bind :: a %1 -> [()] +dup_bind x = [ () | _ <- [0,1], _ <- [x]] + +dup_guard :: a %1 -> (a %1 -> Bool) -> [()] +dup_guard x g = [ () | _ <- [0,1], g x ] + +guard_last :: a %1 -> [a] +guard_last x = [ x | False] + +guard_bind :: a %1 -> [()] +guard_bind x = [ () | False, _ <- [x]] + +guard_guard :: a %1 -> (a %1 -> Bool) %1 -> [()] +guard_guard x g = [ () | False, g x ] + +-- This could, in principle, be linear. But see Note [Binding in list +-- comprehension isn't linear] in GHC.Tc.Gen.Match. +first_bind :: [()] %1 -> [Int] +first_bind xs = [ y | () <- xs, y <- [0,1]] + +parallel :: a %1 -> [(a, Bool)] +parallel x = [(y,z) | y <- [x] | z <- [True]] + +parallel_guard :: a %1 -> (a %1 -> Bool) -> [(Int, Bool)] +parallel_guard x g = [(y, z) | g x, y <- [0,1] | z <- [True, False]] + +transform :: a %1 -> (a %1 -> Bool) -> [a] +transform x g = [y | g x, y <- [0, 1], then take 2] ===================================== testsuite/tests/linear/should_fail/T25081.stderr ===================================== @@ -0,0 +1,65 @@ +T25081.hs:8:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_last’: dup_last x = [x | _ <- [0, 1]] + +T25081.hs:11:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_bind’: + dup_bind x = [() | _ <- [0, 1], _ <- [x]] + +T25081.hs:14:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘dup_guard’: + dup_guard x g = [() | _ <- [0, 1], g x] + +T25081.hs:17:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_last’: guard_last x = [x | False] + +T25081.hs:20:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_bind’: + guard_bind x = [() | False, _ <- [x]] + +T25081.hs:23:13: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:23:15: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘g’ + • In an equation for ‘guard_guard’: + guard_guard x g = [() | False, g x] + +T25081.hs:28:12: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘xs’ + • In an equation for ‘first_bind’: + first_bind xs = [y | () <- xs, y <- [0, 1]] + +T25081.hs:31:10: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel’: + parallel x = [(y, z) | y <- [x] | z <- [True]] + +T25081.hs:34:16: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘parallel_guard’: + parallel_guard x g + = [(y, z) | g x, y <- [0, 1] | z <- [True, False]] + +T25081.hs:37:11: error: [GHC-18872] + • Couldn't match type ‘Many’ with ‘One’ + arising from multiplicity of ‘x’ + • In an equation for ‘transform’: + transform x g = [y | g x, y <- [0, 1], then take 2] + ===================================== testsuite/tests/linear/should_fail/all.T ===================================== @@ -51,3 +51,4 @@ test('LinearLet7', normal, compile_fail, ['']) test('LinearLet8', normal, compile_fail, ['']) test('LinearLet9', normal, compile_fail, ['']) test('LinearLet10', normal, compile_fail, ['']) +test('T25081', normal, compile_fail, ['']) ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3470,7 +3470,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3484,7 +3484,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0844f77469755f3dd72db9f1648b04e5ae2c994b...9f8319aaede9a01ee25d644f178c6b3dd8cd9347 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0844f77469755f3dd72db9f1648b04e5ae2c994b...9f8319aaede9a01ee25d644f178c6b3dd8cd9347 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 15:59:36 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 29 Jul 2024 11:59:36 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a7bc687a898_3956c2101ce0c5159f@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 0e354b71 by sheaf at 2024-07-29T17:58:34+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in the X86, AArch64 and PowerPC NCGs, as well as in the LLVM backend. Fixes #25120 - - - - - 26 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,13 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -725,6 +725,8 @@ pprMachOp_for_C platform mop = case mop of MO_F_Neg _ -> char '-' MO_F_Mul _ -> char '*' MO_F_Quot _ -> char '/' + MO_F_Min _ -> text "fmin" + MO_F_Max _ -> text "fmax" -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> @@ -917,6 +919,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e354b717d71cd5fd3b19582721adbcbfc286458 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0e354b717d71cd5fd3b19582721adbcbfc286458 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 16:01:27 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Mon, 29 Jul 2024 12:01:27 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a7bcd7e4e0e_3956c2101f418522cd@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 4dd4d6f4 by sheaf at 2024-07-29T18:00:47+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 26 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,13 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -725,6 +725,8 @@ pprMachOp_for_C platform mop = case mop of MO_F_Neg _ -> char '-' MO_F_Mul _ -> char '*' MO_F_Quot _ -> char '/' + MO_F_Min _ -> text "fmin" + MO_F_Max _ -> text "fmax" -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> @@ -917,6 +919,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4dd4d6f499a63b4a7abe858577c170b029ac197d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4dd4d6f499a63b4a7abe858577c170b029ac197d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 17:26:11 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Mon, 29 Jul 2024 13:26:11 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] skip T24634 when debugging Message-ID: <66a7d0b392b09_2b07e03f1204219ec@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 36e03cd6 by Torsten Schmits at 2024-07-29T19:26:05+02:00 skip T24634 when debugging - - - - - 1 changed file: - testsuite/tests/bytecode/T24634/all.T Changes: ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,7 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, + when(compiler_debugged(), skip), ], makefile_test, []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/36e03cd62bdf22107c609f6114c03075623976e5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/36e03cd62bdf22107c609f6114c03075623976e5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 21:08:26 2024 From: gitlab at gitlab.haskell.org (Jade (@Jade)) Date: Mon, 29 Jul 2024 17:08:26 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/structured-ghci-errors Message-ID: <66a804ca591b8_2b07e0ddf75c354f2@gitlab.mail> Jade pushed new branch wip/structured-ghci-errors at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/structured-ghci-errors You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 21:18:28 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Mon, 29 Jul 2024 17:18:28 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: TTG HsCmdArrForm: use Fixity via extension point Message-ID: <66a8072412b4c_2b07e0e41434421ac@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: f66a36e6 by romes at 2024-07-29T17:18:00-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 3bfef490 by Matthew Pickering at 2024-07-29T17:18:01-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 21 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - utils/check-exact/ExactPrint.hs Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 } , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } - , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 + , "Linux_Alpine" : { "( >= 3.12 && < 3.20 )": alpine3_12 , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } @@ -242,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 } + , "unknown_versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,56 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving (Eq, Data) ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3470,7 +3470,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3484,7 +3484,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9f8319aaede9a01ee25d644f178c6b3dd8cd9347...3bfef4909ba1af142ad41d4533595d0f4e9466ff -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9f8319aaede9a01ee25d644f178c6b3dd8cd9347...3bfef4909ba1af142ad41d4533595d0f4e9466ff You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Mon Jul 29 22:23:51 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Mon, 29 Jul 2024 18:23:51 -0400 Subject: [Git][ghc/ghc][wip/T24984] 13 commits: Fix -freg-graphs for FP and AARch64 NCG (#24941). Message-ID: <66a8167722de5_2b07e011fac385143d@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 61cde2f9 by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Work in progress on rejigging kick-out - - - - - 717ee3bf by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Wibbles - - - - - fe2316cc by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Fix egregious bug in any2 - - - - - ab536462 by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Add a very important rider to (KK3) (Not properly documented yet.) - - - - - beab3911 by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Documenation of the new plan - - - - - 71dad0ac by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Wiblbe - - - - - 9fc0d17f by Simon Peyton Jones at 2024-07-29T23:23:42+01:00 Respond to review - - - - - 30 changed files: - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Utils/Misc.hs - compiler/GHC/Utils/Outputable.hs - docs/users_guide/9.12.1-notes.rst - docs/users_guide/phases.rst - hadrian/doc/flavours.md - + testsuite/tests/codeGen/should_gen_asm/T24941.hs - testsuite/tests/codeGen/should_gen_asm/all.T - + testsuite/tests/linear/should_compile/LinearListComprehension.hs - testsuite/tests/linear/should_compile/all.T - + testsuite/tests/linear/should_fail/T25081.hs - + testsuite/tests/linear/should_fail/T25081.stderr - testsuite/tests/linear/should_fail/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/62ea54a56fb6a672397374bfa2361743cd6a2c15...9fc0d17f685b1a1090e980f9401bcb87830ea732 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/62ea54a56fb6a672397374bfa2361743cd6a2c15...9fc0d17f685b1a1090e980f9401bcb87830ea732 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 00:14:40 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Mon, 29 Jul 2024 20:14:40 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a83070f237c_1835ea5311dc22770@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 2340b72c by Fabricio de Sousa Nascimento at 2024-07-30T09:14:19+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 17 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,282 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming the LHS on type class Instances] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming the LHS of type class Instances is similar to [Renaming children on +export lists] as they both rely on the [Configurable GRE lookup priority]. + +One main difference is that we require parents to match on LHS names in type +classes, while on export lists, we may sometimes export a name with a different +parent than it was declared, for example PatternSynonyms (see [Typing Pattern +Synonym Exports]). + +Another difference is in the presence of ambiguous names. Because we are strict +on the parent, we won't report a name clash in the example below (see #24452), +as it would lead to a confusing error. + + module Ambiguous where + + import Control.Applicative (Alternative) + import qualified Data.Map as Map (empty) + import qualified Data.Set as Set (empty) + + instance Alternative Foo where + empty = undefined + +Note that the solution to this error would be to import the correct `empty` from +Applicative. + import Control.Applicative (Alternative, empty) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see [Renaming child GREs] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +{- Note [Picking and disambiguating children candidates] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The goal of `pick_matching_gres` is to pick one occurrence to rename, and fail +at any ambiguity. Note that failing to reject a program with multiple +parent matches can cause #25014. + + module Ambig1 where + data family T a + data instance T Bool = MkT + + module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT + + module Program (T(MkT)) where -- Ambig1 or Ambig2? + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + +Even when we don't find matching parents, we need to consider matching names +without a parent, for example for pattern synonyms below. + + module M (Maybe (Empty)) where + class Empty a where + isEmpty :: a -> Bool + + instance Empty (Maybe a) where + isEmpty Nothing = True + + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) +-} +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for details of what is happening here. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | [gre] <- matching_parent_gres, null no_parent_gres = + MatchingParentOccurrence gre + | [gre] <- no_parent_gres, length no_parent_gres == 1 = + NoParentOccurrence gre + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | otherwise = do + let all_gres = matching_parent_gres ++ no_parent_gres + AmbiguousOccurrence (NE.fromList all_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused ghc to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +967,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +974,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2284,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,6 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2340b72c174798c0ea4659734131570ffc0ae2d8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2340b72c174798c0ea4659734131570ffc0ae2d8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 05:38:42 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 30 Jul 2024 01:38:42 -0400 Subject: [Git][ghc/ghc][master] TTG HsCmdArrForm: use Fixity via extension point Message-ID: <66a87c62a9332_2bd6fc56c1b0163df@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 20 changed files: - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - utils/check-exact/ExactPrint.hs Changes: ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,56 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving (Eq, Data) ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3470,7 +3470,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3484,7 +3484,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d26482892e435f6f30ffc5616b39d09800151065 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d26482892e435f6f30ffc5616b39d09800151065 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 05:39:13 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 30 Jul 2024 01:39:13 -0400 Subject: [Git][ghc/ghc][master] ghcup-metadata: More metadata fixes Message-ID: <66a87c8181c81_2bd6fc70b19c210ed@gitlab.mail> Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 1 changed file: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 } , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } - , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 + , "Linux_Alpine" : { "( >= 3.12 && < 3.20 )": alpine3_12 , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } @@ -242,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 } + , "unknown_versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e258ad546d96fcfffd525f9b51d237cee467ad73 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e258ad546d96fcfffd525f9b51d237cee467ad73 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 07:44:50 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 30 Jul 2024 03:44:50 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a899f2a5b26_2bd6fcce101c309ca@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 0c309eef by Fabricio de Sousa Nascimento at 2024-07-30T16:44:13+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 23 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/T24452b.hs - testsuite/tests/rename/T24452/T24452b.stderr - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/T25014g.hs - + testsuite/tests/rename/T25014/T25014g.stderr - + testsuite/tests/rename/T25014/T25014h.hs - + testsuite/tests/rename/T25014/all.T - testsuite/tests/rename/prog005/VersionGraphClient.hs-boot Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,269 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +-- Re revview this +-- Fix Links Tis +Note [Renaming child GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +When renaming a GRE, we sometimes make use of GRE parent information to +disambiguate or to improve error messages. This happens in two situations: + + - when renaming an export list, e.g. `T`, `fld` in `module M ( A(T, fld) )`, + - when renaming methods of a class instance, e.g. + `instance C a where { type Assoc a = Int; method a = a }` + +In both of these situations, we first look up all matching GREs, but then +further refine by filtering out GREs with incorrect parents. This is done in +pick_matching_gres, using the DisambigInfo datatype. We proceed as follows: + + 1. We first check if there are no matching GRE at all, and return NoOccurence. + 2. Then we check whether there is a single matching GRE with the right parent, + say gre. + If so, return "MatchingParentOccurrence gre" + 2. If there are multiple matching GREs with the right parent, + return those, using AmbiguousOccurrence. + 3. In the absence of GREs with the right parent, we check whether there is + a single matching GRE, say gre. + If so, return "NoParentOccurrence gre". + 5. Finally, there are multiple matching GREs (none with the right parent), + return all matches, using AmbiguousOccurrence. + +We then consume this information slightly differently for the export case and +for the instance method case, because for exports we can accept a GRE which has +no parent (e.g. when bundling a pattern synonym, as per Note [Parents] +in GHC.Types.Name.Reader), whereas for a class instance we definitely need +the class itself to be the parent, as in the example: + + import Control.Applicative ( Alternative ) + import Data.Set ( empty ) + instance Alternative Foo where + empty = ... + +Test cases: + - T11970 (both cases) + - T25014{a,b,c,d,e,f,g,h} (export lists) + - T23664, T24452{a,b,c,d,e,f} (class instances) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see [Renaming child GREs] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for details of what is happening here. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre + | [gre] <- no_parent_gres, null matching_parent_gres = + -- Checking `null matching_parent_gres` prevents a program to compile + -- when there is a parent ambiguity. See T24014g + NoParentOccurrence gre + | otherwise = do + let all_gres = matching_parent_gres ++ no_parent_gres + AmbiguousOccurrence (NE.fromList all_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused ghc to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +954,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +961,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2271,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/T24452b.hs ===================================== @@ -1,5 +1,4 @@ -- Alternative.empty is not visible -{-# LANGUAGE GeneralizedNewtypeDeriving #-} module BugReproduce where import Control.Applicative (Alternative) ===================================== testsuite/tests/rename/T24452/T24452b.stderr ===================================== @@ -1,2 +1,2 @@ -T24452b.hs:10:3: error: [GHC-54721] +T24452b.hs:9:3: error: [GHC-54721] ‘empty’ is not a (visible) method of class ‘Alternative’ \ No newline at end of file ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014g.hs ===================================== @@ -0,0 +1,9 @@ +-- Even though there is a single MkT without a parent, there is an ambiguity +-- between Ambig1.T.MkT and Ambig2.T.MkT so we can't compile +{-# LANGUAGE PatternSynonyms #-} + +module T25014g (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + + pattern MkT = Ambig1.MkT ===================================== testsuite/tests/rename/T25014/T25014g.stderr ===================================== @@ -0,0 +1,11 @@ +T25014g.hs:5:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014g.hs:6:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014g.hs:7:18-23 + (and originally defined at Ambig2.hs:5:25-27), + or ‘T25014g.MkT’, defined at T25014g.hs:9:3. + In the export: T(MkT) ===================================== testsuite/tests/rename/T25014/T25014h.hs ===================================== @@ -0,0 +1,8 @@ +-- A comment +{-# LANGUAGE PatternSynonyms #-} + +module T25014h (T(MkT)) where + import Ambig1 (T(MkT)) + import qualified Ambig1 as Am + + pattern MkT = Am.MkT ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,8 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) +test('T25014g', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014g','-v0']) +test('T25014h', [extra_files(['Ambig1.hs'])], multimod_compile, ['T25014h','-v0']) \ No newline at end of file ===================================== testsuite/tests/rename/prog005/VersionGraphClient.hs-boot ===================================== @@ -1,3 +1,4 @@ -module VersionGraphClient where +module VersionGraphClient wViewType.hs + -rw- 156 06-25 17:50 test.There data VersionGraphClient View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0c309eef9bd3dbeaad0d3d27dc3e4166cc5bca95 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0c309eef9bd3dbeaad0d3d27dc3e4166cc5bca95 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 07:48:32 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 30 Jul 2024 03:48:32 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a89ad067f99_2bd6fce289203181f@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: 41ce6331 by Fabricio de Sousa Nascimento at 2024-07-30T16:48:11+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 23 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/T24452b.hs - testsuite/tests/rename/T24452/T24452b.stderr - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/T25014g.hs - + testsuite/tests/rename/T25014/T25014g.stderr - + testsuite/tests/rename/T25014/T25014h.hs - + testsuite/tests/rename/T25014/all.T - testsuite/tests/rename/prog005/VersionGraphClient.hs-boot Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,267 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming child GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +When renaming a GRE, we sometimes make use of GRE parent information to +disambiguate or to improve error messages. This happens in two situations: + + - when renaming an export list, e.g. `T`, `fld` in `module M ( A(T, fld) )`, + - when renaming methods of a class instance, e.g. + `instance C a where { type Assoc a = Int; method a = a }` + +In both of these situations, we first look up all matching GREs, but then +further refine by filtering out GREs with incorrect parents. This is done in +pick_matching_gres, using the DisambigInfo datatype. We proceed as follows: + + 1. We first check if there are no matching GRE at all, and return NoOccurence. + 2. Then we check whether there is a single matching GRE with the right parent, + say gre. + If so, return "MatchingParentOccurrence gre" + 2. If there are multiple matching GREs with the right parent, + return those, using AmbiguousOccurrence. + 3. In the absence of GREs with the right parent, we check whether there is + a single matching GRE, say gre. + If so, return "NoParentOccurrence gre". + 5. Finally, there are multiple matching GREs (none with the right parent), + return all matches, using AmbiguousOccurrence. + +We then consume this information slightly differently for the export case and +for the instance method case, because for exports we can accept a GRE which has +no parent (e.g. when bundling a pattern synonym, as per Note [Parents] +in GHC.Types.Name.Reader), whereas for a class instance we definitely need +the class itself to be the parent, as in the example: + + import Control.Applicative ( Alternative ) + import Data.Set ( empty ) + instance Alternative Foo where + empty = ... + +Test cases: + - T11970 (both cases) + - T25014{a,b,c,d,e,f,g,h} (export lists) + - T23664, T24452{a,b,c,d,e,f} (class instances) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see [Renaming child GREs] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for details of what is happening here. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre + | [gre] <- no_parent_gres, null matching_parent_gres = + -- Checking `null matching_parent_gres` prevents a program to compile + -- when there is a parent ambiguity. See T24014g + NoParentOccurrence gre + | otherwise = do + let all_gres = matching_parent_gres ++ no_parent_gres + AmbiguousOccurrence (NE.fromList all_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused GHC to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +952,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +959,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2269,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/T24452b.hs ===================================== @@ -1,5 +1,4 @@ -- Alternative.empty is not visible -{-# LANGUAGE GeneralizedNewtypeDeriving #-} module BugReproduce where import Control.Applicative (Alternative) ===================================== testsuite/tests/rename/T24452/T24452b.stderr ===================================== @@ -1,2 +1,2 @@ -T24452b.hs:10:3: error: [GHC-54721] +T24452b.hs:9:3: error: [GHC-54721] ‘empty’ is not a (visible) method of class ‘Alternative’ \ No newline at end of file ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014g.hs ===================================== @@ -0,0 +1,9 @@ +-- Even though there is a single MkT without a parent, there is an ambiguity +-- between Ambig1.T.MkT and Ambig2.T.MkT so we can't compile +{-# LANGUAGE PatternSynonyms #-} + +module T25014g (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + + pattern MkT = Ambig1.MkT ===================================== testsuite/tests/rename/T25014/T25014g.stderr ===================================== @@ -0,0 +1,11 @@ +T25014g.hs:5:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014g.hs:6:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014g.hs:7:18-23 + (and originally defined at Ambig2.hs:5:25-27), + or ‘T25014g.MkT’, defined at T25014g.hs:9:3. + In the export: T(MkT) ===================================== testsuite/tests/rename/T25014/T25014h.hs ===================================== @@ -0,0 +1,8 @@ +-- A comment +{-# LANGUAGE PatternSynonyms #-} + +module T25014h (T(MkT)) where + import Ambig1 (T(MkT)) + import qualified Ambig1 as Am + + pattern MkT = Am.MkT ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,8 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) +test('T25014g', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014g','-v0']) +test('T25014h', [extra_files(['Ambig1.hs'])], multimod_compile, ['T25014h','-v0']) \ No newline at end of file ===================================== testsuite/tests/rename/prog005/VersionGraphClient.hs-boot ===================================== @@ -1,3 +1,4 @@ -module VersionGraphClient where +module VersionGraphClient wViewType.hs + -rw- 156 06-25 17:50 test.There data VersionGraphClient View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41ce6331ecb4ef7ca0eb5c579152fa914a94db5d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/41ce6331ecb4ef7ca0eb5c579152fa914a94db5d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 08:48:34 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 04:48:34 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a8a8e2ac164_2bd6fc12b0ab04382d@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: fc874768 by sheaf at 2024-07-30T10:48:09+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 26 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -725,6 +725,8 @@ pprMachOp_for_C platform mop = case mop of MO_F_Neg _ -> char '-' MO_F_Mul _ -> char '*' MO_F_Quot _ -> char '/' + MO_F_Min _ -> text "fmin" + MO_F_Max _ -> text "fmax" -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> @@ -917,6 +919,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc87476832781af930e4214a991d981260ba4650 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc87476832781af930e4214a991d981260ba4650 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 09:07:52 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 30 Jul 2024 05:07:52 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a8ad688fd6f_528336a34441924@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: d25864be by Fabricio de Sousa Nascimento at 2024-07-30T18:07:30+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 23 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/T24452b.hs - testsuite/tests/rename/T24452/T24452b.stderr - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/T25014g.hs - + testsuite/tests/rename/T25014/T25014g.stderr - + testsuite/tests/rename/T25014/T25014h.hs - + testsuite/tests/rename/T25014/T25014h.stderr - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,267 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming child GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +When renaming a GRE, we sometimes make use of GRE parent information to +disambiguate or to improve error messages. This happens in two situations: + + - when renaming an export list, e.g. `T`, `fld` in `module M ( A(T, fld) )`, + - when renaming methods of a class instance, e.g. + `instance C a where { type Assoc a = Int; method a = a }` + +In both of these situations, we first look up all matching GREs, but then +further refine by filtering out GREs with incorrect parents. This is done in +pick_matching_gres, using the DisambigInfo datatype. We proceed as follows: + + 1. We first check if there are no matching GRE at all, and return NoOccurence. + 2. Then we check whether there is a single matching GRE with the right parent, + say gre. + If so, return "MatchingParentOccurrence gre" + 2. If there are multiple matching GREs with the right parent, + return those, using AmbiguousOccurrence. + 3. In the absence of GREs with the right parent, we check whether there is + a single matching GRE, say gre. + If so, return "NoParentOccurrence gre". + 5. Finally, there are multiple matching GREs (none with the right parent), + return all matches, using AmbiguousOccurrence. + +We then consume this information slightly differently for the export case and +for the instance method case, because for exports we can accept a GRE which has +no parent (e.g. when bundling a pattern synonym, as per Note [Parents] +in GHC.Types.Name.Reader), whereas for a class instance we definitely need +the class itself to be the parent, as in the example: + + import Control.Applicative ( Alternative ) + import Data.Set ( empty ) + instance Alternative Foo where + empty = ... + +Test cases: + - T11970 (both cases) + - T25014{a,b,c,d,e,f,g,h} (export lists) + - T23664, T24452{a,b,c,d,e,f} (class instances) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see [Renaming child GREs] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for details of what is happening here. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre + | [gre] <- no_parent_gres, null matching_parent_gres = + -- Checking `null matching_parent_gres` prevents a program to compile + -- when there is a parent ambiguity. See T24014g + NoParentOccurrence gre + | otherwise = do + let all_gres = matching_parent_gres ++ no_parent_gres + AmbiguousOccurrence (NE.fromList all_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused GHC to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +952,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +959,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2269,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/T24452b.hs ===================================== @@ -1,5 +1,4 @@ -- Alternative.empty is not visible -{-# LANGUAGE GeneralizedNewtypeDeriving #-} module BugReproduce where import Control.Applicative (Alternative) ===================================== testsuite/tests/rename/T24452/T24452b.stderr ===================================== @@ -1,2 +1,2 @@ -T24452b.hs:10:3: error: [GHC-54721] +T24452b.hs:9:3: error: [GHC-54721] ‘empty’ is not a (visible) method of class ‘Alternative’ \ No newline at end of file ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014g.hs ===================================== @@ -0,0 +1,9 @@ +-- Even though there is a single MkT without a parent, there is an ambiguity +-- between Ambig1.T.MkT and Ambig2.T.MkT so we can't compile +{-# LANGUAGE PatternSynonyms #-} + +module T25014g (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + + pattern MkT = Ambig1.MkT ===================================== testsuite/tests/rename/T25014/T25014g.stderr ===================================== @@ -0,0 +1,11 @@ +T25014g.hs:5:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014g.hs:6:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014g.hs:7:18-23 + (and originally defined at Ambig2.hs:5:25-27), + or ‘T25014g.MkT’, defined at T25014g.hs:9:3. + In the export: T(MkT) ===================================== testsuite/tests/rename/T25014/T25014h.hs ===================================== @@ -0,0 +1,8 @@ +-- A comment +{-# LANGUAGE PatternSynonyms #-} + +module T25014h (T(MkT)) where + import Ambig1 (T(MkT)) + import qualified Ambig1 as Am + + pattern MkT = Am.MkT ===================================== testsuite/tests/rename/T25014/T25014h.stderr ===================================== @@ -0,0 +1,8 @@ +T25014h.hs:4:17: error: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Am.MkT’, + imported qualified from ‘Ambig1’ at T25014h.hs:6:3-31 + (and originally defined at Ambig1.hs:5:26-28), + or ‘T25014h.MkT’, defined at T25014h.hs:8:3. + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,8 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) +test('T25014g', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014g','-v0']) +test('T25014h', [extra_files(['Ambig1.hs'])], multimod_compile_fail, ['T25014h','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d25864be9d1151339b2dfc3d1366b4c74f03ad31 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d25864be9d1151339b2dfc3d1366b4c74f03ad31 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 09:55:42 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 05:55:42 -0400 Subject: [Git][ghc/ghc][wip/romes/strict-state-tweaks] Deriving-via one-shot strict state Monad instances Message-ID: <66a8b89e279af_5283828f5c580c2@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/strict-state-tweaks at Glasgow Haskell Compiler / GHC Commits: 9d2ebcbc by Rodrigo Mesquita at 2024-07-30T10:55:25+01:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - 6 changed files: - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout Changes: ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -215,6 +215,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -234,6 +234,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9d2ebcbc069b526d3af8fd17aa99b00ca5727a9a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9d2ebcbc069b526d3af8fd17aa99b00ca5727a9a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 10:06:07 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 06:06:07 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a8bb0f542e4_3c86ab8abc461653@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: 63d2a5d4 by sheaf at 2024-07-30T12:05:37+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 26 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -725,6 +725,8 @@ pprMachOp_for_C platform mop = case mop of MO_F_Neg _ -> char '-' MO_F_Mul _ -> char '*' MO_F_Quot _ -> char '/' + MO_F_Min _ -> text "fmin" + MO_F_Max _ -> text "fmax" -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> @@ -917,6 +919,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63d2a5d461905d2d83a5fc12ded0b6018679b92a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63d2a5d461905d2d83a5fc12ded0b6018679b92a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 10:26:07 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 30 Jul 2024 06:26:07 -0400 Subject: [Git][ghc/ghc][wip/T24984] 3 commits: TTG HsCmdArrForm: use Fixity via extension point Message-ID: <66a8bfbf6a815_3c86ab56a8d86664f@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24984 at Glasgow Haskell Compiler / GHC Commits: d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 48e9025f by Simon Peyton Jones at 2024-07-30T11:24:27+01:00 Make kick-out more selective This MR revised the crucial kick-out criteria in the constraint solver. Ticket #24984 showed an example in which * We were kicking out unnecessarily * That gave rise to extra work, of course * But it /also/ led to exponentially-sized coercions due to lack of sharing in coercions (something we want to fix separately #20264) This MR sharpens up the kick-out criteria; specifially in (KK2) we look only under type family applications if (fs>=fw). This forced me to understand the existing kick-out story, and I ended up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet. Especially look at the new `Note [The KickOut Criteria]` The proof of termination is not air-tight, but it is better than before, and both Richard and I think it's correct :-). - - - - - 30 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Type.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Types/Constraint.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/GHC/Utils/Misc.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/indexed-types/should_compile/T3208b.stderr - testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr - testsuite/tests/indexed-types/should_fail/T8227.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9fc0d17f685b1a1090e980f9401bcb87830ea732...48e9025fa252f8eb6b5fcfb321c667eeaf2bbf3c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9fc0d17f685b1a1090e980f9401bcb87830ea732...48e9025fa252f8eb6b5fcfb321c667eeaf2bbf3c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 11:23:08 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 30 Jul 2024 07:23:08 -0400 Subject: [Git][ghc/ghc][wip/T24978] 9 commits: Fix -freg-graphs for FP and AARch64 NCG (#24941). Message-ID: <66a8cd1cb53b5_3c86ab84f7887789f@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 0d182ac6 by Simon Peyton Jones at 2024-07-30T12:22:58+01:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to address As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv - - - - - 15 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Opt/DmdAnal.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9d7b70bff58feca962d24f6a64b32b619cc78b94...0d182ac6a4c76428095b716ef34b8ec13b22b6a7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9d7b70bff58feca962d24f6a64b32b619cc78b94...0d182ac6a4c76428095b716ef34b8ec13b22b6a7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:14:47 2024 From: gitlab at gitlab.haskell.org (Fabricio Nascimento (@fabu)) Date: Tue, 30 Jul 2024 08:14:47 -0400 Subject: [Git][ghc/ghc][wip/fabu/T25014-mistakenly-accepted-parent] compiler: refactors renamer lookup for sub binder occurences Message-ID: <66a8d937d78ca_3c86abc52f389215c@gitlab.mail> Fabricio Nascimento pushed to branch wip/fabu/T25014-mistakenly-accepted-parent at Glasgow Haskell Compiler / GHC Commits: ddc51a8f by Fabricio de Sousa Nascimento at 2024-07-30T21:14:24+09:00 compiler: refactors renamer lookup for sub binder occurences Refactors lookupSubBndrOcc_helper into two functions that separately deal with lookup for type classes and export lists. Removes the Semigroup instance of DisambigInfo in favor of directly filtering the GRE occurences, the refactored logic also fix and issue with a program with multiple references being incorrectly accepted Fix #25014 - - - - - 22 changed files: - compiler/GHC/Rename/Env.hs - compiler/GHC/Tc/Gen/Export.hs - compiler/GHC/Types/Name/Reader.hs - testsuite/tests/rename/T24452/T24452b.hs - testsuite/tests/rename/T24452/T24452b.stderr - testsuite/tests/rename/T24452/all.T - + testsuite/tests/rename/T25014/Ambig1.hs - + testsuite/tests/rename/T25014/Ambig2.hs - + testsuite/tests/rename/T25014/T25014a.hs - + testsuite/tests/rename/T25014/T25014a.stderr - + testsuite/tests/rename/T25014/T25014b.hs - + testsuite/tests/rename/T25014/T25014b.stderr - + testsuite/tests/rename/T25014/T25014c.hs - + testsuite/tests/rename/T25014/T25014c.stderr - + testsuite/tests/rename/T25014/T25014d.hs - + testsuite/tests/rename/T25014/T25014d.stderr - + testsuite/tests/rename/T25014/T25014e.hs - + testsuite/tests/rename/T25014/T25014f.hs - + testsuite/tests/rename/T25014/T25014g.hs - + testsuite/tests/rename/T25014/T25014g.stderr - + testsuite/tests/rename/T25014/T25014h.hs - + testsuite/tests/rename/T25014/all.T Changes: ===================================== compiler/GHC/Rename/Env.hs ===================================== @@ -32,7 +32,8 @@ module GHC.Rename.Env ( getUpdFieldLbls, ChildLookupResult(..), - lookupSubBndrOcc_helper, + lookupChildExportListSubBndr, + lookupInstanceDeclarationSubBndr, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, lookupSigOccRnN, lookupSigCtxtOccRn, @@ -113,7 +114,6 @@ import Data.Either ( partitionEithers ) import Data.Function ( on ) import Data.List ( find, partition, groupBy, sortBy ) import qualified Data.List.NonEmpty as NE -import qualified Data.Semigroup as Semi import System.IO.Unsafe ( unsafePerformIO ) {- @@ -403,7 +403,7 @@ lookupInstDeclBndr cls what rdr -- In an instance decl you aren't allowed -- to use a qualified name for the method -- (Although it'd make perfect sense.) - ; mb_name <- lookupSubBndrOcc + ; mb_name <- lookupInstanceDeclarationSubBndr NoDeprecationWarnings -- we don't give deprecated -- warnings when a deprecated class @@ -679,144 +679,267 @@ disambiguation anyway, because `x` is an original name, and lookupGlobalOccRn will find it. -} --- | Used in export lists to lookup the children. -lookupSubBndrOcc_helper :: Bool -> DeprecationWarnings - -> Name - -> RdrName -- ^ thing we are looking up - -> LookupChild -- ^ how to look it up (e.g. which - -- 'NameSpace's to look in) - -> RnM ChildLookupResult -lookupSubBndrOcc_helper must_have_parent warn_if_deprec parent rdr_name how_lkup - | isUnboundName parent - -- Avoid an error cascade - = return (FoundChild (mkUnboundGRERdr rdr_name)) - - | otherwise = do - gre_env <- getGlobalRdrEnv - let original_gres = lookupGRE gre_env (LookupChildren (rdrNameOcc rdr_name) how_lkup) - picked_gres = pick_gres original_gres - -- The remaining GREs are things that we *could* export here. - -- Note that this includes things which have `NoParent`; - -- those are sorted in `checkPatSynParent`. - traceTc "parent" (ppr parent) - traceTc "lookupExportChild must_have_parent:" (ppr must_have_parent) - traceTc "lookupExportChild original_gres:" (ppr original_gres) - traceTc "lookupExportChild picked_gres:" (ppr picked_gres) +{- +Note [Renaming child GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~ +When renaming a GRE, we sometimes make use of GRE parent information to +disambiguate or to improve error messages. This happens in two situations: + + - when renaming an export list, e.g. `T`, `fld` in `module M ( A(T, fld) )`, + - when renaming methods of a class instance, e.g. + `instance C a where { type Assoc a = Int; method a = a }` + +In both of these situations, we first look up all matching GREs, but then +further refine by filtering out GREs with incorrect parents. This is done in +pick_matching_gres, using the DisambigInfo datatype. We proceed as follows: + + 1. We first check if there are no matching GRE at all, and return NoOccurence. + 2. Then we check whether there is a single matching GRE with the right parent, + say gre. + If so, return "MatchingParentOccurrence gre" + 2. If there are multiple matching GREs with the right parent, + return those, using AmbiguousOccurrence. + 3. In the absence of GREs with the right parent, we check whether there is + a single matching GRE, say gre. + If so, return "NoParentOccurrence gre". + 5. Finally, there are multiple matching GREs (none with the right parent), + return all matches, using AmbiguousOccurrence. + +We then consume this information slightly differently for the export case and +for the instance method case, because for exports we can accept a GRE which has +no parent (e.g. when bundling a pattern synonym, as per Note [Parents] +in GHC.Types.Name.Reader), whereas for a class instance we definitely need +the class itself to be the parent, as in the example: + + import Control.Applicative ( Alternative ) + import Data.Set ( empty ) + instance Alternative Foo where + empty = ... + +Test cases: + - T11970 (both cases) + - T25014{a,b,c,d,e,f,g,h} (export lists) + - T23664, T24452{a,b,c,d,e,f} (class instances) +-} +lookupInstanceDeclarationSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> SDoc + -> RdrName -- ^ thing we are looking up + -> RnM (Either NotInScopeError Name) +lookupInstanceDeclarationSubBndr warn_if_deprec parent doc rdr_name = + lookupExactOrOrig rdr_name (Right . greName) $ + -- This happens for built-in classes, see mod52 for example + do + let lookup_method = LookupChild { wantedParent = parent + , lookupDataConFirst = False + , prioritiseParent = True -- See T23664. + } + (picked_gres, _) <- pick_matching_gres parent rdr_name lookup_method + traceRn "lookupInstanceDeclarationSubBndr" (ppr picked_gres) + -- See [Mismatched class methods and associated type families] + -- in TcInstDecls. + case picked_gres of + MatchingParentOccurrence g -> do + addUsedGRE warn_if_deprec g + return $ Right (greName g) + NoOccurrence -> + return $ Left (UnknownSubordinate doc) + NoParentOccurrence _ -> + return $ Left (UnknownSubordinate doc) + AmbiguousOccurrence _ -> + return $ Left (UnknownSubordinate doc) + +-- For details, see [Renaming child GREs] +lookupChildExportListSubBndr :: DeprecationWarnings + -> Name -- ^ Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM ChildLookupResult +lookupChildExportListSubBndr warn_if_deprec parent rdr_name lookup_method = do + (picked_gres, original_gres) <- + pick_matching_gres parent rdr_name lookup_method + traceRn "lookupChildExportListSubBndr" (ppr picked_gres) case picked_gres of + NoParentOccurrence g -> + success_found_child warn_if_deprec g + MatchingParentOccurrence g -> + success_found_child warn_if_deprec g NoOccurrence -> - noMatchingParentErr original_gres - UniqueOccurrence g -> - if must_have_parent - then noMatchingParentErr original_gres - else checkFld g - DisambiguatedOccurrence g -> - checkFld g + error_no_occurrence_after_disambiguation parent rdr_name original_gres AmbiguousOccurrence gres -> - if must_have_parent - -- It is more helpful to tell the user that the ambiguous matches - -- are for a wrong parent, then that there is a name clash, - -- see (#24452). Also since `gres` is NonEmpty and is a sub-list - -- of `original_gres` we are sure the original list is NonEmpty. - then mkIncorrectParentErr (NE.fromList original_gres) - else mkNameClashErr gres - where - checkFld :: GlobalRdrElt -> RnM ChildLookupResult - checkFld g = do - addUsedGRE warn_if_deprec g - return $ FoundChild g - - -- Called when we find no matching GREs after disambiguation but - -- there are three situations where this happens. - -- 1. There were none to begin with. - -- 2. None of the matching ones were the parent but - -- a. They were from an overloaded record field so we can report - -- a better error. - -- b. The original lookup was actually ambiguous. - -- For example, the case where overloading is off and two - -- record fields are in scope from different record - -- constructors, neither of which is the parent. - noMatchingParentErr :: [GlobalRdrElt] -> RnM ChildLookupResult - noMatchingParentErr original_gres = do - traceRn "noMatchingParentErr" (ppr original_gres) - dup_fields_ok <- xoptM LangExt.DuplicateRecordFields - case original_gres of - [] -> return NameNotFound - [g] -> mkIncorrectParentErr (NE.fromList [g]) - gss@(g:gss'@(_:_)) -> - if dup_fields_ok && all isRecFldGRE gss - then mkIncorrectParentErr (NE.fromList gss) - else mkNameClashErr $ g NE.:| gss' - - mkIncorrectParentErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkIncorrectParentErr gres = return $ IncorrectParent parent (NE.head gres) - [p | x <- NE.toList gres, ParentIs p <- [greParent x]] - - mkNameClashErr :: NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult - mkNameClashErr gres = do - addNameClashErrRn rdr_name gres - return (FoundChild (NE.head gres)) - - pick_gres :: [GlobalRdrElt] -> DisambigInfo - -- For Unqual, find GREs that are in scope qualified or unqualified - -- For Qual, find GREs that are in scope with that qualification - pick_gres gres - | isUnqual rdr_name - = mconcat (map right_parent gres) - | otherwise - = mconcat (map right_parent (pickGREs rdr_name gres)) - - right_parent :: GlobalRdrElt -> DisambigInfo - right_parent gre - = case greParent gre of - ParentIs cur_parent - | parent == cur_parent -> DisambiguatedOccurrence gre - | otherwise -> NoOccurrence - NoParent -> UniqueOccurrence gre -{-# INLINEABLE lookupSubBndrOcc_helper #-} + error_name_clash rdr_name gres + where + success_found_child warn_if_deprec g = do + addUsedGRE warn_if_deprec g + return $ FoundChild g + +pick_matching_gres :: Name -- Parent + -> RdrName -- ^ thing we are looking up + -> LookupChild -- ^ how to look it up (e.g. which + -- 'NameSpace's to look in) + -> RnM (DisambigInfo, [GlobalRdrEltX GREInfo]) +pick_matching_gres parent rdr_name lookup_method = do + if isUnboundName parent + -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + then return (MatchingParentOccurrence (mkUnboundGRERdr rdr_name), []) + else do + gre_env <- getGlobalRdrEnv + let lookup_chidren = LookupChildren (rdrNameOcc rdr_name) lookup_method + original_gres = lookupGRE gre_env lookup_chidren + picked_gres = pick_gres original_gres + -- The remaining GREs are things that we *could* export here. + -- Note that this includes things which have 'NoParent'; + -- those are sorted in 'checkPatSynParent'. + traceTc "pick_matching_gres original_gres:" (ppr original_gres) + return (picked_gres, original_gres) + where + -- See Note [Renaming child GREs] for details of what is happening here. + pick_gres :: [GlobalRdrElt] -> DisambigInfo + pick_gres gres + | null no_parent_gres && null matching_parent_gres = + NoOccurrence + | [gre] <- matching_parent_gres = + MatchingParentOccurrence gre + | [gre] <- no_parent_gres, null matching_parent_gres = + -- Checking `null matching_parent_gres` prevents a program to compile + -- when there is a parent ambiguity. See T24014g + NoParentOccurrence gre + | otherwise = do + let all_gres = matching_parent_gres ++ no_parent_gres + AmbiguousOccurrence (NE.fromList all_gres) + where + resolved_gres = resolve_gres rdr_name gres + (matching_parent_gres, no_parent_gres) = partition_gres resolved_gres + + -- foldr preserves the order of the errors as they appear in the source + partition_gres :: [DisambigInfo] -> ([GlobalRdrElt], [GlobalRdrElt]) + partition_gres = foldr separate_gres_matches ([], []) + where + separate_gres_matches :: DisambigInfo -> ([GlobalRdrElt], [GlobalRdrElt]) -> ([GlobalRdrElt], [GlobalRdrElt]) + separate_gres_matches (MatchingParentOccurrence g) (matching_parent_gres, no_parent_gres) = (g:matching_parent_gres, no_parent_gres) + separate_gres_matches (NoParentOccurrence g) (matching_parent_gres, no_parent_gres) = (matching_parent_gres, g:no_parent_gres) + separate_gres_matches _ acc = acc + + -- For Unqual, find GREs that are in scope qualified or unqualified + -- For Qual, find GREs that are in scope with that qualification + resolve_gres :: RdrName -> [GlobalRdrElt] -> [DisambigInfo] + resolve_gres rdr_name gres + | isUnqual rdr_name = map (match_parent parent) gres + | otherwise = map (match_parent parent) (pickGREs rdr_name gres) + +{- Note [Better errors for no matching GREs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When GHC does not find a matching name on GREs after disambiguation +(see [Picking and disambiguating children candidates]) it outputs an error like +`Not in scope: ...` (NoOccurence). In some cases we can offer a better error +by looking at the original GRE matches before disambiguation and attempt to +surface problems that could have caused GHC to not being able to find the +correct identifier. This is what error_no_occurrence_after_disambiguation does. + +1. For example where the name exists for a different parent. + + module IncorrectParent (A (b)) where + data A = A { a :: () } + data B = B { b :: () } + +In this case instead of `Not in scope: ‘b’` we prefer the error. + The type constructor ‘A’ is not the parent of the record selector ‘b’ (...) + +2. Another case is when there is an ambiguity and we have DuplicateRecordFields. + + {-# LANGUAGE DuplicateRecordFields #-} + module IncorrectParent (A (other)) where + data A = A { one :: () } + data B = B { other :: () } + data C = C { other :: () } + +we also prefer + The type constructor ‘A’ is not the parent of the record selector ‘other’ (...) + +instead of: + Ambiguous occurrence ‘other’. + It could refer to + either the field ‘other’ of record ‘B’ ... + or the field ‘other’ of record ‘C’ ... +-} +error_no_occurrence_after_disambiguation :: Name + -> RdrName + -> [GlobalRdrEltX GREInfo] + -> RnM ChildLookupResult +error_no_occurrence_after_disambiguation parent rdr_name original_gres = do + traceRn "error_no_matching_parent" (ppr original_gres) + dup_fields_ok <- xoptM LangExt.DuplicateRecordFields + case original_gres of + [] -> return NameNotFound + [g] -> error_incorrect_parent parent (NE.fromList [g]) + gss@(g:gss'@(_:_)) -> + if dup_fields_ok && all isRecFldGRE gss + then error_incorrect_parent parent (NE.fromList gss) + else error_name_clash rdr_name $ g NE.:| gss' + +error_name_clash :: RdrName -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_name_clash rdr_name gres = do + addNameClashErrRn rdr_name gres + return (FoundChild (NE.head gres)) -- Avoid an error cascade, see Note [ Unbound vs Ambiguous Names ] + +error_incorrect_parent :: Name -> NE.NonEmpty GlobalRdrElt -> RnM ChildLookupResult +error_incorrect_parent parent gres = return $ IncorrectParent parent (NE.head gres) + [p | x <- NE.toList gres, ParentIs p <- [greParent x]] + + +{- Note [Disambiguating GREs by parent] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Names can occur on GRE with or without Parent. When renaming an identifier +for example the `foo` on export `A (foo)` on the export list of the program +below, we have the following types of matches: + + {-# LANGUAGE DuplicateRecordFields #-} + module Matches (A (foo, Pat, bar)) where + import Data.Map (empty) + + data A = A { foo :: () } + data B = B { foo :: () } + + pattern Pat = ... + +if we are looking for `foo` in the export list `A (foo)` +1. `A.foo` is a MatchingParentOccurrence. +2. `B.foo` is a NoOccurrence, as it is parent B, does not match the parent A +we are looking for. + +if we are looking for `Pat` in the export list `A (Pat)` +3. `pattern Pat` is a NoParentOccurrence. + +The AmbiguousOccurrence arise anytime multiple NoParentOccurrences or +MatchingOccurrences are found, see [Picking and disambiguating children candidates] +-} +match_parent :: Name -> GlobalRdrElt -> DisambigInfo +match_parent parent gre + = case greParent gre of + ParentIs cur_parent + | parent == cur_parent -> MatchingParentOccurrence gre + | otherwise -> NoOccurrence + NoParent -> NoParentOccurrence gre -- | This domain specific datatype is used to record why we decided it was -- possible that a GRE could be exported with a parent. data DisambigInfo = NoOccurrence -- ^ The GRE could not be found, or it has the wrong parent. - | UniqueOccurrence GlobalRdrElt + | NoParentOccurrence GlobalRdrElt -- ^ The GRE has no parent. It could be a pattern synonym. - | DisambiguatedOccurrence GlobalRdrElt - -- ^ The parent of the GRE is the correct parent. + | MatchingParentOccurrence GlobalRdrElt + -- ^ The parent of the GRE is the correct parent. See match_parent. | AmbiguousOccurrence (NE.NonEmpty GlobalRdrElt) -- ^ The GRE is ambiguous. - -- - -- For example, two normal identifiers with the same name are in - -- scope. They will both be resolved to "UniqueOccurrence" and the - -- monoid will combine them to this failing case. - instance Outputable DisambigInfo where ppr NoOccurrence = text "NoOccurrence" - ppr (UniqueOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre - ppr (DisambiguatedOccurrence gre) = text "DiambiguatedOccurrence:" <+> ppr gre + ppr (NoParentOccurrence gre) = text "UniqueOccurrence:" <+> ppr gre + ppr (MatchingParentOccurrence gre) = text "MatchingParentOccurrence:" + <+> ppr gre ppr (AmbiguousOccurrence gres) = text "Ambiguous:" <+> ppr gres -instance Semi.Semigroup DisambigInfo where - -- These are the key lines: we prefer disambiguated occurrences to other - -- names. - _ <> DisambiguatedOccurrence g' = DisambiguatedOccurrence g' - DisambiguatedOccurrence g' <> _ = DisambiguatedOccurrence g' - - NoOccurrence <> m = m - m <> NoOccurrence = m - UniqueOccurrence g <> UniqueOccurrence g' - = AmbiguousOccurrence $ g NE.:| [g'] - UniqueOccurrence g <> AmbiguousOccurrence gs - = AmbiguousOccurrence (g `NE.cons` gs) - AmbiguousOccurrence gs <> UniqueOccurrence g' - = AmbiguousOccurrence (g' `NE.cons` gs) - AmbiguousOccurrence gs <> AmbiguousOccurrence gs' - = AmbiguousOccurrence (gs Semi.<> gs') - -instance Monoid DisambigInfo where - mempty = NoOccurrence - mappend = (Semi.<>) - -- Lookup SubBndrOcc can never be ambiguous -- -- Records the result of looking up a child. @@ -829,7 +952,6 @@ data ChildLookupResult [Name] -- ^ list of possible parents -- | We resolved to a child | FoundChild GlobalRdrElt - instance Outputable ChildLookupResult where ppr NameNotFound = text "NameNotFound" ppr (FoundChild n) = text "Found:" <+> ppr (greParent n) <+> ppr n @@ -837,28 +959,6 @@ instance Outputable ChildLookupResult where = text "IncorrectParent" <+> hsep [ppr p, ppr $ greName g, ppr ns] -lookupSubBndrOcc :: DeprecationWarnings - -> Name -- Parent - -> SDoc - -> RdrName - -> RnM (Either NotInScopeError Name) --- ^ Find all the things the 'RdrName' maps to, --- and pick the one with the right 'Parent' 'Name'. -lookupSubBndrOcc warn_if_deprec the_parent doc rdr_name = - lookupExactOrOrig rdr_name (Right . greName) $ - -- This happens for built-in classes, see mod052 for example - do { child <- lookupSubBndrOcc_helper True warn_if_deprec the_parent rdr_name what_lkup - ; return $ case child of - FoundChild g -> Right (greName g) - NameNotFound -> Left (UnknownSubordinate doc) - IncorrectParent {} -> Left (UnknownSubordinate doc) } - -- See [Mismatched class methods and associated type families] - -- in TcInstDecls. - where - what_lkup = LookupChild { wantedParent = the_parent - , lookupDataConFirst = False - , prioritiseParent = True -- See T23664. - } {- Note [Family instance binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2169,7 +2269,7 @@ lookupBindGroupOcc ctxt what rdr_name also_try_tycon_ns ns_spec = NE.singleton (Left err) lookup_cls_op cls - = NE.singleton <$> lookupSubBndrOcc AllDeprecationWarnings cls doc rdr_name + = NE.singleton <$> lookupInstanceDeclarationSubBndr AllDeprecationWarnings cls doc rdr_name where doc = text "method of class" <+> quotes (ppr cls) ===================================== compiler/GHC/Tc/Gen/Export.hs ===================================== @@ -654,32 +654,67 @@ If the module has NO main function: The IO action ‘main’ is not defined in module ‘Main’ -} +{- +Note [Renaming children on export lists] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Renaming export lists has many corner cases, and 5 different things can appear +in a children export list under a parent. --- Renaming exports lists is a minefield. Five different things can appear in --- children export lists ( T(A, B, C) ). --- 1. Record selectors --- 2. Type constructors --- 3. Data constructors --- 4. Pattern Synonyms --- 5. Pattern Synonym Selectors --- --- However, things get put into weird name spaces. --- 1. Some type constructors are parsed as variables (-.->) for example. --- 2. All data constructors are parsed as type constructors --- 3. When there is ambiguity, we default type constructors to data --- constructors and require the explicit `type` keyword for type --- constructors. --- --- This function first establishes the possible namespaces that an --- identifier might be in (`choosePossibleNameSpaces`). --- --- Then for each namespace in turn, tries to find the correct identifier --- there returning the first positive result or the first terminating --- error. --- + module M (R (s), D (MkD), Maybe (Empty), Either (Empty), pattern Px) where + + -- 1. Record Selector + data R = R { s :: Int } + + -- 2. Data Constructor + data D a = MkD a + + -- 3. Type Constructor + type S = MkD Int + + -- 4. Pattern Synonyms + class Empty a where + isEmpty :: a -> Bool + instance Empty (Maybe a) where + isEmpty Nothing = True + instance Empty (Either a b) where + isEmpty (Left _) = True + pattern Empty :: Empty a => a + pattern Empty <- (isEmpty -> True) + + -- 5. Record Pattern Synonym selectors + data Point = Point Int Int + + pattern Px :: Int -> Point + pattern Px{x} <- Point x _ + + +To makes matter more complicated: +1. Some type constructors are parsed as variables (-.->) for example. +2. All data constructors are parsed as type constructors +3. When there is ambiguity, we default type constructors to data +constructors and require the explicit `type` keyword for type +constructors. +4. Pattern synonyms are very flexible in which parents they can be exported with +(see [Typing Pattern Synonym Exports]). + +We proceed in two steps: + + 1. We look up GREs, handling the possible NameSpaces to look up in. + See Note [Configurable GRE lookup priority]. + 2. We refine by using the GRE parent information. + See Note [Renaming child GREs]. + +For more details see +[Renaming the LHS on type class Instances], +[Configurable GRE lookup priority] and [Picking and disambiguating children +candidates]. + +Also notice that this logic is similar to +[Renaming the LHS on type class Instances] +-} lookupChildrenExport :: Name -> [LIEWrappedName GhcPs] -> RnM ([(LIEWrappedName GhcRn, GlobalRdrElt)]) lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items @@ -698,8 +733,8 @@ lookupChildrenExport spec_parent rdr_items = mapAndReportM doOne rdr_items , prioritiseParent = False -- See T11970. } - -- Do not report export list declaration deprecations - name <- lookupSubBndrOcc_helper False ExportDeprecationWarnings + -- Do not report export list declaration deprecations + name <- lookupChildExportListSubBndr ExportDeprecationWarnings spec_parent bareName what_lkup traceRn "lookupChildrenExport" (ppr name) -- Default to data constructors for slightly better error ===================================== compiler/GHC/Types/Name/Reader.hs ===================================== @@ -1215,7 +1215,7 @@ data LookupChild -- - @True@: prioritise getting the right 'Parent' -- - @False@: prioritise getting the right 'NameSpace' -- - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. } instance Outputable LookupChild where @@ -1262,21 +1262,27 @@ greIsRelevant which_gres ns gre where other_ns = greNameSpace gre -{- Note [childGREPriority] -~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Configurable GRE lookup priority] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are currently two places in the compiler where we look up GlobalRdrElts -which have a given Parent. These are the two calls to lookupSubBndrOcc_helper: +which have a given Parent. - A. Looking up children in an export item, e.g. + A. lookupChildExportListSubBndr looks up children in an export item, e.g. module M ( T(MkT, D) ) where { data T = MkT; data D = D } - B. Looking up binders in a class or instance declaration, e.g. + -- see [Renaming children on export lists] + + B. lookupInstanceDeclarationSubBndr looks up binders in a class or + instance declaration, e.g. + the operator +++ in the fixity declaration: - class C a where { type (+++) :: a -> a ->; infixl 6 +++ } + class C a where { type (+++) :: a -> a -> a; infixl 6 +++ } (+++) :: Int -> Int -> Int; (+++) = (+) + -- see [Renaming the LHS on type class Instances] + In these two situations, there are two competing metrics for finding the "best" 'GlobalRdrElt' that a particular 'OccName' resolves to: @@ -1307,7 +1313,7 @@ Not doing so led to #23664. -- -- We score by 'Parent' and 'NameSpace', with higher priorities having lower -- numbers. Which lexicographic order we use ('Parent' or 'NameSpace' first) --- is determined by the first argument; see Note [childGREPriority]. +-- is determined by the first argument; see Note [Configurable GRE lookup priority]. childGREPriority :: LookupChild -- ^ what kind of child do we want, -- e.g. what should its parent be? -> NameSpace -- ^ what 'NameSpace' are we originally looking in? @@ -1327,7 +1333,7 @@ childGREPriority (LookupChild { wantedParent = wanted_parent in Just $ if par_first then (par_prio, ns_prio) else (ns_prio, par_prio) - -- See Note [childGREPriority]. + -- See Note [Configurable GRE lookup priority]. where -- Pick out the possible 'NameSpace's in order of priority. ===================================== testsuite/tests/rename/T24452/T24452b.hs ===================================== @@ -1,5 +1,4 @@ -- Alternative.empty is not visible -{-# LANGUAGE GeneralizedNewtypeDeriving #-} module BugReproduce where import Control.Applicative (Alternative) ===================================== testsuite/tests/rename/T24452/T24452b.stderr ===================================== @@ -1,2 +1,2 @@ -T24452b.hs:10:3: error: [GHC-54721] +T24452b.hs:9:3: error: [GHC-54721] ‘empty’ is not a (visible) method of class ‘Alternative’ \ No newline at end of file ===================================== testsuite/tests/rename/T24452/all.T ===================================== @@ -3,4 +3,4 @@ test('T24452b', normal, compile_fail, ['']) test('T24452c', normal, compile_fail, ['']) test('T24452d', normal, compile_fail, ['']) test('T24452e', normal, compile_fail, ['']) -test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) \ No newline at end of file +test('T24452f', [extra_files(['AmbigPatSynA.hs', 'AmbigPatSynB.hs'])], multimod_compile_fail, ['T24452f','-v0']) ===================================== testsuite/tests/rename/T25014/Ambig1.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig2 +{-# LANGUAGE TypeFamilies #-} +module Ambig1 where + data family T a + data instance T Bool = MkT ===================================== testsuite/tests/rename/T25014/Ambig2.hs ===================================== @@ -0,0 +1,5 @@ +-- A module that is ambiguous with Ambig1 +{-# LANGUAGE TypeFamilies #-} +module Ambig2 where + import Ambig1 (T) + data instance T Int = MkT ===================================== testsuite/tests/rename/T25014/T25014a.hs ===================================== @@ -0,0 +1,5 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014a.stderr ===================================== @@ -0,0 +1,10 @@ +T25014a.hs:2:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014a.hs:3:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014a.hs:4:18-23 + (and originally defined at Ambig2.hs:5:25-27). + In the export: T(MkT) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014b.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile trying to export a missing name +module T25014b (A (foo)) where + +data A ===================================== testsuite/tests/rename/T25014/T25014b.stderr ===================================== @@ -0,0 +1,3 @@ +T25014b.hs:2:17: [GHC-76037] + Not in scope: ‘foo’ + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014c.hs ===================================== @@ -0,0 +1,8 @@ +-- Should not compile trying to export a missing name +module T25014c (A (foo)) where + +data A + +data B = B { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014c.stderr ===================================== @@ -0,0 +1,5 @@ +T25014c.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the record selector ‘foo’. + Record selectors can only be exported with their parent type constructor. + Parent: B + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014d.hs ===================================== @@ -0,0 +1,6 @@ +-- Should not compile trying to export a name with the wrong parent +module T25014b (A (foo)) where + +data A + +foo = 1 ===================================== testsuite/tests/rename/T25014/T25014d.stderr ===================================== @@ -0,0 +1,4 @@ +T25014d.hs:2:17: [GHC-88993] + The type constructor ‘A’ is not the parent of the identifier ‘foo’. + Identifiers can only be exported with their parent type constructor. + In the export: A(foo) \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014e.hs ===================================== @@ -0,0 +1,6 @@ +-- Should compile as A.foo matches parent +module T25014b (A (foo)) where + +data A = A { + foo :: Int +} ===================================== testsuite/tests/rename/T25014/T25014f.hs ===================================== @@ -0,0 +1,4 @@ +-- Should not compile as it is unclear what gets exported +module T25014a (T(MkT)) where + import Ambig1 (T(MkT)) + data S \ No newline at end of file ===================================== testsuite/tests/rename/T25014/T25014g.hs ===================================== @@ -0,0 +1,9 @@ +-- Even though there is a single MkT without a parent, there is an ambiguity +-- between Ambig1.T.MkT and Ambig2.T.MkT so we can't compile +{-# LANGUAGE PatternSynonyms #-} + +module T25014g (T(MkT)) where + import Ambig1 (T(MkT)) + import Ambig2 (T(MkT)) + + pattern MkT = Ambig1.MkT ===================================== testsuite/tests/rename/T25014/T25014g.stderr ===================================== @@ -0,0 +1,11 @@ +T25014g.hs:5:17: [GHC-87543] + Ambiguous occurrence ‘MkT’. + It could refer to + either ‘Ambig1.MkT’, + imported from ‘Ambig1’ at T25014g.hs:6:18-23 + (and originally defined at Ambig1.hs:5:26-28), + or ‘Ambig2.MkT’, + imported from ‘Ambig2’ at T25014g.hs:7:18-23 + (and originally defined at Ambig2.hs:5:25-27), + or ‘T25014g.MkT’, defined at T25014g.hs:9:3. + In the export: T(MkT) ===================================== testsuite/tests/rename/T25014/T25014h.hs ===================================== @@ -0,0 +1,8 @@ +-- A comment +{-# LANGUAGE PatternSynonyms #-} + +module T25014h (T(MkT)) where + import Ambig1 (T(MkT)) + import qualified Ambig1 as Am + + pattern MkT = Am.MkT ===================================== testsuite/tests/rename/T25014/all.T ===================================== @@ -0,0 +1,8 @@ +test('T25014a', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014a','-v0']) +test('T25014b', [], compile_fail, ['']) +test('T25014c', [], compile_fail, ['']) +test('T25014d', [], compile_fail, ['']) +test('T25014e', [], compile, ['']) +test('T25014f', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile, ['T25014f','-v0']) +test('T25014g', [extra_files(['Ambig1.hs', 'Ambig2.hs'])], multimod_compile_fail, ['T25014g','-v0']) +test('T25014h', [extra_files(['Ambig1.hs'])], multimod_compile, ['T25014h','-v0']) \ No newline at end of file View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ddc51a8ff6f484a97e6a4f7778b443b54d041a3c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ddc51a8ff6f484a97e6a4f7778b443b54d041a3c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:30:40 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 30 Jul 2024 08:30:40 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/t25122 Message-ID: <66a8dcf075288_3c86abdda6e4957d0@gitlab.mail> Matthew Pickering pushed new branch wip/t25122 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/t25122 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:31:21 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Tue, 30 Jul 2024 08:31:21 -0400 Subject: [Git][ghc/ghc][wip/t25122] driver: Fix -Wmissing-home-modules when multiple units have the same module name Message-ID: <66a8dd193ad11_3c86abec6e049598b@gitlab.mail> Matthew Pickering pushed to branch wip/t25122 at Glasgow Haskell Compiler / GHC Commits: d95d0356 by Matthew Pickering at 2024-07-30T13:30:43+01:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - 5 changed files: - compiler/GHC/Driver/Make.hs - + testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs - testsuite/tests/driver/multipleHomeUnits/all.T - + testsuite/tests/driver/multipleHomeUnits/unitSame1 - + testsuite/tests/driver/multipleHomeUnits/unitSame2 Changes: ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -329,10 +329,12 @@ warnMissingHomeModules dflags targets mod_graph = -- Note also that we can't always infer the associated module name -- directly from the filename argument. See #13727. is_known_module mod = - (Map.lookup (moduleName (ms_mod mod)) mod_targets == Just (ms_unitid mod)) + is_module_target mod || maybe False is_file_target (ml_hs_file (ms_location mod)) + is_module_target mod = (moduleName (ms_mod mod), ms_unitid mod) `Set.member` mod_targets + is_file_target file = Set.member (withoutExt file) file_targets file_targets = Set.fromList (mapMaybe file_target targets) @@ -343,7 +345,7 @@ warnMissingHomeModules dflags targets mod_graph = TargetFile file _ -> Just (withoutExt (augmentByWorkingDirectory dflags file)) - mod_targets = Map.fromList (mod_target <$> targets) + mod_targets = Set.fromList (mod_target <$> targets) mod_target Target {targetUnitId, targetId} = case targetId of ===================================== testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs ===================================== @@ -0,0 +1 @@ +module T25122 where ===================================== testsuite/tests/driver/multipleHomeUnits/all.T ===================================== @@ -71,6 +71,11 @@ test('multipleHomeUnits_shared', [extra_files([ 'A.hs', 'unitShared1', 'unitShar test('multipleHomeUnits_shared_ghci', [extra_files([ 'shared.script', 'A.hs', 'unitShared1', 'unitShared2']), extra_run_opts('-unit @unitShared1 -unit @unitShared2')], ghci_script, ['shared.script']) +test('T25122', + [ extra_files( + [ 'T25122', 'unitSame1', 'unitSame2']) + ], multiunit_compile, [['unitSame1', 'unitSame2'], '-v0 -fhide-source-paths -Werror -Wmissing-home-modules']) + ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame1 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=s1 ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame2 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=u2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d95d03561ca861d23b8f4df620e4c69fefa0b6b7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d95d03561ca861d23b8f4df620e4c69fefa0b6b7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:33:39 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 08:33:39 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a8dda380767_3c86ab108a8d010197e@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: b7f6e70e by sheaf at 2024-07-30T14:33:18+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 28 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -725,6 +725,8 @@ pprMachOp_for_C platform mop = case mop of MO_F_Neg _ -> char '-' MO_F_Mul _ -> char '*' MO_F_Quot _ -> char '/' + MO_F_Min _ -> text "fmin" + MO_F_Max _ -> text "fmax" -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> @@ -917,6 +919,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -203,6 +203,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -176,6 +176,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7f6e70eb08c01daf3b41d5b53098073e8b75173 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b7f6e70eb08c01daf3b41d5b53098073e8b75173 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:43:25 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 08:43:25 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a8dfed503a2_3c86ab121dd781042bd@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: a1e09b82 by sheaf at 2024-07-30T14:43:02+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 28 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -535,13 +535,20 @@ pprMachOpApp' platform mop args -- ternary args@[_,_,_] -> - pprMachOp_for_C platform mop <> parens (pprWithCommas pprArg args) + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprWithCommas pprArg args) -- dyadic - [x,y] -> pprArg x <+> pprMachOp_for_C platform mop <+> pprArg y + args@[x,y] -> + let (fixity, op) = pprMachOp_for_C platform mop + in case fixity of + Infix -> pprArg x <+> op <+> pprArg y + Prefix -> op <> parens (pprWithCommas pprArg args) -- unary - [x] -> pprMachOp_for_C platform mop <> parens (pprArg x) + [x] -> + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprArg x) _ -> panic "PprC.pprMachOp : machop with wrong number of args" @@ -701,36 +708,41 @@ pprBlockId b = char '_' <> ppr (getUnique b) -- Print a MachOp in a way suitable for emitting via C. -- -pprMachOp_for_C :: Platform -> MachOp -> SDoc +data Fixity = Prefix | Infix + deriving ( Eq, Show ) + +pprMachOp_for_C :: Platform -> MachOp -> (Fixity, SDoc) pprMachOp_for_C platform mop = case mop of -- Integer operations - MO_Add _ -> char '+' - MO_Sub _ -> char '-' - MO_Eq _ -> text "==" - MO_Ne _ -> text "!=" - MO_Mul _ -> char '*' + MO_Add _ -> (Infix, char '+') + MO_Sub _ -> (Infix, char '-') + MO_Eq _ -> (Infix, text "==") + MO_Ne _ -> (Infix, text "!=") + MO_Mul _ -> (Infix, char '*') - MO_S_Quot _ -> char '/' - MO_S_Rem _ -> char '%' - MO_S_Neg _ -> char '-' + MO_S_Quot _ -> (Infix, char '/') + MO_S_Rem _ -> (Infix, char '%') + MO_S_Neg _ -> (Infix, char '-') - MO_U_Quot _ -> char '/' - MO_U_Rem _ -> char '%' + MO_U_Quot _ -> (Infix, char '/') + MO_U_Rem _ -> (Infix, char '%') -- Floating-point operations - MO_F_Add _ -> char '+' - MO_F_Sub _ -> char '-' - MO_F_Neg _ -> char '-' - MO_F_Mul _ -> char '*' - MO_F_Quot _ -> char '/' + MO_F_Add _ -> (Infix, char '+') + MO_F_Sub _ -> (Infix, char '-') + MO_F_Neg _ -> (Infix, char '-') + MO_F_Mul _ -> (Infix, char '*') + MO_F_Quot _ -> (Infix, char '/') + MO_F_Min _ -> (Prefix, text "fmin") + MO_F_Max _ -> (Prefix, text "fmax") -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> case w of - W32 -> text "fmaf" - W64 -> text "fma" + W32 -> (Prefix, text "fmaf") + W64 -> (Prefix, text "fma") _ -> pprTrace "offending mop:" (text "FMAdd") @@ -747,34 +759,34 @@ pprMachOp_for_C platform mop = case mop of (panic $ "PprC.pprMachOp_for_C: unsupported vector operation") -- Signed comparisons - MO_S_Ge _ -> text ">=" - MO_S_Le _ -> text "<=" - MO_S_Gt _ -> char '>' - MO_S_Lt _ -> char '<' + MO_S_Ge _ -> (Infix, text ">=") + MO_S_Le _ -> (Infix, text "<=") + MO_S_Gt _ -> (Infix, char '>') + MO_S_Lt _ -> (Infix, char '<') -- & Unsigned comparisons - MO_U_Ge _ -> text ">=" - MO_U_Le _ -> text "<=" - MO_U_Gt _ -> char '>' - MO_U_Lt _ -> char '<' + MO_U_Ge _ -> (Infix, text ">=") + MO_U_Le _ -> (Infix, text "<=") + MO_U_Gt _ -> (Infix, char '>') + MO_U_Lt _ -> (Infix, char '<') -- & Floating-point comparisons - MO_F_Eq _ -> text "==" - MO_F_Ne _ -> text "!=" - MO_F_Ge _ -> text ">=" - MO_F_Le _ -> text "<=" - MO_F_Gt _ -> char '>' - MO_F_Lt _ -> char '<' + MO_F_Eq _ -> (Infix, text "==") + MO_F_Ne _ -> (Infix, text "!=") + MO_F_Ge _ -> (Infix, text ">=") + MO_F_Le _ -> (Infix, text "<=") + MO_F_Gt _ -> (Infix, char '>') + MO_F_Lt _ -> (Infix, char '<') -- Bitwise operations. Not all of these may be supported at all -- sizes, and only integral MachReps are valid. - MO_And _ -> char '&' - MO_Or _ -> char '|' - MO_Xor _ -> char '^' - MO_Not _ -> char '~' - MO_Shl _ -> text "<<" - MO_U_Shr _ -> text ">>" -- unsigned shift right - MO_S_Shr _ -> text ">>" -- signed shift right + MO_And _ -> (Infix, char '&') + MO_Or _ -> (Infix, char '|') + MO_Xor _ -> (Infix, char '^') + MO_Not _ -> (Infix, char '~') + MO_Shl _ -> (Infix, text "<<") + MO_U_Shr _ -> (Infix, text ">>") -- unsigned shift right + MO_S_Shr _ -> (Infix, text ">>") -- signed shift right -- Conversions. Some of these will be NOPs, but never those that convert -- between ints and floats. @@ -785,11 +797,11 @@ pprMachOp_for_C platform mop = case mop of -- bitcasts, in the C backend these are performed with __builtin_memcpy. -- See rts/include/stg/Prim.h - MO_FW_Bitcast W32 -> text "hs_bitcastfloat2word" - MO_FW_Bitcast W64 -> text "hs_bitcastdouble2word64" + MO_FW_Bitcast W32 -> (Prefix, text "hs_bitcastfloat2word") + MO_FW_Bitcast W64 -> (Prefix, text "hs_bitcastdouble2word64") - MO_WF_Bitcast W32 -> text "hs_bitcastword2float" - MO_WF_Bitcast W64 -> text "hs_bitcastword642double" + MO_WF_Bitcast W32 -> (Prefix, text "hs_bitcastword2float") + MO_WF_Bitcast W64 -> (Prefix, text "hs_bitcastword642double") MO_FW_Bitcast w -> pprTrace "offending mop:" (text "MO_FW_Bitcast") @@ -806,19 +818,19 @@ pprMachOp_for_C platform mop = case mop of -- noop casts MO_UU_Conv from to | from == to -> empty - MO_UU_Conv _from to -> parens (machRep_U_CType platform to) + MO_UU_Conv _from to -> (Prefix, parens (machRep_U_CType platform to)) MO_SS_Conv from to | from == to -> empty - MO_SS_Conv _from to -> parens (machRep_S_CType platform to) + MO_SS_Conv _from to -> (Prefix, parens (machRep_S_CType platform to)) MO_XX_Conv from to | from == to -> empty - MO_XX_Conv _from to -> parens (machRep_U_CType platform to) + MO_XX_Conv _from to -> (Prefix,parens (machRep_U_CType platform to)) MO_FF_Conv from to | from == to -> empty - MO_FF_Conv _from to -> parens (machRep_F_CType to) + MO_FF_Conv _from to -> (Prefix,parens (machRep_F_CType to)) - MO_SF_Round _from to -> parens (machRep_F_CType to) - MO_FS_Truncate _from to -> parens (machRep_S_CType platform to) + MO_SF_Round _from to -> (Prefix,parens (machRep_F_CType to)) + MO_FS_Truncate _from to -> (Prefix,parens (machRep_S_CType platform to)) MO_RelaxedRead _ -> pprTrace "offending mop:" (text "MO_RelaxedRead") @@ -917,6 +929,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -203,6 +203,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -176,6 +176,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a1e09b829f27e1db482fe499718a460c7f2ab947 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a1e09b829f27e1db482fe499718a460c7f2ab947 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 12:44:11 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 08:44:11 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a8e01b8a2d1_3c86ab128fe3c10494f@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: af1780d1 by sheaf at 2024-07-30T14:43:50+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 28 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -535,13 +535,20 @@ pprMachOpApp' platform mop args -- ternary args@[_,_,_] -> - pprMachOp_for_C platform mop <> parens (pprWithCommas pprArg args) + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprWithCommas pprArg args) -- dyadic - [x,y] -> pprArg x <+> pprMachOp_for_C platform mop <+> pprArg y + args@[x,y] -> + let (fixity, op) = pprMachOp_for_C platform mop + in case fixity of + Infix -> pprArg x <+> op <+> pprArg y + Prefix -> op <> parens (pprWithCommas pprArg args) -- unary - [x] -> pprMachOp_for_C platform mop <> parens (pprArg x) + [x] -> + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprArg x) _ -> panic "PprC.pprMachOp : machop with wrong number of args" @@ -701,36 +708,41 @@ pprBlockId b = char '_' <> ppr (getUnique b) -- Print a MachOp in a way suitable for emitting via C. -- -pprMachOp_for_C :: Platform -> MachOp -> SDoc +data Fixity = Prefix | Infix + deriving ( Eq, Show ) + +pprMachOp_for_C :: Platform -> MachOp -> (Fixity, SDoc) pprMachOp_for_C platform mop = case mop of -- Integer operations - MO_Add _ -> char '+' - MO_Sub _ -> char '-' - MO_Eq _ -> text "==" - MO_Ne _ -> text "!=" - MO_Mul _ -> char '*' + MO_Add _ -> (Infix, char '+') + MO_Sub _ -> (Infix, char '-') + MO_Eq _ -> (Infix, text "==") + MO_Ne _ -> (Infix, text "!=") + MO_Mul _ -> (Infix, char '*') - MO_S_Quot _ -> char '/' - MO_S_Rem _ -> char '%' - MO_S_Neg _ -> char '-' + MO_S_Quot _ -> (Infix, char '/') + MO_S_Rem _ -> (Infix, char '%') + MO_S_Neg _ -> (Infix, char '-') - MO_U_Quot _ -> char '/' - MO_U_Rem _ -> char '%' + MO_U_Quot _ -> (Infix, char '/') + MO_U_Rem _ -> (Infix, char '%') -- Floating-point operations - MO_F_Add _ -> char '+' - MO_F_Sub _ -> char '-' - MO_F_Neg _ -> char '-' - MO_F_Mul _ -> char '*' - MO_F_Quot _ -> char '/' + MO_F_Add _ -> (Infix, char '+') + MO_F_Sub _ -> (Infix, char '-') + MO_F_Neg _ -> (Infix, char '-') + MO_F_Mul _ -> (Infix, char '*') + MO_F_Quot _ -> (Infix, char '/') + MO_F_Min _ -> (Prefix, text "fmin") + MO_F_Max _ -> (Prefix, text "fmax") -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> case w of - W32 -> text "fmaf" - W64 -> text "fma" + W32 -> (Prefix, text "fmaf") + W64 -> (Prefix, text "fma") _ -> pprTrace "offending mop:" (text "FMAdd") @@ -747,34 +759,34 @@ pprMachOp_for_C platform mop = case mop of (panic $ "PprC.pprMachOp_for_C: unsupported vector operation") -- Signed comparisons - MO_S_Ge _ -> text ">=" - MO_S_Le _ -> text "<=" - MO_S_Gt _ -> char '>' - MO_S_Lt _ -> char '<' + MO_S_Ge _ -> (Infix, text ">=") + MO_S_Le _ -> (Infix, text "<=") + MO_S_Gt _ -> (Infix, char '>') + MO_S_Lt _ -> (Infix, char '<') -- & Unsigned comparisons - MO_U_Ge _ -> text ">=" - MO_U_Le _ -> text "<=" - MO_U_Gt _ -> char '>' - MO_U_Lt _ -> char '<' + MO_U_Ge _ -> (Infix, text ">=") + MO_U_Le _ -> (Infix, text "<=") + MO_U_Gt _ -> (Infix, char '>') + MO_U_Lt _ -> (Infix, char '<') -- & Floating-point comparisons - MO_F_Eq _ -> text "==" - MO_F_Ne _ -> text "!=" - MO_F_Ge _ -> text ">=" - MO_F_Le _ -> text "<=" - MO_F_Gt _ -> char '>' - MO_F_Lt _ -> char '<' + MO_F_Eq _ -> (Infix, text "==") + MO_F_Ne _ -> (Infix, text "!=") + MO_F_Ge _ -> (Infix, text ">=") + MO_F_Le _ -> (Infix, text "<=") + MO_F_Gt _ -> (Infix, char '>') + MO_F_Lt _ -> (Infix, char '<') -- Bitwise operations. Not all of these may be supported at all -- sizes, and only integral MachReps are valid. - MO_And _ -> char '&' - MO_Or _ -> char '|' - MO_Xor _ -> char '^' - MO_Not _ -> char '~' - MO_Shl _ -> text "<<" - MO_U_Shr _ -> text ">>" -- unsigned shift right - MO_S_Shr _ -> text ">>" -- signed shift right + MO_And _ -> (Infix, char '&') + MO_Or _ -> (Infix, char '|') + MO_Xor _ -> (Infix, char '^') + MO_Not _ -> (Infix, char '~') + MO_Shl _ -> (Infix, text "<<") + MO_U_Shr _ -> (Infix, text ">>") -- unsigned shift right + MO_S_Shr _ -> (Infix, text ">>") -- signed shift right -- Conversions. Some of these will be NOPs, but never those that convert -- between ints and floats. @@ -785,11 +797,11 @@ pprMachOp_for_C platform mop = case mop of -- bitcasts, in the C backend these are performed with __builtin_memcpy. -- See rts/include/stg/Prim.h - MO_FW_Bitcast W32 -> text "hs_bitcastfloat2word" - MO_FW_Bitcast W64 -> text "hs_bitcastdouble2word64" + MO_FW_Bitcast W32 -> (Prefix, text "hs_bitcastfloat2word") + MO_FW_Bitcast W64 -> (Prefix, text "hs_bitcastdouble2word64") - MO_WF_Bitcast W32 -> text "hs_bitcastword2float" - MO_WF_Bitcast W64 -> text "hs_bitcastword642double" + MO_WF_Bitcast W32 -> (Prefix, text "hs_bitcastword2float") + MO_WF_Bitcast W64 -> (Prefix, text "hs_bitcastword642double") MO_FW_Bitcast w -> pprTrace "offending mop:" (text "MO_FW_Bitcast") @@ -805,20 +817,20 @@ pprMachOp_for_C platform mop = case mop of -- noop casts - MO_UU_Conv from to | from == to -> empty - MO_UU_Conv _from to -> parens (machRep_U_CType platform to) + MO_UU_Conv from to | from == to -> (Prefix, empty) + MO_UU_Conv _from to -> (Prefix, parens (machRep_U_CType platform to)) - MO_SS_Conv from to | from == to -> empty - MO_SS_Conv _from to -> parens (machRep_S_CType platform to) + MO_SS_Conv from to | from == to -> (Prefix, empty) + MO_SS_Conv _from to -> (Prefix, parens (machRep_S_CType platform to)) - MO_XX_Conv from to | from == to -> empty - MO_XX_Conv _from to -> parens (machRep_U_CType platform to) + MO_XX_Conv from to | from == to -> (Prefix, empty) + MO_XX_Conv _from to -> (Prefix,parens (machRep_U_CType platform to)) - MO_FF_Conv from to | from == to -> empty - MO_FF_Conv _from to -> parens (machRep_F_CType to) + MO_FF_Conv from to | from == to -> (Prefix, empty) + MO_FF_Conv _from to -> (Prefix,parens (machRep_F_CType to)) - MO_SF_Round _from to -> parens (machRep_F_CType to) - MO_FS_Truncate _from to -> parens (machRep_S_CType platform to) + MO_SF_Round _from to -> (Prefix,parens (machRep_F_CType to)) + MO_FS_Truncate _from to -> (Prefix,parens (machRep_S_CType platform to)) MO_RelaxedRead _ -> pprTrace "offending mop:" (text "MO_RelaxedRead") @@ -917,6 +929,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Min n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Min n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -203,6 +203,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -176,6 +176,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/af1780d1dfcb11d1742746fa5e8a5c892a21e4b6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/af1780d1dfcb11d1742746fa5e8a5c892a21e4b6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 13:46:16 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 30 Jul 2024 09:46:16 -0400 Subject: [Git][ghc/ghc][wip/T24978] Add Given injectivity for built-in type families Message-ID: <66a8eea86a816_3c86ab183c8bc128182@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 282fb06a by Simon Peyton Jones at 2024-07-30T14:46:06+01:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to address As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv - - - - - 11 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/Core/TyCo/FVs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/282fb06a68f506da06ccd07f98eccacf548438dd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/282fb06a68f506da06ccd07f98eccacf548438dd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 14:00:00 2024 From: gitlab at gitlab.haskell.org (Simon Peyton Jones (@simonpj)) Date: Tue, 30 Jul 2024 10:00:00 -0400 Subject: [Git][ghc/ghc][wip/T24978] 2 commits: Add Given injectivity for built-in type families Message-ID: <66a8f1e0be9de_3c86ab1a8cb80143527@gitlab.mail> Simon Peyton Jones pushed to branch wip/T24978 at Glasgow Haskell Compiler / GHC Commits: 4345a741 by Simon Peyton Jones at 2024-07-30T14:59:47+01:00 Add Given injectivity for built-in type families Ticket #24845 asks (reasonably enough) that if we have [G] a+b ~ 0 then we also know [G] a ~ 0, b ~ 0 and similar injectivity-like facts for other built-in type families. The status quo was that we never generate evidence for injectivity among Givens -- but it is quite reasonnable to do so. All we need is to have /evidence/ for the new constraints This MR implements that goal. I also took the opportunity to address As a result this MR touches a lot of code. The big things are: * Coercion constructor UnivCo now takes a [Coercion] as argument to express the coercions on which the UnivCo depends. A nice consequence is that UnivCoProvenance now has no free variables, simpler in a number of places. * Coercion constructors AxiomInstCo and AxiomRuleCo are combined into AxiomCo. The new AxiomCo, carries a (slightly oddly named) CoAxiomRule, which itself is a sum type of the various forms of built-in axiom. See Note [CoAxiomRule] in GHC.Core.Coercion.Axiom A merit of this is that we can separate the case of open and closed type families, and eliminate the redundant `BranchIndex` in the former case. * Much better representation for data BuiltInSynFamily, which means we no longer need to enumerate built-in axioms as well as built-in tycons. * There is a massive refactor in GHC.Builtin.Types.Literals, which contains all the built-in axioms for type-level operations (arithmetic, append, cons etc). A big change is that instead of redundantly having (a) a hand-written matcher, and (b) a template-based "proves" function, which were hard to keep in sync, the two are derive from one set of human-supplied info. See GHC.Builtin.Types.Literals.mkRewriteAxiom, and friends. * Significant changes in GHC.Tc.Solver.Equality to account for the new opportunity for Given/Given equalities. Smaller things * Improve pretty-printing to avoid parens around atomic coercions. * Do proper eqType in findMatchingIrreds, not `eqTypeNoKindCheck`. Looks like a bug, Richard agrees. * coercionLKind and coercionRKind are hot functions. I refactored the implementation (which I had to change anyway) to increase sharing. See Note [coercionKind performance] in GHC.Core.Coercion * I wrote a new Note [Finding orphan names] in GHC.Core.FVs about orphan names * I improved the `is_concrete` flag in GHC.Core.Type.buildSynTyCon, to avoid calling tyConsOfType. I forget exactly why I did this, but it's definitely better now. * I moved some code from GHC.Tc.Types.Constraint into GHC.Tc.Types.CtLocEnv - - - - - 14fd2211 by Simon Peyton Jones at 2024-07-30T14:59:47+01:00 Rename GHC.Tc.Types.CtLocEnv to GHC.Tc.Types.CtLoc - - - - - 11 changed files: - compiler/GHC/Builtin/Types/Literals.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Axiom.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/Core/TyCo/FVs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/282fb06a68f506da06ccd07f98eccacf548438dd...14fd22118f9eff5753382015979ce451198da821 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/282fb06a68f506da06ccd07f98eccacf548438dd...14fd22118f9eff5753382015979ce451198da821 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:28:36 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 11:28:36 -0400 Subject: [Git][ghc/ghc][wip/kill-ioport] 4692 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <66a906a416b18_246ab1b612032045@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kill-ioport at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 264a4fa9 by Owen Shepherd at 2024-02-15T09:41:06-05:00 feat: Add sortOn to Data.List.NonEmpty Adds `sortOn` to `Data.List.NonEmpty`, and adds comments describing when to use it, compared to `sortWith` or `sortBy . comparing`. The aim is to smooth out the API between `Data.List`, and `Data.List.NonEmpty`. This change has been discussed in the [clc issue](https://github.com/haskell/core-libraries-committee/issues/227). - - - - - b57200de by Fendor at 2024-02-15T09:41:47-05:00 Prefer RdrName over OccName for looking up locations in doc renaming step Looking up by OccName only does not take into account when functions are only imported in a qualified way. Fixes issue #24294 Bump haddock submodule to include regression test - - - - - 8ad02724 by Luite Stegeman at 2024-02-15T17:33:32-05:00 JS: add simple optimizer The simple optimizer reduces the size of the code generated by the JavaScript backend without the complexity and performance penalty of the optimizer in GHCJS. Also see #22736 Metric Decrease: libdir size_hello_artifact - - - - - 20769b36 by Matthew Pickering at 2024-02-15T17:34:07-05:00 base: Expose `--no-automatic-time-samples` in `GHC.RTS.Flags` API This patch builds on 5077416e12cf480fb2048928aa51fa4c8fc22cf1 and modifies the base API to reflect the new RTS flag. CLC proposal #243 - https://github.com/haskell/core-libraries-committee/issues/243 Fixes #24337 - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 08031ada by Teo Camarasu at 2024-02-16T13:37:00-05:00 base: export System.Mem.performBlockingMajorGC The corresponding C function was introduced in ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264. Resolves #24228 The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230 Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1f534c2e by Florian Weimer at 2024-02-16T13:37:42-05:00 Fix C output for modern C initiative GCC 14 on aarch64 rejects the C code written by GHC with this kind of error: error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion] 68 | *(ffi_arg*)resp = cret; | ^ Add the correct cast. For more information on this see: https://fedoraproject.org/wiki/Changes/PortingToModernC Tested-by: Richard W.M. Jones <rjones at redhat.com> - - - - - 5d3f7862 by Matthew Craven at 2024-02-16T13:38:18-05:00 Bump bytestring submodule to 0.12.1.0 - - - - - 902ebcc2 by Ian-Woo Kim at 2024-02-17T06:01:01-05:00 Add missing BCO handling in scavenge_one. - - - - - 97d26206 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Make cast between words and floats real primops (#24331) First step towards fixing #24331. Replace foreign prim imports with real primops. - - - - - a40e4781 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: add constant folding for bitcast between float and word (#24331) - - - - - 5fd2c00f by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: replace stack checks with assertions in casting primops There are RESERVED_STACK_WORDS free words (currently 21) on the stack, so omit the checks. Suggested by Cheng Shao. - - - - - 401dfe7b by Sylvain Henry at 2024-02-17T06:01:44-05:00 Reexport primops from GHC.Float + add deprecation - - - - - 4ab48edb by Ben Gamari at 2024-02-17T06:02:21-05:00 rts/Hash: Don't iterate over chunks if we don't need to free data When freeing a `HashTable` there is no reason to walk over the hash list before freeing it if the user has not given us a `dataFreeFun`. Noticed while looking at #24410. - - - - - bd5a1f91 by Cheng Shao at 2024-02-17T06:03:00-05:00 compiler: add SEQ_CST fence support In addition to existing Acquire/Release fences, this commit adds SEQ_CST fence support to GHC, allowing Cmm code to explicitly emit a fence that enforces total memory ordering. The following logic is added: - The MO_SeqCstFence callish MachOp - The %prim fence_seq_cst() Cmm syntax and the SEQ_CST_FENCE macro in Cmm.h - MO_SeqCstFence lowering logic in every single GHC codegen backend - - - - - 2ce2a493 by Cheng Shao at 2024-02-17T06:03:38-05:00 testsuite: fix hs_try_putmvar002 for targets without pthread.h hs_try_putmvar002 includes pthread.h and doesn't work on targets without this header (e.g. wasm32). It doesn't need to include this header at all. This was previously unnoticed by wasm CI, though recent toolchain upgrade brought in upstream changes that completely removes pthread.h in the single-threaded wasm32-wasi sysroot, therefore we need to handle that change. - - - - - 1fb3974e by Cheng Shao at 2024-02-17T06:03:38-05:00 ci: bump ci-images to use updated wasm image This commit bumps our ci-images revision to use updated wasm image. - - - - - 56e3f097 by Andrew Lelechenko at 2024-02-17T06:04:13-05:00 Bump submodule text to 2.1.1 T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a. Metric Decrease: T17123 - - - - - a7569495 by Cheng Shao at 2024-02-17T06:04:51-05:00 rts: remove redundant rCCCS initialization This commit removes the redundant logic of initializing each Capability's rCCCS to CCS_SYSTEM in initProfiling(). Before initProfiling() is called during RTS startup, each Capability's rCCCS has already been assigned CCS_SYSTEM when they're first initialized. - - - - - 7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00 Drop dependence on `touch` This drops GHC's dependence on the `touch` program, instead implementing it within GHC. This eliminates an external dependency and means that we have one fewer program to keep track of in the `configure` script - - - - - 0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00 Parser, renamer, type checker for @a-binders (#17594) GHC Proposal 448 introduces binders for invisible type arguments (@a-binders) in various contexts. This patch implements @-binders in lambda patterns and function equations: {-# LANGUAGE TypeAbstractions #-} id1 :: a -> a id1 @t x = x :: t -- @t-binder on the LHS of a function equation higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16) higherRank f = (f 42, f 42) ex :: (Int8, Int16) ex = higherRank (\ @a x -> maxBound @a - x ) -- @a-binder in a lambda pattern in an argument -- to a higher-order function Syntax ------ To represent those @-binders in the AST, the list of patterns in Match now uses ArgPat instead of Pat: data Match p body = Match { ... - m_pats :: [LPat p], + m_pats :: [LArgPat p], ... } + data ArgPat pass + = VisPat (XVisPat pass) (LPat pass) + | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass)) + | XArgPat !(XXArgPat pass) The VisPat constructor represents patterns for visible arguments, which include ordinary value-level arguments and required type arguments (neither is prefixed with a @), while InvisPat represents invisible type arguments (prefixed with a @). Parser ------ In the grammar (Parser.y), the lambda and lambda-cases productions of aexp non-terminal were updated to accept argpats instead of apats: aexp : ... - | '\\' apats '->' exp + | '\\' argpats '->' exp ... - | '\\' 'lcases' altslist(apats) + | '\\' 'lcases' altslist(argpats) ... + argpat : apat + | PREFIX_AT atype Function left-hand sides did not require any changes to the grammar, as they were already parsed with productions capable of parsing @-binders. Those binders were being rejected in post-processing (isFunLhs), and now we accept them. In Parser.PostProcess, patterns are constructed with the help of PatBuilder, which is used as an intermediate data structure when disambiguating between FunBind and PatBind. In this patch we define ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived data structure produced in isFunLhs and consumed in checkFunBind. Renamer ------- Renaming of @-binders builds upon prior work on type patterns, implemented in 2afbddb0f24, which guarantees proper scoping and shadowing behavior of bound type variables. This patch merely defines rnLArgPatsAndThen to process a mix of visible and invisible patterns: + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn] + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where + rnArgPatAndThen (VisPat x p) = ... rnLPatAndThen ... + rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ... Common logic between rnArgPats and rnPats is factored out into the rn_pats_general helper. Type checker ------------ Type-checking of @-binders builds upon prior work on lazy skolemisation, implemented in f5d3e03c56f. This patch extends tcMatchPats to handle @-binders. Now it takes and returns a list of LArgPat rather than LPat: tcMatchPats :: ... - -> [LPat GhcRn] + -> [LArgPat GhcRn] ... - -> TcM ([LPat GhcTc], a) + -> TcM ([LArgPat GhcTc], a) Invisible binders in the Match are matched up with invisible (Specified) foralls in the type. This is done with a new clause in the `loop` worker of tcMatchPats: loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a) loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys) ... -- NEW CLAUSE: | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis = ... In addition to that, tcMatchPats no longer discards type patterns. This is done by filterOutErasedPats in the desugarer instead. x86_64-linux-deb10-validate+debug_info Metric Increase: MultiLayerModulesTH_OneShot - - - - - 486979b0 by Jade at 2024-02-19T07:12:13-05:00 Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246 Fixes: #24346 - - - - - 17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00 Fix reST in users guide It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax. - - - - - 35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00 Fix searching for errors in sphinx build - - - - - 4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00 hadrian: fix wasm backend post linker script permissions The post-link.mjs script was incorrectly copied and installed as a regular data file without executable permission, this commit fixes it. - - - - - a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00 testsuite: mark T23540 as fragile on i386 See #24449 for details. - - - - - 249caf0d by Matthew Craven at 2024-02-19T20:36:09-05:00 Add @since annotation to Data.Data.mkConstrTag - - - - - cdd939e7 by Jade at 2024-02-19T20:36:46-05:00 Enhance documentation of Data.Complex - - - - - d04f384f by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian/bindist: Ensure that phony rules are marked as such Otherwise make may not run the rule if file with the same name as the rule happens to exist. - - - - - efcbad2d by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian: Generate HSC2HS_EXTRAS variable in bindist installation We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. - - - - - c540559c by Matthew Pickering at 2024-02-21T04:59:23-05:00 ci: Show --info for installed compiler - - - - - ab9281a2 by Matthew Pickering at 2024-02-21T04:59:23-05:00 configure: Correctly set --target flag for linker opts Previously we were trying to use the FP_CC_SUPPORTS_TARGET with 4 arguments, when it only takes 3 arguments. Instead we need to use the `FP_PROG_CC_LINKER_TARGET` function in order to set the linker flags. Actually fixes #24414 - - - - - 9460d504 by Rodrigo Mesquita at 2024-02-21T04:59:59-05:00 configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS - - - - - 77629e76 by Andrei Borzenkov at 2024-02-21T05:00:35-05:00 Namespacing for fixity signatures (#14032) Namespace specifiers were added to syntax of fixity signatures: - sigdecl ::= infix prec ops | ... + sigdecl ::= infix prec namespace_spec ops | ... To preserve namespace during renaming MiniFixityEnv type now has separate FastStringEnv fields for names that should be on the term level and for name that should be on the type level. makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way: - signatures without namespace specifiers fill both fields - signatures with 'data' specifier fill data field only - signatures with 'type' specifier fill type field only Was added helper function lookupMiniFixityEnv that takes care about looking for a name in an appropriate namespace. Updates haddock submodule. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 84357d11 by Teo Camarasu at 2024-02-21T05:01:11-05:00 rts: only collect live words in nonmoving census when non-concurrent This avoids segfaults when the mutator modifies closures as we examine them. Resolves #24393 - - - - - 9ca56dd3 by Ian-Woo Kim at 2024-02-21T05:01:53-05:00 mutex wrap in refreshProfilingCCSs - - - - - 1387966a by Cheng Shao at 2024-02-21T05:02:32-05:00 rts: remove unused HAVE_C11_ATOMICS macro This commit removes the unused HAVE_C11_ATOMICS macro. We used to have a few places that have fallback paths when HAVE_C11_ATOMICS is not defined, but that is completely redundant, since the FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler doesn't support C11 style atomics. There are also many places (e.g. in unreg backend, SMP.h, library cbits, etc) where we unconditionally use C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the oldest distro we test in our CI, so there's no value in keeping HAVE_C11_ATOMICS. - - - - - 0f40d68f by Andreas Klebinger at 2024-02-21T05:03:09-05:00 RTS: -Ds - make sure incall is non-zero before dereferencing it. Fixes #24445 - - - - - e5886de5 by Ben Gamari at 2024-02-21T05:03:44-05:00 rts/AdjustorPool: Use ExecPage abstraction This is just a minor cleanup I found while reviewing the implementation. - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 09941666 by Adam Gundry at 2024-02-21T13:53:12+00:00 Define GHC2024 language edition (#24320) See https://github.com/ghc-proposals/ghc-proposals/pull/613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail at joachim-breitner.de> - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 5121a4ed by Ben Gamari at 2024-02-23T06:40:55-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. Bumps haddock submodule. - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 0eb2265d by Hécate Moonlight at 2024-02-24T16:02:16-05:00 Improve the synopsis and description of base - - - - - 2e36f5d2 by Jade at 2024-02-24T16:02:51-05:00 Error Messages: Properly align cyclic module error Fixes: #24476 - - - - - bbfb051c by Ben Gamari at 2024-02-24T19:10:23-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. - - - - - d8d6ad8c by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Move modules into GHC.Internal.* namespace Bumps haddock submodule due to testsuite output changes. - - - - - a82af7cd by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Rewrite `@since ` to `@since base-` These will be incrementally moved to the export sites in `base` where possible. - - - - - ca3836e1 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Migrate Haddock `not-home` pragmas from `ghc-internal` This ensures that we do not use `base` stub modules as declarations' homes when not appropriate. - - - - - c8cf3e26 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Partially freeze exports of GHC.Base Sadly there are still a few module reexports. However, at least we have decoupled from the exports of `GHC.Internal.Base`. - - - - - 272573c6 by Ben Gamari at 2024-02-24T19:10:23-05:00 Move Haddock named chunks - - - - - 2d8a881d by Ben Gamari at 2024-02-24T19:10:23-05:00 Drop GHC.Internal.Data.Int - - - - - 55c4c385 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler: Fix mention to `GHC....` modules in wasm desugaring Really, these references should be via known-key names anyways. I have fixed the proximate issue here but have opened #24472 to track the additional needed refactoring. - - - - - 64150911 by Ben Gamari at 2024-02-24T19:10:23-05:00 Accept performance shifts from ghc-internal restructure As expected, Haddock now does more work. Less expected is that some other testcases actually get faster, presumably due to less interface file loading. As well, the size_hello_artifact test regressed a bit when debug information is enabled due to debug information for the new stub symbols. Metric Decrease: T12227 T13056 Metric Increase: haddock.Cabal haddock.base MultiLayerModulesTH_OneShot size_hello_artifact - - - - - 317a915b by Ben Gamari at 2024-02-24T19:10:23-05:00 Expose GHC.Wasm.Prim from ghc-experimental Previously this was only exposed from `ghc-internal` which violates our agreement that users shall not rely on things exposed from that package. Fixes #24479. - - - - - 3bbd2bf2 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Small optimisation of evCallStack Don't lookupIds unless we actually need them. - - - - - 3e5c9e3c by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Use toException instead of SomeException - - - - - 125714a6 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Factor out errorBelch This was useful when debugging - - - - - 3d6aae7c by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Clean up imports of GHC.Stack.CloneStack - - - - - 6900306e by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move PrimMVar to GHC.Internal.MVar - - - - - 28f8a148 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move prettyCallStack to GHC.Internal.Stack - - - - - 4892de47 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Explicit dependency to workaround #24436 Currently `ghc -M` fails to account for `.hs-boot` files correctly, leading to issues with cross-package one-shot builds failing. This currently manifests in `GHC.Exception` due to the boot file for `GHC.Internal.Stack`. Work around this by adding an explicit `import`, ensuring that `GHC.Internal.Stack` is built before `GHC.Exception`. See #24436. - - - - - 294c93a5 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Use displayException in top-level exception handler Happily this also allows us to eliminate a special case for Deadlock exceptions. Implements [CLC #198](https://github.com/haskell/core-libraries-committee/issues/198). - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - cf756a25 by Ben Gamari at 2024-02-24T22:11:53-05:00 rts: Fix symbol references in Wasm RTS - - - - - 4e4d47a0 by Jade at 2024-02-26T15:17:20-05:00 GHCi: Improve response to unloading, loading and reloading modules Fixes #13869 - - - - - f3de8a3c by Zubin Duggal at 2024-02-26T15:17:57-05:00 rel-eng/fetch-gitlab.py: Fix name of aarch64 alpine 3_18 release job - - - - - c71bfdff by Cheng Shao at 2024-02-26T15:18:35-05:00 hadrian/hie-bios: pass -j to hadrian This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. - - - - - 50bfdb46 by Cheng Shao at 2024-02-26T15:18:35-05:00 ci: enable parallelism in hadrian/ghci scripts This commit enables parallelism when the hadrian/ghci scripts are called in CI. The time bottleneck is in the hadrian build step, but previously the build step wasn't parallelized. - - - - - 61a78231 by Felix Yan at 2024-02-26T15:19:14-05:00 m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension This implements Proposal 0475, introducing the `ListTuplePuns` extension which is enabled by default. Disabling this extension makes it invalid to refer to list, tuple and sum type constructors by using built-in syntax like `[Int]`, `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`. Instead, this syntax exclusively denotes data constructors for use with `DataKinds`. The conventional way of referring to these data constructors by prefixing them with a single quote (`'(Int, Int)`) is now a parser error. Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo` data constructor has been renamed to `MkSolo` (in a previous commit). Unboxed tuples and sums now have real source declarations in `GHC.Types`. Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo` and `Solo#`. Constraint tuples now have the unambiguous type constructors `CTuple<n>` as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before. A new parser construct has been added for the unboxed sum data constructor declarations. The type families `Tuple`, `Sum#` etc. that were intended to provide nicer syntax have been omitted from this change set due to inference problems, to be implemented at a later time. See the MR discussion for more info. Updates the submodule utils/haddock. Updates the cabal submodule due to new language extension. Metric Increase: haddock.base Metric Decrease: MultiLayerModulesTH_OneShot size_hello_artifact Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst Merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns This enriched the `CtOrigin` for non-linear patterns to include data of the pattern that created the constraint (which can be quite useful if it occurs nested in a pattern) as well as an explanation why the pattern is non-restricted in (at least in some cases). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * Main change: make the error message generated by mkFunTysMsg more accurate by changing "value arguments" to "visible arguments". * Refactor: define a new type synonym VisArity and use it instead of Arity in a few places. It might be the case that there other places in the compiler that should talk about visible arguments rather than value arguments, but I haven't tried to find them all, focusing only on the error message reported in the ticket. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - 54e6c849 by Ben Gamari at 2024-07-30T16:26:55+01:00 Kill IOPort# This type is unnecessary, having been superceded by `MVar` and a rework of WinIO's blocking logic. See #20947. See https://github.com/haskell/core-libraries-committee/issues/213. - - - - - 20 changed files: - .ghcid - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/default.nix - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/README.mkd - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitlab/rel_eng/upload_ghc_libs.py - .gitmodules - CODEOWNERS The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9144936731591b3066a6d7e4205d4f028d8617c5...54e6c849674229348f3933ca0c9477665ed45695 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9144936731591b3066a6d7e4205d4f028d8617c5...54e6c849674229348f3933ca0c9477665ed45695 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:31:47 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 11:31:47 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66a90763b6cf8_246ab133b92c35438@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 8800456c by Cheng Shao at 2024-07-30T17:23:39+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - 11 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -991,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, IORef TypeEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1007,22 +1015,48 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } -- The bytecode generation itself is lazy because otherwise even when doing -- recompilation checking the bytecode will be generated (which slows things down a lot) -- the laziness is OK because generateByteCode just depends on things already loaded -- in the interface file. LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + (tc_hsc_env, types_var, initial_types) <- mk_tc_env + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings types_var fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons initial_types) NoStubs Nothing [] trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) + -- TODO why are we not using tc_hsc_env here? generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef initial_types + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', types_var, initial_types) + where + initial_types = md_types details + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWholeCoreBindingsWith mk_tc_env hsc_env + where + mk_tc_env = do + initial_types <- eps_PTE <$> hscEPS hsc_env + types_var <- newIORef initial_types + pure (hsc_env, types_var, initial_types) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "makima") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8800456c3dd9d81b4e05c7c25c460626912cbca6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8800456c3dd9d81b4e05c7c25c460626912cbca6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:33:08 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 11:33:08 -0400 Subject: [Git][ghc/ghc][wip/romes/25091] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66a907b42a16a_246ab1317a1837458@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25091 at Glasgow Haskell Compiler / GHC Commits: 3218c3b2 by Rodrigo Mesquita at 2024-07-30T15:33:06+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -53,7 +53,10 @@ import GHC.Internal.Show import GHC.Internal.Exception.Context {- | -An exception context. +A constraint used to propagate 'ExceptionContext's. + +GHC will automatically default any unsolved 'HasExceptionContext' constraints to an +empty exception context, similarly to 'HasCallStack'. NOTE: The fact that @HasExceptionContext@ is defined as an implicit parameter is an implementation detail and __should not__ be considered a part of the API. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3218c3b226a6d18deccfb6e98510b84fa135ae6d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3218c3b226a6d18deccfb6e98510b84fa135ae6d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:33:16 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 11:33:16 -0400 Subject: [Git][ghc/ghc][wip/romes/25091] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66a907bc62cb5_246ab143a4403943b@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25091 at Glasgow Haskell Compiler / GHC Commits: 6df6d0f2 by Rodrigo Mesquita at 2024-07-30T15:33:10+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -60,6 +60,8 @@ empty exception context, similarly to 'HasCallStack'. NOTE: The fact that @HasExceptionContext@ is defined as an implicit parameter is an implementation detail and __should not__ be considered a part of the API. +It does however mean that any implicit parameter `?exceptionContext :: ExceptionContext` +will be subject to defaulting, as described above. @since base-4.20.0.0 -} View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6df6d0f246e0f0807c73430cd47f30147e6bc990 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6df6d0f246e0f0807c73430cd47f30147e6bc990 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:34:57 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 11:34:57 -0400 Subject: [Git][ghc/ghc][wip/romes/25091] 13 commits: Revert "Allow non-absolute values for bootstrap GHC variable" Message-ID: <66a908212fc23_246ab158a160401ef@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25091 at Glasgow Haskell Compiler / GHC Commits: 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 31b0a388 by Rodrigo Mesquita at 2024-07-30T16:34:49+01:00 base: Add haddocks to HasExceptionContext Fixes #25091 - - - - - 30 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/GHC/Types/Id.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6df6d0f246e0f0807c73430cd47f30147e6bc990...31b0a3881048aa6625bda5405d4a08cf18ed74f5 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6df6d0f246e0f0807c73430cd47f30147e6bc990...31b0a3881048aa6625bda5405d4a08cf18ed74f5 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 15:45:28 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 11:45:28 -0400 Subject: [Git][ghc/ghc][wip/kill-ioport] Kill IOPort# Message-ID: <66a90a98d7053_246ab178ab2c558b0@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kill-ioport at Glasgow Haskell Compiler / GHC Commits: 2768fd9f by Ben Gamari at 2024-07-30T16:45:01+01:00 Kill IOPort# This type is unnecessary, having been superceded by `MVar` and a rework of WinIO's blocking logic. See #20947. See https://github.com/haskell/core-libraries-committee/issues/213. - - - - - 25 changed files: - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - libraries/base/base.cabal - libraries/base/changelog.md - − libraries/base/src/GHC/IOPort.hs - libraries/ghc-heap/GHC/Exts/Heap/Closures.hs - libraries/ghc-internal/ghc-internal.cabal - libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc - libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Exts.hs - libraries/ghc-internal/src/GHC/Internal/IO/Buffer.hs - libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc - − libraries/ghc-internal/src/GHC/Internal/IOPort.hs - libraries/ghc-prim/GHC/Prim/PtrEq.hs - libraries/ghc-prim/changelog.md - rts/Prelude.h - rts/PrimOps.cmm - rts/RtsSymbols.c - rts/include/stg/MiscClosures.h - rts/win32/AsyncWinIO.c - testsuite/tests/primops/should_run/UnliftedIOPort.hs - testsuite/tests/primops/should_run/all.T - utils/genprimopcode/Main.hs Changes: ===================================== compiler/GHC/Builtin/Types/Prim.hs ===================================== @@ -77,7 +77,6 @@ module GHC.Builtin.Types.Prim( mutVarPrimTyCon, mkMutVarPrimTy, mVarPrimTyCon, mkMVarPrimTy, - ioPortPrimTyCon, mkIOPortPrimTy, tVarPrimTyCon, mkTVarPrimTy, stablePtrPrimTyCon, mkStablePtrPrimTy, stableNamePrimTyCon, mkStableNamePrimTy, @@ -278,7 +277,6 @@ exposedPrimTyCons , mutableByteArrayPrimTyCon , smallMutableArrayPrimTyCon , mVarPrimTyCon - , ioPortPrimTyCon , tVarPrimTyCon , mutVarPrimTyCon , realWorldTyCon @@ -310,7 +308,7 @@ charPrimTyConName, intPrimTyConName, int8PrimTyConName, int16PrimTyConName, int3 arrayPrimTyConName, smallArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, smallMutableArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, - ioPortPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, + tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, compactPrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, eqPrimTyConName, eqReprPrimTyConName, eqPhantPrimTyConName, @@ -342,7 +340,6 @@ mutableArrayPrimTyConName = mkPrimTc (fsLit "MutableArray#") mutableArrayPri mutableByteArrayPrimTyConName = mkPrimTc (fsLit "MutableByteArray#") mutableByteArrayPrimTyConKey mutableByteArrayPrimTyCon smallMutableArrayPrimTyConName= mkPrimTc (fsLit "SmallMutableArray#") smallMutableArrayPrimTyConKey smallMutableArrayPrimTyCon mutVarPrimTyConName = mkPrimTc (fsLit "MutVar#") mutVarPrimTyConKey mutVarPrimTyCon -ioPortPrimTyConName = mkPrimTc (fsLit "IOPort#") ioPortPrimTyConKey ioPortPrimTyCon mVarPrimTyConName = mkPrimTc (fsLit "MVar#") mVarPrimTyConKey mVarPrimTyCon tVarPrimTyConName = mkPrimTc (fsLit "TVar#") tVarPrimTyConKey tVarPrimTyCon stablePtrPrimTyConName = mkPrimTc (fsLit "StablePtr#") stablePtrPrimTyConKey stablePtrPrimTyCon @@ -1280,20 +1277,6 @@ mutVarPrimTyCon = pcPrimTyCon_LevPolyLastArg mutVarPrimTyConName [Nominal, Repre mkMutVarPrimTy :: Type -> Type -> Type mkMutVarPrimTy s elt = TyConApp mutVarPrimTyCon [getLevity elt, s, elt] -{- -************************************************************************ -* * -\subsection[TysPrim-io-port-var]{The synchronizing I/O Port type} -* * -************************************************************************ --} - -ioPortPrimTyCon :: TyCon -ioPortPrimTyCon = pcPrimTyCon_LevPolyLastArg ioPortPrimTyConName [Nominal, Representational] unliftedRepTy - -mkIOPortPrimTy :: Type -> Type -> Type -mkIOPortPrimTy s elt = TyConApp ioPortPrimTyCon [getLevity elt, s, elt] - {- ************************************************************************ * * ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -3123,43 +3123,6 @@ primop IsEmptyMVarOp "isEmptyMVar#" GenPrimOp effect = ReadWriteEffect ------------------------------------------------------------------------- -section "Synchronized I/O Ports" - {Operations on 'IOPort#'s. } ------------------------------------------------------------------------- - -primtype IOPort# s a - { A shared I/O port is almost the same as an 'MVar#'. - The main difference is that IOPort has no deadlock detection or - deadlock breaking code that forcibly releases the lock. } - -primop NewIOPortOp "newIOPort#" GenPrimOp - State# s -> (# State# s, IOPort# s a_levpoly #) - {Create new 'IOPort#'; initially empty.} - with - out_of_line = True - effect = ReadWriteEffect - -primop ReadIOPortOp "readIOPort#" GenPrimOp - IOPort# s a_levpoly -> State# s -> (# State# s, a_levpoly #) - {If 'IOPort#' is empty, block until it becomes full. - Then remove and return its contents, and set it empty. - Throws an 'IOPortException' if another thread is already - waiting to read this 'IOPort#'.} - with - out_of_line = True - effect = ReadWriteEffect - -primop WriteIOPortOp "writeIOPort#" GenPrimOp - IOPort# s a_levpoly -> a_levpoly -> State# s -> (# State# s, Int# #) - {If 'IOPort#' is full, immediately return with integer 0, - throwing an 'IOPortException'. - Otherwise, store value arg as 'IOPort#''s new contents, - and return with integer 1. } - with - out_of_line = True - effect = ReadWriteEffect - ------------------------------------------------------------------------ section "Delay/wait operations" ------------------------------------------------------------------------ ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1708,9 +1708,6 @@ emitPrimOp cfg primop = ReadMVarOp -> alwaysExternal TryReadMVarOp -> alwaysExternal IsEmptyMVarOp -> alwaysExternal - NewIOPortOp -> alwaysExternal - ReadIOPortOp -> alwaysExternal - WriteIOPortOp -> alwaysExternal DelayOp -> alwaysExternal WaitReadOp -> alwaysExternal WaitWriteOp -> alwaysExternal ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -1153,10 +1153,6 @@ genPrim prof bound ty op = case op of PromptOp -> unhandledPrimop op Control0Op -> unhandledPrimop op - NewIOPortOp -> unhandledPrimop op - ReadIOPortOp -> unhandledPrimop op - WriteIOPortOp -> unhandledPrimop op - GetSparkOp -> unhandledPrimop op AnyToAddrOp -> unhandledPrimop op MkApUpd0_Op -> unhandledPrimop op ===================================== libraries/base/base.cabal ===================================== @@ -267,8 +267,6 @@ Library , Type.Reflection , Type.Reflection.Unsafe , Unsafe.Coerce - -- TODO: remove - , GHC.IOPort reexported-modules: GHC.Num.Integer ===================================== libraries/base/changelog.md ===================================== @@ -15,6 +15,7 @@ * Add `firstA` and `secondA` to `Data.Bitraversable`. ([CLC proposal #172](https://github.com/haskell/core-libraries-committee/issues/172)) * Deprecate `GHC.TypeNats.Internal`, `GHC.TypeLits.Internal`, `GHC.ExecutionStack.Internal` ([CLC proposal #217](https://github.com/haskell/core-libraries-committee/issues/217)) * Define `Eq1`, `Ord1`, `Show1` and `Read1` instances for basic `Generic` representation types. ([CLC proposal #273](https://github.com/haskell/core-libraries-committee/issues/273)) + * `GHC.Exts.IOPort#` and its related operations have been removed ([CLC #213](https://github.com/haskell/core-libraries-committee/issues/213)) ## 4.20.0.0 May 2024 * Shipped with GHC 9.10.1 ===================================== libraries/base/src/GHC/IOPort.hs deleted ===================================== @@ -1,39 +0,0 @@ --- | --- --- Module : GHC.IOPort --- Copyright : (c) Tamar Christina 2019 --- License : see libraries/base/LICENSE --- --- Maintainer : ghc-devs at haskell.org --- Stability : internal --- Portability : non-portable (GHC Extensions) --- --- The 'IOPort' type. This is a facility used by the Windows IO subsystem. --- --- /The API of this module is unstable and not meant to be consumed by the general public./ --- If you absolutely must depend on it, make sure to use a tight upper --- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can --- change rapidly without much warning. --- --- We have strict rules with an I/O Port: --- * writing more than once is an error --- * reading more than once is an error --- --- It gives us the ability to have one thread to block, wait for a result from --- another thread and then being woken up. *Nothing* more. --- --- This type is very much GHC internal. It might be changed or removed without --- notice in future releases. --- - -module GHC.IOPort - (-- * IOPorts - IOPort(..), - newIOPort, - newEmptyIOPort, - readIOPort, - writeIOPort, - doubleReadException - ) where - -import GHC.Internal.IOPort \ No newline at end of file ===================================== libraries/ghc-heap/GHC/Exts/Heap/Closures.hs ===================================== @@ -253,14 +253,6 @@ data GenClosure b , value :: !b -- ^ Pointer to closure } - -- | An @IOPort#@, with a queue of thread state objects blocking on them - | IOPortClosure - { info :: !StgInfoTable - , queueHead :: !b -- ^ Pointer to head of queue - , queueTail :: !b -- ^ Pointer to tail of queue - , value :: !b -- ^ Pointer to closure - } - -- | A @MutVar#@ | MutVarClosure { info :: !StgInfoTable @@ -537,7 +529,6 @@ allClosures (MutArrClosure {..}) = mccPayload allClosures (SmallMutArrClosure {..}) = mccPayload allClosures (MutVarClosure {..}) = [var] allClosures (MVarClosure {..}) = [queueHead,queueTail,value] -allClosures (IOPortClosure {..}) = [queueHead,queueTail,value] allClosures (FunClosure {..}) = ptrArgs allClosures (BlockingQueueClosure {..}) = [link, blackHole, owner, queue] allClosures (WeakClosure {..}) = [cfinalizers, key, value, finalizer] ++ Data.Foldable.toList weakLink ===================================== libraries/ghc-internal/ghc-internal.cabal ===================================== @@ -293,8 +293,6 @@ Library GHC.Internal.Type.Reflection GHC.Internal.Type.Reflection.Unsafe GHC.Internal.Unsafe.Coerce - -- TODO: remove - GHC.Internal.IOPort reexported-modules: GHC.Num.Integer @@ -318,7 +316,6 @@ Library GHC.Internal.Event.IntVar GHC.Internal.Event.PSQ GHC.Internal.Event.Unique - -- GHC.Internal.IOPort -- TODO: hide again after debug GHC.Internal.Unicode.Bits GHC.Internal.Unicode.Char.DerivedCoreProperties GHC.Internal.Unicode.Char.UnicodeData.GeneralCategory ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc ===================================== @@ -109,7 +109,6 @@ import GHC.Internal.Base import GHC.Internal.Conc.Bound import GHC.Internal.Conc.Sync import GHC.Internal.IO -import GHC.Internal.IOPort import GHC.Internal.Num import GHC.Internal.Real import GHC.Internal.Bits @@ -170,7 +169,7 @@ import {-# SOURCE #-} GHC.Internal.Debug.Trace (traceEventIO) -- fact that something else has finished the remainder of their queue or must -- have a guarantee to never block. In this implementation we strive to -- never block. This is achieved by not having the worker threads call out --- to any user code, and to have the IOPort synchronization primitive never +-- to any user code, and to have the MVar synchronization primitive never -- block. This means if the port is full the message is lost, however we -- have an invariant that the port can never be full and have a waiting -- receiver. As such, dropping the message does not change anything as there @@ -541,11 +540,11 @@ withOverlappedEx :: forall a. -> CompletionCallback (IOResult a) -> IO (IOResult a) withOverlappedEx mgr fname h async offset startCB completionCB = do - signal <- newEmptyIOPort :: IO (IOPort (IOResult a)) + signal <- newEmptyMVar :: IO (MVar (IOResult a)) let signalReturn a = failIfFalse_ (dbgMsg "signalReturn") $ - writeIOPort signal (IOSuccess a) + writeMVar signal (IOSuccess a) signalThrow ex = failIfFalse_ (dbgMsg "signalThrow") $ - writeIOPort signal (IOFailed ex) + writeMVar signal (IOFailed ex) mask_ $ do let completionCB' e b = do result <- completionCB e b @@ -689,7 +688,7 @@ withOverlappedEx mgr fname h async offset startCB completionCB = do registerAlertableWait delay return $ IOFailed Nothing let runner = do debugIO $ (dbgMsg ":: waiting ") ++ " | " ++ show lpol - res <- readIOPort signal `catch` cancel + res <- readMVar signal `catch` cancel debugIO $ dbgMsg ":: signaled " case res of IOFailed err -> FFI.throwWinErr fname (maybe 0 fromIntegral err) @@ -722,7 +721,7 @@ withOverlappedEx mgr fname h async offset startCB completionCB = do let err' = fromIntegral err debugIO $ dbgMsg $ ":: done callback: " ++ show err' ++ " - " ++ show numBytes completionCB err' (fromIntegral numBytes) - else readIOPort signal + else readMVar signal CbError err -> do reqs3 <- removeRequest debugIO $ "-1.. " ++ show reqs3 ++ " requests queued." @@ -742,10 +741,10 @@ withOverlappedEx mgr fname h async offset startCB completionCB = do -- Uses an inline definition of threadDelay to prevent an import -- cycle. let usecs = 250 -- 0.25ms - m <- newEmptyIOPort + m <- newEmptyMVar reg <- registerTimeout mgr usecs $ - writeIOPort m () >> return () - readIOPort m `onException` unregisterTimeout mgr reg + writeMVar m () >> return () + readMVar m `onException` unregisterTimeout mgr reg | otherwise = sleepBlock 1 -- 1 ms waitForCompletion :: HANDLE -> Ptr FFI.OVERLAPPED -> IO (CbResult Int) waitForCompletion fhndl lpol = do ===================================== libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs ===================================== @@ -11,7 +11,6 @@ import GHC.Internal.Conc.Sync import GHC.Internal.Base import GHC.Internal.Event.Windows import GHC.Internal.IO -import GHC.Internal.IOPort ensureIOManagerIsRunning :: IO () ensureIOManagerIsRunning = wakeupIOManager @@ -23,10 +22,10 @@ interruptIOManager = interruptSystemManager -- 2147483647 μs, less than 36 minutes. threadDelay :: Int -> IO () threadDelay usecs = mask_ $ do - m <- newEmptyIOPort + m <- newEmptyMVar mgr <- getSystemManager - reg <- registerTimeout mgr usecs $ writeIOPort m () >> return () - readIOPort m `onException` unregisterTimeout mgr reg + reg <- registerTimeout mgr usecs $ writeMVar m () >> return () + readMVar m `onException` unregisterTimeout mgr reg -- | Be careful not to exceed @maxBound :: Int@, which on 32-bit machines is only -- 2147483647 μs, less than 36 minutes. ===================================== libraries/ghc-internal/src/GHC/Internal/Exts.hs ===================================== @@ -59,7 +59,6 @@ module GHC.Internal.Exts sameMVar#, sameMutVar#, sameTVar#, - sameIOPort#, samePromptTag#, -- ** Compat wrapper ===================================== libraries/ghc-internal/src/GHC/Internal/IO/Buffer.hs ===================================== @@ -223,10 +223,10 @@ data BufferState = ReadBuffer | WriteBuffer deriving Eq -- ^ @since base-4.2.0.0 withBuffer :: Buffer e -> (Ptr e -> IO a) -> IO a -withBuffer Buffer{ bufRaw=raw } f = withForeignPtr (castForeignPtr raw) f +withBuffer Buffer{ bufRaw=raw } f = unsafeWithForeignPtr (castForeignPtr raw) f withRawBuffer :: RawBuffer e -> (Ptr e -> IO a) -> IO a -withRawBuffer raw f = withForeignPtr (castForeignPtr raw) f +withRawBuffer raw f = unsafeWithForeignPtr (castForeignPtr raw) f isEmptyBuffer :: Buffer e -> Bool isEmptyBuffer Buffer{ bufL=l, bufR=r } = l == r ===================================== libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc ===================================== @@ -932,8 +932,7 @@ openFile' filepath iomode non_blocking tmp_opts = -- handle. For WinIO we always use FILE_FLAG_OVERLAPPED, which -- means we always issue asynchronous file operation using an -- OVERLAPPED structure. All blocking, if required must be done - -- on the Haskell side by using existing mechanisms such as MVar - -- or IOPorts. + -- on the Haskell side by using existing mechanisms such as MVars. then #{const FILE_FLAG_OVERLAPPED} -- I believe most haskell programs do sequential scans, so -- optimize for the common case. Though ideally, this would ===================================== libraries/ghc-internal/src/GHC/Internal/IOPort.hs deleted ===================================== @@ -1,128 +0,0 @@ -{-# LANGUAGE Unsafe #-} -{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-} -{-# OPTIONS_GHC -funbox-strict-fields #-} -{-# OPTIONS_HADDOCK hide #-} - ------------------------------------------------------------------------------ --- | --- Module : GHC.Internal.IOPort --- Copyright : (c) Tamar Christina 2019 --- License : see libraries/base/LICENSE --- --- Maintainer : ghc-devs at haskell.org --- Stability : internal --- Portability : non-portable (GHC Extensions) --- --- The 'IOPort' type. This is a facility used by the Windows IO subsystem. --- --- /The API of this module is unstable and not meant to be consumed by the general public./ --- If you absolutely must depend on it, make sure to use a tight upper --- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can --- change rapidly without much warning. --- --- We have strict rules with an I/O Port: --- * writing more than once is an error --- * reading more than once is an error --- --- It gives us the ability to have one thread to block, wait for a result from --- another thread and then being woken up. *Nothing* more. --- --- This type is very much GHC internal. It might be changed or removed without --- notice in future releases. --- ------------------------------------------------------------------------------ - -module GHC.Internal.IOPort ( - -- * IOPorts - IOPort(..) - , newIOPort - , newEmptyIOPort - , readIOPort - , writeIOPort - , doubleReadException - ) where - -import GHC.Internal.Base -import GHC.Internal.Exception -import GHC.Internal.Text.Show - -data IOPortException = IOPortException deriving Show - -instance Exception IOPortException where - displayException IOPortException = "IOPortException" - - -doubleReadException :: SomeException -doubleReadException = toException IOPortException - -data IOPort a = IOPort (IOPort# RealWorld a) -{- ^ -An 'IOPort' is a synchronising variable, used -for communication between concurrent threads, where one of the threads is -controlled by an external state. e.g. by an I/O action that is serviced by the -runtime. It can be thought of as a box, which may be empty or full. - -It is mostly similar to the behavior of 'Control.Concurrent.MVar.MVar' -except 'writeIOPort' doesn't block if the variable is full and the GC -won't forcibly release the lock if it thinks -there's a deadlock. - -The properties of IOPorts are: -* Writing to an empty IOPort will not block. -* Writing to an full IOPort will not block. It might throw an exception. -* Reading from an IOPort for the second time might throw an exception. -* Reading from a full IOPort will not block, return the value and empty the port. -* Reading from an empty IOPort will block until a write. -* Reusing an IOPort (that is, reading or writing twice) is not supported - and might throw an exception. Even if reads and writes are - interleaved. - -This type is very much GHC internal. It might be changed or removed without -notice in future releases. - --} - --- | @since base-4.1.0.0 -instance Eq (IOPort a) where - (IOPort ioport1#) == (IOPort ioport2#) = - isTrue# (sameIOPort# ioport1# ioport2#) - - - --- |Create an 'IOPort' which is initially empty. -newEmptyIOPort :: IO (IOPort a) -newEmptyIOPort = IO $ \ s# -> - case newIOPort# s# of - (# s2#, svar# #) -> (# s2#, IOPort svar# #) - --- |Create an 'IOPort' which contains the supplied value. -newIOPort :: a -> IO (IOPort a) -newIOPort value = - newEmptyIOPort >>= \ ioport -> - writeIOPort ioport value >> - return ioport - --- |Atomically read the contents of the 'IOPort'. If the 'IOPort' is --- currently empty, 'readIOPort' will wait until it is full. After a --- 'readIOPort', the 'IOPort' is left empty. --- --- There is one important property of 'readIOPort': --- --- * Only a single threads can be blocked on an 'IOPort'. --- -readIOPort :: IOPort a -> IO a -readIOPort (IOPort ioport#) = IO $ \ s# -> readIOPort# ioport# s# - --- |Put a value into an 'IOPort'. If the 'IOPort' is currently full, --- 'writeIOPort' will throw an exception. --- --- There is one important property of 'writeIOPort': --- --- * Only a single thread can be blocked on an 'IOPort'. --- -writeIOPort :: IOPort a -> a -> IO Bool -writeIOPort (IOPort ioport#) x = IO $ \ s# -> - case writeIOPort# ioport# x s# of - (# s, 0# #) -> (# s, False #) - (# s, _ #) -> (# s, True #) - ===================================== libraries/ghc-prim/GHC/Prim/PtrEq.hs ===================================== @@ -34,7 +34,6 @@ module GHC.Prim.PtrEq sameMutVar#, sameTVar#, sameMVar#, - sameIOPort#, samePromptTag#, eqStableName# ) where @@ -129,10 +128,6 @@ sameTVar# = unsafePtrEquality# sameMVar# :: forall {l} s (a :: TYPE (BoxedRep l)). MVar# s a -> MVar# s a -> Int# sameMVar# = unsafePtrEquality# --- | Compare the underlying pointers of two 'IOPort#'s. -sameIOPort# :: forall {l} s (a :: TYPE (BoxedRep l)). IOPort# s a -> IOPort# s a -> Int# -sameIOPort# = unsafePtrEquality# - -- | Compare the underlying pointers of two 'PromptTag#'s. samePromptTag# :: forall a. PromptTag# a -> PromptTag# a -> Int# samePromptTag# = unsafePtrEquality# ===================================== libraries/ghc-prim/changelog.md ===================================== @@ -1,3 +1,9 @@ +## 0.13.0 + +- Unreleased + +- `IOPort#` and its related operations have been removed ([CLC #213](https://github.com/haskell/core-libraries-committee/issues/213)) + ## 0.12.0 - Shipped with GHC 9.10.1 ===================================== rts/Prelude.h ===================================== @@ -48,7 +48,6 @@ PRELUDE_CLOSURE(ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOn PRELUDE_CLOSURE(ghczminternal_GHCziInternalziIOziException_cannotCompactFunction_closure); PRELUDE_CLOSURE(ghczminternal_GHCziInternalziIOziException_cannotCompactPinned_closure); PRELUDE_CLOSURE(ghczminternal_GHCziInternalziIOziException_cannotCompactMutable_closure); -PRELUDE_CLOSURE(ghczminternal_GHCziInternalziIOPort_doubleReadException_closure); PRELUDE_CLOSURE(ghczminternal_GHCziInternalziControlziExceptionziBase_nonTermination_closure); PRELUDE_CLOSURE(ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure); PRELUDE_CLOSURE(ghczminternal_GHCziInternalziEventziThread_blockedOnBadFD_closure); @@ -116,7 +115,6 @@ PRELUDE_INFO(ghczminternal_GHCziInternalziStable_StablePtr_con_info); #define cannotCompactMutable_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOziException_cannotCompactMutable_closure) #define nonTermination_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziControlziExceptionziBase_nonTermination_closure) #define nestedAtomically_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure) -#define doubleReadException DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziIOPort_doubleReadException_closure) #define absentSumFieldError_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziPrimziPanic_absentSumFieldError_closure) #define underflowException_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziExceptionziType_underflowException_closure) #define overflowException_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziExceptionziType_overflowException_closure) ===================================== rts/PrimOps.cmm ===================================== @@ -32,7 +32,6 @@ import pthread_mutex_unlock; import CLOSURE ghczminternal_GHCziInternalziControlziExceptionziBase_nestedAtomically_closure; import CLOSURE ghczminternal_GHCziInternalziIOziException_heapOverflow_closure; import CLOSURE ghczminternal_GHCziInternalziIOziException_blockedIndefinitelyOnMVar_closure; -import CLOSURE ghczminternal_GHCziInternalziIOPort_doubleReadException_closure; import AcquireSRWLockExclusive; import ReleaseSRWLockExclusive; import CLOSURE ghczmprim_GHCziTypes_False_closure; @@ -2125,238 +2124,6 @@ stg_tryReadMVarzh ( P_ mvar, /* :: MVar a */ ) return (1, val); } -/* ----------------------------------------------------------------------------- - * IOPort primitives - * - * readIOPort & writeIOPort work as follows. Firstly, an important invariant: - * - * Only one read and one write is allowed for an IOPort. - * Reading or writing to the same port twice will throw an exception. - * - * readIOPort: - * IOPort empty : then add ourselves to the blocking queue - * IOPort full : remove the value from the IOPort, and - * blocking queue empty : return - * blocking queue non-empty : perform the only blocked - * writeIOPort from the queue, and - * wake up the thread - * (IOPort is now empty) - * - * writeIOPort is just the dual of the above algorithm. - * - * How do we "perform a writeIOPort"? Well, By storing the value and prt on the - * stack, same way we do with MVars. Semantically the operations mutate the - * stack the same way so we will re-use the logic and datastructures for MVars - * for IOPort. See stg_block_putmvar and stg_block_takemvar in HeapStackCheck.c - * for the stack layout, and the PerformPut and PerformTake macros below. We - * also re-use the closure types MVAR_CLEAN/_DIRTY for IOPort. - * - * The remaining caveats of MVar thus also apply for an IOPort. The main - * crucial difference between an MVar and IOPort is that the scheduler will not - * be allowed to interrupt a blocked IOPort just because it thinks there's a - * deadlock. This is especially crucial for the non-threaded runtime. - * - * To avoid double reads/writes we set only the head to a MVarTSOQueue when - * a reader queues up on a port. - * We set the tail to the port itself upon reading. We can do this - * since there can only be one reader/writer for the port. In contrast to MVars - * which do need to keep a list of blocked threads. - * - * This means IOPorts have these valid states and transitions: - * - ┌─────────┐ - │ Empty │ head == tail == value == END_TSO_QUEUE - ├─────────┤ - │ │ - write │ │ read - v v - value != END_TSO_QUEUE ┌─────────┐ ┌─────────┐ value == END_TSO_QUEUE - head == END_TSO_QUEUE │ full │ │ reading │ head == queue with single reader - tail == END_TSO_QUEUE └─────────┘ └─────────┘ tail == END_TSO_QUEUE - │ │ - read │ │ write - │ │ - v v - ┌──────────┐ value != END_TSO_QUEUE - │ Used │ head == END_TSO_QUEUE - └──────────┘ tail == ioport - - * - * -------------------------------------------------------------------------- */ - - -stg_readIOPortzh ( P_ ioport /* :: IOPort a */ ) -{ - W_ val, info, tso, q; - - LOCK_CLOSURE(ioport, info); - - /* If the Port is empty, put ourselves on the blocked readers - * list and wait until we're woken up. - */ - if (StgMVar_value(ioport) == stg_END_TSO_QUEUE_closure) { - - // There is or was already another reader, throw exception. - if (StgMVar_head(ioport) != stg_END_TSO_QUEUE_closure || - StgMVar_tail(ioport) != stg_END_TSO_QUEUE_closure) { - unlockClosure(ioport, info); - jump stg_raiseIOzh(ghczminternal_GHCziInternalziIOPort_doubleReadException_closure); - } - - if (info == stg_MVAR_CLEAN_info) { - ccall dirty_MVAR(BaseReg "ptr", ioport "ptr", StgMVar_value(ioport)); - } - - ALLOC_PRIM_WITH_CUSTOM_FAILURE - (SIZEOF_StgMVarTSOQueue, - unlockClosure(ioport, stg_MVAR_DIRTY_info); - GC_PRIM_P(stg_readIOPortzh, ioport)); - - q = Hp - SIZEOF_StgMVarTSOQueue + WDS(1); - - // link = stg_END_TSO_QUEUE_closure since we check that - // there is no other reader above. - StgMVarTSOQueue_link(q) = stg_END_TSO_QUEUE_closure; - StgMVarTSOQueue_tso(q) = CurrentTSO; - - SET_HDR(q, stg_MVAR_TSO_QUEUE_info, CCS_SYSTEM); - - %release StgMVar_head(ioport) = q; - StgTSO__link(CurrentTSO) = q; - StgTSO_block_info(CurrentTSO) = ioport; - - // See Note [Heap memory barriers] - %release StgTSO_why_blocked(CurrentTSO) = BlockedOnMVar::I32; - - //Unlocks the closure as well - jump stg_block_readmvar(ioport); - } - - //This way we can check of there has been a read already. - //Upon reading we set tail to indicate the port is now closed. - if (StgMVar_tail(ioport) == stg_END_TSO_QUEUE_closure) { - StgMVar_tail(ioport) = ioport; - StgMVar_head(ioport) = stg_END_TSO_QUEUE_closure; - } else { - //Or another thread has read already: Throw an exception. - unlockClosure(ioport, info); - jump stg_raiseIOzh(ghczminternal_GHCziInternalziIOPort_doubleReadException_closure); - } - - val = StgMVar_value(ioport); - - unlockClosure(ioport, info); - return (val); -} - -stg_writeIOPortzh ( P_ ioport, /* :: IOPort a */ - P_ val, /* :: a */ ) -{ - W_ info, tso, q; - - LOCK_CLOSURE(ioport, info); - - /* If there is already a value in the port, then raise an exception - as it's the second write. - Correct usages of IOPort should never have a second - write. */ - if (StgMVar_value(ioport) != stg_END_TSO_QUEUE_closure) { - unlockClosure(ioport, info); - jump stg_raiseIOzh(ghczminternal_GHCziInternalziIOPort_doubleReadException_closure); - return (0); - } - - // We are going to mutate the closure, make sure its current pointers - // are marked. - if (info == stg_MVAR_CLEAN_info) { - ccall update_MVAR(BaseReg "ptr", ioport "ptr", StgMVar_value(ioport) "ptr"); - } - - q = StgMVar_head(ioport); -loop: - if (q == stg_END_TSO_QUEUE_closure) { - /* No takes, the IOPort is now full. */ - if (info == stg_MVAR_CLEAN_info) { - ccall dirty_MVAR(BaseReg "ptr", ioport "ptr", StgMVar_value(ioport) "ptr"); - } - StgMVar_value(ioport) = val; - - unlockClosure(ioport, stg_MVAR_DIRTY_info); - return (1); - } - //Possibly IND added by removeFromMVarBlockedQueue - if (StgHeader_info(q) == stg_IND_info || - StgHeader_info(q) == stg_MSG_NULL_info) { - q = %acquire StgInd_indirectee(q); - goto loop; - } - - // There is a readIOPort waiting: wake it up - tso = StgMVarTSOQueue_tso(q); - - // Assert no read has happened yet. - ASSERT(StgMVar_tail(ioport) == stg_END_TSO_QUEUE_closure); - // And there is only one reader queued up. - ASSERT(StgMVarTSOQueue_link(q) == stg_END_TSO_QUEUE_closure); - - // We perform the read here, so set tail/head accordingly. - StgMVar_head(ioport) = stg_END_TSO_QUEUE_closure; - StgMVar_tail(ioport) = ioport; - - // In contrast to MVars we do not need to move on to the - // next element in the waiting list here, as there can only ever - // be one thread blocked on a port. - - // save why_blocked here, because waking up the thread destroys - // this information - W_ why_blocked; - why_blocked = TO_W_(StgTSO_why_blocked(tso)); // TODO Missing acquire - ASSERT(StgTSO_block_info(tso) == ioport); - - // actually perform the takeMVar - W_ stack; - stack = StgTSO_stackobj(tso); - if (IS_STACK_CLEAN(stack)) { - ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); - } - PerformTake(stack, val); - - // indicate that the operation has now completed. - StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - - ccall tryWakeupThread(MyCapability() "ptr", tso); - - // For MVars we loop here, waking up all readers. - // IOPorts however can only have on reader. So we are done - // at this point. - - //Either there was no reader queued, or he must have been - //blocked on BlockedOnMVar - ASSERT(why_blocked == BlockedOnMVar); - - unlockClosure(ioport, info); - return (1); -} -/* ----------------------------------------------------------------------------- - IOPort primitives - -------------------------------------------------------------------------- */ - -stg_newIOPortzh () -{ - W_ ioport; - - ALLOC_PRIM_ (SIZEOF_StgMVar, stg_newIOPortzh); - - ioport = Hp - SIZEOF_StgMVar + WDS(1); - SET_HDR(ioport, stg_MVAR_DIRTY_info,CCCS); - // MVARs start dirty: generation 0 has no mutable list - StgMVar_head(ioport) = stg_END_TSO_QUEUE_closure; - StgMVar_tail(ioport) = stg_END_TSO_QUEUE_closure; - StgMVar_value(ioport) = stg_END_TSO_QUEUE_closure; - - return (ioport); -} - /* ----------------------------------------------------------------------------- Stable name primitives ------------------------------------------------------------------------- */ ===================================== rts/RtsSymbols.c ===================================== @@ -645,9 +645,6 @@ extern char **environ; SymI_HasDataProto(stg_newMVarzh) \ SymI_HasDataProto(stg_newMutVarzh) \ SymI_HasDataProto(stg_newTVarzh) \ - SymI_HasDataProto(stg_readIOPortzh) \ - SymI_HasDataProto(stg_writeIOPortzh) \ - SymI_HasDataProto(stg_newIOPortzh) \ SymI_HasDataProto(stg_noDuplicatezh) \ SymI_HasDataProto(stg_atomicModifyMutVar2zh) \ SymI_HasDataProto(stg_atomicModifyMutVarzuzh) \ ===================================== rts/include/stg/MiscClosures.h ===================================== @@ -423,10 +423,6 @@ RTS_FUN_DECL(stg_block_stmwait); RTS_FUN_DECL(stg_block_throwto); RTS_RET(stg_block_throwto); -RTS_FUN_DECL(stg_readIOPortzh); -RTS_FUN_DECL(stg_writeIOPortzh); -RTS_FUN_DECL(stg_newIOPortzh); - /* Entry/exit points from StgStartup.cmm */ RTS_RET(stg_stop_thread); ===================================== rts/win32/AsyncWinIO.c ===================================== @@ -147,7 +147,7 @@ * Create a thread to execute "runner" We never truly shut down the IO Manager. While this means we - might block forever on the IOPort if the IO Manager is no longer + might block forever on the MVar if the IO Manager is no longer needed we consider this cheap compared to the complexity of properly handling pausing and resuming of the manager. ===================================== testsuite/tests/primops/should_run/UnliftedIOPort.hs ===================================== @@ -1,31 +0,0 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE MagicHash #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE UnboxedTuples #-} -{-# LANGUAGE UnliftedDatatypes #-} - -module Main where - -import Data.Kind -import GHC.Exts -import GHC.IO - -type U :: Type -data U = U Int# - -main :: IO () -main = do - res <- IO \ s0 -> - case newIOPort# s0 of - (# s1, port #) -> - case writeIOPort# port (U 17#) s1 of - (# s2, i #) -> - case catch# (writeIOPort# port (U 19#)) (\ _ s -> (# s, 3# #)) s2 of - (# s3, j #) -> - case readIOPort# port s3 of - (# s4, U r1 #) -> - case catch# (readIOPort# port) (\ _ s -> (# s, U 4# #)) s4 of - (# s5, U r2 #) -> - (# s5, [ I# i, I# j, I# r1, I# r2 ] #) - print res ===================================== testsuite/tests/primops/should_run/all.T ===================================== @@ -45,7 +45,6 @@ test('LevPolyPtrEquality2', normal, compile_and_run, ['']) test('UnliftedArray1', normal, compile_and_run, ['']) test('UnliftedArray2', normal, compile_and_run, ['']) test('UnliftedArrayCAS', normal, compile_and_run, ['']) -test('UnliftedIOPort', js_broken(22261), compile_and_run, ['']) test('UnliftedMutVar1', normal, compile_and_run, ['']) test('UnliftedMutVar2', normal, compile_and_run, ['']) test('UnliftedMutVar3', normal, compile_and_run, ['']) ===================================== utils/genprimopcode/Main.hs ===================================== @@ -832,8 +832,6 @@ ppType (TyApp (TyCon "StableName#") [x]) = "mkStableNamePrimTy " ++ ppType x ppType (TyApp (TyCon "MVar#") [x,y]) = "mkMVarPrimTy " ++ ppType x ++ " " ++ ppType y -ppType (TyApp (TyCon "IOPort#") [x,y]) = "mkIOPortPrimTy " ++ ppType x - ++ " " ++ ppType y ppType (TyApp (TyCon "TVar#") [x,y]) = "mkTVarPrimTy " ++ ppType x ++ " " ++ ppType y View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2768fd9f73a9c750fb3c286f5e0cd7a23954e855 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2768fd9f73a9c750fb3c286f5e0cd7a23954e855 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 16:03:18 2024 From: gitlab at gitlab.haskell.org (Jade (@Jade)) Date: Tue, 30 Jul 2024 12:03:18 -0400 Subject: [Git][ghc/ghc][wip/structured-ghci-errors] 20 commits: ci: Replace debian 10 with debian 12 on validation jobs Message-ID: <66a90ec66e871_246ab1aecce86702b@gitlab.mail> Jade pushed to branch wip/structured-ghci-errors at Glasgow Haskell Compiler / GHC Commits: 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 53c18922 by sheaf at 2024-07-30T13:24:13+02:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - b2979257 by Jade at 2024-07-30T16:24:52+02:00 WIP - - - - - 5e738c19 by Jade at 2024-07-30T18:02:33+02:00 WIP (using own type family) - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Ppr.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Errors/Ppr.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Errors/Ppr.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/PostProcess.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/325a5b6c6241f396631faf989d0ee5183c7f87c7...5e738c19d8c366b9779ae8f9e73360431f6222f6 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/325a5b6c6241f396631faf989d0ee5183c7f87c7...5e738c19d8c366b9779ae8f9e73360431f6222f6 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 16:03:23 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 12:03:23 -0400 Subject: [Git][ghc/ghc][wip/clc216] 4694 commits: [haddock @ 2002-04-04 16:23:43 by simonmar] Message-ID: <66a90ecb5d871_246ab198c9986717c@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 2b39cd94 by Simon Marlow at 2002-04-04T16:23:43+00:00 [haddock @ 2002-04-04 16:23:43 by simonmar] This is Haddock, my stab at a Haskell documentation tool. It's not quite ready for release yet, but I'm putting it in the repository so others can take a look. It uses a locally modified version of the hssource parser, extended with support for GHC extensions and documentation annotations. - - - - - 99ede94f by Simon Marlow at 2002-04-04T16:24:10+00:00 [haddock @ 2002-04-04 16:24:10 by simonmar] forgot one file - - - - - 8363294c by Simon Marlow at 2002-04-05T13:58:15+00:00 [haddock @ 2002-04-05 13:58:15 by simonmar] Remap names in the exported declarations to be "closer" to the current module. eg. if an exported declaration mentions a type 'T' which is imported from module A then re-exported from the current module, then links from the type or indeed the documentation will point to the current module rather than module A. This is to support better hiding: module A won't be referred to in the generated output. - - - - - 1570cbc1 by Simon Marlow at 2002-04-05T13:58:23+00:00 [haddock @ 2002-04-05 13:58:23 by simonmar] update the TODO list - - - - - 3a62f96b by Simon Marlow at 2002-04-05T14:11:51+00:00 [haddock @ 2002-04-05 14:11:51 by simonmar] Fix the anchor for a class declaration - - - - - c5d9a471 by Simon Marlow at 2002-04-05T14:18:41+00:00 [haddock @ 2002-04-05 14:18:41 by simonmar] remove underlines on visited links - - - - - 97280525 by Simon Marlow at 2002-04-05T16:11:47+00:00 [haddock @ 2002-04-05 16:11:47 by simonmar] - Update to generate more correct HTML. - Use our own non-overloaded table combinators, as the overloaded versions were giving me a headache. The improved type safety caught several errors in the HTML generation. - - - - - 9acd3a4d by Simon Marlow at 2002-04-05T16:32:19+00:00 [haddock @ 2002-04-05 16:32:19 by simonmar] Add width property to the title, and add TD.children for the module contents page. - - - - - ec9a0847 by Simon Marlow at 2002-04-08T16:39:56+00:00 [haddock @ 2002-04-08 16:39:56 by simonmar] Fix a problem with exports of the form T(..). - - - - - e4627dc8 by Simon Marlow at 2002-04-08T16:41:38+00:00 [haddock @ 2002-04-08 16:41:37 by simonmar] - Add our own versions of Html & BlockTable for the time being. - Add support for generating an index to the HTML backend - - - - - 2d73fd75 by Simon Marlow at 2002-04-09T11:23:24+00:00 [haddock @ 2002-04-09 11:23:24 by simonmar] Add '-- /' as a synonym for '-- |', for compatibility with IDoc. - - - - - 3675464e by Simon Marlow at 2002-04-09T11:33:55+00:00 [haddock @ 2002-04-09 11:33:54 by simonmar] - add the <...> syntax for marking up URLs in documentation - Make the output for data & class declarations more compact when there aren't any documentation annotations on the individual methods or constructors respectively. - - - - - 5077f5b1 by Simon Marlow at 2002-04-09T11:36:04+00:00 [haddock @ 2002-04-09 11:36:04 by simonmar] Update the TODO list - - - - - 9e83c54d by Simon Marlow at 2002-04-10T10:50:06+00:00 [haddock @ 2002-04-10 10:50:06 by simonmar] Use explicit 'px' suffix on pixel sizes; IE seems to prefer them - - - - - 052de51c by Simon Marlow at 2002-04-10T13:23:13+00:00 [haddock @ 2002-04-10 13:23:13 by simonmar] Lex URLs as a single token to avoid having to escape special characters inside the URL string. - - - - - 47187edb by Simon Marlow at 2002-04-10T13:23:55+00:00 [haddock @ 2002-04-10 13:23:55 by simonmar] Not sure why I made the constructor name for a record declaration into a TyCls name, but change it back into a Var name anyhow. - - - - - 3dc6aa81 by Simon Marlow at 2002-04-10T13:26:10+00:00 [haddock @ 2002-04-10 13:26:09 by simonmar] Lots of changes, including: - add index support to the HTML backend - clean up the renamer, put it into a monad - propogate unresolved names to the top level and report them in a nicer way - various bugfixes - - - - - c2a70a72 by Simon Marlow at 2002-04-10T13:32:39+00:00 [haddock @ 2002-04-10 13:32:39 by simonmar] Skeleton documentation - - - - - 50c98d17 by Simon Marlow at 2002-04-10T13:37:23+00:00 [haddock @ 2002-04-10 13:37:23 by simonmar] Update the TODO list, separate into pre-1.0 and post-1.0 items - - - - - f3778be6 by Simon Marlow at 2002-04-10T14:30:58+00:00 [haddock @ 2002-04-10 14:30:58 by simonmar] Add an introduction - - - - - cfbaf9f7 by Simon Marlow at 2002-04-10T14:59:51+00:00 [haddock @ 2002-04-10 14:59:51 by simonmar] Sort the module tree - - - - - 76bd7b34 by Simon Marlow at 2002-04-10T15:50:11+00:00 [haddock @ 2002-04-10 15:50:10 by simonmar] Generate a little table of contents at the top of the module doc (only if the module actually contains some section headings, though). - - - - - bb8560a1 by Simon Marlow at 2002-04-10T16:10:26+00:00 [haddock @ 2002-04-10 16:10:26 by simonmar] Now we understand (or at least don't barf on) type signatures in patterns such as you might find when scoped type variables are in use. - - - - - 86c2a026 by Simon Marlow at 2002-04-10T16:10:49+00:00 [haddock @ 2002-04-10 16:10:49 by simonmar] more updates - - - - - 1c052b0e by Simon Marlow at 2002-04-10T16:28:05+00:00 [haddock @ 2002-04-10 16:28:05 by simonmar] Parse errors in doc strings are now reported as warnings rather that causing the whole thing to fall over. It still needs cleaning up (the warning is emitted with trace) but this will do for the time being. - - - - - ace03e8f by Simon Marlow at 2002-04-10T16:38:03+00:00 [haddock @ 2002-04-10 16:38:03 by simonmar] update again - - - - - 69006c3e by Simon Marlow at 2002-04-11T13:38:02+00:00 [haddock @ 2002-04-11 13:38:02 by simonmar] mention Opera - - - - - fe9b10f8 by Simon Marlow at 2002-04-11T13:40:31+00:00 [haddock @ 2002-04-11 13:40:30 by simonmar] - copy haddock.css into the same place as the generated HTML - new option: --css <file> specifies the style sheet to use - new option: -o <dir> specifies the directory in which to generate the output. - because Haddock now needs to know where to find its default stylesheet, we have to have a wrapper script and do the haddock-inplace thing (Makefile code copied largely from fptools/happy). - - - - - 106adbbe by Simon Marlow at 2002-04-24T15:12:41+00:00 [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. - - - - - 995d3f9e by Simon Marlow at 2002-04-24T15:14:12+00:00 [haddock @ 2002-04-24 15:14:11 by simonmar] Grok the kind of module headers we use in fptools/libraries, and pass the "portability", "stability", and "maintainer" strings through into the generated HTML. If the module header doesn't match the pattern, then we don't include the info in the HTML. - - - - - e14da136 by Simon Marlow at 2002-04-24T15:16:57+00:00 [haddock @ 2002-04-24 15:16:57 by simonmar] Done module headers now. - - - - - 2ca8dfd4 by Simon Marlow at 2002-04-24T15:57:48+00:00 [haddock @ 2002-04-24 15:57:47 by simonmar] Handle gcons in export lists (a common extension). - - - - - 044cea81 by Simon Marlow at 2002-04-25T14:20:12+00:00 [haddock @ 2002-04-25 14:20:12 by simonmar] Add the little lambda icon - - - - - 63955027 by Simon Marlow at 2002-04-25T14:40:05+00:00 [haddock @ 2002-04-25 14:40:05 by simonmar] - Add support for named chunks of documentation which can be referenced from the export list. - Copy the icon from $libdir to the destination in HTML mode. - - - - - 36e3f913 by Simon Marlow at 2002-04-25T16:48:36+00:00 [haddock @ 2002-04-25 16:48:36 by simonmar] More keyboard bashing - - - - - 7ae18dd0 by Simon Marlow at 2002-04-26T08:43:33+00:00 [haddock @ 2002-04-26 08:43:33 by simonmar] Package util reqd. to compile with 4.08.2 - - - - - bbd5fbab by Simon Marlow at 2002-04-26T10:13:00+00:00 [haddock @ 2002-04-26 10:13:00 by simonmar] Include $(GHC_HAPPY_OPTS) when compiling HsParser - - - - - 31c53d79 by Simon Marlow at 2002-04-26T11:18:57+00:00 [haddock @ 2002-04-26 11:18:56 by simonmar] - support for fundeps (partially contributed by Brett Letner - thanks Brett). - make it build with GHC 4.08.2 - - - - - c415ce76 by Simon Marlow at 2002-04-26T13:15:02+00:00 [haddock @ 2002-04-26 13:15:02 by simonmar] Move the explicit formatting of the little table for the stability/portability/maintainer info from the HTML into the CSS, and remove the explicit table size (just right-align it). - - - - - 520ee21a by Simon Marlow at 2002-04-26T16:01:44+00:00 [haddock @ 2002-04-26 16:01:44 by simonmar] Yet more keyboard bashing - this is pretty much complete now. - - - - - 2ae37179 by Simon Marlow at 2002-04-26T16:02:14+00:00 [haddock @ 2002-04-26 16:02:14 by simonmar] Add a couple of things I forgot about - - - - - b7211e04 by Simon Marlow at 2002-04-29T15:28:12+00:00 [haddock @ 2002-04-29 15:28:12 by simonmar] bugfix for declBinders on a NewTypeDecl - - - - - 640c154a by Simon Marlow at 2002-04-29T15:28:54+00:00 [haddock @ 2002-04-29 15:28:54 by simonmar] Allow '-- |' style annotations on constructors and record fields. - - - - - 393f258a by Simon Marlow at 2002-04-29T15:37:32+00:00 [haddock @ 2002-04-29 15:37:32 by simonmar] syntax fix - - - - - 8a2c2549 by Simon Marlow at 2002-04-29T15:37:48+00:00 [haddock @ 2002-04-29 15:37:48 by simonmar] Add an example - - - - - db88f8a2 by Simon Marlow at 2002-04-29T15:55:46+00:00 [haddock @ 2002-04-29 15:55:46 by simonmar] remove a trace - - - - - 2b0248e0 by Simon Marlow at 2002-04-29T15:56:19+00:00 [haddock @ 2002-04-29 15:56:19 by simonmar] Fix for 'make install' - - - - - 120453a0 by Simon Marlow at 2002-04-29T15:56:39+00:00 [haddock @ 2002-04-29 15:56:39 by simonmar] Install the auxilliary bits - - - - - 950e6dbb by Simon Marlow at 2002-04-29T15:57:30+00:00 [haddock @ 2002-04-29 15:57:30 by simonmar] Add BinDist bits - - - - - 154b9d71 by Simon Marlow at 2002-05-01T11:02:52+00:00 [haddock @ 2002-05-01 11:02:52 by simonmar] update - - - - - ba6c39fa by Simon Marlow at 2002-05-01T11:03:26+00:00 [haddock @ 2002-05-01 11:03:26 by simonmar] Add another item - - - - - bacb5e33 by Simon Marlow at 2002-05-03T08:50:00+00:00 [haddock @ 2002-05-03 08:50:00 by simonmar] Fix some typos. - - - - - 54c87895 by Sven Panne at 2002-05-05T19:40:51+00:00 [haddock @ 2002-05-05 19:40:51 by panne] As a temporary hack/workaround for a bug in GHC's simplifier, don't pass Happy the -c option for generating the parsers in this subdir. Furthermore, disable -O for HaddocParse, too. - - - - - e6c08703 by Simon Marlow at 2002-05-06T09:51:10+00:00 [haddock @ 2002-05-06 09:51:10 by simonmar] Add RPM spec file (thanks to Tom Moertel <tom-rpms at moertel.com>) - - - - - 7b8fa8e7 by Simon Marlow at 2002-05-06T12:29:26+00:00 [haddock @ 2002-05-06 12:29:26 by simonmar] Add missing type signature (a different workaround for the bug in GHC's simplifier). - - - - - cd0e300d by Simon Marlow at 2002-05-06T12:30:09+00:00 [haddock @ 2002-05-06 12:30:09 by simonmar] Remove workaround for simplifier bug in previous revision. - - - - - 687e68fa by Simon Marlow at 2002-05-06T12:32:32+00:00 [haddock @ 2002-05-06 12:32:32 by simonmar] Allow empty data declarations (another GHC extension). - - - - - 8f29f696 by Simon Marlow at 2002-05-06T12:49:21+00:00 [haddock @ 2002-05-06 12:49:21 by simonmar] Fix silly bug in named documentation block lookup. - - - - - 8e0059af by Simon Marlow at 2002-05-06T13:02:42+00:00 [haddock @ 2002-05-06 13:02:42 by simonmar] Add another named chunk with a different name - - - - - 68f8a896 by Simon Marlow at 2002-05-06T13:32:32+00:00 [haddock @ 2002-05-06 13:32:32 by simonmar] Be more lenient about extra paragraph breaks - - - - - 65fc31db by Simon Marlow at 2002-05-07T15:36:36+00:00 [haddock @ 2002-05-07 15:36:36 by simonmar] DocEmpty is a right and left-unit of DocAppend (remove it in the smart constructor). - - - - - adc81078 by Simon Marlow at 2002-05-07T15:37:15+00:00 [haddock @ 2002-05-07 15:37:15 by simonmar] Allow code blocks to be denoted with bird-tracks in addition to [...]. - - - - - 1283a3c1 by Simon Marlow at 2002-05-08T11:21:56+00:00 [haddock @ 2002-05-08 11:21:56 by simonmar] Add a facility for specifying options that affect Haddock's treatment of the module. Options are given at the top of the module in a comma-separated list, beginning with '-- #'. eg. -- # prune, hide, ignore-exports Options currently available, with their meanings: prune: ignore declarations which have no documentation annotations ignore-exports: act as if the export list were not specified (i.e. export everything local to the module). hide: do not include this module in the generated documentation, but propagate any exported definitions to modules which re-export them. There's a slight change in the semantics for re-exporting a full module by giving 'module M' in the export list: if module M does not have the 'hide' option, then the documentation will now just contain a reference to module M rather than the full inlined contents of that module. These features, and some other changes in the pipeline, are the result of discussions between myself and Manuel Chakravarty <chak at cse.unsw.edu.au> (author of IDoc) yesterday. Also: some cleanups, use a Writer monad to collect error messages in some places instead of just printing them with trace. - - - - - a2239cf5 by Simon Marlow at 2002-05-08T11:22:30+00:00 [haddock @ 2002-05-08 11:22:30 by simonmar] Update to test new features. - - - - - 6add955f by Simon Marlow at 2002-05-08T13:37:25+00:00 [haddock @ 2002-05-08 13:37:25 by simonmar] Change the markup for typewriter-font from [...] to @... at . The reasoning is that the '@' symbol is much less likely to be needed than square brackets, and we don't want to have to escape square brackets in code fragments. This will be mildly painful in the short term, but it's better to get the change out of the way as early as possible. - - - - - cda06447 by Simon Marlow at 2002-05-08T13:39:56+00:00 [haddock @ 2002-05-08 13:39:56 by simonmar] Allow nested-style comments to be used as documentation annotations too. eg. {-| ... -} is equivalent to -- | ... An extra space can also be left after the comment opener: {- | ... -}. The only version that isn't allowed is {-# ... -}, because this syntax overlaps with Haskell pragmas; use {- # ... -} instead. - - - - - db23f65e by Simon Marlow at 2002-05-08T14:48:41+00:00 [haddock @ 2002-05-08 14:48:39 by simonmar] Add support for existential quantifiers on constructors. - - - - - adce3794 by Simon Marlow at 2002-05-08T15:43:25+00:00 [haddock @ 2002-05-08 15:43:25 by simonmar] update - - - - - 62a1f436 by Simon Marlow at 2002-05-08T15:44:10+00:00 [haddock @ 2002-05-08 15:44:10 by simonmar] Update to version 0.2 - - - - - f6a24ba3 by Simon Marlow at 2002-05-09T08:48:29+00:00 [haddock @ 2002-05-09 08:48:29 by simonmar] typo - - - - - 9f9522a4 by Simon Marlow at 2002-05-09T10:33:14+00:00 [haddock @ 2002-05-09 10:33:14 by simonmar] oops, left out '/' from the special characters in the last change. - - - - - 14abcb39 by Simon Marlow at 2002-05-09T10:34:44+00:00 [haddock @ 2002-05-09 10:34:44 by simonmar] Fix buglet - - - - - b8d878be by Simon Marlow at 2002-05-09T10:35:00+00:00 [haddock @ 2002-05-09 10:35:00 by simonmar] Give a more useful instance of Show for Module. - - - - - f7bfd626 by Simon Marlow at 2002-05-09T10:37:07+00:00 [haddock @ 2002-05-09 10:37:07 by simonmar] The last commit to Main.lhs broke the delicate balance of laziness which was being used to avoid computing the dependency graph of modules. So I finally bit the bullet and did a proper topological sort of the module graph, which turned out to be easy (stealing the Digraph module from GHC - this really ought to be in the libraries somewhere). - - - - - b481c1d0 by Simon Marlow at 2002-05-09T10:37:25+00:00 [haddock @ 2002-05-09 10:37:25 by simonmar] another item done - - - - - 032e2b42 by Simon Marlow at 2002-05-09T10:44:15+00:00 [haddock @ 2002-05-09 10:44:15 by simonmar] Don't consider a module re-export as having documentation, for the purposes of deciding whether we need a Synopsis section or not. - - - - - 5fb45e92 by Simon Marlow at 2002-05-09T11:10:55+00:00 [haddock @ 2002-05-09 11:10:55 by simonmar] Add a special case for list types in ppHsAType - - - - - 1937e428 by Simon Marlow at 2002-05-09T12:43:06+00:00 [haddock @ 2002-05-09 12:43:06 by simonmar] Type synonyms can accept a ctype on the RHS, to match GHC. - - - - - 0f16ce56 by Simon Marlow at 2002-05-09T12:45:19+00:00 [haddock @ 2002-05-09 12:45:19 by simonmar] Add 'stdcall' keyword - - - - - 29b0d7d2 by Simon Marlow at 2002-05-09T13:35:45+00:00 [haddock @ 2002-05-09 13:35:45 by simonmar] Add System Requirements section - - - - - bf14dddd by Simon Marlow at 2002-05-09T13:36:11+00:00 [haddock @ 2002-05-09 13:36:11 by simonmar] Test existential types, amongst other things - - - - - 502f8f6f by Simon Marlow at 2002-05-09T13:37:35+00:00 [haddock @ 2002-05-09 13:37:35 by simonmar] Print the module name in a doc-string parse error - - - - - ca1f8d49 by Simon Marlow at 2002-05-09T13:38:04+00:00 [haddock @ 2002-05-09 13:38:04 by simonmar] Add dependency - - - - - 8d3d91ff by Simon Marlow at 2002-05-09T15:37:57+00:00 [haddock @ 2002-05-09 15:37:57 by simonmar] Add the changelog/release notes - - - - - f3960959 by Simon Marlow at 2002-05-09T15:47:47+00:00 [haddock @ 2002-05-09 15:47:47 by simonmar] mention the backquote-style of markup - - - - - 089fb6e6 by Simon Marlow at 2002-05-09T15:59:45+00:00 [haddock @ 2002-05-09 15:59:45 by simonmar] update - - - - - bdd3be0b by Simon Marlow at 2002-05-09T15:59:56+00:00 [haddock @ 2002-05-09 15:59:56 by simonmar] Document changes since 0.1 - - - - - 00fc4af8 by Simon Marlow at 2002-05-10T08:22:48+00:00 [haddock @ 2002-05-10 08:22:48 by simonmar] oops, update to version 0.2 - - - - - a8a79041 by Simon Marlow at 2002-05-10T16:05:08+00:00 [haddock @ 2002-05-10 16:05:08 by simonmar] Only include a mini-contents if there are 2 or more sections - - - - - 06653319 by Simon Marlow at 2002-05-13T09:13:12+00:00 [haddock @ 2002-05-13 09:13:12 by simonmar] fix typos - - - - - 1402b19b by Simon Marlow at 2002-05-13T10:14:22+00:00 [haddock @ 2002-05-13 10:14:22 by simonmar] Allow backquote as the right-hand quote as well as the left-hand quote, as suggested by Dean Herrington. Clean up the grammar a litte. - - - - - dcd5320d by Simon Marlow at 2002-05-13T10:44:10+00:00 [haddock @ 2002-05-13 10:44:10 by simonmar] a couple more things, prioritise a bit - - - - - a90130c4 by Simon Marlow at 2002-05-13T15:19:03+00:00 [haddock @ 2002-05-13 15:19:03 by simonmar] Cope with datatypes which have documentation on the constructor but not the type itself, and records which have documentation on the fields but not the constructor. (Thanks to Ross Paterson for pointing out the bugs). - - - - - a774d432 by Simon Marlow at 2002-05-13T15:20:54+00:00 [haddock @ 2002-05-13 15:20:54 by simonmar] Fix one of the record examples - - - - - 2d1d5218 by Simon Marlow at 2002-05-15T12:44:35+00:00 [haddock @ 2002-05-15 12:44:35 by simonmar] Preserve the newline before a bird-track, but only within a paragraph. - - - - - 1554c09a by Simon Marlow at 2002-05-15T13:03:02+00:00 [haddock @ 2002-05-15 13:03:01 by simonmar] Reworking of the internals to support documenting function arguments (the Most Wanted new feature by the punters). The old method of keeping parsed documentation in a Name -> Doc mapping wasn't going to cut it for anntations on type components, where there's no name to attach the documentation to, so I've moved to storing all the documentation in the abstract syntax. Previously some of the documentation was left in the abstract syntax by the parser, but was later extracted into the mapping. In order to avoid having to parameterise the abstract syntax over the type of documentation stored in it, we have to parse the documentation at the same time as we parse the Haskell source (well, I suppose we could store 'Either String Doc' in the HsSyn, but that's clunky). One upshot is that documentation is now parsed eagerly, and documentation parse errors are fatal (but have better line numbers in the error message). The new story simplifies matters for the code that processes the source modules, because we don't have to maintain the extra Name->Doc mapping, and it should improve efficiency a little too. New features: - Function arguments and return values can now have doc annotations. - If you refer to a qualified name in a doc string, eg. 'IO.putStr', then Haddock will emit a hyperlink even if the identifier is not in scope, so you don't have to make sure everything referred to from the documentation is imported. - several bugs & minor infelicities fixed. - - - - - 57344dc3 by Simon Marlow at 2002-05-15T13:03:19+00:00 [haddock @ 2002-05-15 13:03:19 by simonmar] Bump to version 0.3 - - - - - b2791812 by Simon Marlow at 2002-05-15T13:03:41+00:00 [haddock @ 2002-05-15 13:03:41 by simonmar] update - - - - - fead183e by Simon Marlow at 2002-05-15T13:10:15+00:00 [haddock @ 2002-05-15 13:10:15 by simonmar] Rename Foo.hs to Test.hs, and add a Makefile - - - - - b0b1f89f by Simon Marlow at 2002-05-15T13:16:07+00:00 [haddock @ 2002-05-15 13:16:07 by simonmar] - Remove the note about function argument docs not being implemented - Note that qualified identifiers can be used to point to entities that aren't in scope. - - - - - 5665f31a by Simon Marlow at 2002-05-15T13:28:46+00:00 [haddock @ 2002-05-15 13:28:46 by simonmar] Patch to add support for GHC-style primitive strings ".."#, from Ross Paterson. - - - - - 0564505d by Simon Marlow at 2002-05-17T10:51:57+00:00 [haddock @ 2002-05-17 10:51:57 by simonmar] Fix bugs in qualified name handling (A.B.f was returned as B.f) - - - - - 10e7311c by Simon Marlow at 2002-05-21T10:24:52+00:00 [haddock @ 2002-05-21 10:24:52 by simonmar] - Use an alternate tabular layout for datatypes, which is more compact - Fix some problems with the function argument documentation - - - - - 2f91c2a6 by Simon Marlow at 2002-05-21T10:27:40+00:00 [haddock @ 2002-05-21 10:27:40 by simonmar] add a few more test cases - - - - - 01c2ddd2 by Simon Marlow at 2002-05-21T10:28:33+00:00 [haddock @ 2002-05-21 10:28:33 by simonmar] Rearrange a bit, and add support for tabular datatype rendering - - - - - a4e4c5f8 by Simon Marlow at 2002-05-27T09:03:52+00:00 [haddock @ 2002-05-27 09:03:51 by simonmar] Lots of changes: - instances of a class are listed with the class, and instances involving a datatype are listed with that type. Derived instances aren't included at the moment: the calculation to find the instance head for a derived instance is non-trivial. - some formatting changes; use rows with specified height rather than cellspacing in some places. - various fixes (source file links were wrong, amongst others) - - - - - 48722e68 by Simon Marlow at 2002-05-27T12:30:38+00:00 [haddock @ 2002-05-27 12:30:37 by simonmar] - Put function arguments *before* the doc for the function, as suggested by Sven Panne. This looks nicer when the function documentation is long. - Switch to using bold for binders at the definition site, and use underline for keywords. This makes the binder stand out more. - - - - - 657204d2 by Simon Marlow at 2002-05-27T13:19:49+00:00 [haddock @ 2002-05-27 13:19:49 by simonmar] Fix bug: we weren't renaming HsDocCommentNamed in renameDecl - - - - - 592aae66 by Simon Marlow at 2002-05-27T14:10:27+00:00 [haddock @ 2002-05-27 14:10:27 by simonmar] Fix some bugs in the rendering of qualified type signatures. - - - - - 69c8f763 by Simon Marlow at 2002-05-27T14:36:45+00:00 [haddock @ 2002-05-27 14:36:45 by simonmar] warning message tweak - - - - - 16e64e21 by Simon Marlow at 2002-05-27T14:53:53+00:00 [haddock @ 2002-05-27 14:53:53 by simonmar] hyperlinked identifiers should be in <tt> - - - - - 8d5e4783 by Simon Marlow at 2002-05-27T15:56:45+00:00 [haddock @ 2002-05-27 15:56:45 by simonmar] Do something sensible for modules which don't export anything (except instances). - - - - - 9d3ef811 by Simon Marlow at 2002-05-28T10:12:50+00:00 [haddock @ 2002-05-28 10:12:50 by simonmar] Rename the module documentation properly (bug reported by Sven Panne). - - - - - ef03a1cc by Simon Marlow at 2002-05-28T10:13:04+00:00 [haddock @ 2002-05-28 10:13:04 by simonmar] Add some more test cases - - - - - 92baa0e8 by Simon Marlow at 2002-05-28T11:17:55+00:00 [haddock @ 2002-05-28 11:17:55 by simonmar] If an identifier doesn't lex, then just replace it by a DocString. - - - - - a3156213 by Simon Marlow at 2002-05-28T16:16:19+00:00 [haddock @ 2002-05-28 16:16:19 by simonmar] Only link to names in the current module which are actually listed in the documentation. A name may be exported but not present in the documentation if it is exported as part of a 'module M' export specifier. - - - - - 31acf941 by Simon Marlow at 2002-05-28T16:17:11+00:00 [haddock @ 2002-05-28 16:17:11 by simonmar] update - - - - - 7e474ebf by Sigbjorn Finne at 2002-05-28T22:42:08+00:00 [haddock @ 2002-05-28 22:42:08 by sof] Handle lone occurrences of '/', e.g., -- | This/that. [did this in the lexer rather than in the parser, as I couldn't see a way not to introduce an S/R conflict that way.] - - - - - 093f7e53 by Simon Marlow at 2002-05-29T09:09:49+00:00 [haddock @ 2002-05-29 09:09:49 by simonmar] Back out previous change until we can find a better way to do this. - - - - - 9234389c by Simon Marlow at 2002-05-29T13:19:06+00:00 [haddock @ 2002-05-29 13:19:06 by simonmar] Make the markup syntax a little more friendly: - single quotes are now interpreted literally unless they surround a valid Haskell identifier. So for example now there's no need to escape a single quote used as an apostrophe. - text to the right of a bird track is now literal (if you want marked-up text in a code block, use @...@). - - - - - b3333526 by Simon Marlow at 2002-05-29T13:38:51+00:00 [haddock @ 2002-05-29 13:38:51 by simonmar] Document recent changes to markup syntax - - - - - f93641d6 by Simon Marlow at 2002-05-29T15:27:18+00:00 [haddock @ 2002-05-29 15:27:18 by simonmar] Include the instances in abstract data types too - - - - - 613f21e3 by Simon Marlow at 2002-06-03T13:05:58+00:00 [haddock @ 2002-06-03 13:05:57 by simonmar] Allow exporting of individual class methods and record selectors. For these we have to invent the correct type signature, which we do in the simplest possible way (i.e. no context reduction nonsense in the class case). - - - - - 14b36807 by Simon Marlow at 2002-06-03T13:20:00+00:00 [haddock @ 2002-06-03 13:20:00 by simonmar] Fix linking to qualified names again (thanks to Sven Panne for pointing out the bug). - - - - - 95b10eac by Simon Marlow at 2002-06-03T13:46:48+00:00 [haddock @ 2002-06-03 13:46:48 by simonmar] Fix for exporting record selectors from a newtype declaration - - - - - 272f932e by Simon Marlow at 2002-06-03T13:56:38+00:00 [haddock @ 2002-06-03 13:56:38 by simonmar] update to version 0.3 - - - - - 1c0a3bed by Simon Marlow at 2002-06-03T14:05:07+00:00 [haddock @ 2002-06-03 14:05:07 by simonmar] Add changes in version 0.3 - - - - - 145b4626 by Simon Marlow at 2002-06-03T14:12:38+00:00 [haddock @ 2002-06-03 14:12:38 by simonmar] Render class names as proper binders - - - - - 052106b3 by Simon Marlow at 2002-06-03T14:15:10+00:00 [haddock @ 2002-06-03 14:15:10 by simonmar] update, and separate into bugs, features, and cosmetic items. - - - - - 854f4914 by Simon Marlow at 2002-06-03T14:16:13+00:00 [haddock @ 2002-06-03 14:16:13 by simonmar] More test cases - - - - - 466922c8 by Simon Marlow at 2002-06-03T14:16:56+00:00 [haddock @ 2002-06-03 14:16:56 by simonmar] Example from the paper - - - - - 9962a045 by Simon Marlow at 2002-06-03T14:17:49+00:00 [haddock @ 2002-06-03 14:17:49 by simonmar] A debugging version of the style-sheet, which gives some tables coloured backgrounds so we can see what's going on. - - - - - f16b79db by Simon Marlow at 2002-06-03T14:19:46+00:00 [haddock @ 2002-06-03 14:19:46 by simonmar] typo - - - - - 620db27b by Simon Marlow at 2002-06-03T14:48:32+00:00 [haddock @ 2002-06-03 14:48:32 by simonmar] oops, fix markup bugs - - - - - 53fd105c by Simon Marlow at 2002-06-05T09:05:07+00:00 [haddock @ 2002-06-05 09:05:07 by simonmar] Keep foreign imports when there is no export list (bug reported by Sven Panne). - - - - - 6d98989c by Simon Marlow at 2002-06-05T09:12:02+00:00 [haddock @ 2002-06-05 09:12:02 by simonmar] Identifiers in single quotes can be symbol names too (bug reported by Hal Daume). - - - - - 001811e5 by Sven Panne at 2002-06-08T14:03:36+00:00 [haddock @ 2002-06-08 14:03:36 by panne] Tiny workaround for the fact that Haddock currently ignores HsImportSpecs: Let the local_orig_env take precedence. This is no real solution at all, but improves things sometimes, e.g. in my GLUT documentation. :-) - - - - - 504d19c9 by Simon Marlow at 2002-06-11T09:23:25+00:00 [haddock @ 2002-06-11 09:23:25 by simonmar] portability nit - - - - - e13b5af4 by Simon Marlow at 2002-06-20T12:38:07+00:00 [haddock @ 2002-06-20 12:38:07 by simonmar] Empty declaration fixes. - - - - - f467a9b6 by Simon Marlow at 2002-06-20T12:39:02+00:00 [haddock @ 2002-06-20 12:39:01 by simonmar] Add support for a "prologue" - a description for the whole library, placed on the contents page before the module list. - - - - - b8dbfe20 by Simon Marlow at 2002-06-21T12:43:06+00:00 [haddock @ 2002-06-21 12:43:06 by simonmar] When we have a single code block paragraph, don't place it in <pre>..</pre>, just use <tt>..</tt> to avoid generating extra vertical white space in some browsers. - - - - - 4831dbbd by Simon Marlow at 2002-06-21T15:50:42+00:00 [haddock @ 2002-06-21 15:50:42 by simonmar] Add support for reading and writing interface files(!) This turned out to be quite easy, and necessary to get decent hyperlinks between the documentation for separate packages in the libraries. The functionality isn't quite complete yet: for a given package of modules, you'd like to say "the HTML for these modules lives in directory <dir>" (currently they are assumed to be all in the same place). Two new flags: --dump-interface=FILE dump an interface file in FILE --read-interface=FILE read interface from FILE an interface file describes *all* the modules being processed. Only the exported names are kept in the interface: if you re-export a name from a module in another interface the signature won't be copied. This is a compromise to keep the size of the interfaces sensible. Also, I added another useful option: --no-implicit-prelude avoids trying to import the Prelude. Previously this was the default, but now importing the Prelude from elsewhere makes sense if you also read in an interface containing the Prelude module, so Haddock imports the Prelude implicitly according to the Haskell spec. - - - - - d3640a19 by Sven Panne at 2002-06-23T14:54:00+00:00 [haddock @ 2002-06-23 14:54:00 by panne] Make it compile with newer GHCs - - - - - 780c506b by Sven Panne at 2002-06-23T15:44:31+00:00 [haddock @ 2002-06-23 15:44:31 by panne] Cleaned up build root handling and added more docs - - - - - 45290d2e by Simon Marlow at 2002-06-24T14:37:43+00:00 [haddock @ 2002-06-24 14:37:42 by simonmar] When reading an interface, allow a file path offset to be specified which represents the path to the HTML files for the modules specified by that interface. The path may be either relative (to the location of the HTML for this package), or absolute. The syntax is --read-interface=PATH,FILE where PATH is the path to the HTML, and FILE is the filename containing the interface. - - - - - 4e2b9ae6 by Simon Marlow at 2002-07-03T16:01:08+00:00 [haddock @ 2002-07-03 16:01:07 by simonmar] Handle import specs properly, include 'hiding'. Haddock now has a complete implementation of the Haskell module system (more or less; I won't claim it's 100% correct). - - - - - 9a9aa1a8 by Simon Marlow at 2002-07-03T16:18:16+00:00 [haddock @ 2002-07-03 16:18:16 by simonmar] Update - - - - - 560c3026 by Simon Marlow at 2002-07-04T14:56:10+00:00 [haddock @ 2002-07-04 14:56:10 by simonmar] Clean up the code that constructs the exported declarations, and fix a couple of bugs along the way. Now if you import a class hiding one of the methods, then re-export the class, the version in the documentation will correctly have the appropriate method removed. - - - - - 2c26e77d by Simon Marlow at 2002-07-04T15:26:13+00:00 [haddock @ 2002-07-04 15:26:13 by simonmar] More bugfixes to the export handling - - - - - 03e0710d by Simon Marlow at 2002-07-09T10:12:10+00:00 [haddock @ 2002-07-09 10:12:10 by simonmar] Don't require that the list type comes from "Prelude" for it to be treated as special syntax (sometimes it comes from Data.List or maybe even GHC.Base). - - - - - 44f3891a by Simon Marlow at 2002-07-09T10:12:51+00:00 [haddock @ 2002-07-09 10:12:51 by simonmar] commented-out debugging code - - - - - 97280873 by Krasimir Angelov at 2002-07-09T16:33:33+00:00 [haddock @ 2002-07-09 16:33:31 by krasimir] 'Microsoft HTML Help' support - - - - - 3dc04655 by Simon Marlow at 2002-07-10T09:40:56+00:00 [haddock @ 2002-07-10 09:40:56 by simonmar] Fix for rendering of the (->) type constructor, from Ross Paterson. - - - - - c9f149c6 by Simon Marlow at 2002-07-10T10:26:11+00:00 [haddock @ 2002-07-10 10:26:11 by simonmar] Tweaks to the MS Help support: the extra files are now only generated if you ask for them (--ms-help). - - - - - e8acc1e6 by Simon Marlow at 2002-07-10T10:57:10+00:00 [haddock @ 2002-07-10 10:57:10 by simonmar] Document all the new options since 0.3 - - - - - 8bb85544 by Simon Marlow at 2002-07-10T10:58:31+00:00 [haddock @ 2002-07-10 10:58:31 by simonmar] Sort the options a bit - - - - - abc0dd59 by Simon Marlow at 2002-07-15T09:19:38+00:00 [haddock @ 2002-07-15 09:19:38 by simonmar] Fix a bug in mkExportItems when processing a module without an explicit export list. We were placing one copy of a declaration for each binder in the declaration, which for a data type would mean one copy of the whole declaration per constructor or record selector. - - - - - dde65bb9 by Simon Marlow at 2002-07-15T09:54:16+00:00 [haddock @ 2002-07-15 09:54:16 by simonmar] merge rev. 1.35 - - - - - bd7eb8c4 by Simon Marlow at 2002-07-15T10:14:31+00:00 [haddock @ 2002-07-15 10:14:30 by simonmar] Be a bit more liberal in the kind of commenting styles we allow, as suggested by Malcolm Wallace. Mostly this consists of allowing doc comments either side of a separator token. In an export list, a section heading is now allowed before the comma, as well as after it. eg. module M where ( T(..) -- * a section heading , f -- * another section heading , g ) In record fields, doc comments are allowed anywhere (previously a doc-next was allowed only after the comma, and a doc-before was allowed only before the comma). eg. data R = C { -- | describes 'f' f :: Int -- | describes 'g' , g :: Int } - - - - - 8f6dfe34 by Simon Marlow at 2002-07-15T10:21:56+00:00 [haddock @ 2002-07-15 10:21:56 by simonmar] Mention alternative commenting styles. - - - - - fc515bb7 by Simon Marlow at 2002-07-15T16:16:50+00:00 [haddock @ 2002-07-15 16:16:50 by simonmar] Allow multiple sections/subsections before and after a comma in the export list. Also at the same time I made the syntax a little stricter (multiple commas now aren't allowed between export specs). - - - - - 80a97e74 by Simon Marlow at 2002-07-19T09:13:10+00:00 [haddock @ 2002-07-19 09:13:10 by simonmar] Allow special id's ([], (), etc.) to be used in an import declaration. - - - - - a69d7378 by Simon Marlow at 2002-07-19T09:59:02+00:00 [haddock @ 2002-07-19 09:59:02 by simonmar] Allow special id's ([], (), etc.) to be used in an import declarations. - - - - - d205fa60 by Simon Marlow at 2002-07-19T10:00:16+00:00 [haddock @ 2002-07-19 10:00:16 by simonmar] Relax the restrictions which require doc comments to be followed by semi colons - in some cases this isn't necessary. Now you can write module M where { -- | some doc class C where {} } without needing to put a semicolon before the class declaration. - - - - - e9301e14 by Simon Marlow at 2002-07-23T08:24:09+00:00 [haddock @ 2002-07-23 08:24:09 by simonmar] A new TODO list item - - - - - e5d77586 by Simon Marlow at 2002-07-23T08:40:56+00:00 [haddock @ 2002-07-23 08:40:56 by simonmar] - update the acknowledgements - remove the paragraph that described how to use explicit layout with doc comments; it isn't relevant any more. - - - - - 78a94137 by Simon Marlow at 2002-07-23T08:43:02+00:00 [haddock @ 2002-07-23 08:43:02 by simonmar] more tests - - - - - 5c320927 by Simon Marlow at 2002-07-23T08:43:26+00:00 [haddock @ 2002-07-23 08:43:26 by simonmar] Updates for version 0.4 - - - - - 488e99ae by Simon Marlow at 2002-07-23T09:10:46+00:00 [haddock @ 2002-07-23 09:10:46 by simonmar] Fix the %changelog (rpm complained that it wasn't in the right order) - - - - - a77bb373 by Simon Marlow at 2002-07-23T09:12:38+00:00 [haddock @ 2002-07-23 09:12:38 by simonmar] Another item for the TODO list - - - - - f1ec1813 by Simon Marlow at 2002-07-23T10:18:46+00:00 [haddock @ 2002-07-23 10:18:46 by simonmar] Add a version banner when invoked with -v - - - - - 1d44cadf by Simon Marlow at 2002-07-24T09:28:19+00:00 [haddock @ 2002-07-24 09:28:19 by simonmar] Remove ^Ms - - - - - 4d8d5e94 by Simon Marlow at 2002-07-24T09:42:18+00:00 [haddock @ 2002-07-24 09:42:17 by simonmar] Patches to quieten ghc -Wall, from those nice folks at Galois. - - - - - d6edc43e by Simon Marlow at 2002-07-25T14:37:29+00:00 [haddock @ 2002-07-25 14:37:28 by simonmar] Patch to allow simple hyperlinking to an arbitrary location in another module's documentation, from Volker Stolz. Now in a doc comment: #foo# creates <a name="foo"></a> And you can use the form "M\#foo" to hyperlink to the label 'foo' in module 'M'. Note that the backslash is necessary for now. - - - - - b34d18fa by Simon Marlow at 2002-08-02T09:08:22+00:00 [haddock @ 2002-08-02 09:08:22 by simonmar] The <TT> and <PRE> environments seem to use a font that is a little too small in IE. Compensate. (suggestion from Daan Leijen). - - - - - 8106b086 by Simon Marlow at 2002-08-02T09:25:23+00:00 [haddock @ 2002-08-02 09:25:20 by simonmar] Remove <P>..</P> from around list items, to reduce excess whitespace between the items of bulleted and ordered lists. (Suggestion from Daan Leijen). - - - - - c1acff8f by Simon Marlow at 2002-08-05T09:03:49+00:00 [haddock @ 2002-08-05 09:03:49 by simonmar] update - - - - - f968661c by Simon Marlow at 2002-11-11T09:32:57+00:00 [haddock @ 2002-11-11 09:32:57 by simonmar] Fix cut-n-pasto - - - - - 12d02619 by Simon Marlow at 2002-11-13T09:49:46+00:00 [haddock @ 2002-11-13 09:49:46 by simonmar] Small bugfix in the --read-interface option parsing from Brett Letner. - - - - - 30e32d5e by Ross Paterson at 2003-01-16T15:07:57+00:00 [haddock @ 2003-01-16 15:07:57 by ross] Adjust for the new exception libraries (as well as the old ones). - - - - - 871f65df by Sven Panne at 2003-02-20T21:31:40+00:00 [haddock @ 2003-02-20 21:31:40 by panne] * Add varsyms and consyms to index * Exclude empty entries from index - - - - - bc42cc87 by Sven Panne at 2003-02-24T21:26:29+00:00 [haddock @ 2003-02-24 21:26:29 by panne] Don't convert a "newtype" to a single-constructor "data" for non-abstractly exported types, they are quite different regarding strictness/pattern matching. Now a "data" without any constructors is only emitted for an abstractly exported type, regardless if it is actually a "newtype" or a "data". - - - - - 0c2a1d99 by Sven Panne at 2003-03-08T19:02:38+00:00 [haddock @ 2003-03-08 19:02:38 by panne] Fixed some broken/redirected/canonicalized links found by a very picky link checker. - - - - - 25459269 by Sven Panne at 2003-03-09T21:13:43+00:00 [haddock @ 2003-03-09 21:13:43 by panne] Don't append a fragment to non-defining index entries, only documents with a defining occurrence have a name anchor. - - - - - 6be4db86 by Sven Panne at 2003-03-10T21:34:25+00:00 [haddock @ 2003-03-10 21:34:24 by panne] Escape fragments. This fixes e.g. links to operators. - - - - - eb12972c by Ross Paterson at 2003-04-25T10:50:06+00:00 [haddock @ 2003-04-25 10:50:05 by ross] An 80% solution to generating derived instances. A complete solution would duplicate the instance inference logic, but if a type variable occurs as a constructor argument, then we can just propagate the derived class to the variable. But we know nothing of the constraints on any type variables that occur elsewhere. For example, the declarations data Either a b = Left a | Right b deriving (Eq, Ord) data Ptr a = Ptr Addr# deriving (Eq, Ord) newtype IORef a = IORef (STRef RealWorld a) deriving Eq yield the instances (Eq a, Eq b) => Eq (Either a b) (Ord a, Ord b) => Ord (Either a b) Eq (Ptr a) Ord (Ptr a) (??? a) => Eq (IORef a) The last example shows the limits of this local analysis. Note that a type variable may be in both categories: then we know a constraint, but there may be more, or a stronger constraint, e.g. data Tree a = Node a [Tree a] deriving Eq yields (Eq a, ??? a) => Eq (Tree a) - - - - - de886f78 by Simon Marlow at 2003-04-25T11:17:55+00:00 [haddock @ 2003-04-25 11:17:55 by simonmar] Some updates, including moving the derived instance item down to the bottom of the list now that Ross has contributed some code that does the job for common cases. - - - - - 1b52cffd by Simon Marlow at 2003-04-30T14:02:32+00:00 [haddock @ 2003-04-30 14:02:32 by simonmar] When installing on Windows, run cygpath over $(HADDOCKLIB) so that haddock (a mingw program, built by GHC) can understand it. You still need to be in a cygwin environment to run Haddock, because of the shell script wrapper. - - - - - d4f638de by Simon Marlow at 2003-05-06T10:04:47+00:00 [haddock @ 2003-05-06 10:04:47 by simonmar] Catch another case of a paragraph containing just a DocMonospaced that should turn into a DocCodeBlock. - - - - - 4162b2b9 by Simon Marlow at 2003-05-06T10:11:44+00:00 [haddock @ 2003-05-06 10:11:44 by simonmar] Add some more code-block tests. - - - - - 4f5802c8 by Simon Marlow at 2003-05-06T10:14:52+00:00 [haddock @ 2003-05-06 10:14:52 by simonmar] Don't turn a single DocCodeBlock into a DocMonospaced, because that tends to remove the line breaks in the code. - - - - - ef8c45f7 by Simon Marlow at 2003-05-21T15:07:21+00:00 [haddock @ 2003-05-21 15:07:21 by simonmar] Only omit the module contents when there are no section headings at all. - - - - - bcee1e75 by Sigbjorn Finne at 2003-05-30T16:50:45+00:00 [haddock @ 2003-05-30 16:50:45 by sof] cygpath: for now, steer clear of --mixed - - - - - 30567af3 by Sigbjorn Finne at 2003-05-30T17:59:28+00:00 [haddock @ 2003-05-30 17:59:28 by sof] oops, drop test defn from prev commit - - - - - b0856e7d by Simon Marlow at 2003-06-03T09:55:26+00:00 [haddock @ 2003-06-03 09:55:26 by simonmar] Two small fixes to make the output valid HTML 4.01 (transitional). Thanks to Malcolm Wallace for pointing out the problems. - - - - - 70e137ea by Simon Marlow at 2003-07-28T13:30:35+00:00 [haddock @ 2003-07-28 13:30:35 by simonmar] Add tests for a couple of bugs. - - - - - 122bd578 by Simon Marlow at 2003-07-28T13:31:25+00:00 [haddock @ 2003-07-28 13:31:25 by simonmar] Add documentation for anchors. - - - - - 0bd27cb2 by Simon Marlow at 2003-07-28T13:31:46+00:00 [haddock @ 2003-07-28 13:31:46 by simonmar] Update - - - - - 08052d42 by Simon Marlow at 2003-07-28T13:32:12+00:00 [haddock @ 2003-07-28 13:32:12 by simonmar] layout tweak. - - - - - 13942749 by Simon Marlow at 2003-07-28T13:33:03+00:00 [haddock @ 2003-07-28 13:33:03 by simonmar] Differentiate links to types/classes from links to variables/constructors with a prefix ("t:" and "v:" respectively). - - - - - d7f493b9 by Simon Marlow at 2003-07-28T13:35:17+00:00 [haddock @ 2003-07-28 13:35:16 by simonmar] When a module A exports another module's contents via 'module B', then modules which import entities from B re-exported by A should link to B.foo rather than A.foo. See examples/Bug2.hs. - - - - - d94cf705 by Simon Marlow at 2003-07-28T13:36:14+00:00 [haddock @ 2003-07-28 13:36:14 by simonmar] Update to version 0.5 - - - - - dbb776cd by Sven Panne at 2003-07-28T14:02:43+00:00 [haddock @ 2003-07-28 14:02:43 by panne] * Updated to version 0.5 * Automagically generate configure if it is not there - - - - - 6cfeee53 by Simon Marlow at 2003-07-28T14:32:43+00:00 [haddock @ 2003-07-28 14:32:42 by simonmar] Update to avoid using hslibs with GHC >= 5.04 - - - - - a1ce838f by Simon Marlow at 2003-07-28T14:33:37+00:00 [haddock @ 2003-07-28 14:33:37 by simonmar] Update for 0.5 - - - - - c0fe6493 by Simon Marlow at 2003-07-28T14:53:22+00:00 [haddock @ 2003-07-28 14:53:22 by simonmar] Markup fix - - - - - 6ea31596 by Sven Panne at 2003-07-28T16:40:45+00:00 [haddock @ 2003-07-28 16:40:45 by panne] Make it compile with GHC >= 6.01 - - - - - afcd30fc by Simon Marlow at 2003-07-30T15:04:52+00:00 [haddock @ 2003-07-30 15:04:52 by simonmar] Pay attention to import specs when building the the import env, as well as the orig env. This may fix some wrong links in documentation when import specs are being used. - - - - - 17c3137f by Simon Marlow at 2003-07-30T16:05:41+00:00 [haddock @ 2003-07-30 16:05:40 by simonmar] Rename instances based on the import_env for the module in which they are to be displayed. This should give, in many cases, better links for the types and classes mentioned in the instance head. This involves keeping around the import_env in the iface until the end, because instances are not collected up until all the modules have been processed. Fortunately it doesn't seem to affect performance much. Instance heads are now attached to ExportDecls, rather than the HTML backend passing around a separate mapping for instances. This is a cleanup. - - - - - 3d3b5c87 by Sven Panne at 2003-08-04T10:18:24+00:00 [haddock @ 2003-08-04 10:18:24 by panne] Don't print parentheses around one-element contexts - - - - - 9e3f3f2d by Simon Marlow at 2003-08-04T12:59:47+00:00 [haddock @ 2003-08-04 12:59:47 by simonmar] A couple of TODOs. - - - - - e9d8085c by Simon Marlow at 2003-08-05T14:10:31+00:00 [haddock @ 2003-08-05 14:10:31 by simonmar] I'm not sure why, but it seems that the index entries for non-defining occurrences of entities did not have an anchor - the link just pointed to the module. This fixes it. - - - - - ff5c7d6d by Simon Marlow at 2003-08-15T14:42:59+00:00 [haddock @ 2003-08-15 14:42:59 by simonmar] Convert the lexer to Alex, and fix a bug in the process. - - - - - 1aa077bf by Simon Marlow at 2003-08-15T15:00:18+00:00 [haddock @ 2003-08-15 15:00:18 by simonmar] Update - - - - - d3de1e38 by Simon Marlow at 2003-08-15T15:01:03+00:00 [haddock @ 2003-08-15 15:01:03 by simonmar] wibbles - - - - - b40ece3b by Simon Marlow at 2003-08-18T10:04:47+00:00 [haddock @ 2003-08-18 10:04:47 by simonmar] Lex the 'mdo' keyword as 'do'. - - - - - 8f9a1146 by Simon Marlow at 2003-08-18T11:48:24+00:00 [haddock @ 2003-08-18 11:48:24 by simonmar] Two bugs from Sven. - - - - - ea54ebc0 by Simon Marlow at 2003-08-18T11:48:46+00:00 [haddock @ 2003-08-18 11:48:46 by simonmar] Fixes to the new lexer. - - - - - d5f6a4b5 by Simon Marlow at 2003-08-19T09:09:03+00:00 [haddock @ 2003-08-19 09:09:03 by simonmar] Further wibbles to the syntax. - - - - - 6bbdadb7 by Sven Panne at 2003-08-26T18:45:35+00:00 [haddock @ 2003-08-26 18:45:35 by panne] Use autoreconf instead of autoconf - - - - - 32e889cb by Sven Panne at 2003-08-26T19:01:19+00:00 [haddock @ 2003-08-26 19:01:18 by panne] Made option handling a bit more consistent with other tools, in particular: Every program in fptools should output * version info on stdout and terminate successfully when -V or --version * usage info on stdout and terminate successfully when -? or --help * usage info on stderr and terminate unsuccessfully when an unknown option is given. - - - - - 5d156a91 by Sven Panne at 2003-08-26T19:20:55+00:00 [haddock @ 2003-08-26 19:20:55 by panne] Make it *very* clear that we terminate when given a -V/--version flag - - - - - e6577265 by Sven Panne at 2003-08-27T07:50:03+00:00 [haddock @ 2003-08-27 07:50:02 by panne] * Made -D a short option for --dump-interface. * Made -m a short option for --ms-help. * Made -n a short option for --no-implicit-prelude. * Made -c a short option for --css. * Removed DocBook options from executable (they didn't do anything), but mark them as reserved in the docs. Note that the short option for DocBook output is now -S (from SGML) instead of -d. The latter is now a short option for --debug. * The order of the Options in the documentation now matches the order printed by Haddock itself. Note: Although changing the names of options is often a bad idea, I'd really like to make the options for the programs in fptools more consistent and compatible to the ones used in common GNU programs. - - - - - d303ff98 by Simon Marlow at 2003-09-10T08:23:48+00:00 [haddock @ 2003-09-10 08:23:48 by simonmar] Add doc subdir. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 9a70e46a by Simon Marlow at 2003-09-10T08:24:32+00:00 [haddock @ 2003-09-10 08:24:32 by simonmar] Install these files in $(datadir), not $(libdir), since they're architecture independent. Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - bbb87e7a by Simon Marlow at 2003-09-10T08:25:31+00:00 [haddock @ 2003-09-10 08:25:31 by simonmar] Haddock's supplementary HTML bits now live in $(datadir), not $(libdir). Patch contributed by: Ian Lynagh <igloo at earth.li>. - - - - - 3587c24b by Simon Marlow at 2003-09-22T10:34:38+00:00 [haddock @ 2003-09-22 10:34:38 by simonmar] Allow installing of docs. - - - - - d510b517 by Sven Panne at 2003-10-11T08:10:44+00:00 [haddock @ 2003-10-11 08:10:44 by panne] Include architecture-independent files in file list - - - - - 187d7618 by Sigbjorn Finne at 2003-10-20T17:19:24+00:00 [haddock @ 2003-10-20 17:19:22 by sof] support for i-parameters + zip comprehensions - - - - - b6c7a273 by Simon Marlow at 2003-11-03T14:24:24+00:00 [haddock @ 2003-11-03 14:24:24 by simonmar] Update TODO file. - - - - - 58513e33 by Simon Marlow at 2003-11-05T11:22:04+00:00 [haddock @ 2003-11-05 11:22:04 by simonmar] Remove the last of the uses of 'trace' to emit warnings, and tidy up a couple of places where duplicate warnings were being emitted. - - - - - 33a78846 by Simon Marlow at 2003-11-05T11:30:53+00:00 [haddock @ 2003-11-05 11:30:52 by simonmar] - Suppress warnings about unknown imported modules by default. - Add a -v/--verbose flag to re-enable these warnings. The general idea is to suppress the "Warning: unknown module: Prelude" warnings which most Haddock users will see every time, and which aren't terribly useful. - - - - - a969de7f by Simon Marlow at 2003-11-05T12:30:28+00:00 [haddock @ 2003-11-05 12:30:28 by simonmar] - Remove the emboldening of index entries for defining locations. This isn't useful, and breaks abstractions. - If an entity is re-exported by a module but the module doesn't include documentation for that entity (perhaps because it is re-exported by 'module M'), then don't attempt to hyperlink to the documentation from the index. Instead, just list that module in the index, to indicate that the entity is exported from there. - - - - - f14ea82a by Simon Marlow at 2003-11-05T15:15:59+00:00 [haddock @ 2003-11-05 15:15:59 by simonmar] Index overhaul: - no more separate type/class and variable/function indices - the index now makes a distinction between different entities with the same name. One example is a type constructor with the same name as a data constructor, but another example is simply a function with the same name exported by two different modules. For example, the index entry for 'catch' now looks like this: catch 1 (Function) Control.Exception 2 (Function) GHC.Exception, Prelude, System.IO, System.IO.Error making it clear that there are two different 'catch'es, but one of them is exported by several modules. - Each index page now has the index contents (A B C ...) at the top. Please let me know if you really hate any of this. - - - - - 01a25ca6 by Simon Marlow at 2003-11-05T15:16:38+00:00 [haddock @ 2003-11-05 15:16:38 by simonmar] Update - - - - - 1a7ccb86 by Simon Marlow at 2003-11-05T17:16:05+00:00 [haddock @ 2003-11-05 17:16:04 by simonmar] Support for generating a single unified index for several packages. --use-index=URL turns off normal index generation, causes Index links to point to URL. --gen-index generates an combined index from the specified interfaces. Currently doesn't work exactly right, because the interfaces don't contain the iface_reexported info. I'll need to fix that up. - - - - - a2bca16d by Simon Marlow at 2003-11-06T10:44:52+00:00 [haddock @ 2003-11-06 10:44:52 by simonmar] Include iface_reexported in the .haddock file. This unfortunately bloats the file (40% for base). If this gets to be a problem we can always apply the dictionary trick that GHC uses for squashing .hi files. - - - - - 0a09c293 by Simon Marlow at 2003-11-06T12:39:47+00:00 [haddock @ 2003-11-06 12:39:46 by simonmar] - Add definition lists, marked up like this: -- | This is a definition list: -- -- [@foo@] The description of @foo at . -- -- [@bar@] The description of @bar at . Cunningly, the [] characters are not treated specially unless a [ is found at the beginning of a paragraph, in which case the ] becomes special in the following text. - Add --use-contents and --gen-contents, along the lines of --use-index and --gen-index added yesterday. Now we can generate a combined index and contents for the whole of the hierarchical libraries, and in theory the index/contents on the system could be updated as new packages are added. - - - - - fe1b3460 by Simon Marlow at 2003-11-06T14:47:36+00:00 [haddock @ 2003-11-06 14:47:36 by simonmar] Remove the 'Parent' button - it is of dubious use, and often points into thin air. - - - - - db6d762f by Simon Marlow at 2003-11-06T16:48:14+00:00 [haddock @ 2003-11-06 16:48:11 by simonmar] - Include the OptHide setting in the interface, so we don't include hidden modules in the combined index/contents. - Add a -k/--package flag to set the package name for the current set of modules. The package name for each module is now shown in the right-hand column of the contents, in a combined contents page. - - - - - 7d71718b by Simon Marlow at 2003-11-06T16:50:28+00:00 [haddock @ 2003-11-06 16:50:28 by simonmar] Add -k/--package docs - - - - - ef43949d by Simon Marlow at 2003-11-06T16:51:23+00:00 [haddock @ 2003-11-06 16:51:23 by simonmar] Bump to 0.6 - - - - - 1c419e06 by Simon Marlow at 2003-11-06T16:51:50+00:00 [haddock @ 2003-11-06 16:51:50 by simonmar] update - - - - - 69422327 by Simon Marlow at 2003-11-10T14:41:06+00:00 [haddock @ 2003-11-10 14:41:05 by simonmar] Re-exporting names from a different package is problematic, because we don't have access to the full documentation for the entity. Currently Haddock just ignores entities with no documentation, but this results in bogus-looking empty documentation for many of the modules in the haskell98 package. So: - the documentation will now just list the name, as a link pointing to the location of the actual documentation. - now we don't attempt to link to these re-exported entities if they are referred to by the current module. Additionally: - If there is no documentation in the current module, include just the Synopsis section (rather than just the documentation section, as it was before). This just looks nicer and was on the TODO list. - - - - - 3c3fc433 by Simon Marlow at 2003-11-10T14:51:59+00:00 [haddock @ 2003-11-10 14:51:59 by simonmar] Fix for getReExports: take into account names which are not visible because they are re-exported from a different package. - - - - - 31c8437b by Simon Marlow at 2003-11-10T15:10:53+00:00 [haddock @ 2003-11-10 15:10:53 by simonmar] Version 0.6 changes - - - - - a7c2430b by Simon Marlow at 2003-11-10T15:15:58+00:00 [haddock @ 2003-11-10 15:15:58 by simonmar] getReExports: one error case that isn't - - - - - 00cc459c by Simon Marlow at 2003-11-10T16:15:19+00:00 [haddock @ 2003-11-10 16:15:18 by simonmar] copyright update - - - - - ca62408d by Simon Marlow at 2003-11-11T09:57:25+00:00 [haddock @ 2003-11-11 09:57:25 by simonmar] Version 0.6 - - - - - 3acbf818 by Simon Marlow at 2003-11-11T12:10:44+00:00 [haddock @ 2003-11-11 12:10:44 by simonmar] Go back to producing just the documentation section, rather than just the synopsis section, for a module with no documentation annotations. One reason is that the synopsis section tries to link each entity to its documentation on the same page. Also, the doc section anchors each entity, and it lists instances which the synopsis doesn't. - - - - - 6c90abc2 by Simon Marlow at 2003-11-12T10:03:39+00:00 [haddock @ 2003-11-12 10:03:39 by simonmar] 2002 -> 2003 - - - - - 090bbc4c by Simon Marlow at 2003-11-28T12:08:00+00:00 [haddock @ 2003-11-28 12:08:00 by simonmar] update - - - - - 8096a832 by Simon Marlow at 2003-11-28T12:09:58+00:00 [haddock @ 2003-11-28 12:09:58 by simonmar] Fix some of the problems with Haddock generating pages that are too wide. Now we only specify 'nowrap' when it is necessary to avoid a code box getting squashed up by the text to the right of it. - - - - - 35294929 by Sven Panne at 2003-12-29T17:16:31+00:00 [haddock @ 2003-12-29 17:16:31 by panne] Updated my email address - - - - - cdb697bf by Simon Marlow at 2004-01-08T10:14:24+00:00 [haddock @ 2004-01-08 10:14:24 by simonmar] Add instructions for using GHC to pre-process source for feeding to Haddock. - - - - - 8dfc491f by Simon Marlow at 2004-01-09T12:45:46+00:00 [haddock @ 2004-01-09 12:45:46 by simonmar] Add -optP-P to example ghc command line. - - - - - ac41b820 by Simon Marlow at 2004-02-03T11:02:03+00:00 [haddock @ 2004-02-03 11:02:03 by simonmar] Fix bug in index generation - - - - - f4e7edcb by Simon Marlow at 2004-02-10T11:51:16+00:00 [haddock @ 2004-02-10 11:51:16 by simonmar] Don't throw away whitespace at the beginning of a line (experimental fix). - - - - - 68e212d2 by Simon Marlow at 2004-02-10T12:10:08+00:00 [haddock @ 2004-02-10 12:10:08 by simonmar] Fix for previous commit: I now realise why the whitespace was stripped from the beginning of the line. Work around it. - - - - - e7d7f2df by Sven Panne at 2004-02-10T18:38:45+00:00 [haddock @ 2004-02-10 18:38:45 by panne] Make Haddock link with the latest relocated monad transformer package - - - - - 992d4225 by Simon Marlow at 2004-02-16T10:21:35+00:00 [haddock @ 2004-02-16 10:21:35 by simonmar] Add a TODO - - - - - 1ac55326 by Simon Marlow at 2004-03-12T11:33:39+00:00 [haddock @ 2004-03-12 11:33:39 by simonmar] Add an item. - - - - - 0478e903 by Simon Marlow at 2004-03-15T12:24:05+00:00 [haddock @ 2004-03-15 12:24:05 by simonmar] Add an item. - - - - - 6f26d21a by Simon Marlow at 2004-03-18T14:21:29+00:00 [haddock @ 2004-03-18 14:21:29 by simonmar] Fix URL - - - - - 19b6bb99 by Simon Marlow at 2004-03-22T14:09:03+00:00 [haddock @ 2004-03-22 14:09:03 by simonmar] getReExports was bogus: we should really look in the import_env to find the documentation for an entity which we are re-exporting without documentation. Suggested by: Ross Paterson (patch modified by me). - - - - - 5c756031 by Simon Marlow at 2004-03-24T09:42:11+00:00 [haddock @ 2004-03-24 09:42:10 by simonmar] hiding bug from Ross Paterson (fixed in rev 1.59 of Main.hs) - - - - - 1b692e6c by Simon Marlow at 2004-03-24T10:10:50+00:00 [haddock @ 2004-03-24 10:10:50 by simonmar] mkExportItems fix & simplification: we should be looking at the actual exported names (calculated earlier) to figure out which subordinates of a declaration are exported. This means that if you export a record, and name its fields separately in the export list, the fields will still be visible in the documentation for the constructor. - - - - - 90e5e294 by Simon Marlow at 2004-03-24T10:12:08+00:00 [haddock @ 2004-03-24 10:12:08 by simonmar] Make restrictCons take into account record field names too (removing a ToDo). - - - - - 2600efa4 by Simon Marlow at 2004-03-24T10:16:17+00:00 [haddock @ 2004-03-24 10:16:17 by simonmar] Record export tests. - - - - - 6a8575c7 by Simon Marlow at 2004-03-25T09:35:14+00:00 [haddock @ 2004-03-25 09:35:14 by simonmar] restrictTo: fix for restricting a newtype with a record field. - - - - - dcf55a8d by Simon Marlow at 2004-03-25T10:01:42+00:00 [haddock @ 2004-03-25 10:01:42 by simonmar] Fix duplicate instance bug - - - - - f49aa758 by Simon Marlow at 2004-03-25T10:02:41+00:00 [haddock @ 2004-03-25 10:02:41 by simonmar] Duplicate instance bug. - - - - - 7b87344c by Simon Marlow at 2004-03-25T10:29:56+00:00 [haddock @ 2004-03-25 10:29:56 by simonmar] If a name is imported from two places, one hidden and one not, choose the unhidden one to link to. Also, when there's only a hidden module to link to, don't try linking to it. - - - - - 40f44d7b by Simon Marlow at 2004-03-25T15:17:24+00:00 [haddock @ 2004-03-25 15:17:23 by simonmar] Add support for collaspible parts of the page, with a +/- button and a bit of JavaScript. Make the instances collapsible, and collapse them by default. This makes documentation with long lists of instances (eg. the Prelude) much easier to read. Maybe we should give other documentation sections the same treatment. - - - - - 9b64dc0f by Simon Marlow at 2004-03-25T15:20:55+00:00 [haddock @ 2004-03-25 15:20:55 by simonmar] Update - - - - - c2fff7f2 by Simon Marlow at 2004-03-25T15:45:10+00:00 [haddock @ 2004-03-25 15:45:10 by simonmar] Eliminate some unnecessary spaces in the HTML rendering - - - - - b7948ff0 by Simon Marlow at 2004-03-25T16:00:37+00:00 [haddock @ 2004-03-25 16:00:36 by simonmar] Remove all that indentation in the generated HTML to keep the file sizes down. - - - - - da2bb4ca by Sven Panne at 2004-03-27T09:57:58+00:00 [haddock @ 2004-03-27 09:57:57 by panne] Added the new-born haddock.js to the build process and the documentation. - - - - - b99e6f8c by Sven Panne at 2004-03-27T10:32:20+00:00 [haddock @ 2004-03-27 10:32:20 by panne] "type" is a required attribute of the "script" element - - - - - 562b185a by Sven Panne at 2004-03-27T12:52:34+00:00 [haddock @ 2004-03-27 12:52:34 by panne] Add a doctype for the contents page, too. - - - - - f6a99c2d by Simon Marlow at 2004-04-14T10:03:25+00:00 [haddock @ 2004-04-14 10:03:25 by simonmar] fix for single-line comment syntax - - - - - de366303 by Simon Marlow at 2004-04-20T13:08:04+00:00 [haddock @ 2004-04-20 13:08:04 by simonmar] Allow a 'type' declaration to include documentation comments. These will be ignored by Haddock, but at least one user (Johannes Waldmann) finds this feature useful, and it's easy to add. - - - - - fd78f51e by Simon Marlow at 2004-05-07T15:14:56+00:00 [haddock @ 2004-05-07 15:14:56 by simonmar] - update copyright - add version to abstract - - - - - 59f53e32 by Sven Panne at 2004-05-09T14:39:53+00:00 [haddock @ 2004-05-09 14:39:53 by panne] Fix the fix for single-line comment syntax, ------------------------------------------- is now a valid comment line again. - - - - - 8b18f2fe by Simon Marlow at 2004-05-10T10:11:51+00:00 [haddock @ 2004-05-10 10:11:51 by simonmar] Update - - - - - 225a491d by Ross Paterson at 2004-05-19T13:10:23+00:00 [haddock @ 2004-05-19 13:10:23 by ross] Make the handling of "deriving" slightly smarter, by ignoring data constructor arguments that are identical to the lhs. Now handles things like data Tree a = Leaf a | Branch (Tree a) (Tree a) deriving ... - - - - - 37588686 by Mike Thomas at 2004-05-21T06:38:14+00:00 [haddock @ 2004-05-21 06:38:14 by mthomas] Windows exe extensions (bin remains for Unix). - - - - - cf2b9152 by Simon Marlow at 2004-05-25T09:34:54+00:00 [haddock @ 2004-05-25 09:34:54 by simonmar] Add some TODO items - - - - - 4d29cdfc by Simon Marlow at 2004-05-25T10:41:46+00:00 [haddock @ 2004-05-25 10:41:46 by simonmar] Complain if -h is used with --gen-index or --gen-contents, because it'll overwrite the new index/contents. - - - - - 2e0771e0 by Mike Thomas at 2004-05-28T20:17:55+00:00 [haddock @ 2004-05-28 20:17:55 by mthomas] Windows: search for templates in executable directory. Unix: Haddock tries cwd first rather than error if no -l arg. - - - - - 8d10bde1 by Sven Panne at 2004-06-05T16:53:34+00:00 [haddock @ 2004-06-05 16:53:34 by panne] Misc. rpm spec file cleanup, including: * make BuildRoot handling more consistent * added default file attributes * consistent defines and tags - - - - - 59974349 by Sven Panne at 2004-06-05T18:01:00+00:00 [haddock @ 2004-06-05 18:01:00 by panne] More rpm spec file cleanup, including: * added some BuildRequires * changed packager to me, so people can complain at the right place :-] * consistently refer to haskell.org instead of www.haskell.org - - - - - b94d4903 by Simon Marlow at 2004-07-01T11:08:58+00:00 [haddock @ 2004-07-01 11:08:57 by simonmar] Update to the +/- buttons: use a resized image rather than a <button>. Still seeing some strange effects in Konqueror, so might need to use a fixed-size image instead. - - - - - d5278f67 by Sven Panne at 2004-07-04T15:15:55+00:00 [haddock @ 2004-07-04 15:15:55 by panne] Install pictures for +/- pictures, too (JPEG is a strange format for graphics like this, I would have expected GIF or PNG here.) Things look fine with Konqueror and Netscape on Linux now, the only downside is that the cursor doesn't change when positioned above the "button". - - - - - 46dec6c5 by Sven Panne at 2004-07-13T17:59:28+00:00 [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. - - - - - 1d7bc432 by Simon Marlow at 2004-07-22T08:54:06+00:00 [haddock @ 2004-07-22 08:54:06 by simonmar] Add single quote to $ident, so you can say eg. 'foldl'' to refer to foldl' (the longest match rule is our friend). Bug reported by Adrian Hey <ahey at iee.org> - - - - - f183618b by Krasimir Angelov at 2004-07-27T22:59:35+00:00 [haddock @ 2004-07-27 22:58:23 by krasimir] Add basic support for Microsoft HTML Help 2.0 - - - - - d515d0c2 by Krasimir Angelov at 2004-07-27T23:02:36+00:00 [haddock @ 2004-07-27 23:02:36 by krasimir] escape names in the index - - - - - a5f1be23 by Krasimir Angelov at 2004-07-27T23:05:21+00:00 [haddock @ 2004-07-27 23:05:21 by krasimir] Add jsFile, plusFile and minusFile to the file list - - - - - c4fb4881 by Krasimir Angelov at 2004-07-28T22:12:10+00:00 [haddock @ 2004-07-28 22:12:09 by krasimir] bugfix. Move contentsHtmlFile, indexHtmlFile and subIndexHtmlFile functions to HaddockUtil.hs module to make them accessible from HaddockHH2.hs - - - - - 64d30b1d by Krasimir Angelov at 2004-07-30T22:15:47+00:00 [haddock @ 2004-07-30 22:15:45 by krasimir] more stuffs - support for separated compilation of packages - the contents page now uses DHTML TreeView - fixed copyFile bug - - - - - 133c8c5c by Krasimir Angelov at 2004-07-31T12:04:38+00:00 [haddock @ 2004-07-31 12:04:37 by krasimir] make the DHtmlTree in contents page more portable. The +/- buttons are replaced with new images which looks more beatiful. - - - - - 79040963 by Krasimir Angelov at 2004-07-31T13:10:20+00:00 [haddock @ 2004-07-31 13:10:20 by krasimir] Make DHtmlTree compatible with Mozila browser - - - - - 1a55dc90 by Krasimir Angelov at 2004-07-31T14:52:55+00:00 [haddock @ 2004-07-31 14:52:55 by krasimir] fix - - - - - 85ce0237 by Krasimir Angelov at 2004-07-31T14:53:28+00:00 [haddock @ 2004-07-31 14:53:28 by krasimir] HtmlHelp 1.x - - - - - 3c0c53ba by Krasimir Angelov at 2004-07-31T20:35:21+00:00 [haddock @ 2004-07-31 20:35:21 by krasimir] Added support for DevHelp - - - - - d42b5af1 by Krasimir Angelov at 2004-07-31T21:17:51+00:00 [haddock @ 2004-07-31 21:17:51 by krasimir] Document new features in HtmlHelp - - - - - 790fe21e by Krasimir Angelov at 2004-08-01T15:14:02+00:00 [haddock @ 2004-08-01 15:14:02 by krasimir] add missing imports - - - - - fd7cc6bc by Krasimir Angelov at 2004-08-01T19:52:08+00:00 [haddock @ 2004-08-01 19:52:06 by krasimir] fix some bugs. Now I have got the entire libraries documentation in HtmlHelp 2.0 format. - - - - - 94ad7ac8 by Krasimir Angelov at 2004-08-01T19:53:50+00:00 [haddock @ 2004-08-01 19:53:50 by krasimir] I forgot to add the new +/- images - - - - - f0c65388 by Krasimir Angelov at 2004-08-02T16:25:53+00:00 [haddock @ 2004-08-02 16:25:53 by krasimir] Add root node to the table of contents. All modules in tree are not children of the root - - - - - f50bd85d by Sven Panne at 2004-08-02T18:17:46+00:00 [haddock @ 2004-08-02 18:17:46 by panne] Mainly DocBook fixes - - - - - 09527ce3 by Sven Panne at 2004-08-02T20:02:29+00:00 [haddock @ 2004-08-02 20:02:29 by panne] Fixed -o/--odir handling. Generating the output, especially the directory handling, is getting a bit convoluted nowadays... - - - - - c8fbacfa by Sven Panne at 2004-08-02T20:31:13+00:00 [haddock @ 2004-08-02 20:31:13 by panne] Warning police - - - - - 37830bff by Sven Panne at 2004-08-02T20:32:29+00:00 [haddock @ 2004-08-02 20:32:28 by panne] Nuked dead code - - - - - 13847171 by Sven Panne at 2004-08-02T21:12:27+00:00 [haddock @ 2004-08-02 21:12:25 by panne] Use pathJoin instead of low-level list-based manipulation for FilePaths - - - - - c711d61e by Sven Panne at 2004-08-02T21:16:02+00:00 [haddock @ 2004-08-02 21:16:02 by panne] Removed WinDoze CRs - - - - - b1f7dc88 by Sven Panne at 2004-08-03T19:35:59+00:00 [haddock @ 2004-08-03 19:35:59 by panne] Fixed spelling of "http-equiv" attribute - - - - - dd5f394e by Sven Panne at 2004-08-03T19:44:03+00:00 [haddock @ 2004-08-03 19:44:03 by panne] Pacify W3C validator: * Added document encoding (currently UTF-8, not sure if this is completely correct) * Fixed syntax of `id' attributes * Added necessary `alt' attribute for +/- images Small layout improvement: * Added space after +/- images (still not perfect, but better than before) - - - - - 919c47c6 by Sigbjorn Finne at 2004-08-03T19:45:11+00:00 [haddock @ 2004-08-03 19:45:11 by sof] make it compile with <= ghc-6.1 - - - - - 4d6f01d8 by Sigbjorn Finne at 2004-08-03T19:45:30+00:00 [haddock @ 2004-08-03 19:45:30 by sof] ffi wibble - - - - - 4770643a by Sven Panne at 2004-08-03T20:47:46+00:00 [haddock @ 2004-08-03 20:47:46 by panne] Fixed CSS for button style. Note that only "0" is a valid measure without a unit! - - - - - 14aaf2e5 by Sven Panne at 2004-08-03T21:07:59+00:00 [haddock @ 2004-08-03 21:07:58 by panne] Improved spacing of dynamic module tree - - - - - 97c3579a by Simon Marlow at 2004-08-09T11:03:04+00:00 [haddock @ 2004-08-09 11:03:04 by simonmar] Add FormatVersion Patch submitted by: George Russell <ger at informatik.uni-bremen.de> - - - - - af7f8c03 by Simon Marlow at 2004-08-09T11:55:07+00:00 [haddock @ 2004-08-09 11:55:05 by simonmar] Add support for a short description for each module, which is included in the contents. The short description should be given in a "Description: " field of the header. Included in this patch are changes that make the format of the header a little more flexible. From the comments: -- all fields in the header are optional and have the form -- -- [spaces1][field name][spaces] ":" -- [text]"\n" ([spaces2][space][text]"\n" | [spaces]"\n")* -- where each [spaces2] should have [spaces1] as a prefix. -- -- Thus for the key "Description", -- -- > Description : this is a -- > rather long -- > -- > description -- > -- > The module comment starts here -- -- the value will be "this is a .. description" and the rest will begin -- at "The module comment". The header fields must be in the following order: Module, Description, Copyright, License, Maintainer, Stability, Portability. Patches submitted by: George Russell <ger at informatik.uni-bremen.de>, with a few small changes be me, mostly to merge with other recent changes. ToDo: document the module header. - - - - - 7b865ad3 by Simon Marlow at 2004-08-10T14:09:57+00:00 [haddock @ 2004-08-10 14:09:57 by simonmar] Fixes for DevHelp/HtmlHelp following introduction of short module description. - - - - - 814766cd by Simon Marlow at 2004-08-10T14:33:46+00:00 [haddock @ 2004-08-10 14:33:45 by simonmar] Fixes to installation under Windows. - - - - - 39cf9ede by Simon Marlow at 2004-08-12T12:08:23+00:00 [haddock @ 2004-08-12 12:08:23 by simonmar] Avoid using string-gap tricks. - - - - - b6d78551 by Simon Marlow at 2004-08-13T10:53:21+00:00 [haddock @ 2004-08-13 10:53:21 by simonmar] Update - - - - - eaae7417 by Simon Marlow at 2004-08-13T10:53:50+00:00 [haddock @ 2004-08-13 10:53:50 by simonmar] Test for primes in quoted links - - - - - 68c34f06 by Sven Panne at 2004-08-16T19:59:38+00:00 [haddock @ 2004-08-16 19:59:36 by panne] XMLification - - - - - 7f45a6f9 by Sven Panne at 2004-08-18T16:42:54+00:00 [haddock @ 2004-08-18 16:42:54 by panne] Re-added indices + minor fixes - - - - - 8a5dd97c by Sigbjorn Finne at 2004-08-25T17:15:42+00:00 [haddock @ 2004-08-25 17:15:42 by sof] backquote HADDOCK_VERSION defn for <= ghc-6.0.x; believe this is only needed under mingw - - - - - 4b1b42ea by Sven Panne at 2004-08-26T20:08:50+00:00 [haddock @ 2004-08-26 20:08:49 by panne] SGML is dead, long live DocBook XML! Note: The BuildRequires tags in the spec files are still incomplete and the documentation about the DocBook tools needs to be updated, too. Stay tuned... - - - - - 8d52cedb by Sven Panne at 2004-08-26T21:03:19+00:00 [haddock @ 2004-08-26 21:03:19 by panne] Updated BuildRequires tags. Alas, there seems to be no real standard here, so your mileage may vary... At least the current specs should work on SuSE Linux. - - - - - e6982912 by Sigbjorn Finne at 2004-08-30T15:44:59+00:00 [haddock @ 2004-08-30 15:44:59 by sof] escape HADDOCK_VERSION double quotes on all platforms when compiling with <=6.0.x - - - - - b3fbc867 by Simon Marlow at 2004-08-31T13:09:42+00:00 [haddock @ 2004-08-31 13:09:42 by simonmar] Avoid GHC/shell versionitis and create Version.hs - - - - - c359e16a by Sven Panne at 2004-09-05T19:12:33+00:00 [haddock @ 2004-09-05 19:12:32 by panne] * HTML documentation for "foo.xml" goes into directory "foo" again, not "foo-html". This is nicer and consistent with the behaviour for building the docs from SGML. * Disabled building PostScript documentation in the spec files for now, there are some strange issues with the FO->PS conversion for some files which have to be clarified first. - - - - - c68b1eba by Sven Panne at 2004-09-24T07:04:38+00:00 [haddock @ 2004-09-24 07:04:38 by panne] Switched the default state for instances and the module hierarchy to non-collapsed. This can be reversed when we finally use cookies from JavaScript to have a more persistent state. Previously going back and forth in the documentation was simply too annoying because everything was collapsed again and therefore the documentation was not easily navigatable. - - - - - dfb32615 by Simon Marlow at 2004-09-30T08:21:29+00:00 [haddock @ 2004-09-30 08:21:29 by simonmar] Add a feature request - - - - - 45ff783c by Sven Panne at 2004-10-23T19:54:00+00:00 [haddock @ 2004-10-23 19:54:00 by panne] Improved the Cygwin/MinGW chaos a little bit. There is still confusion about host platform vs. target platform... - - - - - 5f644714 by Krasimir Angelov at 2004-10-28T16:01:51+00:00 [haddock @ 2004-10-28 16:01:51 by krasimir] update for ghc-6.3+ - - - - - 92d9753e by Sven Panne at 2004-11-01T16:39:01+00:00 [haddock @ 2004-11-01 16:39:01 by panne] Revert previous commit: It's Network.URI which should be changed, not Haddock. - - - - - 05f70f6e by Simon Marlow at 2005-01-04T16:15:51+00:00 [haddock @ 2005-01-04 16:15:51 by simonmar] parser fix: allow qualified specialids. - - - - - 47870837 by Simon Marlow at 2005-01-04T16:16:54+00:00 [haddock @ 2005-01-04 16:16:54 by simonmar] Add a test - - - - - ff11fc2c by Ross Paterson at 2005-01-10T19:18:22+00:00 [haddock @ 2005-01-10 19:18:22 by ross] Render non-ASCII characters using numeric character references, to simplify charset issues. There's a META tag saying the charset is UTF-8, but GHC outputs characters as raw bytes. Ideally we need an encoding on the input side too, primarily in comments, because source files containing non-ASCII characters aren't portable between locales. - - - - - eba2fc4e by Simon Marlow at 2005-01-11T10:44:37+00:00 [haddock @ 2005-01-11 10:44:37 by simonmar] Remove string gap - - - - - b899a381 by Ross Paterson at 2005-01-13T11:41:33+00:00 [haddock @ 2005-01-13 11:41:33 by ross] recognize SGML-style numeric character references &#ddd; or &#xhhhh; and translate them into Chars. - - - - - 106e3cf0 by Ross Paterson at 2005-01-13T14:43:41+00:00 [haddock @ 2005-01-13 14:43:41 by ross] also allow uppercase X in hexadecimal character references (like SGML) - - - - - e8f54f25 by Ross Paterson at 2005-01-13T14:44:24+00:00 [haddock @ 2005-01-13 14:44:24 by ross] Describe numeric character references. - - - - - 914ccdce by Sven Panne at 2005-01-15T18:44:48+00:00 [haddock @ 2005-01-15 18:44:45 by panne] Make Haddock compile again after the recent base package changed. The Map/Set legacy hell has been factored out, so that all modules can simply use the new non-deprecated interfaces. Probably a lot of things can be improved by a little bit of Map/Set/List algebra, this can be done later if needed. Small note: Currently the list of instances in HTML code is reversed. This will hopefully be fixed later. - - - - - 6ab20e84 by Sven Panne at 2005-01-16T12:18:26+00:00 [haddock @ 2005-01-16 12:18:26 by panne] Trim imports - - - - - efb81da9 by Sven Panne at 2005-01-16T12:58:08+00:00 [haddock @ 2005-01-16 12:58:03 by panne] Correctly handle the new order of arguments for the combining function given to fromListWith. - - - - - e27b5834 by Sven Panne at 2005-01-16T14:14:41+00:00 [haddock @ 2005-01-16 14:14:39 by panne] Data.Map.unions is left-biased. - - - - - dae3cc3e by Sven Panne at 2005-01-16T14:22:44+00:00 [haddock @ 2005-01-16 14:22:44 by panne] Added the last missing "flip" to get identical HTML output as previous versions. - - - - - 951d8408 by Sven Panne at 2005-01-16T14:37:10+00:00 [haddock @ 2005-01-16 14:37:10 by panne] Refactored Text.PrettyPrint legacy hell into a separate module. - - - - - f1c4b892 by Sven Panne at 2005-01-16T15:41:25+00:00 [haddock @ 2005-01-16 15:41:21 by panne] Cleaned up imports and dropped support for GHC < 5.03, it never worked, anyway. - - - - - 60824c6e by Simon Marlow at 2005-01-18T10:02:48+00:00 [haddock @ 2005-01-18 10:02:48 by simonmar] Add a TODO - - - - - a8c82f23 by Krasimir Angelov at 2005-01-28T23:19:39+00:00 [haddock @ 2005-01-28 23:19:39 by krasimir] import Foreign/Foreign.C are required for Windows - - - - - d8450a23 by Simon Marlow at 2005-02-02T16:23:04+00:00 [haddock @ 2005-02-02 16:23:00 by simonmar] Revamp the linking strategy in Haddock. Now name resolution is done in two phases: - first resolve everything to original names, like a Haskell compiler would. - then, figure out the "home" location for every entity, and point all the links to there. The home location is the lowest non-hidden module in the import hierarchy that documents the entity. If there are multiple candidates, one is chosen at random. Also: - Haddock should not generate any HTML with dangling links any more. Unlinked references are just rendered as plain text. - Error reporting is better: if we can't find a link destination for an entity reference, we now emit a warning. - - - - - 1cce71d0 by Simon Marlow at 2005-02-03T13:42:19+00:00 [haddock @ 2005-02-03 13:42:19 by simonmar] - add --ignore-all-exports flag, which behaves as if every module has the ignore-exports attribute (requested by Chris Ryder). - add --hide option to hide a module on the command line. - add --use-package option to get Haddock info for a package from ghc-pkg (largely untested). - remove reexports from the .haddock file, they aren't used any more. - - - - - 767123ef by Ross Paterson at 2005-02-03T16:17:37+00:00 [haddock @ 2005-02-03 16:17:37 by ross] fix typo for < 6.3 - - - - - 0c680c04 by Simon Marlow at 2005-02-04T12:03:31+00:00 [haddock @ 2005-02-04 12:03:31 by simonmar] Fix bug in renameExportItems that meant links in instances weren't being renamed properly. - - - - - ff7abe5f by Simon Marlow at 2005-02-04T12:15:53+00:00 [haddock @ 2005-02-04 12:15:52 by simonmar] Add attribute #not-home, to indicate that the current module should not be considered to be a home module for the each entity it exports, unless there is no other module that exports the entity. - - - - - fc2cfd27 by Simon Marlow at 2005-02-04T12:40:02+00:00 [haddock @ 2005-02-04 12:40:02 by simonmar] Update the documentation w.r.t. home modules and the not-home attribute. - - - - - 26b8ddf7 by Ross Paterson at 2005-02-04T13:36:06+00:00 [haddock @ 2005-02-04 13:36:05 by ross] sort lists of instances by - arity of the type constructors (so higher-kinded instances come first) - name of the class - argument types - - - - - 26bfb19c by Simon Marlow at 2005-02-23T15:57:12+00:00 [haddock @ 2005-02-23 15:57:12 by simonmar] Fix documentation regarding the module attributes. - - - - - 9c3afd02 by Simon Marlow at 2005-02-28T16:18:17+00:00 [haddock @ 2005-02-28 16:18:17 by simonmar] version 0.7 - - - - - a95fd63f by Simon Marlow at 2005-02-28T16:22:08+00:00 [haddock @ 2005-02-28 16:22:08 by simonmar] Attempt to fix the layout of the package names in the contents. Having tried just about everything, the only thing I can get to work reliably is to make the package names line up on a fixed offset from the left margin. This obviously isn't ideal, so anyone else that would like to have a go at improving it is welcome. One option is to remove the +/- buttons from the contents list and go back to a plain table. The contents page now uses CSS for layout rather than tables. It seems that most browsers have different interpretations of CSS layout, so only the simplest things lead to consistent results. - - - - - 905d42f7 by Simon Marlow at 2005-03-01T17:16:42+00:00 [haddock @ 2005-03-01 17:16:40 by simonmar] Another attempt at lining up the package names on the contents page. Now, they line up with Konqueror, and almost line up with Firefox & IE (different layout in each case). - - - - - a0e1d178 by Wolfgang Thaller at 2005-03-09T08:28:39+00:00 [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). - - - - - 9e1eb784 by Simon Marlow at 2005-04-22T14:27:15+00:00 [haddock @ 2005-04-22 14:27:15 by simonmar] Add a TODO item - - - - - 23281f78 by Ross Paterson at 2005-05-18T12:41:59+00:00 [haddock @ 2005-05-18 12:41:59 by ross] fix 3 bugs in --use-package, and document it. - - - - - 00074a68 by Sven Panne at 2005-05-21T12:35:29+00:00 [haddock @ 2005-05-21 12:35:29 by panne] Warning/versionitis police - - - - - 341fa822 by Simon Marlow at 2005-06-15T15:43:21+00:00 [haddock @ 2005-06-15 15:43:21 by simonmar] Allow "licence" as an alternate spelling of "license" - - - - - 3b953f8b by Simon Marlow at 2005-06-16T08:14:12+00:00 [haddock @ 2005-06-16 08:14:12 by simonmar] wibble - - - - - abfd9826 by Simon Marlow at 2005-06-27T14:46:40+00:00 [haddock @ 2005-06-27 14:46:40 by simonmar] name hierarchical HTML files as A-B-C.html instead of A.B.C.html. The old way confused Apache because the extensions are sometimes interpreted as having special meanings. - - - - - a01eea00 by Simon Marlow at 2005-08-04T13:59:40+00:00 [haddock @ 2005-08-04 13:59:40 by simonmar] 0.7 changes - - - - - 170ef87e by Simon Marlow at 2005-08-04T15:08:03+00:00 [haddock @ 2005-08-04 15:08:03 by simonmar] spec file from Jens Peterson - - - - - 7621fde4 by Simon Marlow at 2005-08-04T15:59:30+00:00 [haddock @ 2005-08-04 15:59:30 by simonmar] replace mingw tests with $(Windows) - - - - - a20739bb by Sven Panne at 2005-08-05T07:01:12+00:00 [haddock @ 2005-08-05 07:01:12 by panne] Reverted to previous version (but with bumped version number), the last commit broke RPM building on SuSE systems due to differently named dependencies. As a clarification: All .spec files in the repository have to work at least on SuSE, because that's the system I'm using. And as "Mr. Building Police", I reserve me the right to keep them that way... >:-) It might very well be the case that we need different .spec files for different platforms, so packagers which are unhappy with the current .spec files should contact me, stating the actual problems. - - - - - 4afb15cf by Simon Marlow at 2005-10-05T10:51:45+00:00 [haddock @ 2005-10-05 10:51:45 by simonmar] Add a bug - - - - - 60f69f82 by Simon Marlow at 2005-10-05T12:52:03+00:00 [haddock @ 2005-10-05 12:52:03 by simonmar] Document new behaviour of -s option - - - - - f7e520ca by Simon Marlow at 2005-10-10T15:02:55+00:00 [haddock @ 2005-10-10 15:02:55 by simonmar] extractRecSel: ignore non-record constructors (fixes a crash when using datatypes with a mixture of record and non-record style constructors). - - - - - b2edbedb by Simon Marlow at 2005-10-14T09:44:21+00:00 Start CHANGES for 0.8 - - - - - 21c7ac8d by Simon Marlow at 2005-10-14T23:11:19+00:00 First cut of Cabal build system - - - - - 766cecdd by Simon Marlow at 2005-10-29T08:14:43+00:00 Add configure script and Makefile for the docs Add a separate configure script and build system for building the documentation. The configure and Makefile code is stolen from fptools. This is left as a separate build system so that the main Cabal setup doesn't require a Unix build environment or DocBook XML tools. - - - - - aa36c783 by Duncan Coutts at 2006-01-17T19:29:55+00:00 Add a --wiki=URL flag to add a per-module link to a correspondng wiki page. So each html page gets an extra link (placed next to the source code and contents links) to a corresponding wiki page. The idea is to let readers contribute their own notes, examples etc to the documentation. Also slightly tidy up the code for the --source option. - - - - - e06e2da2 by Simon Marlow at 2006-01-18T09:28:15+00:00 TODO: documnet --wiki - - - - - 17adfda9 by Duncan Coutts at 2006-01-19T20:17:59+00:00 Add an optional wiki link for each top level exported name. In each module, for each "top level" exported entity we add a hyper link to a corresponding wiki page. The link url gets the name of the exported entity as a '#'-style anchor, so if there is an anchor in the page with that name then the users browser should jump directly to it. By "top level" we mean functions, classes, class members and data types (data, type, newtype), but not data constructors, class instances or data type class membership. The link is added at the right of the page and in a small font. Hopefully this is the right balance of visibility/distraction. We also include a link to the wiki base url in the contents and index pages. - - - - - f52324bb by Duncan Coutts at 2006-01-19T20:28:27+00:00 Rewrite pathJoin to only add a path separator when necessary. When the path ends in a file seperator there is no need to add another. Now using "--wiki=http://blah.com/foo/" should do the right thing. (Code snippet adapted from Isaac's FilePath package.) - - - - - 43bb89fa by Duncan Coutts at 2006-01-21T17:15:27+00:00 Teach haddock about line pragmas and add accurate source code links Teach haddock about C and Haskell style line pragmas. Extend the lexer/parser's source location tracking to include the file name as well as line/column. This way each AST item that is tagged with a SrcLoc gets the original file name too. Use this original file name to add source links to each exported item, in the same visual style as the wiki links. Note that the per-export source links are to the defining module rather than whichever module haddock pretends it is exported from. This is what we want for source code links. The source code link URL can also contain the name of the export so one could implement jumping to the actual location of the function in the file if it were linked to an html version of the source rather than just plain text. The name can be selected with the %N wild card. So for linking to the raw source code one might use: --source=http://darcs/haskell.org/foo/%F Or for linking to html syntax highlighted code: --source=http://darcs/haskell.org/foo/%M.html#%N - - - - - edd9f229 by Duncan Coutts at 2006-01-22T00:02:00+00:00 Extend URL variable expansion syntax and add source links to the contents page Like the wiki link on the contents and index page, add a source code link too. Extend the wiki & source URL variable expansion syntax. The original syntax was: %F for the source file name (the .hs version only, not the .lhs or .hs.pp one) %M for the module name (with '.' replaced by '/') The new syntax is: %F or %{FILE} for the original source file name %M or %{MODULE} for the module name (no replacements) %N or %{NAME} for the function/type export name %K or %{KIND} for a type/value flag "t" or "v" with these extensions: %{MODULE/./c} to replace the '.' module seperator with any other char c %{VAR|some text with the % char in it} which means if the VAR is not in use in this URL context then "" else replace the given text with the '%' char replaced by the string value of the VAR. This extension allows us to construct URLs wit optional parts, since the module/file name is not available for the URL in the contents/index pages and the value/type name is not available for the URL at the top level of each module. - - - - - eb3c6ada by Duncan Coutts at 2006-01-23T13:42:34+00:00 Remove the complex substitutions and add more command line flags instead. Instead of incomprehensable URL substitutions like ${MODULE/./-|?m=%} we now use three seperate command line flags for the top level, per-module and per-entity source and wiki links. They are: --source-base, --source-module, --source-entity --comments-base, --comments-module, --comments-entity We leave -s, --source as an alias for --source-module which is how that option behaved previously. The long forms of the substitutions are still available, ${FILE} ${MODULE} etc and the only non-trivial substitution is ${MODULE/./c} to replace the '.' characters in the module name with any other character c. eg ${MODULE/./-} Seperating the source and wiki url flags has the added bonus that they can be turned on or off individually. So users can have per-module links for example without having to also have per-entity links.` - - - - - a2f0f2af by Duncan Coutts at 2006-01-23T13:54:52+00:00 Make the --help output fit in 80 columns. This is a purely cosmetic patch, feel free to ignore it. The only trickery going on is that we don't display the deprecated -s, --source flags in the help message, but we do still accept them. - - - - - 2d3a4b0c by Duncan Coutts at 2006-01-23T14:12:16+00:00 Add documentation for the new --source-* and --comments-* command line options - - - - - 1a82a297 by Simon Marlow at 2006-01-23T17:03:27+00:00 fix markup - - - - - 100d464a by Duncan Coutts at 2006-01-23T18:31:13+00:00 remove a couple TODO items that have been done The --wiki, or rather the --comment-* options are now documented. There is probably no need to have haddock invoke unlit or cpp itself since it can now pick up the line pragmas to get the source locations right. Tools like Cabal will arrange for preprocessors to be run so there is less of a need for tools like haddock to do it themselves. - - - - - 3162fa91 by Simon Marlow at 2006-01-24T14:21:56+00:00 add a test I had lying around - - - - - 98947063 by Simon Marlow at 2006-01-31T13:52:54+00:00 add scabal-version field - - - - - c41876e6 by Neil Mitchell at 2006-02-26T17:48:21+00:00 Add Hoogle output option - - - - - f86fb9c0 by Simon Marlow at 2006-03-08T09:15:20+00:00 add haskell.vim Contributed by Brad Bowman <bsb at bereft.net>, thanks! - - - - - 35d3c511 by benjamin.franksen at 2006-03-03T22:39:54+00:00 fixed libdir (/html was missing) - - - - - 4d08fd7d by Simon Marlow at 2006-03-10T11:13:31+00:00 add PatternGuards extension - - - - - 3f095e70 by Simon Marlow at 2006-03-13T11:40:42+00:00 bug fixes from Brad Bowman - - - - - 8610849d by Sven Panne at 2006-03-19T17:02:56+00:00 Fixed Cabal/RPM build - - - - - 34a994d6 by sven.panne at 2006-04-20T12:39:23+00:00 Avoid pattern guards Due to the use of pattern guards in Haddock, GHC was called with -fglasgow-exts. This in turn enables bang patterns, too, which broke the Haddock build. Removing some unnecessary pattern guards seemed to be the better way of fixing this instead of using a pragma to disable pattern guards. - - - - - bb523f51 by Ross Paterson at 2006-04-24T09:03:25+00:00 extend 'deriving' heuristic a little If an argument of a data constructor has a type variable head, it is irreducible and the same type class can be copied into the constraint. (Formerly we just did this for type variable arguments.) - - - - - dab9fe7a by Simon Marlow at 2006-04-26T10:02:31+00:00 record an idea - - - - - 748b7078 by Simon Marlow at 2006-05-08T08:28:53+00:00 add section about deriving - - - - - 11252ea1 by Simon Marlow at 2006-05-24T15:43:10+00:00 replace a fatal error in lexChar with a parseError - - - - - 382c9411 by Simon Marlow at 2006-05-24T15:45:47+00:00 add a bug - - - - - b79272f5 by Simon Marlow at 2006-05-24T15:46:29+00:00 add a bug report - - - - - 912edf65 by David Waern at 2006-07-10T19:09:23+00:00 Initial modifications -- doesn't compile - - - - - a3c7ba99 by David Waern at 2006-07-11T00:54:19+00:00 More porting work -- doesn't compile - - - - - 0a173d19 by David Waern at 2006-07-11T11:30:03+00:00 Make the repos temporarily compile and illustrate a problem - - - - - bad316de by David Waern at 2006-07-11T15:43:47+00:00 Progress on the porting process - - - - - bbf12d02 by David Waern at 2006-07-11T23:07:44+00:00 More progress on the porting -- first pass starting to shape up - - - - - de580ba2 by David Waern at 2006-07-20T17:48:30+00:00 More progress -- still on phase1 - - - - - 75a917a2 by David Waern at 2006-07-23T18:22:43+00:00 More work on pass1 -- mostly done - - - - - 6697b3f7 by David Waern at 2006-07-23T22:17:40+00:00 More work, started working on the renaming phase -- this code will need a cleanup soon :) - - - - - 82a5bcbb by David Waern at 2006-07-29T16:16:43+00:00 Add instances, build renaming environment, start on the renamer - - - - - c3f8f4f1 by David Waern at 2006-07-29T21:37:48+00:00 Complete the renamer - - - - - 7e00d464 by David Waern at 2006-07-30T21:01:57+00:00 Start porting the Html renderer - - - - - f04ce121 by David Waern at 2006-08-09T20:04:56+00:00 More Html rendering progress - - - - - 20c21b53 by David Waern at 2006-08-10T17:37:47+00:00 More progress - - - - - d7097e0d by David Waern at 2006-08-11T20:31:51+00:00 Cleanup - - - - - a7351e86 by David Waern at 2006-08-12T11:44:47+00:00 Render H98 Data declarations - - - - - 3fb2208e by David Waern at 2006-08-12T17:15:34+00:00 Perfect rendering of Test.hs - - - - - 454fd062 by David Waern at 2006-08-13T21:57:08+00:00 Misc fixes and interface load/save - - - - - 7ef7e7be by David Waern at 2006-08-14T00:56:07+00:00 Some refactoring - - - - - a7d3efef by David Waern at 2006-08-19T20:07:55+00:00 Adapt to latest GHC - - - - - 5fc3c0d7 by David Waern at 2006-08-20T21:28:11+00:00 Move interface read/write to its own module + some cleanup - - - - - 037e011c by David Waern at 2006-08-20T21:38:24+00:00 Small cleanup - - - - - da3a1023 by David Waern at 2006-09-03T16:05:22+00:00 Change mode to BatchCompile to avoid GHC API bug - - - - - 3cc9be3b by David Waern at 2006-09-03T16:06:59+00:00 Starting work on GADT rendering - - - - - 94506037 by David Waern at 2006-09-03T20:02:48+00:00 Compensate for change of export list order in GHC - - - - - c2cec4eb by David Waern at 2006-09-04T20:53:01+00:00 Rename a function - - - - - 9a9735ba by David Waern at 2006-09-05T15:51:21+00:00 Change version number to 2.0 - - - - - 3758a714 by David Waern at 2006-09-05T15:51:49+00:00 Align comment properly - - - - - 68478d9e by David Waern at 2006-09-15T18:03:00+00:00 Remove interface reading/writing code and use the GHC api for creating package environments instead - - - - - d2eedd95 by David Waern at 2006-09-15T18:05:29+00:00 Change the executable name to haddock-ghc-nolib - - - - - fcfbcf66 by David Waern at 2006-09-15T18:05:45+00:00 Small source code cleanup - - - - - d08eb017 by David Waern at 2006-09-15T18:06:21+00:00 Remove handling of --package flag - - - - - b8a4cf53 by David Waern at 2006-09-15T18:07:16+00:00 Remove commented-out code - - - - - bef0a684 by David Waern at 2006-09-15T18:37:57+00:00 Don't warn about missing links to () - - - - - e7d25fd7 by David Waern at 2006-09-15T19:50:49+00:00 Remove Interface and Binary2 modules - - - - - 9894f2a1 by David Waern at 2006-09-15T19:53:43+00:00 Remove debug printing from HaddockHtml - - - - - a0e7455d by David Waern at 2006-09-16T00:16:29+00:00 Comments only - - - - - d5b26fa7 by David Waern at 2006-09-16T00:16:57+00:00 Refactor PackageData creation code and start on building the doc env propery (unfinished) - - - - - 06aaa779 by David Waern at 2006-09-16T00:19:25+00:00 Better comments in Main.hs - - - - - 1a52d1b4 by David Waern at 2006-09-18T22:17:11+00:00 Comments and spacing change - - - - - e5a97767 by David Waern at 2006-09-21T17:02:45+00:00 Remove unnecessary fmapM import in Main - - - - - 9d0f9d3a by David Waern at 2006-09-22T18:07:07+00:00 Make import list in HaddockHtml prettier - - - - - 3452f662 by David Waern at 2006-09-22T18:08:47+00:00 Refactor context rendering - - - - - 12d0a6d0 by David Waern at 2006-09-22T18:09:52+00:00 Do proper HsType rendering (inser parentheses correctly) - - - - - 2c20c2f9 by David Waern at 2006-09-22T18:10:45+00:00 Fix a bug in Main.toHsType - - - - - c5396443 by David Waern at 2006-09-22T18:11:16+00:00 Skip external package modules sort for now - - - - - 3fb95547 by David Waern at 2006-09-22T20:35:40+00:00 Take away trailin "2" on all previously clashing type names - - - - - 2174755f by David Waern at 2006-09-22T20:51:43+00:00 Remove unused imports in Main - - - - - 1e9f7a39 by David Waern at 2006-09-22T20:52:11+00:00 Fix a comment in Main - - - - - 32d9e028 by David Waern at 2006-10-05T16:40:11+00:00 Merge with changes to ghc HEAD - - - - - 3058c8f5 by David Waern at 2006-10-05T16:41:02+00:00 Comment fixes - - - - - b9c217ec by David Waern at 2006-10-05T16:49:59+00:00 Filter out more builtin type constructors from warning messages - - - - - 67e7d252 by David Waern at 2006-10-05T19:38:22+00:00 Refactoring -- better structured pass1 - - - - - cd21c0c1 by David Waern at 2006-10-05T19:44:42+00:00 Remove read/dump interface flags - - - - - 313f9e69 by David Waern at 2006-10-05T19:49:26+00:00 Remove unused pretty printing - - - - - 480f09d1 by David Waern at 2006-12-28T13:22:24+00:00 Update to build with latest GHC HEAD - - - - - 63dccfcb by David Waern at 2007-01-05T01:38:45+00:00 Fixed a bug so that --ghc-flag works correctly - - - - - 3117dadc by David Waern at 2006-12-29T18:53:39+00:00 Automatically get the GHC lib dir - - - - - 9dc84a5c by David Waern at 2006-12-29T19:58:53+00:00 Comments - - - - - 0b0237cc by David Waern at 2007-01-05T16:48:30+00:00 Collect docs based on SrcLoc, syncing with removal of DeclEntity from GHC - - - - - a962c256 by David Waern at 2007-01-05T17:02:47+00:00 Add tabs in haddock.cabal - - - - - 0ca30c97 by David Waern at 2007-01-05T17:04:11+00:00 Add GHCUtils.hs - - - - - c0ab9abe by David Waern at 2007-01-10T11:43:08+00:00 Change package name to haddock-ghc, version 0.1 - - - - - 38e18b27 by David Waern at 2007-01-12T12:03:52+00:00 No binder name for foreign exports - - - - - d18587ab by David Waern at 2007-01-12T12:08:15+00:00 Temp record - - - - - ba6251a0 by David Waern at 2007-01-12T18:27:55+00:00 Remove read/dump-interface (again) - - - - - f4ba2b39 by David Waern at 2007-01-12T18:31:36+00:00 Remove DocOption, use the GHC type - - - - - 511be8bd by David Waern at 2007-01-12T18:32:41+00:00 Use exceptions instead of Either when loading package info - - - - - 0f2144d8 by David Waern at 2007-01-12T18:33:23+00:00 Small type change - - - - - 77507eb7 by David Waern at 2007-01-12T18:33:59+00:00 Remove interface file read/write - - - - - 0ea1e14f by David Waern at 2007-01-17T21:40:26+00:00 Add trace_ppr to GHCUtils - - - - - 3878b493 by David Waern at 2007-01-17T21:40:53+00:00 Sort external package modules and build a doc env - - - - - 8dc323fc by David Waern at 2007-01-17T21:42:41+00:00 Remove comment - - - - - f4c5b097 by David Waern at 2007-01-18T23:22:18+00:00 Add haddock-ghc.cabal and remove ghc option pragma in source file - - - - - da242b2c by David Waern at 2007-01-18T23:22:46+00:00 Remove some tabs - - - - - 288ed096 by David Waern at 2007-01-18T23:39:28+00:00 Moved the defaultErrorHandler to scope only over sortAndCheckModules for now - - - - - 4dd150fe by David Waern at 2007-02-03T21:23:56+00:00 Let restrictCons handle infix constructors - - - - - 97893442 by David Waern at 2007-02-04T16:26:00+00:00 Render infix data constructors - - - - - da89db72 by David Waern at 2007-02-04T16:26:33+00:00 CHange project name to Haddock-GHC - - - - - e93d48af by David Waern at 2007-02-04T16:59:08+00:00 Render infix type constructors properly - - - - - 357bc99b by David Waern at 2007-02-04T17:37:08+00:00 Insert spaces around infix function names - - - - - ab6cfc49 by David Waern at 2007-02-04T17:59:54+00:00 Do not list entities without documentation - - - - - 04249c7e by David Waern at 2007-02-04T19:16:25+00:00 Add GADT support (quite untested) - - - - - 2c223f8d by David Waern at 2007-02-04T19:25:10+00:00 Add package file write/save again! - - - - - b07ed218 by David Waern at 2007-02-04T19:33:02+00:00 Comment out minf_iface based stuff - - - - - 953d1fa7 by David Waern at 2007-02-05T00:12:23+00:00 Solve conflicts - - - - - 593247fc by David Waern at 2007-02-06T19:48:48+00:00 Remove -package flag, GHC's can be used instead - - - - - f658ded2 by David Waern at 2007-02-06T20:50:44+00:00 Start for support of ATs - - - - - 97f9e913 by David Waern at 2007-02-06T20:52:27+00:00 Wibble - - - - - 2ce8e4cf by David Waern at 2007-02-16T12:09:49+00:00 Add the DocOptions change - - - - - dee4a9b5 by David Waern at 2007-03-06T01:24:48+00:00 Wibble - - - - - 7cb99d18 by David Waern at 2007-03-06T01:24:58+00:00 Change version to 2.0 and executable name to haddock - - - - - c5aa02bc by David Waern at 2007-03-08T15:59:49+00:00 Go back to -B flag - - - - - 3a349201 by David Waern at 2007-03-09T13:31:59+00:00 Better exception handling and parsing of GHC flags - - - - - 05a69b71 by David Waern at 2007-03-09T17:45:44+00:00 Remove commented-out DocEntity printing - - - - - 755032cb by davve at dtek.chalmers.se at 2007-03-23T23:30:20+00:00 Remove a file that shouldn't be here - - - - - a7077e5f by davve at dtek.chalmers.se at 2007-03-24T03:58:48+00:00 Remove an import - - - - - 6f55aa8b by davve at dtek.chalmers.se at 2007-03-25T00:46:48+00:00 Start work on Haddock API - - - - - f0199480 by davve at dtek.chalmers.se at 2007-03-25T00:56:36+00:00 Prettify some comments - - - - - f952f9d1 by davve at dtek.chalmers.se at 2007-03-25T00:56:53+00:00 Remove ppr in HaddockTypes - - - - - bc594904 by davve at dtek.chalmers.se at 2007-03-25T00:57:53+00:00 Remove commented out doc env inference - - - - - 11ebf08d by davve at dtek.chalmers.se at 2007-03-25T01:23:25+00:00 De-flatten the namespace - - - - - f696b4bc by davve at dtek.chalmers.se at 2007-03-25T03:21:48+00:00 Add missing stuff to API - - - - - 9a2a04c3 by davve at dtek.chalmers.se at 2007-03-25T03:22:02+00:00 Wibble - - - - - 7d04a6d5 by davve at dtek.chalmers.se at 2007-03-25T03:22:08+00:00 Avoid a GHC bug with parseStaticFlags [] - - - - - 4d2820ba by davve at dtek.chalmers.se at 2007-03-26T04:57:01+00:00 Add fall-through case to mkExportItem - - - - - 6ebc8950 by Stefan O'Rear at 2007-03-26T04:14:53+00:00 Add shebang line to Setup.lhs - - - - - 80966ec5 by davve at dtek.chalmers.se at 2007-03-26T05:24:26+00:00 Fix stupid compile error - - - - - 1ea1385d by davve at dtek.chalmers.se at 2007-04-05T17:19:56+00:00 Do save/read of interface files properly - - - - - 0e4f6541 by David Waern at 2007-04-10T21:08:36+00:00 Add version to ghc dependency - - - - - b0499b63 by David Waern at 2007-04-10T21:37:08+00:00 Change package name to haddock - - - - - 9d50d27e by David Waern at 2007-04-24T00:22:14+00:00 Use filepath package instead of FilePath - - - - - 87c7fcdf by David Waern at 2007-07-10T21:03:04+00:00 Add new package dependencies - - - - - 4768709c by David Waern at 2007-07-11T20:37:11+00:00 Follow changes to record constructor representation - - - - - b9a02fee by Simon Marlow at 2007-05-30T14:00:48+00:00 update to compile with the latest GHC & Cabal - - - - - c0ebdc01 by David Waern at 2007-07-11T21:35:45+00:00 Fix conflicts - - - - - 97f7afd4 by David Waern at 2007-07-11T21:52:38+00:00 Follow changes to the GHC API - - - - - a5b7b58f by David Waern at 2007-07-12T20:36:48+00:00 Call parseStaticFlags before newSession - - - - - f7f50dbc by David Waern at 2007-08-01T21:52:58+00:00 Better indentation in haddock.cabal - - - - - d84e52ad by David Waern at 2007-08-02T00:08:18+00:00 Wibble - - - - - a23f494a by David Waern at 2007-08-02T00:08:24+00:00 Be better at trying to load all module dependencies (debugging) - - - - - ee917f13 by David Waern at 2007-08-03T18:48:08+00:00 Load all targets explicitly (checkModule doesn't chase dependencies anymore) - - - - - 5182d631 by David Waern at 2007-08-16T16:48:55+00:00 Finalize support for links to other packages - - - - - dfd1e3da by David Waern at 2007-08-16T16:51:11+00:00 Fix haddock comment errors in Haddock.Types - - - - - 50c0d83e by David Waern at 2007-08-16T16:51:37+00:00 Remove a debug import - - - - - d84b7c2b by David Waern at 2007-08-16T17:06:30+00:00 Rename PackageData to HaddockPackage - - - - - 3b52cb9f by David Waern at 2007-08-16T17:09:42+00:00 Simplify some comments - - - - - 66fa68d9 by David Waern at 2007-08-16T17:11:38+00:00 Comment the HaddockPackage definition - - - - - 8674c761 by David Waern at 2007-08-16T17:25:54+00:00 Improve code layout in Main - - - - - 571a3a0b by David Waern at 2007-08-16T17:32:13+00:00 Remove explict module imports in Main - - - - - d31b3cb0 by David Waern at 2007-08-16T17:36:23+00:00 Correct comments - - - - - 7f8a9f2b by David Waern at 2007-08-16T17:39:50+00:00 Fix layout problems in Haddock.Types - - - - - 9f421d7f by David Waern at 2007-08-17T11:16:48+00:00 Move options out of Main into Haddock.Options - - - - - 80042b63 by David Waern at 2007-08-17T11:26:59+00:00 Small comment/layout fixes - - - - - b141b982 by David Waern at 2007-08-17T11:28:28+00:00 Change project name from Haddock-GHC to Haddock - - - - - dbeb4a81 by David Waern at 2007-08-17T11:41:05+00:00 Add top module comment to all files - - - - - ce99cc9e by David Waern at 2007-08-17T14:53:04+00:00 Factor out typechecking phase into Haddock.Typecheck - - - - - 6bf75d9e by David Waern at 2007-08-17T16:55:35+00:00 Factor out package code to Haddock.Packages - - - - - b396db37 by David Waern at 2007-08-29T22:40:23+00:00 Major refactoring - - - - - 3d4f95ee by David Waern at 2007-08-29T23:26:24+00:00 Rename HaddockModule to Interface and a few more refactorings - - - - - c55326db by David Waern at 2007-08-29T23:48:03+00:00 Some comment cleanup - - - - - 9a84fc46 by David Waern at 2007-08-29T23:49:29+00:00 Add some modules that I forgot to add earlier - - - - - 4536dce2 by David Waern at 2007-08-29T23:55:24+00:00 Wibble - - - - - 9b7f0206 by David Waern at 2007-08-30T16:03:29+00:00 Wibble - - - - - c52c050a by David Waern at 2007-08-30T16:30:37+00:00 Rename HaddockModule to Interface - - - - - eae2995f by David Waern at 2007-08-30T16:42:59+00:00 Simplify createInterfaces - - - - - 53f99caa by David Waern at 2007-09-29T00:04:31+00:00 Add build-type: Simple to the cabal file - - - - - 0d3103a8 by David Waern at 2007-09-29T00:04:58+00:00 Add containers and array dependency - - - - - 6acf5f30 by David Waern at 2007-09-29T00:13:36+00:00 Prettify the cabal file - - - - - 87c1e378 by David Waern at 2007-09-29T13:16:39+00:00 FIX: consym data headers with more than two variables - - - - - b67fc16a by David Waern at 2007-09-29T14:01:32+00:00 FIX: prefix types used as operators should be quoted - - - - - a8f925bc by David Waern at 2007-09-29T14:02:26+00:00 Use isSymOcc from OccName instead of isConSym - - - - - fc330701 by David Waern at 2007-09-29T14:15:37+00:00 Use isLexConSym/isLexVarSym from OccName - - - - - e4f3dbad by David Waern at 2007-09-29T15:01:08+00:00 FIX: do not quote varsym type operators - - - - - 402207d2 by David Waern at 2007-09-29T15:01:50+00:00 Wibble - - - - - f9d89ef0 by David Waern at 2007-09-29T15:17:40+00:00 Take care when pp tyvars - add parens on syms - - - - - 849e2a77 by David Waern at 2007-10-01T21:56:39+00:00 Go back to using a ModuleMap instead of LookupMod - fixes a bug - - - - - 549dbac6 by David Waern at 2007-10-02T01:05:19+00:00 Improve parsing of doc options - - - - - a36021b8 by David Waern at 2007-10-02T23:05:00+00:00 FIX: double arrows in constructor contexts - - - - - d03bf347 by David Waern at 2007-10-09T16:14:05+00:00 Add a simple test suite - - - - - c252c140 by David Waern at 2007-10-17T16:02:28+00:00 Add --optghc=.. style flag passing to GHC - - - - - cce6c1b3 by David Waern at 2007-10-18T22:03:20+00:00 Add support for --read-interface again - - - - - 33d059c0 by David Waern at 2007-10-18T22:30:18+00:00 Refactoring -- get rid of Haddock.Packages - - - - - f9ed0a4c by David Waern at 2007-10-18T22:34:36+00:00 Name changes - - - - - 8a1c816f by David Waern at 2007-10-20T14:24:23+00:00 Add --ghc-version option - - - - - 4925aaa1 by David Waern at 2007-10-21T14:34:26+00:00 Add some Outputable utils - - - - - 69e7e47f by David Waern at 2007-10-21T14:35:49+00:00 FIX: Ord for OrdName was not comparing modules - - - - - 5a4ae535 by David Waern at 2007-10-21T21:18:48+00:00 Wibble - - - - - 03d48e20 by David Waern at 2007-10-24T15:52:56+00:00 Remove Main from "other modules" - - - - - c66f6d82 by David Waern at 2007-10-24T16:37:18+00:00 Make it possible to run haddock on itself - - - - - 21d156d8 by David Waern at 2007-10-25T14:02:14+00:00 Don't set boot modules as targets - - - - - f8bcf91c by David Waern at 2007-10-31T22:11:17+00:00 Add optimisation flags - - - - - 7ac758f2 by David Waern at 2007-11-04T09:48:28+00:00 Go back to loading only targets (seems to work now) - - - - - 4862aae1 by David Waern at 2007-11-05T22:24:57+00:00 Do full compilation of modules -- temporary fix for GHC API problem - - - - - 697e1517 by David Waern at 2007-11-05T22:25:50+00:00 Don't warn about not being able to link to wired/system/builtin-names - - - - - 892186da by David Waern at 2007-11-06T00:49:21+00:00 Filter out instances with TyCons that are not exported - - - - - 9548314c by David Waern at 2007-11-06T09:37:14+00:00 Wibble - - - - - 5cafd627 by David Waern at 2007-11-08T01:43:07+00:00 Filter out all non-vanilla type sigs - - - - - 04621830 by David Waern at 2007-11-08T01:45:13+00:00 Synch loading of names from .haddock files with GHC's name cache - - - - - 88d37f77 by David Waern at 2007-11-08T01:46:21+00:00 Remove commented-out code - - - - - 6409c911 by David Waern at 2007-11-08T01:56:00+00:00 Small bugfix and cleanup in getDeclFromTyCls - - - - - af59d9c2 by David Waern at 2007-11-08T02:08:44+00:00 Remove OrdName stuff - - - - - 3a615e2e by David Waern at 2007-11-08T02:13:41+00:00 Update runtests.hs following changes to haddock - - - - - 01f3314e by David Waern at 2007-11-08T02:33:01+00:00 Complain if we can't link to wired-in names - - - - - fcafb5d1 by David Waern at 2007-11-09T02:40:16+00:00 Don't exit when there are no file arguments - - - - - 194bc332 by David Waern at 2007-11-09T02:55:37+00:00 Wibble - - - - - dbe4cb55 by David Waern at 2007-11-09T02:56:14+00:00 Wibble - - - - - 82869fda by David Waern at 2007-11-10T17:01:43+00:00 Introduce InstalledInterface structure and add more stuff to the .haddock files We introduce InstalledInterface capturing the part of Interface that is stored in the interface files. We change the ppHtmlContents and ppHtmllIndex to take this structure instead of a partial Interface. We add stuff like the doc map and exported names to the .haddock file (via InstalledInterface). - - - - - d6bb57bf by David Waern at 2007-11-10T17:19:48+00:00 FIX: contents and index should include external package modules when --gen-contents/--gen-index - - - - - e8814716 by David Waern at 2007-11-11T00:29:27+00:00 Remove lDocLinkName and its use in Html backend - - - - - 6f9bd702 by David Waern at 2007-11-11T00:50:57+00:00 Do some refactoring in the html backend This also merges an old patch by Augustsson: Wed Jul 12 19:54:36 CEST 2006 lennart.augustsson at credit-suisse.com * Print type definitions like signatures if given arrows. - - - - - 09d0ce24 by Malcolm.Wallace at 2006-07-20T13:13:57+00:00 mention HsColour in the docs, next to option flags for linking to source code - - - - - 24da6c34 by Malcolm.Wallace at 2006-07-20T13:14:50+00:00 change doc references to CVS to give darcs repository location instead - - - - - 74d52cd6 by David Waern at 2007-11-11T00:55:33+00:00 Update copyright - - - - - fcaa3b4f by Duncan Coutts at 2006-09-08T13:41:00+00:00 Eliminate dep on network by doing a little cut'n'paste haddock depending on the network causes a circular dependency at least if you want to build the network lib with haddock docs. - - - - - 10cc9bda by David Waern at 2007-11-11T02:09:41+00:00 Fix conflicts - - - - - 4e3acd39 by David Waern at 2007-11-11T02:21:19+00:00 Manual merge of a patch from Duncan Coutts that removes the dependency on mtl - - - - - fa9070da by Neil Mitchell at 2006-09-29T15:52:03+00:00 Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01 - - - - - d7431c85 by David Waern at 2007-11-11T02:28:50+00:00 Fix conflicts - - - - - f87e8f98 by Simon Marlow at 2006-10-10T11:37:16+00:00 changes for 0.8 - - - - - db929565 by Simon Marlow at 2006-10-10T12:07:12+00:00 fix the name of the source file - - - - - 8220aa4b by Simon Marlow at 2006-10-11T14:17:37+00:00 Rename haddock.js to haddock-util.js haddock.js will be run automatically by Windows when you type 'haddock' if it is found on the PATH, so rename to avoid confusion. Spotted by Adrian Hey. - - - - - 6bccdaa1 by sven.panne at 2006-10-12T15:28:23+00:00 Cabal's sdist does not generate "-src.tar.gz" files, but ".tar.gz" ones - - - - - d3f3fc19 by Simon Marlow at 2006-12-06T16:05:07+00:00 add todo item for --maintainer - - - - - 2da7e269 by Simon Marlow at 2006-12-15T15:52:00+00:00 TODO: do something better about re-exported symbols from another package - - - - - 42d85549 by David Waern at 2007-11-11T02:30:59+00:00 Fix conflicts - - - - - 5e7ef6e5 by Neil Mitchell at 2007-01-11T15:41:15+00:00 Never do spliting index files into many - - - - - f3d4aebe by Neil Mitchell at 2007-01-11T17:07:09+00:00 Add searching on the index page - - - - - bad3ab66 by Neil Mitchell at 2007-01-11T18:17:46+00:00 Delete dead code, now there is only one index page - - - - - cd09eedb by Neil Mitchell at 2007-01-11T18:21:19+00:00 Delete more stuff that is no longer required - - - - - e2806646 by David Waern at 2007-11-11T02:41:53+00:00 Fix conflicts - - - - - a872a823 by Neil Mitchell at 2007-01-11T18:51:43+00:00 Make the index be in case-insensitive alphabetic order - - - - - 8bddd9d7 by Neil Mitchell at 2007-02-06T17:49:12+00:00 Do not create empty tables for data declarations which don't have any constructors, instances or comments. Gets better HTML 4.01 compliance - - - - - 036b8120 by David Waern at 2007-11-11T02:56:58+00:00 Fix conflicts - - - - - f50c1639 by Conal Elliott at 2007-02-14T21:54:00+00:00 added substitution %{FILE///c} - - - - - 402e166a by David Waern at 2007-11-11T03:35:46+00:00 Manual merge of old patch: Sat Apr 21 04:36:43 CEST 2007 Roberto Zunino <zunrob at users.sf.net> * URL expansion for %%, %L, %{LINE} - - - - - 2f264fbd by David Waern at 2007-11-11T03:40:33+00:00 Manual merge of an old patch: Thu Apr 19 20:23:40 CEST 2007 Wolfgang Jeltsch <g9ks157k at acme.softbase.org> * bug fix When Haddock was invoked with the --ignore-all-exports flag but the ignore-exports module attribute wasn't used, hyperlinks weren't created for non-exported names. This fix might not be as clean as one would wish (since --ignore-all-exports now results in ignore_all_exports = True *and* an additional OptIgnoreExports option for every module) but at least the bug seems to be resolved now. - - - - - 7d7ae106 by sven.panne at 2007-09-02T12:18:02+00:00 Install LICENSE in the correct place - - - - - 66eaa924 by David Waern at 2007-11-11T19:02:46+00:00 Fix a bug that made haddock loop - - - - - 4ed47b58 by David Waern at 2007-11-11T19:03:09+00:00 Rename java-script file (this wasn't merge correctly) - - - - - d569534a by David Waern at 2007-11-11T19:06:44+00:00 Don't require -B <ghc-libdir> when no argument files Change readInterfaceFile to take a Maybe Session, to avoid having to pass -B <ghc-libdir> to Haddock when there're no source files to process. This is nice when computing contents/index for external packages. - - - - - 373368bc by Neil Mitchell at 2007-01-11T18:22:44+00:00 Change from tabs to spaces in the ppHtmlIndex function - - - - - 6b063a77 by Neil Mitchell at 2007-01-12T12:17:46+00:00 Rewrite much of the index searching code, previously was too slow to execute on the base library with IE, the new version guarantees less than O(log n) operations be performed, where n is the number in the list (before was always O(n)) - - - - - bfad00b7 by David Waern at 2007-11-11T23:33:53+00:00 Fix conflicts - - - - - cd2dcc09 by Neil Mitchell at 2007-01-12T12:25:01+00:00 Make the max number of results 75 instead of 50, to allow map searching in the base library to work - - - - - 3ae74764 by Neil Mitchell at 2007-01-12T12:58:17+00:00 Make the search box in a form so that enter does the default search - - - - - 142103e5 by David Waern at 2007-11-12T00:03:18+00:00 Merge patch from the old branch: Fri Aug 31 13:21:45 CEST 2007 Duncan Coutts <duncan at haskell.org> * Add category: Development to .cabal file Otherwise it appears on the hackage website in the "Unclassified" category. - - - - - 22ec2ddb by David Waern at 2007-11-25T01:55:29+00:00 A a list of small improvements to the TODO file - - - - - eb0129f4 by Wolfgang Jeltsch at 2007-12-03T23:47:55+00:00 addition of type equality support (at least for HTML generation) - - - - - 816a7e22 by David Waern at 2007-12-08T15:46:26+00:00 Handle class operators correctly when rendering predicates - - - - - 68baaad2 by David Waern at 2007-12-08T16:15:54+00:00 Code layout changes - - - - - 09b77fb4 by David Waern at 2007-12-08T16:16:03+00:00 Handle infix operators correctly in the Type -> HsType translation - - - - - 31c36da2 by David Waern at 2007-12-08T16:24:27+00:00 Add ppLParendTypes/ppLParendType - - - - - b17cc818 by David Waern at 2007-12-08T16:26:12+00:00 Use ppParendType when printing types args in predicates - - - - - ffd1f2cf by David Waern at 2007-12-08T16:45:06+00:00 Fix rendering of instance heads to handle infix operators This is also a refactoring to share this code for rendering predicates. - - - - - ff886d45 by David Waern at 2007-12-08T17:27:46+00:00 Fix rendering of class operators - - - - - e2fcbb9e by David Waern at 2007-12-08T17:59:28+00:00 Fix a bug (use ppTyName instead of ppName to print names in type apps) - - - - - 79a1056e by David Waern at 2007-12-08T21:25:18+00:00 Update tests - - - - - 867741ac by David Waern at 2007-12-08T21:25:49+00:00 Give a diff on test failure - - - - - 7e5eb274 by David Waern at 2008-01-05T14:33:45+00:00 Add DrIFT commands - - - - - 3656454d by David Waern at 2008-01-05T20:26:00+00:00 Add "cabal-version: >= 1.2" to the cabal file - - - - - 77974efc by Simon Marlow at 2007-12-20T09:52:44+00:00 add an item - - - - - f6ac1708 by Simon Marlow at 2007-12-06T14:00:10+00:00 Source links must point to the original module, not the referring module - - - - - eda1d5c9 by David Waern at 2008-01-06T14:40:52+00:00 Manual merge of a patch to the 0.8 branch Thu Dec 6 15:00:10 CET 2007 Simon Marlow <simonmar at microsoft.com> * Source links must point to the original module, not the referring module - - - - - 378f4085 by David Waern at 2008-01-06T16:03:45+00:00 Change stability from stable to experimental - - - - - 8bdafe44 by David Waern at 2008-01-06T16:14:22+00:00 Add haskell.vim (it had been removed somehow) - - - - - ea34d02e by David Waern at 2008-01-06T16:36:57+00:00 Change version to 2.0.0.0 - - - - - 34631ac0 by David Waern at 2008-01-06T16:44:57+00:00 Add missing modules to the cabal file - - - - - 9e142935 by David Waern at 2008-01-06T17:25:42+00:00 Depend on ghc >= 6.8.2 && < 6.9 - - - - - 59f9eeaa by Simon Marlow at 2007-12-20T10:43:04+00:00 add build scripts - - - - - 1c29ae30 by Simon Marlow at 2007-12-20T10:47:07+00:00 update version number - - - - - fe16a3e4 by Simon Marlow at 2007-12-20T10:48:03+00:00 update version - - - - - f688530f by Simon Marlow at 2007-12-20T10:48:29+00:00 doc updates - - - - - ce71b611 by David Waern at 2008-01-07T13:46:32+00:00 Change version in docs and spec - - - - - 03ab8d6f by David Waern at 2008-01-07T13:47:38+00:00 Manually merge over changes to CHANGES for 0.9 - - - - - 39f1b042 by David Waern at 2008-01-07T15:17:41+00:00 Remove the -use-package flag, we don't support it anyway - - - - - 7274a544 by David Waern at 2008-01-07T15:33:05+00:00 Update CHANGES for 2.0.0.0 - - - - - 96594f5d by David Waern at 2008-01-07T15:46:49+00:00 Wibble - - - - - f4c5a4c4 by David Waern at 2008-01-07T15:55:36+00:00 Change url to repo in documentation - - - - - 8a4c77f0 by David Waern at 2008-01-07T16:00:54+00:00 Update CHANGES - - - - - cb3a9288 by David Waern at 2008-01-07T16:02:55+00:00 Documentation fix - - - - - d8e45539 by David Waern at 2008-01-07T16:12:00+00:00 Update docs to say that Haddock accets .lhs files and module names - - - - - 4b5ce824 by David Waern at 2008-01-07T16:12:25+00:00 Document -B option - - - - - 47274262 by David Waern at 2008-01-07T16:23:07+00:00 Update CHANGES - - - - - 7ff314a9 by David Waern at 2008-01-07T16:23:20+00:00 Remove --use-package, --package & --no-implicit.. flags from docs - - - - - 6c3819c0 by David Waern at 2008-01-07T16:23:52+00:00 Remove --no-implicit-prelide flag - - - - - 1b14ae40 by David Waern at 2008-01-07T16:32:26+00:00 Update the "Using literate or pre-processed source" section - - - - - 0117f620 by David Waern at 2008-01-07T16:41:55+00:00 Document the --optghc flag - - - - - 087ab1cf by David Waern at 2008-01-07T16:42:10+00:00 Remove the documenation section on derived instances The problem mentioned there doesn't exist in Haddock 2.0.0.0 - - - - - 7253951e by David Waern at 2008-01-07T16:48:40+00:00 Document OPTIONS_HADDOCK - - - - - 3b6bdcf6 by David Waern at 2008-01-07T16:56:54+00:00 Wibble - - - - - 3025adf9 by David Waern at 2008-01-07T17:08:14+00:00 Wibble - - - - - 5f30f1a0 by David Waern at 2008-01-07T17:15:44+00:00 Change synopsis field to description - - - - - 1673f54b by David Waern at 2008-01-07T17:18:21+00:00 Change my email address in the cabal file - - - - - 55aa9808 by David Waern at 2008-01-07T18:18:02+00:00 Add documentation for readInterfaceFile - - - - - eaea417f by David Waern at 2008-01-07T18:21:30+00:00 Export necessary stuff from Distribution.Haddock - - - - - 7ea18759 by David Waern at 2008-01-07T18:31:49+00:00 Remove dep on Cabal - - - - - 7b79c74e by David Waern at 2008-01-07T18:33:49+00:00 Remove dep on process - - - - - ce3054e6 by David Waern at 2008-01-16T23:01:21+00:00 Add feature-requsts from Henning Thielemann to TODO - - - - - 0c08f1ec by David Waern at 2008-01-16T23:03:02+00:00 Record a bug in TODO - - - - - b04605f3 by David Waern at 2008-01-23T16:59:06+00:00 Add a bug reported by Ross to TODO - - - - - 5b17c030 by David Waern at 2008-01-23T18:05:53+00:00 A a bug report to TODO - - - - - 1c993b0d by David Waern at 2008-01-25T16:30:25+00:00 Accept test output - - - - - c22fc0d0 by David Waern at 2008-01-25T16:34:49+00:00 Accept test output - - - - - 4b795811 by David Waern at 2008-01-25T16:38:37+00:00 Change Hidden.hs (test) to use OPTIONS_HADDOCK - - - - - c124dbd9 by David Waern at 2008-01-25T16:39:23+00:00 Accept test output - - - - - ec6f6eea by David Waern at 2008-01-25T16:42:08+00:00 Add Hidden.html.ref to tests - - - - - 1dc9610c by David Waern at 2008-02-02T20:50:51+00:00 Add a comment about UNPACK bug in TODO - - - - - 2d3f7081 by David Waern at 2008-02-09T22:33:24+00:00 Change the representation of DocNames Ross Paterson reported a bug where links would point to the defining module instead of the "best" module for an identifier (e.g Int pointing to GHC.Base instead of Data.Int). This patch fixes this problem by refactoring the way renamed names are represented. Instead of representing them by: > data DocName = Link Name | NoLink Name they are now represented as such: > data DocName = Documented Name Module | Undocumented Name and the the link-env looks like this: > type LinkEnv = Map Name Module There are several reasons for this. First of all, the bug was caused by changing the module part of Names during the renaming process, without changing the Unique field. This caused names to be overwritten during the loading of .haddock files (which caches names using the NameCache of the GHC session). So we might create new Uniques during renaming to fix this (but I'm not sure that would be problem-free). Instead, we just keep the Name and add the Module where the name is best documented, since it can be useful to keep the original Name around (for e.g. source-code location info and for users of the Haddock API). Also, the names Link/NoLink don't really make sense, since wether to use links or not is entirely up to the users of DocName. In the process of following this change into H.Backends.Html I removed the assumption that binder names are Undocumented (which was just an unnecessary assumption, the OccName is the only thing needed to render these). This will probably make it possible to get rid of the renamer and replace it with a traversal from SYB or Uniplate. Since DocName has changed, InterfaceFile has changed so this patch also increments the file-format version. No backwards-compatibility is implemented. - - - - - 0f28c921 by David Waern at 2008-02-09T23:00:36+00:00 H.GHC.Utils: remove unused imports/exports - - - - - 0c44cad5 by David Waern at 2008-02-10T00:28:13+00:00 H.GHC.Utils: add some functions that were removed by mistake - - - - - e3452f49 by David Waern at 2008-02-10T00:28:48+00:00 Fix some trivial warnings in H.InterfaceFile - - - - - a6d74644 by David Waern at 2008-02-10T00:48:06+00:00 Update the version message to fit in small terminals - - - - - 76c9cd3e by David Waern at 2008-02-10T14:47:39+00:00 Remove bugs from TODO that don't apply anymore since the port - - - - - 5e10e090 by David Waern at 2008-02-10T15:22:47+00:00 Remove bugs from TODO that weren't actual bugs - - - - - fef70878 by David Waern at 2008-02-10T15:23:44+00:00 Remove yet another item from TODO that was not an actual bug - - - - - e1af47b8 by David Waern at 2008-02-11T10:25:57+00:00 Bump the version number to 2.1.0 Since the exported datatype DocName has changed, we need to bump the major version number. Let's also drop the fourth version component, it's not that useful. - - - - - e3be7825 by David Waern at 2008-04-11T14:29:04+00:00 Add a bug to TODO - - - - - cb6574be by David Waern at 2008-04-11T16:00:45+00:00 Use the in-place haddock when running tests - - - - - c6d7af0d by David Waern at 2008-04-11T16:09:16+00:00 Turn off GHC warnings when running tests - - - - - 7f61b546 by David Waern at 2008-04-11T17:24:00+00:00 Add a flag for turning off all warnings - - - - - 883b8422 by David Waern at 2008-04-12T14:02:18+00:00 Fix printing of data binders - - - - - 2a0db8fc by David Waern at 2008-04-12T18:52:46+00:00 Fix missing parenthesis in constructor args bug - - - - - 1b3ac3f9 by David Waern at 2008-04-12T18:57:23+00:00 Simplify test suite and add tests I move all tests into one single directory to simplify things, and add a test for the last bug that was fixed. - - - - - 8f178376 by David Waern at 2008-04-12T19:00:15+00:00 Add a script for copying test output to "expected" output - - - - - 193e3a03 by David Waern at 2008-04-12T19:16:37+00:00 Remove two fixed bugs from TODO - - - - - ddc9130c by David Waern at 2008-04-12T19:37:06+00:00 Update test README - - - - - 956069c0 by David Waern at 2008-05-01T12:16:14+00:00 Update version number in spec and docs - - - - - 5478621c by David Waern at 2008-05-01T12:28:12+00:00 Remove claim of backwards compatibility from docs for readInterfaceFile - - - - - 4a16dea9 by David Waern at 2008-05-01T12:33:04+00:00 Update CHANGES - - - - - 804216fb by David Waern at 2008-05-01T12:43:16+00:00 Add a synopsis - - - - - fd0c84d5 by David Waern at 2008-05-01T12:44:44+00:00 Add Haddock.DocName to the cabal file - - - - - 9f4a7439 by David Waern at 2008-05-01T12:45:53+00:00 Remove -fglasgow-exts and -fasm - - - - - aee7c145 by David Waern at 2008-05-01T12:54:01+00:00 Add LANGUAGE pragmas to source files - - - - - 9a58428b by David Waern at 2008-05-01T12:54:19+00:00 Add extensions to cabal file - - - - - 494f1bee by David Waern at 2008-05-01T13:12:09+00:00 Export DocName in the API - - - - - c938196b by David Waern at 2008-05-01T13:12:19+00:00 Add hide options to some source files - - - - - 236e86af by Neil Mitchell at 2008-06-07T20:45:10+00:00 Rewrite the --hoogle flag support - - - - - 6d910950 by Neil Mitchell at 2008-06-14T10:56:50+00:00 Simplify the newtype/data outputting in Hoogle, as haddock does it automatically - - - - - f87a95a8 by Neil Mitchell at 2008-06-14T12:10:18+00:00 Add initial structure for outputting documentation as well, but does not yet output anything - - - - - 7c3bce54 by Neil Mitchell at 2008-06-14T12:27:07+00:00 Remove <document comment> from the Hoogle output - - - - - 9504a325 by Neil Mitchell at 2008-06-16T06:33:21+00:00 Default to "main" if there is no package, otherwise will clobber hoogle's hoogle info - - - - - 4a794a79 by Neil Mitchell at 2008-06-16T06:53:29+00:00 Change packageName to packageStr, as it better reflects the information stored in it - - - - - 7abc9baf by Neil Mitchell at 2008-06-16T07:09:49+00:00 Add modulePkgInfo to Haddock.GHC.Utils, which gives back package name and version info - - - - - 8ca11514 by Neil Mitchell at 2008-06-16T07:13:48+00:00 Change Hoogle to take the package name and package version separately - - - - - a6da452d by Neil Mitchell at 2008-06-18T11:29:46+00:00 In Hoogle do not list things that are not local to this module - - - - - 974b76b7 by David Waern at 2008-06-19T18:40:13+00:00 Be more consistent with GHC API naming in H.GHC.Utils - - - - - 2facb4eb by David Waern at 2008-06-19T19:03:03+00:00 Update test output - - - - - c501de72 by David Waern at 2008-06-26T20:26:49+00:00 Use ghc-paths to get the lib dir The path can still be overridden using the -B flag. It's not longer required to pass the lib dir to the program that runs the test suite. - - - - - ac4c6836 by David Waern at 2008-06-26T20:33:08+00:00 Update CHANGES - - - - - 9d21c60a by David Waern at 2008-06-26T20:34:53+00:00 Update README - - - - - 741448f0 by David Waern at 2008-06-26T21:12:57+00:00 Improve wording in the help message - - - - - b1b42b11 by David Waern at 2008-06-30T10:16:17+00:00 Rename ForeignType - - - - - 6d6c2b34 by David Waern at 2008-06-30T10:25:09+00:00 Rename TyFamily - - - - - 8d1125ed by David Waern at 2008-06-30T10:37:21+00:00 Rename type patterns - - - - - 7610a4cb by David Waern at 2008-06-30T10:45:07+00:00 Rename associated types - - - - - 8eeba14c by David Waern at 2008-06-30T10:47:41+00:00 Remove the TODO file now that we have a trac - - - - - 1af5b25b by David Waern at 2008-07-02T18:19:28+00:00 Render type family declarations (untested) - - - - - ceb99797 by David Waern at 2008-07-02T18:24:06+00:00 Remove redundant check for summary when rendering data types - - - - - b36a58e0 by David Waern at 2008-07-02T22:01:38+00:00 More support for type families and associated types Now we just need to render the instances - - - - - 78784879 by David Waern at 2008-07-07T22:13:58+00:00 Remove filtering of instances We were filtering out all instances for types with unknown names. This was probably an attempt to filter out instances for internal types. I am removing the filtering for the moment, and will try to fix this properly later. - - - - - 3e758dad by David Waern at 2008-06-30T18:50:30+00:00 Run haddock in-place during testing - - - - - d9dab0ce by David Waern at 2008-07-08T21:04:32+00:00 Remove index.html and doc-index.html from output, they should not be versioned - - - - - 3e6c4681 by David Waern at 2008-07-08T21:06:42+00:00 Update test output following change to instance filtering - - - - - e34a3f14 by David Waern at 2008-07-12T16:48:28+00:00 Stop using the map from exported names to declarations During creation of the interface, we were using two maps: one from exported names to declarations, and one from all defined names in the module to declarations. The first contained subordinate names while the second one didn't. The first map was never used to look up names not defined in the associated module, so if we add subordinate names to the second map, we could use it everywhere. That's that this patch does. This simplifies code because we don't have to pass around two maps everywhere. We now store the map from locally defined things in the interface structure instead of the one from exported names. - - - - - 2e1d2766 by David Waern at 2008-07-12T16:55:21+00:00 Get the all locally defined names from GHC API We previously had some code to compute all locally defined names in a module including subordinate names. We don't need it since we can get the names from modInfoTyThings in the GHC API. - - - - - bf637994 by David Waern at 2008-07-13T13:09:16+00:00 Refactoring in H.Interface.Create We were creating a doc map, a declaration map and a list of entities separately by going through the HsGroup. These structures were all used to build the interface of a module. Instead of doing this, we can start by creating a list of declarations from the HsGroup, then collect the docs directly from this list (instead of using the list of entities), creating a documentation map. We no longer need the Entity data type, and we can store a single map from names to declarations and docs in the interface, instead of the declaration map and the doc map. This way, there is only one place where we filter out the declarations that we don't want, and we can remove a lot of code. Another advantage of this is that we can create the exports directly out of the list of declarations when we export the full module contents. (Previously we did a look up for each name to find the declarations). This is faster and removes another point where we depend on names to identify exported declarations, which is good because it eliminates problems with instances (which don't have names). - - - - - 547e410e by David Waern at 2008-07-13T13:34:51+00:00 Remove FastString import and FSLIT macro in H.I.Create -- they were unused - - - - - 693759d1 by David Waern at 2008-07-13T13:36:23+00:00 Remove unused import from H.I.Create - - - - - cde6e7fb by David Waern at 2008-07-13T13:51:54+00:00 Small touches - - - - - 96de8f1d by David Waern at 2008-07-20T11:21:46+00:00 Preparation for rendering instances as separate declarations We want to be able to render instances as separate declarations. So we remove the Name argument of ExportDecl, since instances are nameless. This patch also contains the first steps needed to gather type family instances and display them in the backend, but the implementation is far from complete. Because of this, we don't actually show the instances yet. - - - - - b0f824fb by David Waern at 2008-07-20T15:53:08+00:00 Follow changes to ExportDecl in Hoogle - - - - - 1192eff3 by Neil Mitchell at 2008-06-26T00:28:10+00:00 Change how the Hoogle backend outputs classes, adding the context in - - - - - 7a0d1464 by Neil Mitchell at 2008-06-26T00:28:46+00:00 Remove the indent utility function from Hoogle backend - - - - - 3361241b by Neil Mitchell at 2008-06-26T09:45:09+00:00 Add support for Hoogle writing ForeignImport/ForeignExport properly - - - - - 795ad3bf by Neil Mitchell at 2008-06-26T12:15:25+00:00 Flesh out the Hoogle code to render documentation - - - - - 23277995 by Neil Mitchell at 2008-06-26T14:56:41+00:00 Fix a bug in the Hoogle backend, unordered lists were being written out <ul>...</u> - - - - - db739b27 by Neil Mitchell at 2008-06-26T15:09:54+00:00 Remove any white space around a <li> element - - - - - f2e6bb8c by Neil Mitchell at 2008-07-10T15:30:47+00:00 Remove the TODO in the Hoogle HTML generation, was already done - - - - - 693ec9a3 by Neil Mitchell at 2008-07-10T15:53:00+00:00 Put brackets round operators in more places in the Hoogle output - - - - - 842313aa by Neil Mitchell at 2008-07-10T16:01:25+00:00 Print type signatures with brackets around the name - - - - - cf93deb0 by David Waern at 2008-07-20T17:04:22+00:00 Bump version number to 2.2.0 - - - - - 30e6a8d1 by David Waern at 2008-07-20T17:04:41+00:00 Resolve conflicts in H.B.Hoogle - - - - - 1f0071c9 by David Waern at 2008-07-23T23:05:01+00:00 Add "all" command to runtests.hs that runs all tests despite failures - - - - - f2723023 by David Waern at 2008-07-23T23:08:39+00:00 Update tests/README - - - - - c0304a11 by David Waern at 2008-07-23T23:21:15+00:00 Be compatible with GHC 6.8.3 The cabal file is converted to use the "new" syntax with explicit Library and Executable sections. We define the __GHC_PATCHLEVEL__ symbol using a conditinal cpp-options field in the cabal file. (Ideally, Cabal would define the symbol for us, like it does for __GLASGOW_HASKELL__). We use these symbols to #ifdef around a small difference between 6.8.2 and 6.8.3. Previously, we only supported GHC 6.8.2 officially but the dependencies field said "ghc <= 6.9". This was just for convenience when testing against the (then compatible) HEAD version of GHC, and was left in the release by mistake. Now, we support both GHC 6.8.2 and 6.8.3 and the dependencies field correctly reflects this. - - - - - 88a5fe71 by David Waern at 2008-07-23T23:54:16+00:00 Depend on the currently available ghc-paths versions only - - - - - 8738d97b by David Waern at 2008-07-24T10:50:44+00:00 FIX haskell/haddock#44: Propagate parenthesis level when printing documented types - - - - - 05339119 by David Waern at 2008-07-24T16:06:18+00:00 Drop unnecessary parenthesis in types, put in by the user We were putting in parenthesis were the user did. Let's remove this since it just clutters up the types. The types are readable anyway since we print parens around infix operators and do not rely on fixity levels. When doing this I discovered that we were relying on user parenthesis when printin types like (a `O` b) c. This patchs fixes this problem so that parenthesis are always inserted around an infix op application in case it is applied to further arguments, or if it's an arguments to a type constructor. Tests are updated. - - - - - b3a99828 by David Waern at 2008-07-24T10:19:43+00:00 Print parenthesis around non-atomic banged types Fixes half of haskell/haddock#44 - - - - - ab5238e0 by David Waern at 2008-07-24T22:07:49+00:00 Add a reference file for the TypeFamilies test - - - - - 1941cc11 by David Waern at 2008-07-25T17:15:53+00:00 Simplify definition of pretty and trace_ppr - - - - - e3bfa33c by David Waern at 2008-07-25T17:18:27+00:00 Warning messages Output a warning when filtering out data/type instances and associated types in instances. We don't show these in the documentation yet, and we need to let the user know. - - - - - 9b85fc89 by David Waern at 2008-07-25T17:45:40+00:00 Doc: Mention Hoogle in the Introduction - - - - - afb2dd60 by David Waern at 2008-07-25T17:49:00+00:00 Doc: update -B description - - - - - 584c0c91 by David Waern at 2008-07-25T18:11:38+00:00 Doc: describe -w flag - - - - - 77619c24 by David Waern at 2008-07-28T12:29:07+00:00 Remove TODO from cabal file - - - - - 96717d5f by David Waern at 2008-07-28T12:29:27+00:00 Support type equality predicates - - - - - c2fd2330 by David Waern at 2008-07-29T19:45:14+00:00 Move unL from H.B.Hoogle to H.GHC.Utils I like Neil's shorter unL better than unLoc from the GHC API. - - - - - c4c3bf6a by David Waern at 2008-07-29T19:47:36+00:00 Do not export ATs when not in list of subitems - - - - - bf9a7b85 by David Waern at 2008-08-03T11:42:59+00:00 Filter out ForeignExports - - - - - df59fcb0 by David Waern at 2008-08-03T14:02:51+00:00 Filter out more declarations The previous refactorings in H.I.Create introduced a few bugs. Filtering of some types of declarations that we don't handle was removed. This patch fixes this. - - - - - 2f8a958b by David Waern at 2008-08-03T15:24:07+00:00 Move reL to H.GHC.Utils so we can use it everywhere - - - - - 8ec15efd by David Waern at 2008-08-03T15:25:00+00:00 Use isVanillaLSig from GHC API instead of home brewn function - - - - - 300f93a2 by David Waern at 2008-08-03T15:25:27+00:00 Filter out separately exported ATs This is a quick and dirty hack to get rid of separately exported ATs. We haven't decided how to handle them yet. No warning message is given. - - - - - 8776d1ec by David Waern at 2008-08-03T16:21:21+00:00 Filter out more declarations and keep only vanilla type sigs in classes - - - - - ea07eada by David Waern at 2008-08-03T16:48:00+00:00 Fix layout - - - - - dd5e8199 by David Waern at 2008-08-03T16:50:52+00:00 Move some utility functions from H.I.Create to H.GHC.Utils - - - - - 4a1dbd72 by David Waern at 2008-08-03T17:39:55+00:00 Do not filter out doc declarations - - - - - 0bc8dca4 by David Waern at 2008-08-03T17:47:26+00:00 Filter out separately exported ATs (take two) - - - - - af970fe8 by David Waern at 2008-08-03T22:39:17+00:00 Update CHANGES - - - - - 5436ad24 by David Waern at 2008-08-03T22:40:20+00:00 Bump version number to 2.2.1 - - - - - d66de448 by David Waern at 2008-08-05T19:00:32+00:00 Remove version restriction on ghc-paths - - - - - 534b1364 by David Waern at 2008-08-05T19:04:35+00:00 Bump version to 2.2.2 and update CHANGES - - - - - 549188ff by David Waern at 2008-08-05T19:16:49+00:00 Fix CHANGES - - - - - 0d156bb4 by Luke Plant at 2008-08-11T15:20:59+00:00 invoking haddock clarification and help - - - - - 748295cc by David Waern at 2008-08-11T18:56:37+00:00 Doc: say that the --hoogle option is functional - - - - - 43301db4 by David Waern at 2008-08-05T19:26:08+00:00 Change ghc version dependency to >= 6.8.2 - - - - - 3e5a53b6 by David Waern at 2008-08-10T22:42:05+00:00 Make H.GHC.Utils build with GHC HEAD - - - - - 7568ace0 by David Waern at 2008-08-11T19:41:54+00:00 Import Control.OldException instead of C.Exception when using ghc >= 6.9 We should really test for base version instead, but I don't currently know which version to test for. - - - - - b71ae991 by David Waern at 2008-08-12T22:40:39+00:00 Make our .haddock file version number depend on the GHC version We need to do this, since our .haddock format can potentially change whenever GHC's version changes (even when only the patchlevel changes). - - - - - 6307ce3f by David Waern at 2008-08-12T22:49:57+00:00 Remove matching on NoteTy in AttachInstances, it has been removed - - - - - 2dbcfd5f by David Waern at 2008-08-12T23:02:02+00:00 Comment out H.GHC.loadPackages - it is unused and doesn't build with ghc >= 6.9 - - - - - c74db5c2 by David Waern at 2008-08-12T23:03:58+00:00 Hide <.> from GHC import in Hoogle only for ghc <= 6.8.3 - - - - - 69a44ebb by David Waern at 2008-08-12T23:11:12+00:00 Follow changes to parseDynamic/StaticFlags - - - - - 5881f3f0 by David Waern at 2008-08-13T21:43:58+00:00 Add __GHC_PATCHLEVEL__ symbol also when building the library - - - - - 8574dc11 by David Waern at 2008-08-13T21:44:17+00:00 Follow move of package string functions from PackageConfig to Module - - - - - c9baa77f by David Waern at 2008-08-13T21:45:29+00:00 Follow extensible exceptions changes - - - - - 9092de15 by David Waern at 2008-08-13T21:46:20+00:00 Update test following Haddock version change - - - - - ebe569a4 by David Waern at 2008-08-13T21:46:54+00:00 Follow changes to parseDynamic- parseStaticFlags in GHC - - - - - b8a5ffd3 by David Waern at 2008-08-13T21:47:36+00:00 Follow changes to Binary in GHC 6.9 - - - - - edfda1cc by David Waern at 2008-08-13T21:50:17+00:00 Change ghc version dependency to >= 6.8.2 && <= 6.9 - - - - - d59be1cf by Neil Mitchell at 2008-08-12T16:02:53+00:00 Output all items, even if they are not defined in this module - ensures map comes from Prelude, not just GHC.Base - - - - - dda93b9f by Neil Mitchell at 2008-08-12T21:37:32+00:00 Add support for type synonyms to Hoogle, was accidentally missing before (woops!) - - - - - b6ee795c by Neil Mitchell at 2008-08-13T14:03:24+00:00 Generalise Hoogle.doc and add a docWith - - - - - 415e1bb2 by Neil Mitchell at 2008-08-13T14:03:46+00:00 Make Hoogle add documentation to a package - - - - - 790a1202 by Neil Mitchell at 2008-08-18T12:52:43+00:00 Use the same method to put out signatures as class methods in the Hoogle backend - - - - - ded37eba by Neil Mitchell at 2008-08-18T12:53:04+00:00 Remove Explicit top-level forall's when pretty-printing signatures - - - - - 6468c722 by Neil Mitchell at 2008-08-20T07:59:13+00:00 Simplify the code by removing not-to-important use of <.> in the Hoogle back end - - - - - 788c3a8b by Neil Mitchell at 2008-08-21T18:20:24+00:00 In the hoogle back end, markup definition lists using <i>, not <b> - - - - - 77d4b000 by Ian Lynagh at 2008-08-14T10:49:14+00:00 Add a Makefile for GHC's build system. Still won't work yet, but we're closer - - - - - 920440d7 by Ian Lynagh at 2008-08-27T18:06:46+00:00 Add haddock.wrapper - - - - - bcda925f by Ian Lynagh at 2008-08-27T18:07:02+00:00 Add a manual Cabal flag to control the ghc-paths dependency - - - - - 04d194e2 by Ian Lynagh at 2008-08-27T20:41:27+00:00 Update extensions in Cabal file Use ScopedTypeVariables instead of PatternSignatures - - - - - 12480043 by Ian Lynagh at 2008-08-27T20:41:55+00:00 Increase the upper bound on the GHC version number - - - - - b1f809a5 by Ian Lynagh at 2008-08-27T21:32:22+00:00 Fix some warnings - - - - - aea0453d by Ian Lynagh at 2008-08-28T14:22:29+00:00 Fixes for using haddock in a GHC build tree - - - - - ad23bf86 by Ian Lynagh at 2008-08-28T21:14:27+00:00 Don't use Cabal wrappers on Windows - - - - - 35858e4c by Ian Lynagh at 2008-08-29T00:07:42+00:00 Fix in-tree haddock on Windows - - - - - c2642066 by Ian Lynagh at 2008-09-03T22:35:53+00:00 follow library changes - - - - - 2eb55d50 by Ian Lynagh at 2008-09-07T18:52:51+00:00 bindist fixes - - - - - 3daa5b59 by Ian Lynagh at 2008-09-10T16:58:18+00:00 We need to tell haddock that its datasubdir is . or it can't find package.conf - - - - - 388fd8c2 by Ian Lynagh at 2008-09-10T19:47:44+00:00 Fix haddock inplace on Windows - - - - - 70a641c1 by Ian Lynagh at 2008-09-10T22:15:44+00:00 Fix installed haddock on Windows - - - - - 83c1e997 by Neil Mitchell at 2008-09-11T10:48:55+00:00 Import GHC.Paths if not IN_GHC_TREE, seems to match the use of GHC.Paths functions much better - - - - - b452519b by Ian Lynagh at 2008-09-12T12:58:24+00:00 Add a LANGUAGE ForeignFunctionInterface pragma - - - - - afbd592c by Ian Lynagh at 2008-09-12T12:59:13+00:00 Wibble imports - - - - - 547ac4ad by Ian Lynagh at 2008-09-14T15:34:22+00:00 Add a "#!/bin/sh" to haddock.wrapper - - - - - f207a807 by Ian Lynagh at 2008-09-15T10:02:32+00:00 Use "exec" when calling haddock in the wrapper - - - - - 2ee68509 by Thomas Schilling at 2008-09-15T09:09:16+00:00 Port Haddock.Interface to new GHC API. This required one bigger change: 'readInterfaceFile' used to take an optional 'Session' argument. This was used to optionally update the name cache of an existing GHC session. This does not work with the new GHC API, because an active session requires the function to return a 'GhcMonad' action, but this is not possible if no session is provided. The solution is to use an argument of functions for reading and updating the name cache and to make the function work for any monad that embeds IO, so it's result type can adapt to the calling context. While refactoring, I tried to make the code a little more self-documenting, mostly turning comments into function names. - - - - - 3bb96431 by Thomas Schilling at 2008-09-15T09:09:37+00:00 Reflect GHC API changes. - - - - - 2e60f714 by Thomas Schilling at 2008-09-15T09:10:37+00:00 Port Haddock.GHC.Typecheck to new GHC API. - - - - - 9cfd4cff by Thomas Schilling at 2008-09-15T09:11:00+00:00 Port Haddock.GHC to new GHC API. - - - - - caffa003 by Thomas Schilling at 2008-09-15T09:11:25+00:00 Port Main to new GHC API. - - - - - 069a4608 by Ian Lynagh at 2008-09-21T11:19:00+00:00 Fix paths used on Windows frmo a GHC tree: There is no whare directory - - - - - 7ceee1f7 by Ian Lynagh at 2008-09-21T12:20:16+00:00 Fix the in-tree haddock on Windows - - - - - 0d486514 by Ian Lynagh at 2008-09-23T18:06:58+00:00 Increase the GHC upper bound from 6.11 to 6.13 - - - - - f092c414 by Neil Mitchell at 2008-09-11T14:56:07+00:00 Do not wrap __ in brackets - - - - - 036bdd13 by Ian Lynagh at 2008-09-28T01:42:35+00:00 Fix building haddock when GhcProfiled=YES - - - - - 01434a89 by David Waern at 2008-09-24T20:24:21+00:00 Add PatternSignatures LANGUAGE pragma to Main and Utils - - - - - 1671a750 by David Waern at 2008-10-02T22:57:25+00:00 For source links, get original module from declaration name instead of environment. Getting it from the environment must have been a remnant from the times when we were using unqualified names (versions 0.x). - - - - - a25dde99 by David Waern at 2008-10-02T22:59:57+00:00 Remove ifaceEnv from Interface - it's no longer used - - - - - 610993da by David Waern at 2008-10-02T23:04:58+00:00 Write a comment about source links for type instance declarations - - - - - 5a96b5d5 by Thomas Schilling at 2008-10-03T10:45:08+00:00 Follow GHC API change of parseModule. - - - - - 5a943ae5 by Ian Lynagh at 2008-10-03T15:56:58+00:00 TAG 2008-10-03 - - - - - 76cdd6ae by Thomas Schilling at 2008-10-08T12:29:50+00:00 Only load modules once when typechecking with GHC. This still doesn't fix the memory leak since the typechecked source is retained and then processed separately. To fix the leak, modules must be processed directly after typechecking. - - - - - 7074d251 by David Waern at 2008-10-09T23:53:54+00:00 Interleave typechecking with interface creation At the same time, we fix a bug where the list of interfaces were processed in the wrong order, when building the links and renaming the interfaces. - - - - - 4b9b2b2d by David Waern at 2008-10-09T23:54:49+00:00 Add some strictness annotations in Interface We add some strictness annotations to the fields of Interface, so that less GHC data is hold on to during processing. - - - - - 22035628 by David Waern at 2008-10-10T20:02:31+00:00 Remove typecheckFiles and MonadUtils import from H.GHC.Typeccheck - - - - - be637ad3 by David Waern at 2008-10-10T20:33:38+00:00 Make Haddock build with GHC 6.8.2 - - - - - 523b3404 by David Waern at 2008-10-10T21:08:09+00:00 Fix documentation for createInterfaces - - - - - e1556702 by David Waern at 2008-10-10T21:26:19+00:00 Hide H.Utils in library - - - - - a8e751c3 by David Waern at 2008-10-10T21:34:59+00:00 Add back .haddock file versioning based on GHC version It was accidentally removed in the patch for GHC 6.8.2 compatibility - - - - - 06fb3c01 by David Waern at 2008-10-10T21:47:15+00:00 Bump version number to 2.3.0 - - - - - ff087fce by David Waern at 2008-10-10T22:35:49+00:00 Add support for DocPic The support for DocPic was merged into the GHC source long ago, but the support in Haddock was forgotten. Thanks Peter Gavin for submitting this fix! - - - - - 3af85bf6 by David Waern at 2008-10-10T23:34:05+00:00 Update tests - - - - - 0966873c by Simon Marlow at 2008-10-10T14:43:04+00:00 no need for handleErrMsg now, we don't throw any ErrMsgs - - - - - f1870de3 by Clemens Fruhwirth at 2008-10-10T13:29:36+00:00 Compile with wrapper but remove it for dist-install - - - - - 7b440dc2 by David Waern at 2008-10-11T14:02:25+00:00 Remove interface from LinksInfo It was there to know the documentation home module when creating a wiki link, but we already know this since we have the DocName. - - - - - e5729e6a by David Waern at 2008-10-15T20:49:18+00:00 Wibble - - - - - b2a8e01a by David Waern at 2008-10-15T21:03:36+00:00 Use type synonyms for declarations and docs in H.I.Create - - - - - be71a15b by David Waern at 2008-10-15T21:12:17+00:00 Comment out unused type family stuff completely - - - - - 91aaf075 by David Waern at 2008-10-15T21:49:04+00:00 Wibble - - - - - 42ba4eb4 by David Waern at 2008-10-15T21:53:53+00:00 Move convenient type synonym to H.Types - - - - - db11b723 by David Waern at 2008-10-15T22:14:07+00:00 Add DeclInfo to H.Types - - - - - 193552b6 by David Waern at 2008-10-15T22:15:01+00:00 Add subordinates with docs to the declaration map The only place in the code where we want the subordinates for a declaration is right after having looked up the declaration in the map. And since we include subordinates in the map, we might as well take the opportunity to store those subordinates that belong to a particular declaration together with that declaration. We also store the documentation for each subordinate. - - - - - 31e6eebc by David Waern at 2008-10-16T17:18:47+00:00 Wibble - - - - - 0dcbd79f by David Waern at 2008-10-16T20:58:42+00:00 Fix haskell/haddock#61 We were not getting docs for re-exported class methods. This was because we were looking up the docs in a map made from the declarations in the current module being rendered. Obviously, re-exported class methods come from another module. Class methods and ATs were the only thing we were looking up using the doc map, everything else we found in the ExporItems. So now I've put subordinate docs in the ExportItem's directly, to make things a bit more consistent. To do this, I added subordinates to the the declarations in the declaration map. This was easy since we were computing subordinates anyway, to store stand-alone in the map. I added a new type synonym 'DeclInfo', which is what we call what is now stored in the map. This little refactoring removes duplicate code to retrieve subordinates and documentation from the HsGroup. - - - - - de47f20a by David Waern at 2008-10-16T22:06:35+00:00 Document function and improve its layout - - - - - e74e625a by Thomas Schilling at 2008-10-20T11:12:57+00:00 Force interface more aggressively. For running Haddock on GHC this reduces memory usage by about 50 MB on a 32 bit system. A heap profile shows total memory usage peak at about 100 MB, but actual usage is at around 300 MB even with compacting GC (+RTS -c). - - - - - b63ac9a1 by David Waern at 2008-10-20T20:25:50+00:00 Make renamer consistent Instead of explicitly making some binders Undocumented, treat all names the same way (that is, try to find a Documented name). - - - - - f6de0bb0 by Ian Lynagh at 2008-09-19T00:54:43+00:00 TAG GHC 6.10 fork - - - - - 74599cd0 by David Waern at 2008-10-20T21:13:24+00:00 Do not save hidden modules in the .haddock file We were saving interfaces of all processed modules including those hidden using {-# OPTIONS_HADDOCK hide #-} in the .haddock file. This caused broken links when generating the index for the libraries that come with GHC. This patch excludes modules with hidden documentation when writing .haddock files. It should fix the above problem. - - - - - 7b6742e9 by David Waern at 2008-10-21T19:54:52+00:00 Do not save hidden modules in the .haddock file (also for ghc >= 6.9) When writing the first patch, I forgot to do the fix in both branches of an #if macro. - - - - - b99b1951 by David Waern at 2008-10-22T20:04:18+00:00 Remove subordinate map and its usage It is not needed now that we store subordinate names in the DeclInfo map. - - - - - da97cddc by David Waern at 2008-10-22T20:11:46+00:00 Tidy up code in H.I.Create a little Remove commented out half-done type instance support, and remove DeclWithDoc synonym. - - - - - 6afa76f3 by David Waern at 2008-10-22T21:17:29+00:00 Fix warnings in H.GHC.Utils - - - - - 171ea1e8 by David Waern at 2008-10-22T21:35:04+00:00 Fix warnings in H.Utils - - - - - c8cb3b91 by David Waern at 2008-10-22T21:36:49+00:00 Wibble - - - - - 767fa06a by David Waern at 2008-10-27T19:59:04+00:00 Make named doc comments into ExportDoc instead of ExportDecl Fixes a crash when processing modules without export lists containing named docs. - - - - - e638bbc6 by David Waern at 2008-11-02T22:21:10+00:00 Add HCAR entry - - - - - 92b4ffcf by David Waern at 2008-11-02T22:44:19+00:00 Update CHANGES - - - - - 84d4da6e by David Waern at 2008-11-03T11:25:04+00:00 Add failing test for template haskell crash - - - - - 2a9cd2b1 by David Waern at 2008-11-04T21:13:44+00:00 Add tests/TH.hs - - - - - 8a59348e by David Waern at 2008-11-04T21:30:26+00:00 TAG 2.3.0 - - - - - 54f70d31 by Thomas Schilling at 2008-10-24T17:04:08+00:00 Enable framed view of the HTML documentation. This patch introduces: - A page that displays the documentation in a framed view. The left side will show a full module index. Clicking a module name will show it in the right frame. If Javascript is enabled, the left side is split again to show the modules at the top and a very short synopsis for the module currently displayed on the right. - Code to generate the mini-synopsis for each module and the mini module index ("index-frames.html"). - CSS rules for the mini-synopsis. - A very small amount of javascript to update the mini-synopsis (but only if inside a frame.) Some perhaps controversial things: - Sharing code was very difficult, so there is a small amount of code duplication. - The amount of generated pages has been doubled, since every module now also gets a mini-synopsis. The overhead should not be too much, but I haven't checked. Alternatively, the mini-synopsis could also be generated using Javascript if we properly annotate the actual synopsis. - - - - - 5d7ea5a6 by David Waern at 2008-11-04T23:20:17+00:00 Follow change to ExportDecl in frames code - - - - - 60e16308 by David Waern at 2008-11-04T23:35:26+00:00 Update CHANGES - - - - - d63fd26d by David Waern at 2008-11-04T23:37:43+00:00 Bump version number - - - - - c1660c39 by David Waern at 2008-11-04T23:44:46+00:00 Update CHANGES - - - - - 995ab384 by David Waern at 2008-11-04T23:55:21+00:00 Remove .ref files from tests/output/ - - - - - 1abbbe75 by David Waern at 2008-11-04T23:57:41+00:00 Output version info before running tests - - - - - 649b182f by David Waern at 2008-11-05T22:45:37+00:00 Add ANNOUNCE message - - - - - c36ae0bb by David Waern at 2008-11-05T23:15:35+00:00 Update ANNOUNCE - - - - - 9c4f3d40 by David Waern at 2008-11-05T23:18:30+00:00 Wibble - - - - - 5aac87ce by David Waern at 2008-11-06T21:07:48+00:00 Depend on base 4.* when using GHC >= 6.9, otherwise 3.* - - - - - b9796a74 by David Waern at 2008-11-06T21:13:40+00:00 Bump version to 2.4.1 and update CHANGES - - - - - d4b26baa by David Waern at 2008-11-06T21:26:33+00:00 Depend on base 4.0.* instead of 4.* - - - - - 2cb0903c by David Waern at 2008-11-06T21:46:53+00:00 Fix warnings in H.B.HH and H.B.HH2 - - - - - e568e89a by David Waern at 2008-11-06T21:47:12+00:00 Fix warnings in Haddock.ModuleTree - - - - - 9dc14fbd by David Waern at 2008-11-06T21:47:52+00:00 Fix warnings in Haddock.Version - - - - - 02ac197c by David Waern at 2008-11-06T21:51:31+00:00 Fix warnings in H.InterfaceFile and H.Options - - - - - 63e7439a by David Waern at 2008-11-06T21:59:45+00:00 Fix warnings in H.GHC.Typecheck - - - - - 4bca5b68 by David Waern at 2008-11-08T13:43:42+00:00 Set HscTarget to HscNothing instead of HscAsm There used to be a bug in the GHC API that prevented us from setting this value. - - - - - 07357aec by David Waern at 2008-11-09T22:27:00+00:00 Re-export NameCache and friends from Distribution.Haddock - - - - - ea554b5a by David Waern at 2008-11-09T23:14:10+00:00 Add Haddock.GHC.Utils to other-modules in library - - - - - 74aecfd7 by David Waern at 2008-11-10T01:18:57+00:00 Export DocName in the library - - - - - 241a58b3 by David Waern at 2008-11-10T01:19:18+00:00 Document the functions in H.DocName - - - - - edc2ef1b by David Waern at 2008-11-10T01:20:52+00:00 Export H.DocName in the library - - - - - 4f588d55 by David Waern at 2008-11-10T01:29:14+00:00 Make DocName an instance of NamedThing - - - - - b4647244 by David Waern at 2008-11-15T22:58:18+00:00 Reflect version bump in test suite - - - - - 4bee8ce2 by David Waern at 2008-11-15T22:58:45+00:00 Update tests For unknown reasons, test output for Bug1 and Test has changed for the better. - - - - - 1690e2f9 by David Waern at 2008-11-15T22:59:33+00:00 Store hidden modules in .haddock files We store documentation for an entity in the 'InstalledInterface' of the definition site module, and never in the same structure for a module which re-exports the entity. So when a client of the Haddock library wants to look up some documentation, he/she might need to access a hidden module. But we currently don't store hidden modules in the .haddock files. So we add the hidden modules and the Haddock options to the .haddock files. The options will be used to filter the module list to obtain the visible modules only, which is necessary for generating the contents and index for installed packages. - - - - - 8add6435 by David Waern at 2008-11-16T14:35:50+00:00 Bump major version number due to .haddock file format change - - - - - 48bfcf82 by David Waern at 2008-11-23T14:32:52+00:00 Update tests to account for version number bump - - - - - 0bbd1738 by David Waern at 2008-11-23T14:33:31+00:00 HADDOCK_DATA_DIR changed to haddock_datadir - - - - - 5088b78c by David Waern at 2008-11-23T17:13:21+00:00 FIX haskell/haddock#45: generate two anchors for each name We generate two anchor tags for each name, one where we don't escape the name and one where we URI-encode it. This is for compatibility between IE and Opera. Test output is updated. - - - - - 5ee5ca3b by Neil Mitchell at 2008-11-27T14:38:11+00:00 Drop HsDocTy annotations, they mess up pretty printing and also have a bracketing bug (#2584) - - - - - 51c014e9 by Roman Cheplyaka at 2008-11-27T22:27:36+00:00 Allow referring to a specific section within a module in a module link Fixes haskell/haddock#65 - - - - - 4094bdc5 by David Waern at 2008-11-28T21:13:33+00:00 Update tests following anchor change - - - - - f89552dd by Thomas Schilling at 2008-11-29T16:16:20+00:00 Haddock really shouldn't try to overwrite files. - - - - - 98127499 by David Waern at 2008-12-07T14:09:15+00:00 Solve conflict - - - - - 319356c5 by David Waern at 2008-10-22T21:16:55+00:00 Add -Wall -Werror to ghc-options - - - - - 3c4968c9 by David Waern at 2008-11-04T23:38:56+00:00 TAG 2.4.0 - - - - - 4b21e003 by David Waern at 2008-11-06T21:14:04+00:00 TAG 2.4.1 - - - - - 8e0cad5c by David Waern at 2008-12-07T14:12:54+00:00 Remove -Werror - - - - - 299d6deb by David Waern at 2008-12-07T14:25:18+00:00 Remove -Wall, we'll focus on warnings after 6.10.2 is out - - - - - 5f4216b6 by David Waern at 2008-12-07T20:58:05+00:00 Resolve conflict properly - - - - - 67d774e7 by Neil Mitchell at 2008-12-15T11:44:26+00:00 Make forall's in constructors explicit, i.e. data Foo = Foo {foo :: Eq a => a} - - - - - 61851792 by Neil Mitchell at 2008-12-18T15:39:39+00:00 Try and find a better package name than "main" for Hoogle, goes wrong when working on an executable rather than a library - - - - - 2fab8554 by David Waern at 2008-12-08T23:19:48+00:00 Make visible names from ExportItems Instead of a complicated calculation of visible names out of GHC's export items, we can get them straight out of the already calculated ExportItems. The ExportItems should represent exactly those items that are visible in an interface. If store all the exported sub-names in ExportDecl instead of only those with documentation, the calculation becomes very simple. So we do this change as well (should perhaps have been a separate patch). This should fix the problem with names from ghc-prim not appearing in the link environment. - - - - - 7caadd8c by Ian Lynagh at 2008-12-11T17:01:04+00:00 Wrap the GHC usage with defaultCleanupHandler This fixes a bug where haddock leaves /tmp/ghc* directories uncleaned. - - - - - 7c9fc9a5 by David Waern at 2009-01-02T21:38:27+00:00 Show re-exported names from external packages again This fixes GHC ticket 2746. In order to also link to the exported subordinate names of a declaration, we need to re-introduce the sub map in the .haddock files. - - - - - 119e4e05 by David Waern at 2009-01-06T23:34:17+00:00 Do not process boot modules We should of course not try to produce documentation for boot modules! The reason this has worked in the past is that the output of "real" modules overwrites the output of boot modules later in the process. However, this causes a subtle link environment problem. So let's get rid of this stupid behaviour. We avoid processing boot modules, but we continue to typecheck them. - - - - - c285b9d2 by David Waern at 2009-01-08T18:03:36+00:00 Export modules also when coming from external packages This seems to have regressed since a refactoring that was part of the 2.3.0 release. - - - - - 24031c17 by David Waern at 2009-01-10T15:26:26+00:00 Change version to 2.4.2 - no need to go to 2.5.0 - - - - - 864d1c3f by David Waern at 2009-01-10T15:35:20+00:00 Update tests to account for version number change - - - - - 524ba886 by David Waern at 2009-01-10T18:29:17+00:00 Add test for Template Haskell splicing - - - - - 05e6e003 by David Waern at 2009-01-10T19:35:42+00:00 Fix Trac haskell/haddock#68: Turn on compilation via C for Template Haskell packages We can't use HscNothing if we need to run code coming from modules inside the processed package during typechecking, which is the case for some packages using Template Haskell. This could be improved, to e.g. use HscInterpreted and HscNothing where possible, instead of using HscC for all modules in the package. - - - - - 2b2bafa1 by David Waern at 2009-01-10T20:22:25+00:00 Only use needsTemplateHaskell when compiling with GHC 6.10.2 or above - - - - - bedc3a93 by Ian Lynagh at 2009-01-11T14:58:41+00:00 Fix the location of INPLACE_PKG_CONF; fixes the build Spotted by Conal Elliott - - - - - 943107c8 by David Waern at 2009-01-20T19:27:39+00:00 Document H.I.Create.collectDocs better - - - - - c6252e37 by David Waern at 2009-01-20T19:29:51+00:00 Fix Trac haskell/haddock#59: TH-generated declarations disappearing This patch was contributed by Joachim Breitner (nomeata). - - - - - 3568a6af by David Waern at 2009-01-21T21:41:48+00:00 Do not indicate that a constructor argument is unboxed We only show the strictness annotation for an unboxed constructor argument. The fact that it is unboxed is an implementation detail and should not be part of the module interface. - - - - - 562a4523 by David Waern at 2009-01-22T18:53:49+00:00 Fix Trac haskell/haddock#50: do not attach docs to pragmas or other kinds of non-declarations We now filter out everything that is not a proper Haskell declaration before collecting the docs and attaching them to declarations. - - - - - 6fdf21c2 by David Waern at 2009-01-22T19:48:09+00:00 Add test for quasi quotation. No reference output yet. - - - - - dc4100fd by David Waern at 2009-01-22T19:57:47+00:00 Improve quasi-quotation test and add reference output - - - - - 908b74bb by David Waern at 2009-01-23T23:22:03+00:00 Filter out separately exported associated types in a smarter way - - - - - f6b42ecb by David Waern at 2009-01-24T16:54:39+00:00 Correct spelling mistake in error message - - - - - 24e4245d by David Waern at 2009-01-24T17:48:03+00:00 Correct comment - - - - - b5e8462f by David Waern at 2009-02-07T13:22:29+00:00 Do not show a subordinate at the top level if its parent is also exported See note in the source code for more info. - - - - - 4b09de57 by David Waern at 2009-02-07T13:53:53+00:00 Update test following change to top level subordinates - - - - - 76379896 by David Waern at 2009-02-07T13:58:04+00:00 Remove html files in the tests/output/ directory which have been accidentally added - - - - - 1a6d8b10 by Joachim Breitner at 2009-02-20T10:29:43+00:00 Typo in comment - - - - - fec367d0 by David Waern at 2009-02-24T20:21:17+00:00 Fix small bug The rule is to prefer type constructors to other things when an identifier in a doc string can refer to multiple things. This stopped working with newer GHC versions (due to a tiny change in the GHC renamer). We implement this rule in the HTML backend for now, instead of fixing it in GHC, since we will move renaming of doc strings to Haddock in the future anyway. - - - - - 9b4172eb by David Waern at 2009-02-25T20:04:38+00:00 Fix bad error handling with newer GHCs When support for GHC 6.10 was added, an error handler was installed only around the typechecking phase. This had the effect that errors thrown during dependency chasing were caught in the top-level exception handler and not printed with enough detail. With this patch we wrap the error handler around all our usage of the Ghc monad. - - - - - de2df363 by Simon Peyton Jones at 2009-02-02T16:47:42+00:00 Hide funTyConName, now exported by TypeRep - - - - - 4d40a29f by Ian Lynagh at 2009-02-12T18:57:49+00:00 Don't build the library when building in the GHC tree - - - - - 1cd0abe4 by Ian Lynagh at 2009-02-13T13:58:53+00:00 Add a ghc.mk - - - - - 3d814eeb by Ian Lynagh at 2009-02-13T18:50:28+00:00 do .depend generation for haddock with the stage1 compiler This is a bit of a hack. We mkdepend with stage1 as if .depend depends on the stage2 compiler then make goes wrong: haddock's .depend gets included, which means that make won't reload until it's built, but we can't build it without the stage2 compiler. We therefore build the stage2 compiler before its .depend file is available, and so compilation fails. - - - - - b55036a4 by Ian Lynagh at 2009-02-25T01:38:13+00:00 Give haddock a wrapper on unix in the new GHC build system - - - - - 9eabfe68 by Ian Lynagh at 2009-02-25T19:21:32+00:00 Create inplace/lib/html in the new GHC build system - - - - - 93af30c7 by Ian Lynagh at 2008-11-07T19:18:23+00:00 TAG GHC 6.10.1 release - - - - - 06e6e34a by Thomas Schilling at 2009-02-24T18:11:00+00:00 Define __GHC_PATCHLEVEL__ for recent version of GHC (stable). - - - - - 680e6ed8 by Thomas Schilling at 2009-02-24T18:12:26+00:00 'needsTemplateHaskell' is not defined in current stable GHC. - - - - - 6c5619df by David Waern at 2009-02-25T22:15:23+00:00 Hide fynTyConName only for recent GHC versions - - - - - 6b2344f1 by Ian Lynagh at 2009-02-26T00:49:56+00:00 Add the module to one of haddocks warnings - - - - - e5d11c70 by David Waern at 2009-02-27T21:37:20+00:00 Bug fix We tried to filter out subordinates that were already exported through their parent. This didn't work properly since we were in some cases looking at the grand-parent and not the parent. We now properly compute all the parent-child relations of a declaration, and use this information to get the parent of a subordinate. We also didn't consider record fields with multiple parents. This is now handled correctly. We don't currently support separately exported associated types. But when we do, they should be handled correctly by this process too. Also slightly improved the warning message that we give when filtering out subordinates. - - - - - 10a79a60 by David Waern at 2009-02-27T22:08:08+00:00 Fix error message conflict The module name is already written in the beginning of the message, as seems to be the convention in Haddock. Perhaps not so clear, but we should change it everywhere in that case. Leaving it as it is for now. - - - - - c5055c7f by David Waern at 2009-02-27T22:15:17+00:00 Shorten warning message - - - - - a72fed3a by David Waern at 2009-02-28T00:53:55+00:00 Do not show package name in warning message - - - - - a5daccb2 by Ian Lynagh at 2009-03-01T14:59:35+00:00 Install haddock in the new GHC build system - - - - - dfdb025c by Ian Lynagh at 2009-03-07T23:56:29+00:00 Relax base dependency to < 4.2, not < 4.1 - - - - - 5769c8b4 by David Waern at 2009-03-21T14:58:52+00:00 Bump .haddock file version number (due to change of format) - - - - - f1b8f67b by David Waern at 2009-03-21T14:59:26+00:00 Define __GHC_PATCHLEVEL__=1 when using ghc-6.10.1 - - - - - 23f78831 by David Waern at 2009-03-21T16:40:52+00:00 Update CHANGES - - - - - 7d2735e9 by David Waern at 2009-03-21T16:50:33+00:00 Update ANNOUNCE - - - - - 0771e00a by David Waern at 2009-03-21T16:54:40+00:00 Update ANNOUNCE, again - - - - - 81a6942a by David Waern at 2009-03-21T17:50:06+00:00 Don't be too verbose in CHANGES - - - - - 29861dcf by David Waern at 2009-03-21T18:03:31+00:00 TAG 2.4.2 - - - - - a585f285 by David Waern at 2009-03-21T19:20:29+00:00 Require Cabal >= 1.2.3 - - - - - 7c611662 by David Waern at 2009-03-21T19:21:48+00:00 TAG 2.4.2 with cabal-version >= 1.2.3 - - - - - 23b7deff by Simon Marlow at 2009-03-20T15:43:42+00:00 new GHC build system: use shell-wrappers macro - - - - - 25f8afe7 by Ian Lynagh at 2009-03-21T19:13:53+00:00 Fix (with a hack?) haddock in teh new build system - - - - - 6a29a37e by David Waern at 2009-03-24T22:10:15+00:00 Remove unnecessary LANGUAGE pragma - - - - - 954da57d by David Waern at 2009-03-24T22:21:23+00:00 Fix warnings in H.B.DevHelp - - - - - 1619f1df by David Waern at 2009-03-26T23:20:44+00:00 -Wall police in H.B.Html - - - - - b211e13b by Simon Marlow at 2009-03-24T13:00:56+00:00 install Haddock's html stuff - - - - - 78e0b107 by David Waern at 2008-12-07T19:58:53+00:00 Add verbosity flag and utils, remove "verbose" flag - - - - - 913dae06 by David Waern at 2008-12-07T20:01:05+00:00 Add some basic "verbose" mode logging in H.Interface - - - - - 1cbff3bf by David Waern at 2009-03-27T00:07:26+00:00 Fix conflicts - - - - - 22f82032 by David Waern at 2009-03-27T21:15:11+00:00 Remove H.GHC.Typecheck - - - - - 81557804 by David Waern at 2009-03-27T21:19:22+00:00 Remove docNameOrig and use getName everywhere instead - - - - - d8267213 by David Waern at 2009-03-27T21:21:46+00:00 Use docNameOcc instead of nameOccName . getName - - - - - 5d55deab by David Waern at 2009-03-27T21:33:04+00:00 Remove H.DocName and put DocName in H.Types - - - - - 8ba72611 by David Waern at 2009-03-27T22:06:26+00:00 Document DocName - - - - - 605f8ca5 by David Waern at 2009-03-27T22:45:21+00:00 -Wall police - - - - - e4da93ae by David Waern at 2009-03-27T23:12:53+00:00 -Wall police in H.B.Hoogle - - - - - bb255519 by David Waern at 2009-03-27T23:41:28+00:00 Define Foldable and Traversable instances for Located - - - - - f1195cfe by David Waern at 2009-03-27T23:51:34+00:00 Wibble - - - - - 23818d7c by David Waern at 2009-03-28T00:03:55+00:00 -Wall police in H.I.Rename - - - - - 0f050d67 by David Waern at 2009-03-28T00:15:15+00:00 -Wall police in H.I.AttachInstances - - - - - 0f3fe038 by David Waern at 2009-03-28T21:09:41+00:00 Wibble - - - - - 275d4865 by David Waern at 2009-03-28T21:27:06+00:00 Layout fix - - - - - 54ff0ef8 by David Waern at 2009-03-28T21:59:07+00:00 -Wall police in H.I.Create - - - - - 7f58b117 by David Waern at 2009-03-28T22:10:19+00:00 -Wall police in H.Interface - - - - - f0c03b44 by David Waern at 2009-03-28T22:22:59+00:00 -Wall police in Main - - - - - 29da355c by David Waern at 2009-03-28T22:23:39+00:00 Turn on -Wall -Werror - - - - - 446d3060 by David Waern at 2009-04-01T20:40:30+00:00 hlint police - - - - - 3867c9fc by David Waern at 2009-04-01T20:48:42+00:00 hlint police - - - - - bd1f1600 by David Waern at 2009-04-01T20:58:02+00:00 hlint police - - - - - e0e90866 by David Waern at 2009-04-05T12:42:53+00:00 Move H.GHC.Utils to H.GhcUtils - - - - - 9cbd426b by David Waern at 2009-04-05T12:57:21+00:00 Remove Haddock.GHC and move its (small) contents to Main - - - - - b5c2cbfd by David Waern at 2009-04-05T13:07:04+00:00 Fix whitespace and stylistic issues in Main - - - - - 3c04aa56 by porges at 2008-12-07T08:22:19+00:00 add unicode output - - - - - 607918da by David Waern at 2009-04-26T15:09:43+00:00 Resolve conflict - - - - - 4bec6b6b by Simon Marlow at 2009-05-13T10:00:31+00:00 fix markup - - - - - 436ad6f4 by Simon Marlow at 2009-03-23T11:54:45+00:00 clean up - - - - - bdcd1398 by Simon Marlow at 2009-03-24T10:36:45+00:00 new GHC build system: add $(exeext) - - - - - 9c0972f3 by Simon Marlow at 2009-03-24T11:04:31+00:00 update for new GHC build system layout - - - - - d0f3f83a by Ian Lynagh at 2009-03-29T15:31:43+00:00 GHC new build system fixes - - - - - 5a8245c2 by Ian Lynagh at 2009-04-04T20:44:23+00:00 Tweak new build system - - - - - 9c6f2d7b by Simon Marlow at 2009-05-13T10:01:27+00:00 add build instructions for GHC - - - - - 66d07c76 by Ian Lynagh at 2009-05-31T00:37:53+00:00 Quote program paths in ghc.mk - - - - - bb7de2cd by Ian Lynagh at 2009-06-03T22:57:55+00:00 Use a bang pattern on an unlifted binding - - - - - 3ad283fc by Ian Lynagh at 2009-06-13T16:17:50+00:00 Include haddock in GHC bindists - - - - - ac447ff4 by David Waern at 2009-06-24T21:07:50+00:00 Delete Haddock.Exception and move contents to Haddock.Types Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types. - - - - - 4464fb9b by David Waern at 2009-06-24T22:23:23+00:00 Add Haddock module headers Add a proper Haddock module header to each module, with a more finegrained copyright. If you feel mis-accreditted, please correct any copyright notice! The maintainer field is set to haddock at projects.haskell.org. Next step is to add a brief description to each module. - - - - - 5f4c95dd by David Waern at 2009-06-24T22:39:44+00:00 Fix spelling error - - - - - 6d074cdb by David Waern at 2009-06-25T21:53:56+00:00 Document Interface and InstalledInterface better - - - - - d0cbd183 by David Waern at 2009-06-27T12:46:46+00:00 Remove misplaced whitespace in H.I.Rename - - - - - fa381c49 by David Waern at 2009-06-27T13:26:03+00:00 Fix haskell/haddock#104 - create output directory if missing - - - - - 91fb77ae by Ian Lynagh at 2009-06-25T15:59:50+00:00 TAG 2009-06-25 - - - - - 0d853f40 by Simon Peyton Jones at 2009-07-02T15:35:22+00:00 Follow extra field in ConDecl - - - - - b201735d by Ian Lynagh at 2009-07-05T16:50:35+00:00 Update Makefile for the new GHC build system - - - - - df6c0092 by Ian Lynagh at 2009-07-05T17:01:13+00:00 Resolve conflicts - - - - - 1066870a by Ian Lynagh at 2009-07-05T17:01:48+00:00 Remove the -Wwarn hack in the GHC build system - - - - - 7e856076 by Ian Lynagh at 2009-07-05T17:17:59+00:00 Fix warnings - - - - - 5d4cd958 by Ian Lynagh at 2009-07-05T19:35:40+00:00 Bump version number Cabal needs to distinguish between haddocks having a --verbose and --verbosity flag - - - - - 6ee07c99 by David Waern at 2009-07-06T20:14:57+00:00 Wibble - - - - - 2308b66f by David Waern at 2009-07-06T20:24:20+00:00 Clearer printing of versions by runtests.hs - - - - - d4b5d9ab by David Waern at 2009-07-06T21:22:42+00:00 Fix (invisible) bug introduced by unicode patch - - - - - 2caca8d8 by David Waern at 2009-07-06T21:44:10+00:00 Use HscAsm instead of HscC when using TH - - - - - 18f3b755 by David Waern at 2009-07-06T22:10:22+00:00 Update HCAR entry (by Janis) - - - - - a72ac9db by David Waern at 2009-07-06T23:01:35+00:00 Follow HsRecTy change with an #if __GLASGOW_HASKEL__ >= 611 - - - - - 549135d2 by David Waern at 2009-07-06T23:11:41+00:00 Remove unused functions from Haddock.Utils - - - - - b450134a by Isaac Dupree at 2009-07-11T14:59:00+00:00 revert to split-index for large indices - remove the search-box, because browsers have search-for-text abilities anyway. - pick 150 items in index as the arbitrary time at which to split it - notice the bug that identifiers starting with non-ASCII characters won't be listed in split-index, but don't bother to fix it yet (see ticket haskell/haddock#116, http://trac.haskell.org/haddock/ticket/116 ) - - - - - 78a5661e by Isaac Dupree at 2009-07-20T15:37:18+00:00 Implement GADT records in HTML backend - - - - - 4e163555 by Isaac Dupree at 2009-07-21T22:03:25+00:00 add test for GADT records - - - - - 79aa4d6e by David Waern at 2009-07-23T20:40:37+00:00 Update test suite following version bump - - - - - 5932c011 by David Waern at 2009-08-02T10:25:39+00:00 Fix documentation bug - - - - - a6970fca by David Waern at 2009-08-12T23:08:53+00:00 Remove support for ghc 6.8.* from .cabal file - - - - - c1695902 by Ian Lynagh at 2009-07-07T13:35:45+00:00 Fix unused import warnings - - - - - fb6df7f9 by Ian Lynagh at 2009-07-16T00:20:31+00:00 Use cProjectVersion directly rather than going through compilerInfo Fixes the build after changes in GHC - - - - - 548cdd66 by Simon Marlow at 2009-07-28T14:27:04+00:00 follow changes in GHC's ForeignType - - - - - 9395aaa0 by David Waern at 2009-08-13T22:17:33+00:00 Switch from PatternSignatures to ScopedTypeVariables in Main - - - - - eebf39bd by David Waern at 2009-08-14T17:14:28+00:00 Version .haddock files made with GHC 6.10.3/4 correclty - - - - - 58f3e735 by David Waern at 2009-08-14T17:19:37+00:00 Support GHC 6.10.* and 6.11.* only - - - - - 5f63cecc by David Waern at 2009-08-14T22:03:20+00:00 Do not version .haddock file based on GHC patchlevel version We require that the instances of Binary that we use from GHC will not change between patchlevel versions. - - - - - d519de9f by David Waern at 2009-08-14T23:50:00+00:00 Update CHANGES - - - - - 35dccf5c by David Waern at 2009-08-14T23:51:38+00:00 Update version number everywhere - - - - - 6d363fea by David Waern at 2009-08-15T09:46:49+00:00 Update ANNOUNCE - - - - - c7ee6bc2 by David Waern at 2009-08-15T09:47:13+00:00 Remove -Werror Forgot that Hackage doesn't like it. - - - - - a125c12b by David Waern at 2009-08-15T09:49:50+00:00 Require Cabal >= 1.6 - - - - - adb2f560 by Isaac Dupree at 2009-08-12T03:47:14+00:00 Cross-Package Documentation version 4 - - - - - 3d6dc04d by David Waern at 2009-08-15T23:42:57+00:00 Put all the IN_GHC_TREE stuff inside getGhcLibDir - - - - - 56624097 by David Waern at 2009-08-15T23:52:03+00:00 Add --print-ghc-libdir - - - - - f15d3ccb by David Waern at 2009-08-16T00:37:52+00:00 Read base.haddock when running tests We can now test cross-package docs. - - - - - 283f0fb9 by David Waern at 2009-08-16T00:50:59+00:00 Update test output - we now have more links - - - - - 673d1004 by David Waern at 2009-08-16T01:26:08+00:00 Read process.haddock when running tests - - - - - 0d127f82 by David Waern at 2009-08-16T01:43:04+00:00 Add a test for cross-package documentation - - - - - f94db967 by Ian Lynagh at 2009-08-16T18:42:44+00:00 Follow GHC build system changes - - - - - 5151278a by Isaac Dupree at 2009-08-16T19:58:05+00:00 make cross-package list types look nicer - - - - - c41e8228 by Isaac Dupree at 2009-08-18T01:47:47+00:00 Haddock.Convert: export more functions This lets us remove some code in Haddock.Interface.AttachInstances - - - - - 2e5fa398 by Isaac Dupree at 2009-08-18T02:11:05+00:00 switch AttachInstances to use synify code It changed an instance from showing ((,) a b) to (a, b) because my synify code is more sophisticated; I hope the latter is a good thing rather than a bad thing aesthetically, here. But this definitely reduces code duplication! - - - - - b8b07123 by Isaac Dupree at 2009-08-18T02:23:31+00:00 Find instances using GHC, which is more complete. In particular, it works cross-package. An intermediate patch also moved the instance-finding into createInterface, but that move turned out not to be necessary, so if we want to do that, it'd go in a separate patch. (Is that possible? Or will we need GHC to have loaded all the modules first, before we can go searching for the instances (e.g. if the modules are recursive or something)?) - - - - - 6959b451 by Isaac Dupree at 2009-08-17T00:37:18+00:00 fix preprocessor conditional sense - - - - - 942823af by Isaac Dupree at 2009-08-16T22:46:48+00:00 remove ghc 6.8 conditionals from Haddock.Interface - - - - - 4b3ad888 by Isaac Dupree at 2009-08-18T20:24:38+00:00 Fix GHC 6.11 build in Haddock.Convert - - - - - 0a89c5ab by Isaac Dupree at 2009-08-23T00:08:58+00:00 hacks to make it compile without fnArgDocsn - - - - - 7b3bed43 by Isaac Dupree at 2009-08-23T03:01:28+00:00 less big-Map-based proper extraction of constructor subdocs - - - - - b21c279a by Isaac Dupree at 2009-08-23T03:02:06+00:00 Html: remove unnecessary+troublesome GHC. qualifications - - - - - 96c97115 by Isaac Dupree at 2009-08-23T03:08:03+00:00 Move doc parsing/lexing into Haddock for ghc>=6.11 - - - - - e1cec02d by Isaac Dupree at 2009-08-23T05:08:14+00:00 get rid of unused DocMap parameter in Html - - - - - 66960c59 by Isaac Dupree at 2009-08-23T05:54:20+00:00 fix horrible named-docs-disappearing bug :-) - - - - - a9d7eff3 by Isaac Dupree at 2009-08-23T06:26:36+00:00 re-implement function-argument docs ..on top of the lexParseRn work. This patch doesn't change the InstalledInterface format, and thus, it does not work cross-package, but that will be easy to add subsequently. - - - - - 8bf6852c by Isaac Dupree at 2009-08-23T07:26:05+00:00 cross-package fnArgDocs. WARNING: changes .haddock binary format While breaking the format, I took the opportunity to unrename the DocMap that's saved to disk, because there's really no reason that we want to know what *another* package's favorite place to link a Name to was. (Is that true? Or might we want to know, someday?) Also, I added instance Binary Map in InterfaceFile. It makes the code a little simpler without changing anything of substance. Also it lets us add another Map hidden inside another Map (fnArgsDocs in instDocMap) without having really-convoluted serialization code. Instances are neat! I don't understand why this change to InterfaceFile seemed to subtly break binary compatibility all by itself, but no matter, I'll just roll it into the greater format-changing patch. Done! - - - - - 30115a64 by Isaac Dupree at 2009-08-23T18:22:47+00:00 Improve behavior for unfindable .haddock - - - - - aa364bda by Isaac Dupree at 2009-08-23T18:28:16+00:00 add comment for FnArgsDoc type - - - - - 49b23a99 by Isaac Dupree at 2009-08-23T21:52:48+00:00 bugfix: restore fnArgDocs for type-synonyms - - - - - f65f9467 by Isaac Dupree at 2009-08-23T22:06:55+00:00 Backends.Hoogle: eliminate warnings - - - - - a292d216 by Isaac Dupree at 2009-08-23T22:10:24+00:00 Haddock.Convert: eliminate warnings - - - - - 5546cd20 by Isaac Dupree at 2009-08-23T22:12:31+00:00 Haddock.Interface.Rename: eliminate warnings - - - - - 0a9798b6 by Isaac Dupree at 2009-08-23T22:18:47+00:00 Main.hs: remove ghc<6.9 conditionals - - - - - e8f9867f by Isaac Dupree at 2009-08-23T22:27:46+00:00 Main.hs: eliminate warnings (except for OldException) - - - - - 61c64247 by Isaac Dupree at 2009-08-23T22:41:01+00:00 move get*LibDir code in Main.hs, to +consistent code, -duplication - - - - - 948f1e69 by Isaac Dupree at 2009-08-23T23:14:26+00:00 Main.hs: OldException->Exception: which eliminates warnings - - - - - 3d5d5e03 by Isaac Dupree at 2009-08-23T23:20:11+00:00 GhcUtils: ghc >= 6.10 - - - - - 2771d657 by Isaac Dupree at 2009-08-23T23:21:55+00:00 InterfaceFile: ghc >= 6.10 - - - - - d9f2b9d1 by Isaac Dupree at 2009-08-23T23:22:58+00:00 Types: ghc >= 6.10 - - - - - ca39210e by Isaac Dupree at 2009-08-23T23:23:26+00:00 ModuleTree: ghc >= 6.10 - - - - - 883c4e59 by Isaac Dupree at 2009-08-23T23:24:04+00:00 Backends.DevHelp: ghc >= 6.10 - - - - - 04667df5 by Isaac Dupree at 2009-08-23T23:24:37+00:00 Backends.Html: ghc >= 6.10 - - - - - a9f7f25f by Isaac Dupree at 2009-08-23T23:25:24+00:00 Utils: ghc >= 6.10 - - - - - b7105022 by Isaac Dupree at 2009-08-23T23:37:47+00:00 eliminate haskell98 dependency, following GHC's example It turns out I/we already had, and it was only a matter of deleting it from the cabal file. - - - - - 292e0911 by Isaac Dupree at 2009-08-24T01:22:44+00:00 refactor out subordinatesWithNoDocs dep of inferenced-decls fix - - - - - c2ed46a2 by Isaac Dupree at 2009-08-24T01:24:03+00:00 Eradicate wrong runtime warning for type-inferenced exported-functions see the long comment in the patch for why I did it this way :-) - - - - - 4ac0b57c by David Waern at 2009-09-04T22:56:20+00:00 Clean up tyThingToHsSynSig a little Factor out noLoc and use the case construct. Also rename the function to tyThingToLHsDecl, since it doesn't just create type signatures. - - - - - 28ab9201 by David Waern at 2009-09-04T22:58:50+00:00 Wibble - - - - - 0d9fe6d0 by David Waern at 2009-09-06T18:39:30+00:00 Add more copyright owners to H.I.AttachInstances - - - - - 122441b1 by David Waern at 2009-09-06T18:44:12+00:00 Style police - - - - - 1fa79463 by David Waern at 2009-09-06T18:57:45+00:00 Move toHsInstHead to Haddock.Convert and call it synifyInstHead - - - - - 0d42a8aa by David Waern at 2009-09-06T21:11:38+00:00 Use colordiff to display test results if available - - - - - ea9d8e03 by Simon Marlow at 2009-08-24T08:46:14+00:00 Follow changes in GHC's interface file format Word32 instead of Int for FastString and Name offsets - - - - - 537e051e by Simon Marlow at 2009-07-29T14:16:53+00:00 define unpackPackageId (it was removed from GHC) - - - - - 50c63aa7 by David Waern at 2009-09-09T23:18:03+00:00 Remove commented-out code - - - - - 511631fe by David Waern at 2009-09-09T23:19:05+00:00 Correct copyright in H.I.ParseModuleHeader - - - - - 898ec768 by David Waern at 2009-09-11T11:22:29+00:00 Use Map.fromList/toList intead of fromAscList/toAscList when serializing Maps This fixes the missing docs problem. The Eq and Ord instances for Name uses the unique number in Name. This number is created at deserialization time by GHC's magic Binary instance for Name, and it is random. Thus, fromAscList can't be used at deserialization time, even though toAscList was used at serialization time. - - - - - 37bec0d5 by Simon Peyton Jones at 2009-09-11T08:28:04+00:00 Track change in HsType - - - - - eb3a97c3 by Ian Lynagh at 2009-09-11T16:07:09+00:00 Allow building with base 4.2 - - - - - bb4205ed by Ian Lynagh at 2009-09-22T13:50:02+00:00 Loosen the GHC dependency - - - - - 5c75deb2 by Ian Lynagh at 2009-09-22T14:08:39+00:00 Fix building with GHC >= 6.12 - - - - - fb131481 by David Waern at 2009-09-11T11:24:48+00:00 Update runtests.hs to work with GHC 6.11 - - - - - ac3a419d by David Waern at 2009-09-11T11:25:14+00:00 Update CrossPackageDocs test - - - - - ec65c3c6 by David Waern at 2009-09-11T11:25:40+00:00 Add reference output for CrossPackageDocs - - - - - 520c2758 by Ian Lynagh at 2009-10-25T17:26:40+00:00 Fix installation in the GHC build system - - - - - 28b3d7df by Ian Lynagh at 2009-11-05T15:57:27+00:00 GHC build system: Make *nix installation work in paths containing spaces - - - - - 5c9bb541 by David Waern at 2009-11-14T11:56:39+00:00 Track change in HsType for the right compiler version - - - - - 905097ce by David Waern at 2009-11-14T12:10:47+00:00 hlint police - - - - - 04920630 by Ian Lynagh at 2009-11-20T13:46:30+00:00 Use defaultObjectTarget rather than HscAsm This fixes haddock when we don't have a native code generator - - - - - 966eb079 by David Waern at 2009-11-15T12:32:21+00:00 Remove commented-out code - - - - - 37f00fc4 by David Waern at 2009-11-22T13:58:48+00:00 Make runtests.hs strip links before diffing Generates easier to read diffs when tests fail. The content of the links is not important anyway since it is not taken into account by the tests. - - - - - 3a9bb8ef by David Waern at 2009-11-22T14:05:06+00:00 Follow findProgramOnPath signature change in runtests.hs - - - - - b26b9e5a by David Waern at 2009-11-22T14:08:40+00:00 Follow removal of GHC.MVar from base in CrossPackageDocs - - - - - f4d90ae4 by David Waern at 2009-11-22T14:48:47+00:00 Make copy.hs strip link contents before copying No more updating of reference files when URLs in links changes. - - - - - 4c9c420d by David Waern at 2009-11-22T15:26:41+00:00 Update test reference output * More links (Int, Float etc) * Stripped link contents - - - - - a62b80e3 by David Waern at 2009-11-23T23:19:39+00:00 Update CrossPackageDocs reference output - Remove GHC.MVar import (removed from base) - Strip link contents - - - - - 43491394 by David Waern at 2009-11-23T23:20:00+00:00 Update test reference files with comments on instances - - - - - 0d370a0b by David Waern at 2009-11-23T23:25:16+00:00 Bump version number - - - - - 2293113e by David Waern at 2009-11-24T20:55:49+00:00 Comments on instances Implementing this was a little trickier than I thought, since we need to match up instances from the renamed syntax with instances represented by InstEnv.Instance. This is due to the current design of Haddock, which matches comments with declarations from the renamed syntax, while getting the list of instances of a class/family directly using the GHC API. - Works for class instances only (Haddock has no support for type family instances yet) - The comments are rendered to the right of the instance head in the HTML output - No change to the .haddock file format - Works for normal user-written instances only. No comments are added on derived or TH-generated instances - - - - - bf586f29 by David Waern at 2009-11-27T22:05:15+00:00 Whitespace police - - - - - b8f03afa by David Waern at 2009-11-27T22:11:46+00:00 Remove bad whitespace and commented-out pieces - - - - - 90b8ee90 by David Waern at 2009-11-27T22:15:04+00:00 Whitespace police - - - - - b5ede900 by David Waern at 2009-11-27T22:15:50+00:00 Whitespace police - - - - - e3fddbfe by David Waern at 2009-11-28T13:37:59+00:00 Remove Name from DocInstance It's not used. - - - - - 9502786c by David Waern at 2009-11-28T13:56:54+00:00 Require at least GHC 6.12 While regression testing Haddock, I found a bug that happens with GHC 6.10.3, but not with GHC 6.12-rc2 (haven't tried 6.10.4). I don't have time to track it down. I think we should just always require the latest major GHC version. The time spent on making Haddock work with older versions is too high compared to the time spent on bugfixing, refactoring and features. - - - - - 8fa688d8 by David Waern at 2009-11-28T15:05:03+00:00 Remove cruft due to compatibility with older GHCs - - - - - 46fbbe9d by David Waern at 2009-11-28T15:07:50+00:00 Add a documentation header to Haddock.Convert - - - - - c3d2cc4a by David Waern at 2009-11-28T15:10:14+00:00 Remove unused H.Utils.FastMutInt2 - - - - - 490aba80 by David Waern at 2009-11-28T15:36:36+00:00 Rename Distribution.Haddock into Documentation.Haddock - - - - - 33ee2397 by David Waern at 2009-11-28T15:36:47+00:00 Fix error message - - - - - a5a3b950 by David Waern at 2009-11-28T16:58:39+00:00 Add a test flag that brings in QuickCheck - - - - - fa049e13 by David Waern at 2009-11-28T19:32:18+00:00 Say that we want quickcheck 2 - - - - - f32b0d9b by David Waern at 2009-11-28T19:32:40+00:00 Add an Arbitrary instance for HsDoc - - - - - da9a8bd7 by David Waern at 2009-11-28T20:15:30+00:00 Rename HsDoc back into Doc - - - - - edb60101 by David Waern at 2009-11-28T22:16:16+00:00 Move H.Interface.Parse/Lex to H.Parse/Lex These are not just used to build Interfaces. - - - - - 0656a9b8 by David Waern at 2009-11-28T23:12:14+00:00 Update version number in test suite - - - - - 5e8c6f4a by David Waern at 2009-12-21T14:12:41+00:00 Improve doc of DocName - - - - - 7868e551 by Ian Lynagh at 2009-09-22T10:43:03+00:00 TAG GHC 6.12-branch created - - - - - 0452a3ea by Ian Lynagh at 2009-12-15T12:46:07+00:00 TAG GHC 6.12.1 release - - - - - 65e9be62 by David Waern at 2009-12-21T16:58:58+00:00 Update CHANGES - - - - - 145cee32 by David Waern at 2009-12-21T16:59:09+00:00 TAG 2.6.0 - - - - - 3c552008 by David Waern at 2009-12-22T17:11:14+00:00 Update ANNOUNCE - - - - - 931f9db4 by David Waern at 2010-01-22T19:57:17+00:00 Convert haddock.vim to use unix newlines - - - - - 4e56588f by David Waern at 2010-01-22T22:11:17+00:00 Remove unnecessary (and inexplicable) uses of nub - - - - - 744bb4d1 by David Waern at 2010-01-22T22:12:14+00:00 Follow move of parser and lexer - - - - - e34bab14 by David Waern at 2010-01-22T22:49:13+00:00 Use findProgramLocation instead of findProgramOnPath in runtests.hs - - - - - 8d39891b by Isaac Dupree at 2010-01-14T18:53:18+00:00 fix html arg-doc off-by-one and silliness - - - - - 9401f2e9 by David Waern at 2010-01-22T22:57:03+00:00 Create a test for function argument docs - - - - - 507a82d7 by David Waern at 2010-01-22T23:24:47+00:00 Put parenthesis around type signature arguments of function type - - - - - 8a305c28 by David Waern at 2010-01-23T17:26:59+00:00 Add reference file for the FunArgs test - - - - - 1309d5e1 by David Waern at 2010-01-24T16:05:08+00:00 Improve FunArg test and update Test.html.ref - - - - - 2990f055 by Yitzchak Gale at 2010-02-14T16:03:46+00:00 Do not generate illegal character in HTML ID attribute. - - - - - c5bcab7a by David Waern at 2010-02-22T22:10:30+00:00 Fix Haddock markup error in comment - - - - - c6416a73 by David Waern at 2010-02-24T22:55:08+00:00 Large additions to the Haddock API Also improved and added more doc comments. - - - - - 57d289d7 by David Waern at 2010-02-24T22:58:02+00:00 Remove unused ifaceLocals - - - - - 80528d93 by David Waern at 2010-02-25T21:05:09+00:00 Add HaddockModInfo to the API - - - - - 82806848 by David Waern at 2010-02-25T21:05:27+00:00 Wibble - - - - - 744cad4c by David Waern at 2010-02-25T23:30:59+00:00 Make it possible to run a single test - - - - - 6a806e4c by David Waern at 2010-03-14T14:19:39+00:00 Bump version number - - - - - a5a8e4a7 by David Waern at 2010-03-14T14:36:35+00:00 Update ANNOUNCE - - - - - 6f05435e by Simon Hengel at 2010-03-15T20:52:42+00:00 Add missing dependencies for 'library' in haddock.cabal - - - - - faefe2bd by David Waern at 2010-03-15T22:29:37+00:00 Solve conflicts - - - - - 9808ad52 by David Waern at 2010-03-15T22:51:21+00:00 Bump version number - - - - - eb0bf60b by David Waern at 2010-03-15T22:52:32+00:00 Update CHANGES - - - - - f95cd891 by David Waern at 2010-03-15T23:01:06+00:00 Add Paths_haddock to other-modules of library - - - - - 65997b0a by David Waern at 2010-03-15T23:14:59+00:00 Update CHANGES - - - - - 7e251731 by David Waern at 2010-03-15T23:15:30+00:00 Bump version number - - - - - c9cd0ddc by David Waern at 2010-03-16T00:28:34+00:00 Fix warning - - - - - 1cac2d93 by Simon Peyton Jones at 2010-01-04T15:22:16+00:00 Fix imports for new location of splitKindFunTys - - - - - 474f26f6 by Simon Peyton Jones at 2010-02-10T14:36:06+00:00 Update Haddock for quasiquotes - - - - - 0dcc06c0 by Simon Peyton Jones at 2010-02-10T10:59:45+00:00 Track changes in HsTyVarBndr - - - - - 2d84733a by Simon Peyton Jones at 2010-02-10T14:52:44+00:00 Track HsSyn chnages - - - - - 9e3adb8b by Ian Lynagh at 2010-02-20T17:09:42+00:00 Resolve conflicts - - - - - a3e72ff8 by Simon Peyton Jones at 2010-03-04T13:05:16+00:00 Track change in HsUtils; and use a nicer function not an internal one - - - - - 27994854 by David Waern at 2010-03-18T22:22:27+00:00 Fix build with GHC 6.12.1 - - - - - 11f6e488 by David Waern at 2010-03-18T22:24:09+00:00 Bump version in test reference files - - - - - 0ef2f11b by David Waern at 2010-03-20T00:56:30+00:00 Fix library part of cabal file when in ghc tree - - - - - 3f6146ff by Mark Lentczner at 2010-03-20T22:30:11+00:00 First, experimental XHTML rendering switch to using the xhtml package copied Html.hs to Xhtml.hs and split into sub-modules under Haddock/Backends/Xhtml and detabify moved footer into div, got ready for iface change headers converted to semantic markup contents in semantic markup summary as semantic markup description in semantic markup, info block in header fixed factored out rendering so during debug it can be readable (see renderToString) - - - - - b8ab329b by Mark Lentczner at 2010-03-20T22:54:01+00:00 apply changes to Html.hs to Xhtml/*.hs incorporate changes that were made between the time Html.hs was copied and split into Xhtml.hs and Xhtml/*.hs includes patchs after "Wibble" (!) through "Fix build with GHC 6.12.1" - - - - - 73df2433 by Ian Lynagh at 2010-03-20T21:56:37+00:00 Follow LazyUniqFM->UniqFM in GHC - - - - - db4f602b by David Waern at 2010-03-29T22:00:01+00:00 Fix build with GHC 6.12 - - - - - d8dca088 by Simon Hengel at 2010-04-02T16:39:55+00:00 Add missing dependencies to cabal file - - - - - e2adc437 by Simon Hengel at 2010-04-02T14:08:40+00:00 Add markup support for interactive examples - - - - - e882ac05 by Simon Hengel at 2010-04-02T14:11:53+00:00 Add tests for interactive examples - - - - - 5a07a6d3 by David Waern at 2010-04-07T17:05:20+00:00 Propagate source positions from Lex.x to Parse.y - - - - - 6493b46f by David Waern at 2010-04-07T21:48:57+00:00 Let runtests.hs die when haddock has not been built - - - - - 5e34423e by David Waern at 2010-04-07T22:01:13+00:00 Make runtests.hs slightly more readable - - - - - 321d59b3 by David Waern at 2010-04-07T22:13:27+00:00 Fix haskell/haddock#75 Add colons to the $ident character set. - - - - - 37b08b8d by David Waern at 2010-04-08T00:32:52+00:00 Fix haskell/haddock#118 Avoid being too greedy when lexing URL markup (<..>), in order to allow multiple URLs on the same line. Do the same thing with <<..>> and #..#. - - - - - df8feac9 by David Waern at 2010-04-08T00:57:33+00:00 Make it easier to add new package deps to test suite This is a hack - we should use Cabal to get the package details instead. - - - - - 1ca6f84b by David Waern at 2010-04-08T01:03:06+00:00 Add ghc-prim to test suite deps - - - - - 27371e3a by Simon Hengel at 2010-04-08T19:26:34+00:00 Let parsing fails on paragraphs that are immediately followed by an example This is more consistent with the way we treat code blocks. - - - - - 83096e4a by David Waern at 2010-04-08T21:20:00+00:00 Improve function name - - - - - 439983ce by David Waern at 2010-04-10T10:46:14+00:00 Fix haskell/haddock#112 No link was generated for 'Addr#' in a doc comment. The reason was simply that the identifier didn't parse. We were using parseIdentifier from the GHC API, with a parser state built from 'defaultDynFlags'. If we pass the dynflags of the module instead, the right options are turned on on while parsing the identifer (in this case -XMagicHash), and the parse succeeds. - - - - - 5c0d35d7 by David Waern at 2010-04-10T10:54:06+00:00 Rename startGhc into withGhc - - - - - dca081fa by Simon Hengel at 2010-04-12T19:09:16+00:00 Add documentation for interactive examples - - - - - c7f26bfa by David Waern at 2010-04-13T00:51:51+00:00 Slight fix to the documentation of examples - - - - - 06eb7c4c by David Waern at 2010-04-13T00:57:05+00:00 Rename Interactive Examples into Examples (and simplify explanation) - - - - - 264830cb by David Waern at 2010-05-10T20:07:27+00:00 Update CHANGES with info about 2.6.1 - - - - - 8e5d4514 by Simon Hengel at 2010-04-18T18:16:54+00:00 Add unit tests for parser - - - - - 68297f40 by David Waern at 2010-05-10T21:53:37+00:00 Improve testsuite README - - - - - f04eb6e4 by David Waern at 2010-05-11T19:14:31+00:00 Re-organise the testsuite structure - - - - - a360f710 by David Waern at 2010-05-11T19:18:03+00:00 Shorten function name - - - - - 1d5dd359 by David Waern at 2010-05-11T21:40:02+00:00 Update runtests.hs following testsuite re-organisation - - - - - ffebe217 by David Waern at 2010-05-11T21:40:10+00:00 Update runtests.hs to use base-4.2.0.1 - - - - - 635de402 by David Waern at 2010-05-11T21:41:11+00:00 Update runparsetests.hs following testsuite reorganisation - - - - - 72137910 by Ian Lynagh at 2010-05-06T20:43:06+00:00 Fix build - - - - - 1a80b76e by Ian Lynagh at 2010-05-06T22:25:29+00:00 Remove redundant import - - - - - 1031a80c by Simon Peyton Jones at 2010-05-07T13:21:09+00:00 Minor wibbles to HsBang stuff - - - - - dd8e7fe5 by Ian Lynagh at 2010-05-08T15:22:00+00:00 GHC build system: Follow "rm" variable changes - - - - - 7f5e6748 by David Waern at 2010-05-13T11:53:02+00:00 Fix build with GHC 6.12.2 - - - - - 7953d4d8 by David Waern at 2010-05-13T18:45:01+00:00 Fixes to comments only - - - - - 8ae8eb64 by David Waern at 2010-05-13T18:57:26+00:00 ModuleMap -> IfaceMap - - - - - 1c3eadc6 by David Waern at 2010-05-13T19:03:13+00:00 Fix whitespace style issues - - - - - e96783c0 by David Waern at 2010-05-13T19:08:53+00:00 Fix comment - - - - - c998a78b by David Waern at 2010-05-13T19:39:00+00:00 Position the module header the same way everywhere Silly, but nice with some consistency :-) - - - - - b48a714e by David Waern at 2010-05-13T19:41:32+00:00 Position of module header, this time in the HTML backends - - - - - f9bfb12e by David Waern at 2010-05-13T19:43:05+00:00 Two newlines between declarations in Main - - - - - 071d44c7 by David Waern at 2010-05-13T19:44:21+00:00 Newlines in Convert - - - - - 036346db by David Waern at 2010-05-13T19:46:47+00:00 Fix a few stylistic issues in H.InterfaceFile - - - - - f0b8379e by David Waern at 2010-05-13T19:47:53+00:00 Add newlines to H.ModuleTree - - - - - 27409f8e by David Waern at 2010-05-13T19:51:10+00:00 Fix stylistic issues in H.Utils - - - - - 24774a11 by David Waern at 2010-05-13T20:00:43+00:00 Structure H.Types better - - - - - 7b6f5e40 by David Waern at 2010-05-13T20:01:04+00:00 Remove bad Arbitrary instance - - - - - fac9f1f6 by David Waern at 2010-05-13T20:05:50+00:00 Get rid of H.Utils.pathJoin and use System.FilePath.joinPath instead - - - - - fe6d00c4 by David Waern at 2010-05-13T20:51:55+00:00 Export a couple of more types from the API - - - - - b2e33a5f by David Waern at 2010-05-13T21:27:51+00:00 Improve doc comment for Interface - - - - - c585f2ce by David Waern at 2010-05-13T21:30:14+00:00 Improve documentation of Haddock.Interface - - - - - e6791db2 by David Waern at 2010-05-13T22:07:35+00:00 Remove meaningless comments - - - - - 7801b390 by David Waern at 2010-05-14T17:53:33+00:00 Remove unused modules - - - - - f813e937 by David Waern at 2010-05-14T17:55:17+00:00 Re-direct compilation output to a temporary directory Also add a flag --no-tmp-comp-dir that can be used to get the old behaviour of writing compilation files to GHC's output directory (default "."). - - - - - e56737ec by David Waern at 2010-05-14T18:06:11+00:00 Wibble - - - - - e40b0447 by David Waern at 2010-05-14T19:01:52+00:00 Move flag evaluation code from Main to Haddock.Options Determining the value of "singular" flags (by e.g. taking the last occurrence of the flag) and other flag evaluation should done in Haddock.Options which is the module that is supposed to define the command line interface. This makes Main a bit easier on the eyes as well. - - - - - 27091f57 by David Waern at 2010-05-14T19:05:10+00:00 Wibble - - - - - c658cf61 by David Waern at 2010-05-14T19:06:49+00:00 Re-order things in Haddock.Options a bit - - - - - 8cfdd342 by David Waern at 2010-05-14T19:20:29+00:00 De-tabify Haddock.Options and fix other whitespace issues - - - - - 0df16b62 by David Waern at 2010-05-14T19:25:07+00:00 Improve comments - - - - - 80b38e2b by David Waern at 2010-05-14T19:26:42+00:00 Whitespace police - - - - - fe580255 by David Waern at 2010-05-14T19:31:23+00:00 Wibbles to comments - - - - - a2b43fad by David Waern at 2010-05-14T20:24:32+00:00 Move some more flag functions to Haddock.Options - - - - - 3f895547 by David Waern at 2010-05-14T20:37:12+00:00 Make renderStep a top-level function in Main - - - - - 5cdca11d by David Waern at 2010-05-14T20:39:27+00:00 Spelling in comment - - - - - ad98d14c by David Waern at 2010-05-14T20:40:26+00:00 Comment fixes - - - - - 0bb9218f by David Waern at 2010-05-14T20:49:01+00:00 Whitespace police - - - - - 0f0a533f by David Waern at 2010-05-15T16:42:29+00:00 Improve description of --dump-interface - - - - - 5b2833ac by David Waern at 2010-05-15T17:16:53+00:00 Document --no-tmp-comp-dir - - - - - 8160b170 by David Waern at 2010-05-15T17:18:59+00:00 Wibble - - - - - 570dbe33 by David Waern at 2010-05-18T21:15:38+00:00 HLint police - - - - - 204e425f by David Waern at 2010-05-18T21:16:30+00:00 HLint police - - - - - 6db657ac by David Waern at 2010-05-18T21:16:37+00:00 Wibble - - - - - b942ccd7 by Simon Marlow at 2010-06-02T08:27:30+00:00 Interrupted disappeared in GHC 6.13 (GHC ticket haskell/haddock#4100) - - - - - 3b94a819 by Simon Marlow at 2010-06-02T08:45:08+00:00 Allow base-4.3 - - - - - c5a1fb7c by Simon Marlow at 2010-06-02T09:03:04+00:00 Fix compilation with GHC 6.13 - - - - - 6181296c by David Waern at 2010-06-08T21:09:05+00:00 Display name of prologue file when parsing it fails - - - - - 7cbc6f60 by Ian Lynagh at 2010-06-13T16:20:25+00:00 Remove redundant imports - - - - - 980c804b by Simon Marlow at 2010-06-22T08:41:50+00:00 isLocalAndTypeInferenced: fix for local module names overlapping package modules - - - - - d74d4a12 by Simon Marlow at 2010-06-23T12:03:27+00:00 Unresolved identifiers in Doc get replaced with DocMonospaced rather than plain strings - - - - - d8546783 by Simon Marlow at 2010-06-30T12:45:17+00:00 LaTeX backend (new options: --latex, --latex-style=<style>) - - - - - 437afa9e by David Waern at 2010-07-01T12:02:44+00:00 Fix a few stylistic whitespace issues in LaTeX backend - - - - - 85bc1fae by David Waern at 2010-07-01T15:42:45+00:00 Make runtest.hs work with GHC 6.12.3 (we should really stop hard coding this) - - - - - 7d2eb86f by David Waern at 2010-07-01T15:43:33+00:00 Update test following Simon's patch to render unresolved names in monospaced font - - - - - 08fcbcd2 by David Waern at 2010-07-01T16:12:18+00:00 Warning police - - - - - d04a8d7a by David Waern at 2010-07-04T14:53:39+00:00 Fix a bug in attachInstances We didn't look for instance docs in all the interfaces of the package. This had the effect of instance docs not always showing up under a declaration. I took the opportunity to clean up the code in H.I.AttachInstances a bit as well. More cleanup is needed, however. - - - - - d10344eb by Simon Hengel at 2010-07-10T09:19:04+00:00 Add missing dependencies to cabal file - - - - - 24090531 by Mark Lentczner at 2010-03-21T04:51:16+00:00 add exports to Xhtml modules - - - - - 84f9a333 by Mark Lentczner at 2010-04-03T19:14:22+00:00 clean up Doc formatting code - add CSS for lists - renderToString now uses showHtml since prettyHtml messes up <pre> sections - - - - - bebccf52 by Mark Lentczner at 2010-04-04T04:51:08+00:00 tweak list css - - - - - 0c2aeb5e by Mark Lentczner at 2010-04-04T06:24:14+00:00 all decls now generate Html not HtmlTable - ppDecl return Html, and so now do all of the functions it calls - added some internal tables to some decls, which is wrong, and will have to be fixed - decl "Box" functions became "Elem" functions to make clear they aren't in a table anymore (see Layout.hs) - docBox went away, as only used in one place (and its days are numbered) - cleaned up logic in a number of places, removed dead code - added maybeDocToHtml which simplified a number of places in the code - - - - - dbf73e6e by Mark Lentczner at 2010-04-05T05:02:43+00:00 clean up processExport and place a div around each decl - - - - - e25b7e9f by Mark Lentczner at 2010-04-10T21:23:21+00:00 data decls are now a sequence of paragraphs, not a table - - - - - 89ee0294 by Mark Lentczner at 2010-04-10T21:29:16+00:00 removed commented out code that can't be maintained - - - - - d466f536 by Mark Lentczner at 2010-04-12T04:56:27+00:00 removed declWithDoc and cleaned up data decls in summary - - - - - ed755832 by Mark Lentczner at 2010-04-12T05:07:53+00:00 merge in markupExample changes - - - - - c36f51fd by Mark Lentczner at 2010-04-25T04:56:37+00:00 made record fields be an unordList, not a table - - - - - ed3a28d6 by Mark Lentczner at 2010-04-25T05:23:28+00:00 fixed surround of instance and constructor tables - - - - - 0e35bbc4 by Mark Lentczner at 2010-04-25T05:36:59+00:00 fix class member boxes in summary - - - - - 5041749b by Mark Lentczner at 2010-04-25T05:38:35+00:00 remove unused bodyBox - - - - - e91724db by Mark Lentczner at 2010-04-25T06:26:10+00:00 fixed javascript quoting/escpaing issue - - - - - f4abbb73 by Mark Lentczner at 2010-05-03T23:04:31+00:00 adjust css for current markup - - - - - e75fec4c by Mark Lentczner at 2010-05-04T06:14:34+00:00 added assoicated types and methods back into class decls - - - - - 84169323 by Mark Lentczner at 2010-05-24T13:13:42+00:00 merge in changes from the big-whitespace cleanup - - - - - 3c1c872e by Mark Lentczner at 2010-06-11T21:03:58+00:00 adjust synopsis and bottom bar spacing - - - - - 3c1f9ef7 by Mark Lentczner at 2010-06-11T21:14:44+00:00 fix missing space in "module" lines in synoposis - - - - - 9a137e6d by Mark Lentczner at 2010-06-11T21:34:08+00:00 changed tt elements to code elements - - - - - 50f71ef1 by Mark Lentczner at 2010-06-11T23:27:46+00:00 factored out ppInstances - - - - - 3b9a9de5 by Mark Lentczner at 2010-06-17T17:36:01+00:00 push single constructors (newtype) onto line with decl - - - - - e0f8f2ec by Mark Lentczner at 2010-06-17T22:20:56+00:00 remove <++> connector - - - - - 56c075dd by Mark Lentczner at 2010-07-13T05:26:21+00:00 change to new page structure - - - - - 04be6ca7 by Mark Lentczner at 2010-07-14T04:21:55+00:00 constructors and args as dl lists, built in Layout.hs - - - - - 65aeafc2 by Mark Lentczner at 2010-07-14T05:38:32+00:00 better interface to subDecls - - - - - 72032189 by Mark Lentczner at 2010-07-14T07:04:10+00:00 made subDecl tables looks just so - - - - - b782eca2 by Mark Lentczner at 2010-07-14T16:00:54+00:00 convert args to SubDecl format - - - - - cc75e98f by Mark Lentczner at 2010-07-14T16:28:53+00:00 convert instances to SubDecl - - - - - 34e2aa5a by Mark Lentczner at 2010-07-14T21:07:32+00:00 removing old table cruft from Layout.hs - - - - - d5810d95 by Mark Lentczner at 2010-07-14T21:54:58+00:00 methods and associated types in new layout scheme - - - - - 65ef9579 by Mark Lentczner at 2010-07-14T23:43:42+00:00 clean up synopsis lists - - - - - e523318f by Mark Lentczner at 2010-07-15T05:02:26+00:00 clean up of anchors - - - - - 1215dfc5 by Mark Lentczner at 2010-07-15T23:53:01+00:00 added two new themes and rough css switcher - - - - - 7f0fd36f by Mark Lentczner at 2010-07-16T04:57:38+00:00 fixed package catpion, added style menu - - - - - 0dd4999c by Mark Lentczner at 2010-07-16T20:12:39+00:00 new output for mini_ pages - - - - - 64b2810b by Mark Lentczner at 2010-07-16T20:58:41+00:00 reformat index-frames - - - - - 3173f555 by Mark Lentczner at 2010-07-16T22:41:53+00:00 convert index to new markup - - - - - b0a4b7c9 by Mark Lentczner at 2010-07-17T04:07:22+00:00 convert index.html to new markup, adjust module markup - - - - - 8261ae1e by Mark Lentczner at 2010-07-17T05:07:29+00:00 classing styling of ancillary pages - - - - - 2a4fb025 by Mark Lentczner at 2010-07-17T05:11:45+00:00 clean up Layout.hs: no more vanillaTable - - - - - 87eec685 by Mark Lentczner at 2010-07-17T05:35:16+00:00 clean up Util.hs - - - - - d304e9b0 by Mark Lentczner at 2010-07-17T05:38:50+00:00 qualify import of XHtml as XHtml - - - - - 7dc05807 by Mark Lentczner at 2010-07-17T06:17:53+00:00 factored out head element generation - - - - - 9cdaec9e by Mark Lentczner at 2010-07-17T06:44:54+00:00 refactored out main page body generation - - - - - 8a51019e by Mark Lentczner at 2010-07-17T06:48:20+00:00 moved footer into only place that used it - - - - - efa479da by Mark Lentczner at 2010-07-17T18:48:30+00:00 styling auxillary pages for tibbe and snappy themes - - - - - 81de5509 by Mark Lentczner at 2010-07-18T04:41:38+00:00 fixed alphabet on index page, and styling of it and packages in module lists - - - - - 20718c1a by Mark Lentczner at 2010-07-18T05:34:29+00:00 cleaned up div functions in Layout.hs - - - - - 60d50453 by Mark Lentczner at 2010-07-18T05:48:39+00:00 added content div to main pages - - - - - ed16561c by Mark Lentczner at 2010-07-18T06:12:22+00:00 add .doc class to documentation blocks - - - - - f5c781b0 by Mark Lentczner at 2010-07-19T05:20:53+00:00 refactoring of anchor ID and fragment handling - - - - - a69a93bf by Mark Lentczner at 2010-07-19T05:35:55+00:00 remove an explicit bold tag - replace with .def class - - - - - d76c7225 by Mark Lentczner at 2010-07-19T06:56:15+00:00 rename Haddock.Backends.Xhtml.Util to Utils - - - - - 5a58c0da by David Waern at 2010-07-21T13:30:54+00:00 Remove trailing whitespace in Haddock.Backends.Xhtml - - - - - 0652aa17 by David Waern at 2010-07-21T13:33:21+00:00 Align a few comments - - - - - 785776c3 by David Waern at 2010-07-21T13:39:04+00:00 Remove trailing whitespace in H.B.X.Decl - - - - - 71a30710 by David Waern at 2010-07-21T13:44:27+00:00 Remove more trailing whitespace - - - - - 38750394 by David Waern at 2010-07-21T13:50:43+00:00 Style police - - - - - 3023d940 by David Waern at 2010-07-21T14:01:22+00:00 Style police in H.B.X.Decl - - - - - df16e9e6 by David Waern at 2010-07-21T14:14:45+00:00 Style police in H.B.X.DocMarkup - - - - - 6020e321 by David Waern at 2010-07-21T14:17:32+00:00 More style police - - - - - 86ad8bf5 by David Waern at 2010-07-21T14:21:02+00:00 Style police in H.B.Xhtml - - - - - aea27d03 by David Waern at 2010-07-21T14:42:03+00:00 Fix warnings in LaTeX backend - - - - - 2aff34a9 by David Waern at 2010-07-21T14:50:46+00:00 Style police in LaTeX backend (mainly more newlines) - - - - - e517162d by David Waern at 2010-07-21T15:05:47+00:00 Doc sections in Main - - - - - b971aa0c by David Waern at 2010-07-21T15:06:17+00:00 Trailing whitespace in Documentation.Haddock - - - - - f11628fb by David Waern at 2010-07-21T15:07:06+00:00 Trailing whitespace in Haddock.Convert - - - - - cbaf284c by David Waern at 2010-07-21T15:08:11+00:00 Style police in Haddock.GhcUtils - - - - - 71feb77b by David Waern at 2010-07-21T15:09:06+00:00 Style police in Haddock.InterfaceFile - - - - - 0a9c80e6 by David Waern at 2010-07-21T15:11:33+00:00 Whitespace police - - - - - 6168376c by David Waern at 2010-07-21T15:16:35+00:00 Style police in Haddock.Utils - - - - - 9fe4dd90 by David Waern at 2010-07-21T15:19:31+00:00 Add -fwarn-tabs - - - - - a000d752 by Mark Lentczner at 2010-07-20T17:25:52+00:00 move CSS Theme functions into Themes.hs - - - - - b52b440f by Mark Lentczner at 2010-07-20T17:29:35+00:00 add Thomas Schilling's theme - - - - - e43fa7e8 by Mark Lentczner at 2010-07-21T04:49:34+00:00 correct icon used with Snappy theme - - - - - ba5092d3 by Mark Lentczner at 2010-07-21T04:56:47+00:00 apply Tibbe's updates to his theme - - - - - 7804eef6 by Mark Lentczner at 2010-07-21T05:15:49+00:00 space between "Style" and the downward triangle - - - - - 7131d4c6 by Mark Lentczner at 2010-07-21T17:43:35+00:00 merge with David's source cleanups - - - - - ee65f1cb by David Waern at 2010-07-22T16:50:46+00:00 Fix a bug where we allowed --hoogle, --latex, etc without input files - - - - - e413ff7a by David Waern at 2010-07-22T17:21:58+00:00 Improve function name - - - - - a0fd14f3 by Simon Marlow at 2010-06-30T15:34:32+00:00 fix warnings - - - - - 31f73d2a by David Waern at 2010-07-22T19:29:41+00:00 Solve conflicts - - - - - d563b4a5 by Simon Marlow at 2010-06-30T15:34:37+00:00 fix warning - - - - - 412b6469 by David Waern at 2010-07-22T19:31:28+00:00 Solve conflict - - - - - 35174b94 by Ian Lynagh at 2010-07-06T17:27:16+00:00 Follow mkPState argument order change - - - - - b5c3585c by Simon Marlow at 2010-07-14T08:49:21+00:00 common up code for instance rendering - - - - - d8009560 by Simon Marlow at 2010-07-14T12:37:11+00:00 fix warnings - - - - - a6d88695 by David Waern at 2010-07-24T15:33:33+00:00 Fix build with ghc < 6.13 - - - - - 94cf9de1 by David Waern at 2010-07-24T15:34:37+00:00 Remove conflict left-over - - - - - 313b15c0 by Mark Lentczner at 2010-07-21T22:09:04+00:00 reorganization of nhaddock.css with tibbe - - - - - 9defed80 by Mark Lentczner at 2010-07-21T22:42:14+00:00 further cleanup of nhaddock.css, float TOC, support aux. pages - - - - - 6d944c1b by Mark Lentczner at 2010-07-22T06:22:23+00:00 remove old HTML backend - - - - - b3e8cba5 by Mark Lentczner at 2010-07-22T06:43:32+00:00 remove --html-help support - it was old, out-of-date, and mostly missing - - - - - d2654a08 by Mark Lentczner at 2010-07-22T21:45:34+00:00 tweaks to nhaddock.css - - - - - f73b285c by Mark Lentczner at 2010-07-23T06:19:35+00:00 command like processing for theme selection The bulk of the change is threadnig the selected theme set through functions in Xhtml.hs so that the selected themes can be used when generating the page output. There isn't much going on in most of these changes, just passing it along. The real work is all done in Themes.hs. - - - - - 8bddc90d by Mark Lentczner at 2010-07-23T06:58:31+00:00 drop --themes support, add named theme support decided that --themes was silly - no one would do that, just use multiple --theme arguments made --theme a synonym for --css and -c made those arguments, if no file is found, look up the argument as the name of a built in theme all of this let's haddock be invoked with "--theme=classic" for example. - - - - - 20cafd4f by Mark Lentczner at 2010-07-23T17:44:29+00:00 rename --default-themes to --built-in-themes - - - - - 0fe41307 by Mark Lentczner at 2010-07-23T18:33:02+00:00 tweaks to theme for info table, headings, and tables - - - - - cba4fee0 by Mark Lentczner at 2010-07-23T19:13:59+00:00 tweaks for dl layout, though still not used - - - - - 463fa294 by Mark Lentczner at 2010-07-23T21:07:19+00:00 tweak look of mini pages, keywords, and preblocks - - - - - 5472fc02 by Mark Lentczner at 2010-07-24T05:36:15+00:00 slide out Synopsis drawer - - - - - 9d5d5de5 by Mark Lentczner at 2010-07-24T06:02:42+00:00 extend package header and footer to edges of page - - - - - a47c91a2 by Mark Lentczner at 2010-07-24T06:28:44+00:00 fields are def lists, tweak css for style menu, mini pages, arguments - - - - - ca20f23b by Mark Lentczner at 2010-07-24T16:55:22+00:00 excisting last vestiges of the --xhtml flag - - - - - 71fb012e by Mark Lentczner at 2010-07-25T18:47:49+00:00 change how collapsing sections are done make whole .caption be the target improve javascript for class toggling have plus/minus images come from .css, not img tags - - - - - c168c8d3 by Mark Lentczner at 2010-07-26T00:32:05+00:00 reorganize files in the html lib data dir - - - - - 93324301 by Mark Lentczner at 2010-07-26T01:27:42+00:00 cleaned up Themes.hs - - - - - ad3b5dd4 by Mark Lentczner at 2010-07-26T02:39:15+00:00 make module list use new collapsers - - - - - 1df9bfc6 by Mark Lentczner at 2010-07-27T19:09:25+00:00 remove Tibbe theme - - - - - 8b9b01b3 by Mark Lentczner at 2010-07-27T20:04:03+00:00 move themes into html dir with .theme and .std-theme extensions - - - - - a7beb965 by Mark Lentczner at 2010-07-27T21:06:34+00:00 give a class to empty dd elements so they can be hidden - - - - - a258c117 by Mark Lentczner at 2010-07-27T21:23:58+00:00 remove custom version of copyFile in Xhtml.hs - - - - - b70dba6e by Mark Lentczner at 2010-07-27T22:12:45+00:00 apply margin changes to pre and headings as per group decision, and small cleanups - - - - - e6f722a2 by Mark Lentczner at 2010-07-28T00:03:12+00:00 make info block and package bar links be floatable by placing them first in the dom tree - - - - - c8278867 by Mark Lentczner at 2010-07-28T19:01:18+00:00 styling source links on declarations - - - - - 88fdc399 by Mark Lentczner at 2010-07-29T01:12:46+00:00 styling tweaks don't generate an empty li for absent style menu in links area update css for Classic and Snappy to handle: dl lists links in package header and in declarations floating of links and info block in package and module headers - - - - - 8a75b213 by Ian Lynagh at 2010-07-30T20:21:46+00:00 Fix build in GHC tree - - - - - ce8e18b3 by Simon Hengel at 2010-08-03T18:37:26+00:00 Adapt paths to data files in cabal file - - - - - 9701a455 by Simon Hengel at 2010-08-07T13:20:27+00:00 Add missing dependency to cabal file - - - - - 01b838d1 by Mark Lentczner at 2010-07-30T20:19:40+00:00 improved synopsis drawer: on click, not hover - - - - - 7b6f3e59 by Mark Lentczner at 2010-07-30T23:38:55+00:00 put the synopsis back in the other themes - - - - - 7b2904c9 by Mark Lentczner at 2010-08-11T11:11:26+00:00 close arrows on expanded synopsis drawer - - - - - ea19e177 by Mark Lentczner at 2010-08-12T21:16:45+00:00 width and font changes removed the max width restrictions on the page as a whole and the synopsis made the main font size smaller (nominally 14pt) and then tweaked most font sizes (relative) to be more consistent - - - - - 5ced00c0 by Mark Lentczner at 2010-08-13T15:09:55+00:00 implemented YUI's CSS font approach - - - - - 2799c548 by Mark Lentczner at 2010-08-13T15:11:59+00:00 adjusted margin to 2em, 1 wasn't enough - - - - - 58f06893 by Mark Lentczner at 2010-08-13T15:48:44+00:00 removed underlining on hover for named anchors headings in interface lost thier a element, no need, just put id on heading css for a elements now only applies to those with href attribute - - - - - 7aced4c4 by Mark Lentczner at 2010-08-13T15:50:22+00:00 more space between elements - - - - - 5a3c1cce by Mark Lentczner at 2010-08-13T16:43:43+00:00 adjusted font sizes of auxilary pages per new scheme - - - - - 487539ef by Mark Lentczner at 2010-08-13T21:43:41+00:00 add Frames button and clean up frames.html - - - - - c1a140b6 by Mark Lentczner at 2010-08-13T22:17:48+00:00 move frames button to js - - - - - b0bdb68e by Mark Lentczner at 2010-08-14T03:44:46+00:00 build style menu in javascript moved to javascript, so as to not polute the content with the style menu removed menu building code in Themes.hs removed onclick in Utils.hs changed text of button in header from "Source code" to "Source" more consistent with links in rest of page - - - - - 43ab7120 by Mark Lentczner at 2010-08-16T15:15:37+00:00 font size and margin tweaks - - - - - c0b68652 by Mark Lentczner at 2010-08-17T18:19:52+00:00 clean up collapser logics javascript code for collapasble sections cleaned up rewrote class utilities in javascript to be more robust refactored utilities for generating collapsable sections made toc be same color as synopsis module list has needed clear attribute in CSS - - - - - 5d573427 by Mark Lentczner at 2010-08-17T23:06:02+00:00 don't collapse entries in module list when clicking on links - - - - - 8c307c4a by Mark Lentczner at 2010-08-17T23:21:43+00:00 add missing data file to .cabal - - - - - 414bcfcf by Mark Lentczner at 2010-08-17T23:28:47+00:00 remove synopsis when in frames - - - - - ba0fa98a by Mark Lentczner at 2010-08-18T16:16:11+00:00 layout tweeks - mini page font size, toc color, etc. - - - - - 63c1bed1 by Mark Lentczner at 2010-08-18T19:50:02+00:00 margin fiddling - - - - - c311c094 by Mark Lentczner at 2010-08-20T01:37:55+00:00 better synopsis handling logic - no flashing - - - - - f1fe5fa8 by Mark Lentczner at 2010-08-20T01:41:06+00:00 fix small layout issues mini frames should have same size top heading give info block dts some padding so they don't collide in some browsers - - - - - 0de84d77 by Mark Lentczner at 2010-08-20T02:13:09+00:00 made style changing and cookies storage robust - - - - - 1ef064f9 by Thomas Schilling at 2010-08-04T13:12:22+00:00 Make synopsis frame behave properly in Firefox. In Firefox, pressing the back button first reverted the synopsis frame, and only clicking the back button a second time would update the main frame. - - - - - dd1c9a94 by Mark Lentczner at 2010-08-21T01:46:19+00:00 remove Snappy theme - - - - - 2353a90d by Mark Lentczner at 2010-08-25T05:16:19+00:00 fix occasional v.scroll bars on pre blocks (I think) - - - - - 459b8bf1 by Simon Hengel at 2010-08-08T10:12:45+00:00 Add createInterfaces' (a more high-level alternative to createInterfaces) to Haddock API - - - - - b1b68675 by David Waern at 2010-08-26T20:31:58+00:00 Follow recent API additions with some refactorings Simon Hegel's patch prompted me to do some refactorings in Main, Haddock.Documentation and Haddock.Interface. - - - - - 264d4d67 by David Waern at 2010-08-26T21:40:59+00:00 Get rid of GhcModule and related cruft We can get everything we need directly from TypecheckedModule. - - - - - 0feacec2 by Mark Lentczner at 2010-08-26T23:44:13+00:00 fixed CSS for ordered lists and def lists in doc blocks - - - - - 2997e0c2 by Mark Lentczner at 2010-08-26T23:45:03+00:00 support both kinds of enumerated lists in doc markup The documentation for Haddock says enumerated lists can use either of (1) first item 2. second item The second form wasn't actually supported - - - - - 5d4ddeec by Mark Lentczner at 2010-08-27T21:29:48+00:00 fix broken header link margins - - - - - 614456ba by Mark Lentczner at 2010-08-27T22:16:19+00:00 fix table of contents CSS - - - - - 03f329a2 by David Waern at 2010-08-28T16:36:09+00:00 Update tests following switch to the Xhtml backend - - - - - ca689fa2 by Mark Lentczner at 2010-08-28T18:25:16+00:00 fix def lists - - - - - 18e1d3d2 by Mark Lentczner at 2010-08-28T18:26:18+00:00 push footer to bottom of window - - - - - b0ab8d82 by David Waern at 2010-08-28T22:04:32+00:00 Whitespace police - - - - - 2d217977 by David Waern at 2010-08-29T12:44:45+00:00 Remove Snappy data files - - - - - 01e27d5f by David Waern at 2010-08-29T13:03:28+00:00 Add source entity path to --read-interface You can now use this flag like this: --read-interface=<html path>,<source entity path>,<.haddock file> By "source entity path" I mean the same thing that is specified with the --source-entity flag. The purpose of this is to be able to specify the source entity path per package, to allow source links to work in the presence of cross-package documentation. When given two arguments or less the --read-interface flag behaves as before. - - - - - 20bf4aaa by David Waern at 2010-08-29T13:11:03+00:00 Naming wibbles - - - - - ad22463f by Mark Lentczner at 2010-08-29T15:14:54+00:00 make portability block be a table - solves layout issues - - - - - 97bd1ae6 by Mark Lentczner at 2010-08-29T15:17:42+00:00 update golden test for Test due to portability box change - - - - - d37e139e by Mark Lentczner at 2010-08-29T17:07:17+00:00 move TOC and Info blocks down 0.5em to improve layout issue w/Test.hs - - - - - acf52501 by David Waern at 2010-08-29T17:32:36+00:00 Allow building with ghc < 6.16 - - - - - 1cb34ed8 by Ian Lynagh at 2010-07-24T23:18:49+00:00 Flatten the dynflags before parsing - - - - - b36845b4 by Ian Lynagh at 2010-07-24T23:26:49+00:00 Follow flattenLanguageFlags -> flattenExtensionFlags rename - - - - - 7f7fcc7e by David Waern at 2010-08-29T17:46:23+00:00 Use flattenExtensionFlags with ghc >= 6.13 only - - - - - 13cf9411 by Ian Lynagh at 2010-08-01T18:09:54+00:00 Make the main haddock script versioned, and make plain "haddock" a symlink - - - - - 495cbff2 by Ian Lynagh at 2010-08-18T18:57:24+00:00 Fix installation in the GHC build system Data-files are now in subdirectories, so we need to handle that - - - - - 88ebab0a by Ian Lynagh at 2010-08-18T19:43:53+00:00 GHC build system: Add all the data files to BINDIST_EXTRAS - - - - - 65837172 by David Waern at 2010-08-29T20:12:34+00:00 Update Test - - - - - 094bbaa2 by David Waern at 2010-08-29T20:55:14+00:00 Revert update to Test - - - - - a881cfb3 by David Waern at 2010-08-31T18:24:15+00:00 Bump version number - - - - - 1fc8a3eb by David Waern at 2010-08-31T22:32:27+00:00 Update ANNOUNCE - - - - - ee1df9d0 by David Waern at 2010-08-31T22:33:11+00:00 Update CHANGES - - - - - 394cc854 by David Waern at 2010-08-31T22:33:23+00:00 Update interface file versioning to work with ghc 6.14/15 - - - - - 7d03b79b by David Waern at 2010-08-31T22:36:00+00:00 Update test output following version change - - - - - a48d82d1 by Mark Lentczner at 2010-09-01T04:29:35+00:00 sort options in doc to match --help output removed --html-help option, as it is no longer supported - - - - - 06561aeb by Mark Lentczner at 2010-09-01T05:29:32+00:00 update options documentation rewrote doc for --html added doc for --theme and --built-in-themes added --use-contents and --gen-contents - - - - - 57dea832 by Mark Lentczner at 2010-09-01T05:31:27+00:00 slight wording change about Frames mode - - - - - fa1f6da3 by David Waern at 2010-09-01T10:57:44+00:00 Update doc configure script to find docbook stylesheets on arch linux - - - - - addff770 by David Waern at 2010-09-01T11:02:29+00:00 Wibble - - - - - 8399006d by David Waern at 2010-09-01T11:19:21+00:00 Replace ghci> with >>> in example syntax - - - - - 35074cf8 by David Waern at 2010-09-01T19:03:27+00:00 Improve docs for --no-tmp-comp-dir - - - - - 0f8f8cfd by David Waern at 2010-09-02T11:22:27+00:00 Add a list of contributors to the user guide Break out everyone thanked in the `Acknowledgements` chapter into a separate contributor list and add everyone from `darcs show authors`. We consider everyone who is thanked to be a contributor as a conservative estimation :-) I have added some more contributors that I know about, who were not in the darcs history, but others may be missing. So please add anyone that you think is missing from the list. - - - - - 42ccf099 by David Waern at 2010-09-02T11:29:22+00:00 Update copyright years in license - - - - - 0d560479 by David Waern at 2010-09-02T11:38:52+00:00 Update release instructions - - - - - 72ab7796 by David Waern at 2010-09-02T19:27:08+00:00 Add a note to ANNOUNCE - - - - - bf9d9c5d by David Waern at 2010-09-02T19:27:48+00:00 H.Utils needs FFI on Win+MinGW - - - - - 048ae44a by Mark Lentczner at 2010-09-04T23:19:47+00:00 make TOC group header identifiers validate - - - - - 8c6faf36 by Simon Michael at 2010-09-22T07:12:34+00:00 add hints for cleaner darcs show authors output - - - - - 9909bd17 by Simon Michael at 2010-09-22T17:58:06+00:00 print haddock coverage info on stdout when generating docs A module's haddockable items are its exports and the module itself. The output is lightly formatted so you can align the :'s and sort for readability. - - - - - 6da72171 by David Waern at 2010-10-03T21:31:24+00:00 Style wibble - - - - - 2f8d8e4d by Tobias Brandt at 2010-08-27T07:01:21+00:00 adding the option to fully qualify identifiers - - - - - 833be6c6 by Tobias Brandt at 2010-08-27T15:50:28+00:00 adding support for local and relative name qualification - - - - - df15c4e9 by Tobias Brandt at 2010-08-27T15:56:37+00:00 corrected qualification help message - - - - - 449e9ce1 by David Waern at 2010-10-16T17:34:30+00:00 Solve conflicts - - - - - 3469bda5 by David Waern at 2010-10-16T18:42:40+00:00 Use "qual" as an abbreviation for qualification instead of "quali" for consistency - - - - - 97c2d728 by David Waern at 2010-10-16T18:47:07+00:00 Style police - - - - - ce14fbea by David Waern at 2010-10-16T21:15:25+00:00 Style police - - - - - fdf29e9d by David Waern at 2010-10-17T00:30:44+00:00 Add a pointer to the style guide - - - - - 8e6b44e8 by rrnewton at 2010-10-24T03:19:28+00:00 Change to index pages: include an 'All' option even when subdividing A-Z. - - - - - 755b131c by David Waern at 2010-11-14T19:39:36+00:00 Bump version - - - - - d0345a04 by David Waern at 2010-11-14T19:41:59+00:00 TAG 2.8.1 - - - - - f6221508 by Simon Peyton Jones at 2010-09-13T09:53:00+00:00 Adapt to minor changes in internal GHC functions - - - - - 1290713d by Ian Lynagh at 2010-09-15T10:37:18+00:00 Remove duplicate Outputable instance for Data.Map.Map - - - - - 87f69eef by Ian Lynagh at 2010-09-21T15:01:10+00:00 Bump GHC dep upper bound - - - - - af36e087 by Ian Lynagh at 2010-09-21T15:12:02+00:00 Fix up __GLASGOW_HASKELL__ tests - - - - - ad67716c by Ian Lynagh at 2010-09-21T20:31:35+00:00 Don't build haddock is HADDOCK_DOCS is NO - - - - - 63b3f1f5 by Ian Lynagh at 2010-09-21T21:39:51+00:00 Fixes for when HADDOCK_DOCS=NO - - - - - e92bfa42 by Ian Lynagh at 2010-09-29T21:15:38+00:00 Fix URL creation on Windows: Use / not \ in URLs. Fixes haskell/haddock#4353 - - - - - 66c55e05 by Ian Lynagh at 2010-09-30T17:03:34+00:00 Tidy up haddock symlink installation In particular, it now doesn't get created if we aren't installing haddock. - - - - - 549b5556 by Ian Lynagh at 2010-10-23T21:17:14+00:00 Follow extension-flattening change in GHC - - - - - d7c2f72b by David Waern at 2010-11-14T20:17:55+00:00 Bump version to 2.8.2 - - - - - 6989a3a9 by David Waern at 2010-11-14T20:26:01+00:00 Solve conflict - - - - - 055c6910 by Ian Lynagh at 2010-09-22T15:36:20+00:00 Bump GHC dep - - - - - c96c0763 by Simon Marlow at 2010-10-27T11:09:44+00:00 follow changes in the GHC API - - - - - 45907129 by David Waern at 2010-11-07T14:00:58+00:00 Update the HCAR entry - - - - - 61940b95 by David Waern at 2010-11-07T14:07:34+00:00 Make the HCAR entry smaller - - - - - aa590b7d by David Waern at 2010-11-14T21:30:59+00:00 Update HCAR entry with November 2010 version - - - - - 587f9847 by David Waern at 2010-11-14T23:48:17+00:00 Require ghc >= 7.0 - - - - - ff5c647c by David Waern at 2010-11-14T23:49:09+00:00 TAG 2.8.2 - - - - - 937fcb4f by David Waern at 2010-11-14T23:49:45+00:00 Solve conflict - - - - - 8e5d0c1a by David Waern at 2010-11-15T21:09:50+00:00 Remove code for ghc < 7 - - - - - 3d47b70a by David Waern at 2010-11-15T21:11:06+00:00 Fix bad merge - - - - - 7f4a0d8a by David Waern at 2010-11-15T21:13:57+00:00 Remove more ghc < 7 code - - - - - 9ee34b50 by David Waern at 2010-11-15T21:31:25+00:00 Match all AsyncExceptions in exception handler - - - - - 42849c70 by David Waern at 2010-11-15T21:35:31+00:00 Just say "internal error" instead of "internal Haddock or GHC error" - - - - - c88c809b by David Waern at 2010-11-15T21:44:19+00:00 Remove docNameOcc under the motto "don't name compositions" - - - - - b798fc7c by David Waern at 2010-11-15T23:27:13+00:00 Wibble - - - - - 2228197e by David Waern at 2010-11-15T23:28:24+00:00 Rename the HCAR entry file - - - - - 8a3f9090 by David Waern at 2010-11-16T00:05:29+00:00 Remove Haskell 2010 extensions from .cabal file - - - - - c7a0c597 by David Waern at 2010-11-16T00:10:28+00:00 Style wibbles - - - - - cde707a5 by David Waern at 2010-11-16T00:12:00+00:00 Remove LANGUAGE ForeignFunctionInterface pragmas - - - - - 1dbda8ed by David Waern at 2010-11-16T00:17:21+00:00 Make a little more use of DoAndIfThenElse - - - - - 4c45ff6e by David Waern at 2010-11-16T00:59:41+00:00 hlint police - - - - - d2feaf09 by David Waern at 2010-11-16T01:14:15+00:00 hlint police - - - - - 99876e97 by David Waern at 2010-11-20T19:06:00+00:00 Haddock documentation updates - - - - - 65ce6987 by David Waern at 2010-11-20T19:42:51+00:00 Follow the style guide closer in Haddock.Types and improve docs - - - - - 28ca304a by tob.brandt at 2010-11-20T17:04:40+00:00 add full qualification for undocumented names - - - - - d61341e3 by David Waern at 2010-11-20T20:04:15+00:00 Re-structure qualification code a little - - - - - 0057e4d6 by David Waern at 2010-11-20T20:07:55+00:00 Re-order functions - - - - - d7279afd by David Waern at 2010-11-21T03:39:54+00:00 Add BangPatterns to alex and happy source files - - - - - 629fe60e by tob.brandt at 2010-11-23T23:35:11+00:00 documentation for qualification - - - - - 37031cee by David Waern at 2010-11-23T21:06:44+00:00 Update CHANGES - don't mention 2.8.2, we won't release it - - - - - f2489e19 by David Waern at 2010-12-01T21:57:11+00:00 Update deps of runtests.hs to work with ghc 7.0.1 - - - - - d3657e9a by David Waern at 2010-12-01T22:04:57+00:00 Make tests compile with ghc 7.0.1 - - - - - a2f09d9b by David Waern at 2010-12-01T22:06:59+00:00 Update tests following version bump - - - - - 50883ebb by David Waern at 2010-12-06T14:09:18+00:00 Update tests following recent changes - - - - - fc2fadeb by David Waern at 2010-12-06T14:17:29+00:00 Add a flag --pretty-html for rendering indented html with newlines - - - - - 30832ef2 by David Waern at 2010-12-06T14:17:35+00:00 Use --pretty-html when running the test suite. Makes it easier to compare output - - - - - a0b81b31 by David Waern at 2010-12-06T14:18:27+00:00 Wibble - - - - - 3aaa23fe by David Waern at 2010-12-06T14:19:29+00:00 Haddockify ppHtml comments - - - - - 24bb24f0 by David Waern at 2010-12-06T14:23:15+00:00 Remove --debug. It was't used, and --verbosity should take its place - - - - - 6bc076e5 by David Waern at 2010-12-06T14:25:37+00:00 Rename golden-tests into html-tests. "golden tests" sounds strange - - - - - 53301e55 by David Waern at 2010-12-06T14:26:26+00:00 QUALI -> QUAL in the description --qual for consistency - - - - - 98b6affb by David Waern at 2010-12-06T21:54:02+00:00 Bump version - - - - - 371bf1b3 by David Waern at 2010-12-06T22:08:55+00:00 Update tests following version bump - - - - - 25be762d by David Waern at 2010-12-06T22:21:03+00:00 Update CHANGES - - - - - 7c7dac71 by David Waern at 2010-12-06T22:33:43+00:00 Update ANNOUNCE - - - - - 30d7a5f2 by Simon Peyton Jones at 2010-11-15T08:38:38+00:00 Alex generates BangPatterns, so make Lex.x accept them (It'd be better for Alex to generate this pragma.) - - - - - 605e8018 by Simon Marlow at 2010-11-17T11:37:24+00:00 Add {-# LANGUAGE BangPatterns #-} to mollify GHC - - - - - a46607ba by David Waern at 2010-12-07T14:08:10+00:00 Solve conflicts - - - - - b28cda66 by David Waern at 2010-12-09T20:41:35+00:00 Docs: Mention that \ is a special character in markup - - - - - a435bfdd by Ian Lynagh at 2010-11-17T14:01:19+00:00 TAG GHC 7.0.1 release - - - - - 5a15a05a by David Waern at 2010-12-11T17:51:19+00:00 Fix indentation problem - - - - - 4232289a by Lennart Kolmodin at 2010-12-17T18:32:03+00:00 Revise haddock.cabal given that we now require ghc-7 default-language should be Haskell2010, slight new semantics for extensions. Rewrite into clearer dependencies of base and Cabal. - - - - - a36302dc by David Waern at 2010-12-19T17:12:37+00:00 Update CHANGES - - - - - 7c8b85b3 by David Waern at 2010-12-19T17:14:24+00:00 Bump version - - - - - cff22813 by Ian Lynagh at 2011-01-05T18:24:27+00:00 Write hoogle output in utf8; fixes GHC build on Windows - - - - - c7e762ea by David Waern at 2011-01-22T00:00:35+00:00 Put title outside doc div when HTML:fying title+prologue Avoids indenting the title, and makes more sense since the title is not a doc string anyway. - - - - - 5f639054 by David Waern at 2011-01-22T16:09:44+00:00 Fix spelling error - contributed by Marco Silva - - - - - c11dce78 by Ian Lynagh at 2011-01-07T02:33:11+00:00 Follow GHC build system changes - - - - - 101cfaf5 by David Waern at 2011-01-08T14:06:44+00:00 Bump version - - - - - af62348b by David Waern at 2011-01-08T14:07:07+00:00 TAG 2.9.2 - - - - - 4d1f6461 by Ian Lynagh at 2011-01-07T23:06:57+00:00 Name the haddock script haddock-ghc-7.0.2 instead of haddock-7.0.2; haskell/haddock#4882 "7.0.2" looked like a haddock version number before - - - - - 8ee4d5d3 by Simon Peyton Jones at 2011-01-10T17:31:12+00:00 Update Haddock to reflect change in hs_tyclds field of HsGroup - - - - - 06f3e3db by Ian Lynagh at 2011-03-03T15:02:37+00:00 TAG GHC 7.0.2 release - - - - - 7de0667d by David Waern at 2011-03-10T22:47:13+00:00 Update CHANGES - - - - - 33a9f1c8 by David Waern at 2011-03-10T22:47:31+00:00 Fix build with ghc 7.0.1 - - - - - 4616f861 by David Waern at 2011-03-10T22:47:50+00:00 TAG 2.9.2-actual - - - - - 0dab5e3c by Simon Hengel at 2011-04-08T15:53:01+00:00 Set shell script for unit tests back to work - - - - - 85c54dee by Simon Hengel at 2011-04-08T16:01:24+00:00 Set unit tests back to work Here "ghci>" was still used instead of ">>>". - - - - - 1cea9b78 by Simon Hengel at 2011-04-08T16:25:36+00:00 Update runtests.hs for GHC 7.0.2 - - - - - 8e5b3bbb by Simon Hengel at 2011-04-08T16:28:49+00:00 Update Haddock version in *.html.ref - - - - - 2545e955 by Simon Hengel at 2011-04-08T17:09:28+00:00 Add support for blank lines in the result of examples Result lines that only contain the string "<BLANKLINE>" are treated as a blank line. - - - - - adf64d2e by Simon Hengel at 2011-04-08T17:36:50+00:00 Add documentation for "support for blank lines in the result of examples" - - - - - c51352ca by David Waern at 2011-05-21T23:57:56+00:00 Improve a haddock comment - - - - - 7419cf2c by David Waern at 2011-05-22T15:41:52+00:00 Use cabal's test suite support to run the test suite This gives up proper dependency tracking of the test script. - - - - - 7770070c by David Waern at 2011-05-22T01:45:44+00:00 We don't need to send DocOptions nor a flag to mkExportItems - - - - - 9d95b7b6 by David Waern at 2011-05-22T21:39:03+00:00 Fix a bug - - - - - 1f93699b by David Waern at 2011-05-22T21:40:21+00:00 Break out fullContentsOf, give it a better name and some documentation The documentation describes how we want this function to eventually behave, once we have fixed a few problems with the current implementation. - - - - - 9a86432f by David Waern at 2011-05-22T21:53:52+00:00 Fix some stylistic issues in mkExportItems - - - - - c271ff0c by David Waern at 2011-05-22T22:09:11+00:00 Indentation - - - - - 93e602b1 by David Waern at 2011-06-10T01:35:31+00:00 Add git commits since switchover: darcs format (followed by a conflict resolution): commit 6f92cdd12d1354dfbd80f8323ca333bea700896a Merge: f420cc4 28df3a1 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Thu May 19 17:54:34 2011 +0100 Merge remote branch 'origin/master' into ghc-generics commit 28df3a119f770fdfe85c687dd73d5f6712b8e7d0 Author: Max Bolingbroke <batterseapower at hotmail.com> Date: Sat May 14 22:37:02 2011 +0100 Unicode fix for getExecDir on Windows commit 89813e729be8bce26765b95419a171a7826f6d70 Merge: 6df3a04 797ab27 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 9 11:55:17 2011 +0100 Merge branch 'ghc-new-co' commit 6df3a040da3dbddee67c6e30a892f87e6b164383 Author: Ian Lynagh <igloo at earth.li> Date: Sun May 8 17:05:50 2011 +0100 Follow changes in SDoc commit f420cc48b9259f0b1afd2438b12f9a2bde57053d Author: Jose Pedro Magalhaes <jpm at cs.uu.nl> Date: Wed May 4 17:31:52 2011 +0200 Adapt haddock to the removal of HsNumTy and TypePat. commit 797ab27bdccf39c73ccad374fea265f124cb52ea Merge: 1d81436 5a91450 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:05:03 2011 +0100 Merge remote branch 'origin/master' into ghc-new-co commit 1d8143659a81cf9611668348e33fd0775c7ab1d2 Author: Simon Peyton Jones <simonpj at microsoft.com> Date: Mon May 2 12:03:46 2011 +0100 Wibbles for ghc-new-co branch commit 5a91450e2ea5a93c70bd3904b022445c9cc82488 Author: Ian Lynagh <igloo at earth.li> Date: Fri Apr 22 00:51:56 2011 +0100 Follow defaultDynFlags change in GHC - - - - - 498da5ae by David Waern at 2011-06-11T00:33:33+00:00 * Merge in git patch from Michal Terepeta >From 6fc71d067738ef4b7de159327bb6dc3d0596be29 Mon Sep 17 00:00:00 2001 From: Michal Terepeta <michal.terepeta at gmail.com> Date: Sat, 14 May 2011 19:18:22 +0200 Subject: [PATCH] Follow the change of TypeSig in GHC. This follows the change in GHC to make TypeSig take a list of names (instead of just one); GHC ticket haskell/haddock#1595. This should also improve the Haddock output in case the user writes a type signature that refers to many names: -- | Some comment.. foo, bar :: ... will now generate the expected output with one signature for both names. - - - - - 094607fe by Ian Lynagh at 2011-06-17T19:10:29+01:00 Fix build - - - - - 8fa35740 by Ian Lynagh at 2011-06-26T21:06:40+01:00 Bump GHC dep to allow 7.2 - - - - - e4d2ca3c by Ian Lynagh at 2011-07-07T23:06:28+01:00 Relax base dep - - - - - b948fde9 by Ian Lynagh at 2011-07-28T16:39:45+01:00 GHC build system: Don't install the datafiles twice - - - - - f82f6d70 by Simon Marlow at 2011-08-11T12:08:15+01:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - b341cc12 by Max Bolingbroke at 2011-08-22T20:25:27+01:00 Fix compilation with no-pred-ty GHC - - - - - 30494581 by Max Bolingbroke at 2011-08-23T10:20:54+01:00 Remaining fixes for PredTy removal - - - - - 0b197138 by Max Bolingbroke at 2011-08-26T08:27:45+01:00 Rename factKind to constraintKind - - - - - a379bec5 by Max Bolingbroke at 2011-09-04T12:54:47+01:00 Deal with change to IParam handling in GHC - - - - - f94e421b by Max Bolingbroke at 2011-09-06T17:34:31+01:00 Adapt Haddock for the ConstraintKind extension changes - - - - - 8821e5cc by Max Bolingbroke at 2011-09-09T08:24:59+01:00 Ignore associated type defaults (just as we ignore default methods) - - - - - 31a0afd4 by Max Bolingbroke at 2011-09-09T09:06:00+01:00 Merge branch 'no-pred-ty' of ssh://darcs.haskell.org/srv/darcs/haddock into no-pred-ty - - - - - dd3b530a by Max Bolingbroke at 2011-09-09T14:10:25+01:00 Merge branch 'no-pred-ty' Conflicts: src/Haddock/Convert.hs - - - - - 5f25ec96 by Max Bolingbroke at 2011-09-09T14:10:40+01:00 Replace FactTuple with ConstraintTuple - - - - - cd30b9cc by David Waern at 2011-09-26T02:17:55+02:00 Bump to version 2.9.3 - - - - - 4fbfd397 by Max Bolingbroke at 2011-09-27T14:55:21+01:00 Follow changes to BinIface Name serialization - - - - - 92257d90 by David Waern at 2011-09-30T23:45:07+02:00 Fix problem with test files not added to distribution tarball - - - - - 00255bda by David Waern at 2011-09-30T23:48:24+02:00 Merge branch 'development' - - - - - 5421264f by David Waern at 2011-10-01T01:25:39+02:00 Merge in darcs patch from Simon Meier: Wed Jun 1 19:41:16 CEST 2011 iridcode at gmail.com * prettier haddock coverage info The new coverage info rendering uses less horizontal space. This reduces the number of unnecessary line-wrappings. Moreover, the most important information, how much has been documented already, is now put up front. Hopefully, this makes it more likely that a library author is bothered by the low coverage of his modules and fixes that issue ;-) - - - - - 07d318ef by David Waern at 2011-10-01T01:34:10+02:00 Use printException instead of deprecated printExceptionAndWarnings - - - - - 40d52ee4 by David Waern at 2011-10-01T01:41:13+02:00 Merge in darcs pach: Mon Apr 11 18:09:54 JST 2011 Liyang HU <haddock at liyang.hu> * Remember collapsed sections in index.html / haddock-util.js - - - - - 279d6dd4 by David Waern at 2011-10-01T01:55:45+02:00 Merge in darcs patch: Joachim Breitner <mail at joachim-breitner.de>**20110619201645 Ignore-this: f6c51228205b0902ad5bfad5040b989a As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301, generating the global index takes much too long if type-level (with lots of auto-generated types) is installed. The patch avoids a quadratic runtime in the subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s. - - - - - d1612383 by David Waern at 2011-10-01T01:56:48+02:00 Merge branch 'development' - - - - - 347520c1 by David Waern at 2011-10-01T01:56:54+02:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9a0c95e8 by David Waern at 2011-10-01T02:19:10+02:00 Improve .cabal file - - - - - 6967dc64 by Ian Lynagh at 2011-10-01T01:34:06+01:00 Follow changes to ForeignImport/ForeignExport in GHC - - - - - 565cb26b by Simon Marlow at 2011-10-04T00:15:04+02:00 Hack this to make it work with both Alex 2.x and Alex 3.x. Unicode in documentation strings is (still) mangled. I don't think it's possible to make it so that we get the current behaviour with Alex 2.x but magic Unicode support if you use Alex 3.x. At some point we have to decide that Alex 3.x is a requirement, then we can do Unicode. - - - - - 8b74f512 by David Waern at 2011-10-04T00:18:17+02:00 Requre ghc >= 7.2 - - - - - 271d360c by David Waern at 2011-10-04T00:22:50+02:00 Bump version to 2.9.4 - - - - - 37f3edb0 by David Waern at 2011-10-06T02:30:21+02:00 Add alex and happy to build-tools. - - - - - 7ac2bb6e by David Terei at 2011-10-12T14:02:55-07:00 Add safe haskell indication to haddock output - - - - - 42c91a47 by David Terei at 2011-10-12T14:06:03-07:00 Fix CSS issue with info table not being contained in module header - - - - - 0eddab6c by David Terei at 2011-10-12T14:06:58-07:00 Add safe haskell indication to haddock output - - - - - 3df058eb by David Terei at 2011-10-12T14:07:07-07:00 Fix CSS issue with info table not being contained in module header - - - - - a40a6c3f by David Waern at 2011-10-22T11:29:06+02:00 Bump .haddock file version since the format has changed recently - - - - - 8a6254be by David Waern at 2011-10-22T11:30:42+02:00 Merge branch 'development' - - - - - 642e3e02 by David Waern at 2011-10-23T21:23:39+02:00 Sort import list - - - - - 36371cf8 by David Waern at 2011-10-23T22:48:18+02:00 Remove NEW_GHC_LAYOUT conditional. - - - - - 5604b499 by David Waern at 2011-10-27T00:15:03+02:00 Add --print-ghc-path. - - - - - 463499fa by David Waern at 2011-10-27T00:16:22+02:00 Make testsuite able to find its dependencies automatically. - - - - - a3506172 by Ryan Newton at 2011-11-05T05:59:58-04:00 Improved declNames internal error. Added a case to handle DocD. - - - - - 001b8baf by David Waern at 2011-11-05T20:37:29+01:00 Rename copy.hs -> accept.hs. - - - - - 55d808d3 by David Waern at 2011-11-05T23:30:02+01:00 Fix build. - - - - - deb5c3be by David Waern at 2011-11-06T00:01:47+01:00 Merge branch 'master' of http://darcs.haskell.org/haddock - - - - - 9b663554 by David Waern at 2011-11-06T00:03:45+01:00 Merge https://github.com/rrnewton/haddock - - - - - 1abb0ff6 by David Waern at 2011-11-06T01:20:37+01:00 Use getDeclMainBinder instead of declNames. - - - - - 4b005c01 by David Waern at 2011-11-06T19:09:53+01:00 Fix build. - - - - - c2c51bc7 by Ian Lynagh at 2011-11-06T23:01:33+00:00 Remove -DNEW_GHC_LAYOUT in ghc.mk - - - - - f847d703 by Jose Pedro Magalhaes at 2011-11-11T09:07:39+00:00 New kind-polymorphic core This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds - - - - - 7d7c3b09 by Jose Pedro Magalhaes at 2011-11-16T21:42:22+01:00 Follow changes to tuple sorts in master - - - - - 8430e03e by Simon Peyton Jones at 2011-11-17T10:20:27+00:00 Remove redundant imports - - - - - d1b06832 by Ian Lynagh at 2011-11-19T01:33:21+00:00 Follow GHC build system change to the way we call rm - - - - - 9e2230ed by David Waern at 2011-11-24T15:00:24+01:00 Fix a bug in test runner and get rid of regex-compat dependency. - - - - - 52039b21 by David Waern at 2011-11-24T23:55:36+01:00 Avoid haskell98 dependency in test - - - - - 92e1220d by David Waern at 2011-11-25T00:03:33+01:00 Avoid depency on regex-compat also in accept.hs. - - - - - ddac6b6f by David Waern at 2011-11-25T02:13:38+01:00 Accept test output. - - - - - 5a720455 by David Waern at 2011-11-25T02:16:20+01:00 Some more changes to test scripts. - - - - - 170a9004 by David Waern at 2011-11-25T02:30:41+01:00 Add flag --interface-version. - - - - - d225576c by David Waern at 2011-11-25T02:39:26+01:00 Remove #ifs for older compiler versions. - - - - - f0d0a4f5 by David Waern at 2011-11-26T04:20:12+01:00 Give preference to type over data constructors for doc comment links at renaming time. Previously this was done in the backends. Also, warn when a doc comment refers to something that is in scope but which we don't have the .haddock file for. These changes mean we can make DocIdentifier [a] into DocIdentifier a. - - - - - eef0e776 by David Waern at 2011-11-26T17:01:06+01:00 Allow doc comments to link to out-of-scope things (#78). (A bug that should have been fixed long ago.) - - - - - 565ad529 by David Waern at 2011-11-26T19:56:21+01:00 Update tests. - - - - - fb3ce7b9 by David Waern at 2011-11-26T21:44:28+01:00 Cleanup. - - - - - d0328126 by David Waern at 2011-11-26T22:10:28+01:00 Fix module reference bug. - - - - - c03765f8 by David Waern at 2011-12-03T05:20:20+01:00 Slightly better behaviour on top-levels without type signatures. - Docs don't get attached to the next top-level with signature by mistake. - If there's an export list and the top-level is part of it, its doc comment shows up in the documentation. - - - - - 48461d31 by David Waern at 2011-12-03T05:38:10+01:00 Add a test for Unicode doc comments. - - - - - 549c4b4e by David Waern at 2011-12-03T19:07:55+01:00 Cleanup. - - - - - 7bfecf91 by David Waern at 2011-12-03T20:13:08+01:00 More cleanup. - - - - - 14fab722 by Ian Lynagh at 2011-12-12T21:21:35+00:00 Update dependencies and binaryInterfaceVersion - - - - - 469e6568 by Ian Lynagh at 2011-12-18T12:56:16+00:00 Fix (untested) building from source tarball without alex/happy haddock's .cabal file was declaring that it needed alex and happy to build, but in the GHC source tarballs it doesn't. - - - - - 895c9a8c by David Waern at 2011-12-27T12:57:43+01:00 Go back to having a doc, sub and decl map instead of one big decl map. This setup makes more sense since when we add value bindings to the processed declarations (for type inference), we will have multiple declarations which should share documentation. Also, we already have a separate doc map for instances which we can now merge into the main doc map. Another benefit is that we don't need the DeclInfo type any longer. - - - - - 736767d9 by David Waern at 2011-12-27T13:33:41+01:00 Merge ../../../haddock Conflicts: src/Haddock/InterfaceFile.hs - - - - - 20016f79 by David Waern at 2011-12-27T13:57:23+01:00 Bump version. - - - - - 31f276fb by David Waern at 2011-12-27T13:57:32+01:00 Merge ../ghc/utils/haddock - - - - - 95b367cd by David Waern at 2011-12-27T14:57:29+01:00 Update tests following version bump. - - - - - fa3c94cd by David Waern at 2011-12-27T14:57:51+01:00 Get rid of quite unnecessary use of different lists. - - - - - 9c4d3c54 by David Waern at 2011-12-27T15:26:42+01:00 Cleanup. - - - - - 2caf9f90 by David Waern at 2011-12-27T16:18:05+01:00 Wibbles. - - - - - 3757d09b by David Waern at 2011-12-27T20:50:26+01:00 Complete support for inferring types for top-level bindings. - - - - - 53418734 by David Waern at 2011-12-28T15:02:13+01:00 Minor fixes and cleanup. - - - - - 0c9d0385 by Ian Lynagh at 2012-01-03T18:31:29+00:00 Follow rename of Instance to ClsInst in GHC - - - - - c9bc969a by Simon Hengel at 2012-01-12T21:28:14+01:00 Make sure that generated xhtml is valid (close haskell/haddock#186) Thanks to Phyx. - - - - - 836a0b9a by David Waern at 2012-02-01T02:30:05+01:00 Fix bug introduced in my recent refactoring. - - - - - c7d733eb by David Waern at 2012-02-01T02:30:26+01:00 Cleanup mkMaps and avoid quadratic behaviour. - - - - - da3cda8f by David Waern at 2012-02-01T02:56:56+01:00 Require ghc >= 7.4. - - - - - 83a3287e by David Waern at 2012-02-01T02:57:36+01:00 Update CHANGES. - - - - - 93408f0b by Simon Hengel at 2012-02-04T00:48:04+01:00 Add reference renderings - - - - - 49d00d2c by Simon Hengel at 2012-02-04T00:48:25+01:00 Set unit tests for parser back to work - - - - - eb450980 by Simon Hengel at 2012-02-04T00:49:07+01:00 Add .gitignore - - - - - a841602c by Simon Hengel at 2012-02-04T00:49:16+01:00 Add .ghci file - - - - - 8861199d by Simon Hengel at 2012-02-04T00:49:29+01:00 tests/html-tests/copy.hs: Use mapM_ instead of mapM So we do net get a list of () on stdout when running with runhaskell. - - - - - b477d9b5 by Simon Hengel at 2012-02-04T00:49:46+01:00 Remove index files from golden tests - - - - - 9dbda34e by Simon Hengel at 2012-02-04T00:49:57+01:00 Add /tests/html-tests/tests/*index*.ref to .gitignore - - - - - a9434817 by Simon Hengel at 2012-02-04T00:50:04+01:00 Add DocWarning to Doc The Xhtml backend has special markup for that, Hoogle and LaTeX reuse what we have for DocEmphasis. - - - - - de2fb6fa by Simon Hengel at 2012-02-04T00:50:13+01:00 Add support for module warnings - - - - - 0640920e by Simon Hengel at 2012-02-04T00:50:21+01:00 Add tests for module warnings - - - - - 30ce0d77 by Simon Hengel at 2012-02-04T00:50:29+01:00 Add support for warnings - - - - - bb367960 by Simon Hengel at 2012-02-04T00:50:37+01:00 Add tests for warnings - - - - - 6af1dc2d by Simon Hengel at 2012-02-04T00:50:50+01:00 Expand type signatures in export list (fixes haskell/haddock#192) - - - - - a06cbf25 by Simon Hengel at 2012-02-04T00:51:04+01:00 Expand type signatures for modules without explicit export list - - - - - 57dda796 by Simon Hengel at 2012-02-04T00:51:15+01:00 Remove obsolete TODO - - - - - 270c3253 by David Waern at 2012-02-04T00:51:24+01:00 Fix issues in support for warnings. * Match against local names only. * Simplify (it's OK to map over the warnings). - - - - - 683634bd by David Waern at 2012-02-04T00:55:11+01:00 Some cleanup and make sure we filter warnings through exports. - - - - - 210cb4ca by David Waern at 2012-02-04T03:01:30+01:00 Merge branch 'fix-for-186' of https://github.com/sol/haddock into ghc-7.4 - - - - - e8db9031 by David Waern at 2012-02-04T03:07:51+01:00 Style police. - - - - - 261f9462 by David Waern at 2012-02-04T03:20:16+01:00 Update tests. - - - - - 823cfc7c by David Waern at 2012-02-04T03:21:12+01:00 Use mapM_ in accept.hs as well. - - - - - 873dd619 by David Waern at 2012-02-04T03:21:33+01:00 Remove copy.hs - use accept.hs instead. - - - - - 0e31a14a by David Waern at 2012-02-04T03:47:33+01:00 Use <> instead of mappend. - - - - - 2ff7544f by David Waern at 2012-02-04T03:48:55+01:00 Remove code for older ghc versions. - - - - - dacf2786 by David Waern at 2012-02-04T15:52:51+01:00 Clean up some code from last SoC project. - - - - - 00cbb117 by David Waern at 2012-02-04T21:43:49+01:00 Mostly hlint-inspired cleanup. - - - - - 7dc86cc2 by Simon Peyton Jones at 2012-02-06T09:14:41+00:00 Track changes in HsDecls - - - - - f91f82fe by Ian Lynagh at 2012-02-16T13:40:11+00:00 Follow changes in GHC caused by the CAPI CTYPE pragma - - - - - a0ea6b0b by Ian Lynagh at 2012-02-22T02:26:12+00:00 Follow changes in GHC - - - - - b23b07d1 by Simon Peyton Jones at 2012-03-02T16:36:41+00:00 Follow changes in data representation from the big PolyKinds commit - - - - - 43406022 by Simon Hengel at 2012-03-05T11:18:34+01:00 Save/restore global state for static flags when running GHC actions This is necessary if we want to run createInterfaces (from Documentation.Haddock) multiple times in the same process. - - - - - 9fba16fe by Paolo Capriotti at 2012-03-06T10:57:33+00:00 Update .gitignore. - - - - - a9325044 by Simon Peyton Jones at 2012-03-14T17:35:42+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - fd48065a by Iavor Diatchki at 2012-03-15T22:43:35-07:00 Add support for type-level literals. - - - - - 2e8206dd by Simon Peyton Jones at 2012-03-16T14:18:22+00:00 Follow changes to tcdKindSig (Trac haskell/haddock#5937) - - - - - 93e13319 by Simon Peyton Jones at 2012-03-17T01:04:05+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock Conflicts: src/Haddock/Convert.hs - - - - - d253fa71 by Iavor Diatchki at 2012-03-19T20:12:18-07:00 Merge remote-tracking branch 'origin/master' into type-nats - - - - - fc40acc8 by Iavor Diatchki at 2012-03-19T20:31:27-07:00 Add a missing case for type literals. - - - - - fd2ad699 by Iavor Diatchki at 2012-03-24T13:28:29-07:00 Rename variable to avoid shadowing warning. - - - - - 9369dd3c by Simon Peyton Jones at 2012-03-26T09:14:23+01:00 Follow refactoring of TyClDecl/HsTyDefn - - - - - 38825ca5 by Simon Peyton Jones at 2012-03-26T09:14:37+01:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - 4324ac0f by David Waern at 2012-04-01T01:51:19+02:00 Disable unicode test. - - - - - 3165b750 by David Waern at 2012-04-01T01:51:34+02:00 Take reader environment directly from TypecheckedSource. - - - - - 213b644c by David Waern at 2012-04-01T01:55:20+02:00 Cleanup. - - - - - 3118b4ba by David Waern at 2012-04-01T02:16:15+02:00 Don't filter out unexported names from the four maps - fixes a regression. - - - - - d6524e17 by David Waern at 2012-04-01T02:40:34+02:00 Fix crash when using --qual. Naughty GHC API! - - - - - ea3c43d8 by Henning Thielemann at 2012-04-01T13:03:07+02:00 add QualOption type for distinction between qualification argument given by the user and the actual qualification for a concrete module - - - - - 5422ff05 by Henning Thielemann at 2012-04-01T16:25:02+02:00 emit an error message when the --qual option is used incorrectly - - - - - 026e3404 by David Waern at 2012-04-01T18:10:30+02:00 Don't crash on unicode strings in doc comments. - - - - - ce006632 by David Waern at 2012-04-01T20:13:35+02:00 Add test for --ignore-all-exports flag/ignore-exports pragma. - - - - - 6e4dd33c by David Waern at 2012-04-01T20:21:03+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.4 - - - - - 734ae124 by Henning Thielemann at 2012-04-01T20:22:10+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - 622f9ba5 by David Waern at 2012-04-01T21:26:13+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 55ce17cb by Henning Thielemann at 2012-04-01T22:03:25+02:00 'abbreviate' qualification style - basic support Currently we ignore the package a module is imported from. This means that a module import would shadow another one with the same module name from a different package. - - - - - c85314ef by David Waern at 2012-04-01T22:05:12+02:00 Check qualification option before processing modules. - - - - - ae4b626c by Henning Thielemann at 2012-04-02T00:19:36+02:00 abbreviated qualification: use Packages.lookupModuleInAllPackages for finding the package that a module belongs to - - - - - 60bdbcf5 by Henning Thielemann at 2012-04-02T00:25:31+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - df44301d by Henning Thielemann at 2012-04-02T00:29:05+02:00 qualification style 'abbreviated' -> 'aliased' - - - - - f4192a64 by David Waern at 2012-04-02T01:05:47+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - 7ba09067 by David Terei at 2012-04-04T15:08:21-07:00 Fix reporting of modules safe haskell mode (#5989) - - - - - d0cc33d0 by David Terei at 2012-04-06T15:50:41+01:00 Fix reporting of modules safe haskell mode (#5989) - - - - - 6e3434c5 by Simon Peyton Jones at 2012-04-20T18:37:46+01:00 Track changes in HsSyn - - - - - 22014ed0 by Simon Peyton Jones at 2012-05-11T22:45:15+01:00 Follow changes to LHsTyVarBndrs - - - - - d9a07b24 by David Waern at 2012-05-15T01:46:35+02:00 Merge branch 'ghc-7.4' of http://darcs.haskell.org/haddock into ghc-7.4 - - - - - a6c4ebc6 by David Waern at 2012-05-16T02:18:32+02:00 Update CHANGES. - - - - - 8e181d29 by David Waern at 2012-05-16T02:27:56+02:00 Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4 - - - - - e358210d by David Waern at 2012-05-16T02:35:33+02:00 Mention the new aliased --qual mode in CHANGES. - - - - - efd36a28 by David Waern at 2012-05-16T21:33:13+02:00 Bump version number. - - - - - d6b3af14 by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for deprecated record field - - - - - 927f800e by Simon Hengel at 2012-05-17T19:08:20+02:00 Use >>= instead of fmap and join - - - - - 048b41d5 by Simon Hengel at 2012-05-17T19:08:20+02:00 newtype-wrap Doc nodes for things that may have warnings attached - - - - - e3a89fc3 by Simon Hengel at 2012-05-17T19:08:20+02:00 Attach warnings to `Documentation` type - - - - - 5d4cc43d by Simon Hengel at 2012-05-17T19:08:20+02:00 Simplify lookupWarning - - - - - cf8ae69d by Simon Hengel at 2012-05-17T19:08:20+02:00 Add test for haskell/haddock#205 - - - - - cb409b19 by Simon Peyton Jones at 2012-05-25T08:30:11+01:00 Follow changes in LHsTyVarBndrs - - - - - 2d5f4179 by Simon Hengel at 2012-05-26T19:21:29+02:00 Add Applicative instance for (GenRnM a) - - - - - e4373060 by Simon Hengel at 2012-05-26T19:21:33+02:00 Use a map for warnings, as suggested by @waern - - - - - 597a68c7 by Simon Hengel at 2012-05-27T08:48:24+02:00 Add an optional label to URLs - - - - - ef1ac7fe by Simon Hengel at 2012-05-27T08:48:24+02:00 Add support for hyperlink labels to parser - - - - - 41f2adce by Simon Hengel at 2012-05-27T08:48:24+02:00 Add golden test for hyperlinks - - - - - 83d5e764 by Simon Hengel at 2012-05-27T08:50:02+02:00 Use LANGUAGE pragmas instead of default-extensions in cabal file - - - - - ddb755e5 by Simon Hengel at 2012-05-27T08:50:02+02:00 Fix typo in comment - - - - - 110676b4 by Simon Hengel at 2012-05-27T08:50:02+02:00 Add a type signature for a where-binding - - - - - 7d9ba2a0 by Ian Lynagh at 2012-06-12T14:38:01+01:00 Follow changes in GHC - - - - - 47c704f2 by Ian Lynagh at 2012-06-12T18:52:16+01:00 Follow changes in GHC - - - - - e1efe1ab by Simon Peyton Jones at 2012-06-13T17:25:29+01:00 Follow changes for the implementation of implicit parameters - - - - - 69abc81c by Ian Lynagh at 2012-06-19T22:52:58+01:00 Follow changes in base - - - - - 9d074a21 by Paolo Capriotti at 2012-06-22T18:26:47+01:00 Use right docMap to get decl documentation. - - - - - e3292ef6 by Ian Lynagh at 2012-07-15T01:31:19+01:00 Follow changes in GHC - - - - - ceae56b0 by Ian Lynagh at 2012-07-16T21:22:48+01:00 Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough - - - - - 9df72735 by Paolo Capriotti at 2012-07-19T16:49:32+01:00 Forward port changes from stable. - - - - - 572f5fcf by Ian Lynagh at 2012-07-19T20:38:26+01:00 Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock - - - - - 9195aca4 by Paolo Capriotti at 2012-07-20T10:27:28+01:00 Update dependencies. - - - - - 33db3923 by Ian Lynagh at 2012-07-20T17:54:43+01:00 Build with GHC 7.7 - - - - - 925a2cea by David Waern at 2012-07-23T16:50:40+02:00 Merge branch 'dev' of https://github.com/sol/haddock into ghc-7.6 Conflicts: src/Haddock/InterfaceFile.hs - - - - - d710ef97 by David Waern at 2012-07-23T16:52:07+02:00 Bump version number. - - - - - eb0c2f83 by David Waern at 2012-07-23T16:57:58+02:00 Update CHANGES. - - - - - b3f56943 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Hide "internal" instances This fixes haskell/haddock#37 (http://trac.haskell.org/haddock/ticket/37) Precisely, we show an instance iff its class and all the types are exported by non-hidden modules. - - - - - a70aa412 by Roman Cheplyaka at 2012-07-27T13:00:13+03:00 Tests for hiding instances (#37) - - - - - c0f4aa58 by Simon Hengel at 2012-07-27T13:00:13+03:00 Add an other test for hiding instances (#37) - - - - - a7ed6268 by Ian Lynagh at 2012-08-07T14:48:13+01:00 Follow changes in GHC - - - - - 0ab30d38 by Ian Lynagh at 2012-08-13T22:12:27+01:00 Improve haddock memory usage - - - - - 0eaa4e30 by Ian Lynagh at 2012-08-13T23:58:46+01:00 Improve haddock memory usage - - - - - 659d26cf by Ian Lynagh at 2012-08-14T13:16:48+01:00 Remove some temporary pragmas I accidentally recorded - - - - - d97fceb6 by Simon Hengel at 2012-08-25T13:19:34+02:00 Add missing dependency to library - - - - - 4c910697 by Simon Hengel at 2012-08-28T07:39:14+02:00 Move .ghci to project root - - - - - fc3c601a by Simon Hengel at 2012-08-28T07:39:14+02:00 accept.hs: Ignore some files - - - - - 1af9b984 by Simon Hengel at 2012-08-28T07:40:04+02:00 Update reference renderings (bump version) - - - - - 980dc253 by Simon Hengel at 2012-08-28T07:40:32+02:00 Update reference renderings (remove links for ()) - - - - - 33651dbf by Simon Hengel at 2012-08-28T07:41:50+02:00 Update documentation of `runInteractiveProcess` in reference rendering - - - - - 7ab25078 by David Waern at 2012-09-07T10:38:50+02:00 Merge branch 'hiddenInstances2' of http://github.com/feuerbach/haddock into ghc-7.6 - - - - - c3de3a4b by David Waern at 2012-09-07T14:29:27+02:00 Follow changes in GHC. - - - - - 298c43ac by David Waern at 2012-09-07T14:59:24+02:00 Update CHANGES. - - - - - e797993a by David Waern at 2012-09-07T15:21:30+02:00 Update ANNOUNCE. - - - - - d0b44790 by David Waern at 2012-09-07T15:22:43+02:00 Merge branch 'hidden-instances' into ghc-7.6 - - - - - 41a4adc8 by Simon Hengel at 2012-09-08T12:08:37+02:00 Update doc/README - - - - - 71ad1040 by Simon Hengel at 2012-09-08T12:17:17+02:00 Add documentation for URL labels - - - - - 9bb41afd by Simon Peyton Jones at 2012-09-20T18:14:26+01:00 Follow data type changes in the tc-untouchables branch Relating entirely to SynTyConRhs - - - - - b8139bfa by Simon Hengel at 2012-09-21T14:24:16+02:00 Disable Unicode test for now - - - - - a5fafdd7 by Simon Hengel at 2012-09-21T14:35:45+02:00 Update TypeOperators test for GHC 7.6.1 Type operators can't be used as type variables anymore! - - - - - 6ccf0025 by Simon Hengel at 2012-09-21T16:02:24+02:00 Remove (Monad (Either e)) instance from ref. rendering of CrossPackageDocs I do not really understand why the behavior changed, so I'll open a ticket, so that we can further investigate. - - - - - b5c6c138 by Ian Lynagh at 2012-09-27T02:00:57+01:00 Follow changes in GHC build system - - - - - b98eded0 by David Waern at 2012-09-27T15:37:02+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 76cc2051 by David Waern at 2012-09-27T15:48:19+02:00 Update hidden instances tests. - - - - - aeaa1c59 by David Waern at 2012-09-28T10:21:32+02:00 Make API buildable with GHC 7.6. - - - - - d76be1b0 by Simon Peyton Jones at 2012-09-28T15:57:05+01:00 Merge remote-tracking branch 'origin/master' into tc-untouchables - - - - - a1922af8 by David Waern at 2012-09-28T19:50:20+02:00 Fix spurious superclass constraints bug. - - - - - bc41bdbb by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove old examples - - - - - bed7d3dd by Simon Hengel at 2012-10-01T11:30:51+02:00 Adapt parsetests for GHC 7.6.1 - - - - - dcdb22bb by Simon Hengel at 2012-10-01T11:30:51+02:00 Add test-suite section for parsetests to cabal file + get rid of HUnit dependency - - - - - 1e5263c9 by Simon Hengel at 2012-10-01T11:30:51+02:00 Remove test flag from cabal file This was not really used. - - - - - 4beee98b by David Waern at 2012-09-28T23:42:28+02:00 Merge branch 'ghc-7.6' of http://darcs.haskell.org/haddock into ghc-7.6 - - - - - 11dd2256 by Ian Lynagh at 2012-10-03T16:17:35+01:00 Follow change in GHC build system - - - - - fbd77962 by Simon Hengel at 2012-10-03T18:49:40+02:00 Remove redundant dependency from cabal file - - - - - 09218989 by Simon Hengel at 2012-10-04T16:03:05+02:00 Fix typo - - - - - 93a2d5f9 by Simon Hengel at 2012-10-04T16:11:41+02:00 Remove trailing whitespace from cabal file - - - - - c8b46cd3 by Simon Hengel at 2012-10-04T16:12:17+02:00 Export Haddock's main entry point from library - - - - - b411e77b by Simon Hengel at 2012-10-04T16:29:46+02:00 Depend on library for executable The main motivation for this is to increase build speed. In GHC's source tree the library is not build, but all modules are now required for the executable, so that GHC's validate will now detect build failures for the library. - - - - - f8f0979f by Simon Hengel at 2012-10-05T00:32:57+02:00 Set executable flag for Setup.lhs - - - - - dd045998 by Simon Hengel at 2012-10-07T16:44:06+02:00 Extend rather than set environment when running HTML tests On some platforms (e.g. ppc64) GHC requires gcc in the path. - - - - - 7b39c3ae by Simon Hengel at 2012-10-07T17:05:45+02:00 cross-package test: re-export IsString instead of Monad There is a monad instance for Q, which is not available on platforms that do not have GHCi support. This caused CrossPackageDocs to fail on those platforms. Re-exporting IsString should test the same thing, but it works on all platforms. - - - - - 0700c605 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Fix some warnings - - - - - f78eca79 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Make -Wall proof - - - - - 6beec041 by Simon Hengel at 2012-10-07T19:06:34+02:00 runtests.hs: Use listToMaybe/fromMaybe instead of safeHead/maybe - - - - - 44b8ce86 by Ian Lynagh at 2012-10-08T21:59:46+01:00 Follow changes in GHC - - - - - 6da5f702 by Simon Hengel at 2012-10-09T11:16:19+02:00 Update .ghci - - - - - 9ac1a1b9 by Kazu Yamamoto at 2012-10-09T12:45:31+02:00 Add markup support for properties - - - - - 1944cb42 by Simon Hengel at 2012-10-09T12:45:31+02:00 Simplify lexing/parsing of properties In contrast to what we do for examples, we do not really need to capture the "prompt" here. - - - - - bffd8e62 by Simon Hengel at 2012-10-09T13:40:14+02:00 Add HTML test for properties - - - - - 2fe9c5cb by Simon Hengel at 2012-10-09T13:40:21+02:00 Add unit tests for properties - - - - - 874e361b by Simon Hengel at 2012-10-09T13:40:33+02:00 Bump interface version - - - - - 2506cc37 by Simon Hengel at 2012-10-09T15:15:04+02:00 Fix parser bug - - - - - 743d2b7d by Simon Hengel at 2012-10-09T15:31:06+02:00 Allow to load interface files with compatible versions - - - - - 981a1660 by Simon Hengel at 2012-10-10T10:32:05+02:00 Export more types from Documentation.Haddock (fixes haskell/haddock#216) - - - - - dff7dc76 by Simon Hengel at 2012-10-10T11:15:19+02:00 Update ANNOUNCE and CHANGES - - - - - edd2bb01 by Simon Hengel at 2012-10-10T11:22:50+02:00 Bump version - - - - - 5039163b by Simon Hengel at 2012-10-10T13:56:04+02:00 Fix typo in documentation - - - - - e4ce34da by Simon Hengel at 2012-10-10T14:28:35+02:00 Add documentation for properties - - - - - 9555ebca by Simon Hengel at 2012-10-11T10:49:04+02:00 Remove redundant if-defs, more source documentation - - - - - 87aa67e1 by Simon Hengel at 2012-10-11T12:32:51+02:00 Adapt cabal file - - - - - c44c1dee by Simon Hengel at 2012-10-11T12:41:58+02:00 Require ghc 7.6 - - - - - 8383bc34 by Simon Hengel at 2012-10-11T12:50:24+02:00 Bump version - - - - - 1030eb38 by Simon Hengel at 2012-10-11T12:55:44+02:00 Update ANNOUNCE and CHANGES - - - - - 74955088 by Simon Hengel at 2012-10-12T09:49:31+02:00 Improve note about `binaryInterfaceVersion` (thanks David) - - - - - ee30f6b7 by Simon Hengel at 2012-10-13T13:40:59+02:00 Update version in html tests, rpm spec file, and user manual - - - - - f2861f18 by Simon Hengel at 2012-10-13T14:40:33+02:00 Remove unused MonadFix constraint - - - - - dfdf1a74 by Simon Hengel at 2012-10-13T15:15:38+02:00 Minor code simplification - - - - - 4ecd1e70 by Simon Hengel at 2012-10-13T15:33:43+02:00 Increase code locality - - - - - f7df5cc9 by Simon Hengel at 2012-10-13T16:03:12+02:00 Minor code simplification - - - - - e737eb6e by Simon Hengel at 2012-10-13T19:03:04+02:00 Handle HsExplicitListTy in renameer (fixes haskell/haddock#213) - - - - - c2dc8f17 by Simon Hengel at 2012-10-13T20:46:31+02:00 Better error messages - - - - - 14d48b4c by Simon Hengel at 2012-10-14T00:21:07+02:00 Simplify RnM type - - - - - 6c2cc547 by Simon Hengel at 2012-10-14T00:23:35+02:00 Simplify lookupRn - - - - - bc77ce85 by Simon Hengel at 2012-10-14T01:51:32+02:00 Organize unite tests hierarchically - - - - - 2306d117 by Simon Hengel at 2012-10-14T10:34:58+02:00 Handle more cases in renameType - - - - - 8a864203 by Simon Hengel at 2012-10-14T11:47:59+02:00 Add mini_HiddenInstances.html.ref and mini_HiddenInstancesB.html.ref - - - - - 3a978eca by Simon Hengel at 2012-10-14T11:49:28+02:00 Add /tests/html-tests/output/ to .gitignore - - - - - db18888a by Simon Hengel at 2012-10-14T13:38:21+02:00 Allow haddock markup in deprecation messages - - - - - e7cfee9f by Simon Hengel at 2012-10-14T14:00:23+02:00 If parsing of deprecation message fails, include it verbatim - - - - - 242a85be by Simon Hengel at 2012-10-14T14:13:24+02:00 Add description for PruneWithWarning test - - - - - 43d33df1 by Simon Hengel at 2012-10-14T15:40:53+02:00 Minor formatting change - - - - - 22768c44 by Simon Hengel at 2012-10-14T16:03:43+02:00 Properly handle deprecation messages for re-exported things (fixes haskell/haddock#220) - - - - - cb4b9111 by Simon Hengel at 2012-10-14T17:30:28+02:00 Add build artifacts for documentation to .gitignore - - - - - 854cd8de by Simon Hengel at 2012-10-14T23:34:51+02:00 unit-tests: Improve readability Add IsString instance for (Doc RdrName) + use <> instead of DocAppend. - - - - - c4446d54 by Simon Hengel at 2012-10-14T23:37:21+02:00 unit-tests: Minor refactoring Rename parse to parseParas. - - - - - 04f2703c by Simon Hengel at 2012-10-15T00:36:42+02:00 Fix typo - - - - - 3d109e44 by Simon Hengel at 2012-10-15T10:30:07+02:00 Add description for DeprecatedReExport test - - - - - 84f0985c by Simon Hengel at 2012-10-15T14:54:19+02:00 Move resources to /resources directory - - - - - a5de7ca6 by Simon Hengel at 2012-10-15T15:46:18+02:00 Move HTML tests to directory /html-test/ - - - - - e21f727d by Simon Hengel at 2012-10-15T19:32:42+02:00 Move HTML reference renderings to /html-test/ref/ - - - - - 3a3c6c75 by Simon Hengel at 2012-10-15T19:32:42+02:00 Copy css, images, etc. on accept - - - - - 40ead6dc by Simon Hengel at 2012-10-15T19:32:42+02:00 Move unit tests to /test directory - - - - - 99a28231 by Simon Hengel at 2012-10-15T19:32:42+02:00 Fix Setup.lhs /usr/bin/runhaskell is not installed on all systems. - - - - - 95faf45e by Simon Hengel at 2012-10-15T19:32:42+02:00 Make test management scripts more robust * They are now independent from the current directory, and hence can be called from everywhere * On UNIX/Linux they can now be run as scripts - - - - - 027aaa2d by Simon Hengel at 2012-10-15T19:53:40+02:00 Add 'dev' flag to cabal file, that builds without -O2 That way --disable-optimization can be used, which decreases build time considerably. - - - - - e0266ede by Simon Hengel at 2012-10-15T20:03:43+02:00 Add test case for "spurious superclass constraints bug" - - - - - 52a2aa92 by Simon Hengel at 2012-10-15T20:28:55+02:00 Adapt accept.lhs, so that it ignores more index files - - - - - 53530781 by Simon Hengel at 2012-10-15T20:49:39+02:00 Rename html-test/runtests.lhs to html-test/run.lhs - - - - - 84518797 by Simon Hengel at 2012-10-15T20:49:39+02:00 Move source files for HTML tests to html-test/src - - - - - a911dc6c by Simon Hengel at 2012-10-15T20:49:39+02:00 Adapt output directory for HTML tests - - - - - d3c15857 by Ian Lynagh at 2012-10-16T16:54:43+01:00 Follow dopt->gopt rename - - - - - 956665a5 by Simon Hengel at 2012-10-18T08:42:48+02:00 Update html-test/README - - - - - 903b1029 by Simon Hengel at 2012-10-18T08:50:26+02:00 Use markdown for html-test/README - - - - - 150b4d63 by Ian Lynagh at 2012-10-18T16:36:00+01:00 Follow changes in GHC: 'flags' has been renamed 'generalFlags' - - - - - 41e04ff9 by Simon Hengel at 2012-11-28T09:54:35+01:00 Export missing types from Documentation.Haddock - - - - - 9be59237 by Ian Lynagh at 2012-11-30T23:20:47+00:00 Update dependencies - - - - - e06842f5 by Simon Hengel at 2012-12-07T20:58:05+01:00 Bump version - - - - - e3dbede0 by Simon Hengel at 2012-12-07T20:58:05+01:00 Add missing test files to cabal file (fixes haskell/haddock#230) - - - - - ee0dcca7 by Simon Hengel at 2012-12-07T20:58:05+01:00 Update CHANGES - - - - - 51601bdb by Simon Peyton Jones at 2012-12-19T17:28:35+00:00 Track changes in UNPACK pragma stuff - - - - - f2573bc1 by Richard Eisenberg at 2012-12-21T20:56:25-05:00 Implement overlapping type family instances. An ordered, overlapping type family instance is introduced by 'type instance where', followed by equations. See the new section in the user manual (7.7.2.2) for details. The canonical example is Boolean equality at the type level: type family Equals (a :: k) (b :: k) :: Bool type instance where Equals a a = True Equals a b = False A branched family instance, such as this one, checks its equations in order and applies only the first the matches. As explained in the note [Instance checking within groups] in FamInstEnv.lhs, we must be careful not to simplify, say, (Equals Int b) to False, because b might later unify with Int. This commit includes all of the commits on the overlapping-tyfams branch. SPJ requested that I combine all my commits over the past several months into one monolithic commit. The following GHC repos are affected: ghc, testsuite, utils/haddock, libraries/template-haskell, and libraries/dph. Here are some details for the interested: - The definition of CoAxiom has been moved from TyCon.lhs to a new file CoAxiom.lhs. I made this decision because of the number of definitions necessary to support BranchList. - BranchList is a GADT whose type tracks whether it is a singleton list or not-necessarily-a-singleton-list. The reason I introduced this type is to increase static checking of places where GHC code assumes that a FamInst or CoAxiom is indeed a singleton. This assumption takes place roughly 10 times throughout the code. I was worried that a future change to GHC would invalidate the assumption, and GHC might subtly fail to do the right thing. By explicitly labeling CoAxioms and FamInsts as being Unbranched (singleton) or Branched (not-necessarily-singleton), we make this assumption explicit and checkable. Furthermore, to enforce the accuracy of this label, the list of branches of a CoAxiom or FamInst is stored using a BranchList, whose constructors constrain its type index appropriately. I think that the decision to use BranchList is probably the most controversial decision I made from a code design point of view. Although I provide conversions to/from ordinary lists, it is more efficient to use the brList... functions provided in CoAxiom than always to convert. The use of these functions does not wander far from the core CoAxiom/FamInst logic. BranchLists are motivated and explained in the note [Branched axioms] in CoAxiom.lhs. - The CoAxiom type has changed significantly. You can see the new type in CoAxiom.lhs. It uses a CoAxBranch type to track branches of the CoAxiom. Correspondingly various functions producing and consuming CoAxioms had to change, including the binary layout of interface files. - To get branched axioms to work correctly, it is important to have a notion of type "apartness": two types are apart if they cannot unify, and no substitution of variables can ever get them to unify, even after type family simplification. (This is different than the normal failure to unify because of the type family bit.) This notion in encoded in tcApartTys, in Unify.lhs. Because apartness is finer-grained than unification, the tcUnifyTys now calls tcApartTys. - CoreLinting axioms has been updated, both to reflect the new form of CoAxiom and to enforce the apartness rules of branch application. The formalization of the new rules is in docs/core-spec/core-spec.pdf. - The FamInst type (in types/FamInstEnv.lhs) has changed significantly, paralleling the changes to CoAxiom. Of course, this forced minor changes in many files. - There are several new Notes in FamInstEnv.lhs, including one discussing confluent overlap and why we're not doing it. - lookupFamInstEnv, lookupFamInstEnvConflicts, and lookup_fam_inst_env' (the function that actually does the work) have all been more-or-less completely rewritten. There is a Note [lookup_fam_inst_env' implementation] describing the implementation. One of the changes that affects other files is to change the type of matches from a pair of (FamInst, [Type]) to a new datatype (which now includes the index of the matching branch). This seemed a better design. - The TySynInstD constructor in Template Haskell was updated to use the new datatype TySynEqn. I also bumped the TH version number, requiring changes to DPH cabal files. (That's why the DPH repo has an overlapping-tyfams branch.) - As SPJ requested, I refactored some of the code in HsDecls: * splitting up TyDecl into SynDecl and DataDecl, correspondingly changing HsTyDefn to HsDataDefn (with only one constructor) * splitting FamInstD into TyFamInstD and DataFamInstD and splitting FamInstDecl into DataFamInstDecl and TyFamInstDecl * making the ClsInstD take a ClsInstDecl, for parallelism with InstDecl's other constructors * changing constructor TyFamily into FamDecl * creating a FamilyDecl type that stores the details for a family declaration; this is useful because FamilyDecls can appear in classes but other decls cannot * restricting the associated types and associated type defaults for a * class to be the new, more restrictive types * splitting cid_fam_insts into cid_tyfam_insts and cid_datafam_insts, according to the new types * perhaps one or two more that I'm overlooking None of these changes has far-reaching implications. - The user manual, section 7.7.2.2, is updated to describe the new type family instances. - - - - - f788d0fb by Simon Peyton Jones at 2012-12-23T15:49:58+00:00 Track changes in HsBang - - - - - ca460a0c by Simon Peyton Jones at 2012-12-23T15:50:28+00:00 Merge branch 'master' of http://darcs.haskell.org//haddock - - - - - f078fea6 by Simon Peyton Jones at 2013-01-02T08:33:13+00:00 Use InstEnv.instanceSig rather than instanceHead (name change) - - - - - 88e41305 by Simon Peyton Jones at 2013-01-14T17:10:27+00:00 Track change to HsBang type - - - - - e1ad4e19 by Kazu Yamamoto at 2013-02-01T11:59:24+09:00 Merge branch 'ghc-7.6' into ghc-7.6-merge-2 Conflicts: haddock.cabal src/Haddock/Interface/AttachInstances.hs src/Haddock/Interface/Create.hs src/Haddock/Interface/LexParseRn.hs src/Haddock/InterfaceFile.hs src/Haddock/Types.hs Only GHC HEAD can compile this. GHC 7.6.x cannot compile this. Some test fail. - - - - - 62bec012 by Kazu Yamamoto at 2013-02-06T11:12:28+09:00 Using tcSplitSigmaTy in instanceHead' (FIXME is resolved.) - - - - - 013fd2e4 by Kazu Yamamoto at 2013-02-06T17:56:21+09:00 Refactoring instanceHead'. - - - - - 3148ce0e by Kazu Yamamoto at 2013-02-07T17:45:10+09:00 Using new syntax in html-test/src/GADTRecords.hs. - - - - - 626dabe7 by Gabor Greif at 2013-02-15T22:42:01+01:00 Typo - - - - - 1eb667ae by Ian Lynagh at 2013-02-16T17:02:07+00:00 Follow changes in base - - - - - 3ef8253a by Ian Lynagh at 2013-03-01T23:23:57+00:00 Follow changes in GHC's build system - - - - - 1a265a3c by Ian Lynagh at 2013-03-03T23:12:07+00:00 Follow changes in GHC build system - - - - - 69941c79 by Max Bolingbroke at 2013-03-10T09:38:28-07:00 Use Alex 3's Unicode support to properly lex source files as UTF-8 Signed-off-by: David Waern <david.waern at gmail.com> - - - - - ea687dad by Simon Peyton Jones at 2013-03-15T14:16:10+00:00 Adapt to tcRnGetInfo returning family instances too This API change was part of the fix to Trac haskell/haddock#4175. But it offers new information to Haddock: the type-family instances, as well as the class instances, of this type. This patch just drops the new information on the floor, but there's an open opportunity to use it in the information that Haddock displays. - - - - - 971a30b0 by Andreas Voellmy at 2013-05-19T20:47:39+01:00 Fix for haskell/haddock#7879. Changed copy of utils/haddock/html/resources/html to use "cp -RL" rather than "cp -R". This allows users to run validate in a build tree, where the build tree was setup using lndir with a relative path to the source directory. - - - - - 31fb7694 by Ian Lynagh at 2013-05-19T20:47:49+01:00 Use "cp -L" when making $(INPLACE_LIB)/latex too - - - - - e9952233 by Simon Hengel at 2013-06-01T18:06:50+02:00 Add -itest to .ghci - - - - - b06873b3 by Mateusz Kowalczyk at 2013-06-01T18:06:50+02:00 Workaround for a failing build with --enable-tests. - - - - - e7858d16 by Simon Hengel at 2013-06-01T19:29:28+02:00 Fix broken test - - - - - 0690acb1 by Richard Eisenberg at 2013-06-21T14:08:25+01:00 Updates to reflect changes in HsDecls to support closed type families. - - - - - 7fd347ec by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 53ed81b6 by Simon Hengel at 2013-07-08T10:28:48+02:00 Fix failing test - - - - - 931c4f4f by Richard Eisenberg at 2013-07-24T13:15:59+01:00 Remove (error "synifyKind") to use WithinType, to allow haddock to process base. - - - - - 55a9c804 by Richard Eisenberg at 2013-08-02T15:54:55+01:00 Changes to reflect changes in GHC's type HsTyVarBndr - - - - - b6e9226c by Mathieu Boespflug at 2013-08-04T10:39:43-07:00 Output Copright and License keys in Xhtml backend. This information is as relevant in the documentation as it is in the source files themselves. Signed-off-by: David Waern <david.waern at gmail.com> - - - - - 4c66028a by David Waern at 2013-08-04T15:27:36-07:00 Bump interface file version. - - - - - 67340163 by David Waern at 2013-08-09T16:12:51-07:00 Update tests. - - - - - 2087569b by Mateusz Kowalczyk at 2013-08-25T09:24:13+02:00 Add spec tests. This adds tests for all elements we can create during regular parsing. This also adds tests for text with unicode in it. - - - - - 97f36a11 by Mateusz Kowalczyk at 2013-08-27T06:59:12+01:00 Fix ticket haskell/haddock#247. I do the same thing that the XHTML backend does: give these no special treatment and just act as if they are regular functions. - - - - - 60681b4f by Mateusz Kowalczyk at 2013-08-27T21:22:48+02:00 LaTeX tests setup - - - - - fa4c27b2 by Mateusz Kowalczyk at 2013-09-02T23:21:43+01:00 Fixes haskell/haddock#253 - - - - - 1a202490 by Mateusz Kowalczyk at 2013-09-03T01:12:50+01:00 Use Hspec instead of nanospec This is motivated by the fact that Haddock tests are not ran by the GHC's ‘validate’ script so we're pretty liberal on dependencies in that area. Full Hspec gives us some nice features such as Quickcheck integration. - - - - - 8cde3b20 by David Luposchainsky at 2013-09-08T07:27:28-05:00 Fix AMP warnings Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - d10661f2 by Herbert Valerio Riedel at 2013-09-11T15:15:01+02:00 Update Git repo URL in `.cabal` file - - - - - 16a44eb5 by Richard Eisenberg at 2013-09-17T09:34:26-04:00 Revision to reflect new role annotation syntax in GHC. - - - - - 4b9833b9 by Herbert Valerio Riedel at 2013-09-18T10:15:28+02:00 Add missing `traverse` method for `GenLocated` As `Traversable` needs at least one of `traverse` or `sequenceA` to be overridden. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - b71fed5d by Simon Hengel at 2013-09-18T22:43:34+02:00 Add test helper - - - - - 4fc1ea86 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#231 - - - - - 435872f6 by Mateusz Kowalczyk at 2013-09-18T22:43:34+02:00 Fixes haskell/haddock#256 We inject -dynamic-too into flags before we run all our actions in the GHC monad. - - - - - b8b24abb by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Add new field to DynFlags - - - - - 49558795 by Simon Hengel at 2013-09-18T22:43:35+02:00 Fallback to ./resources when Cabal data is not found (so that themes are found during development) - - - - - bf79d05c by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Fixes haskell/haddock#5 - - - - - e1baebc2 by Mateusz Kowalczyk at 2013-09-18T22:43:35+02:00 Print missing documentation. Fixes haskell/haddock#258. - - - - - 02ea74de by Austin Seipp at 2013-10-09T10:52:22-05:00 Don't consider StaticFlags when parsing arguments. Instead, discard any static flags before parsing the command line using GHC's DynFlags parser. See http://ghc.haskell.org/trac/ghc/ticket/8276 Based off a patch from Simon Hengel. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 704fd5bb by Simon Hengel at 2013-11-09T00:15:13+01:00 Update HTML tests - - - - - f9fed49e by Simon Hengel at 2013-11-10T18:43:58+01:00 Bump version - - - - - 97ae1999 by Simon Peyton Jones at 2013-11-25T17:25:14+00:00 Track changes in HsSpliceTy data constructor - - - - - 59ad8268 by Simon Peyton Jones at 2014-01-10T18:17:43+00:00 Adapt to small change in Pretty's exports - - - - - 8b12e6aa by Simon Hengel at 2014-01-12T14:48:35-06:00 Some code simplification by using traverse - - - - - fc5ea9a2 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix warnings in test helper - - - - - 6dbb3ba5 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Add ByteString version of Attoparsec - - - - - 968d7774 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 One pass parser and tests. We remove the HTML test as it is no longer necessary. We cover the test case in spec tests and other HTML tests but keeping this around fails: this is because the new parser has different semantics there. In fact, I suspect the original behaviour was a bug that wasn't caught/fixed but simply included as-is during the testing. - - - - - 37a07c9c by Simon Hengel at 2014-01-12T14:48:35-06:00 Rename Haddock.ParseSpec to Haddock.ParserSpec - - - - - f0f68fe9 by Simon Hengel at 2014-01-12T14:48:35-06:00 Don't append newline to parseString input We also check that we have parsed everything with endOfInput. - - - - - 95d60093 by Simon Hengel at 2014-01-12T14:48:35-06:00 Fix totality, unicode, examples, paragraph parsing Also simplify specs and parsers while we're at it. Some parsers were made more generic. This commit is a part of GHC pre-merge squash, email fuuzetsu at fuuzetsu.co.uk if you need the full commit history. - - - - - 7d99108c by Simon Hengel at 2014-01-12T14:48:35-06:00 Update acceptance tests - - - - - d1b59640 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Support for bold. Conflicts: src/Haddock/Backends/Hoogle.hs src/Haddock/Interface/Rename.hs src/Haddock/Parser.hs - - - - - 4b412b39 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Allow for headings inside function documentation. LaTeX will treat the h3-h6 headings the same as we'd have to hack the style file heavily otherwise and it would make the headings tiny anyway. Hoogle upstream said they will put in the functionality on their end. Conflicts: src/Haddock/Interface/Rename.hs src/Haddock/Types.hs test/Haddock/ParserSpec.hs - - - - - fdcca428 by Mateusz Kowalczyk at 2014-01-12T14:48:35-06:00 Per-module extension flags and language listing. Any extensions that are not enabled by a used language (Haskell2010 &c) will be shown. Furthermore, any implicitly enabled are also going to be shown. While we could eliminate this either by using the GHC API or a dirty hack, I opted not to: if a user doesn't want the implied flags to show, they are recommended to use enable extensions more carefully or individually. Perhaps this will encourage users to not enable the most powerful flags needlessly. Enabled with show-extensions. Conflicts: src/Haddock/InterfaceFile.hs - - - - - 368942a2 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Bump interface version There were some breaking changes over the last few patches so we bump the interface version. This causes a big problem with testing: 1. To generate cross package docs, we first need to generate docs for the package used. 2. To generate package docs with new interface version, we need to use Haddock which has the version bumped. 3. To get Haddock with the version bump, we first need to test cross package docs 4. GOTO 1 So the problem is the chicken and the egg problem. It seems that the only solution would be to generate some interface files on the fly but it is non-trivial. To run this test, you'll have to: * build Haddock without the test (make sure everything else passes) * rebuild the packages used in the test with your shiny new binary making sure they are visible to Haddock * remove the ‘_hidden’ suffix and re-run the tests Note: because the packages currently used for this test are those provided by GHC, it's probably non-trivial to just re-build them. Preferably something less tedious to rebuild should be used and something that is not subject to change. - - - - - 124ae7a9 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow for nesting of paragraphs under lists. The nesting rules are similar to Markdown's with the exception that we can not simply indent the first line of a hard wrapped indented paragraph and have it treated as if it was fully indented. The reason is differences in markup as some of our constructs care about whitespace while others just swallow everything up so it's just a lot easier to not bother with it rather than making arbitrary rules. Note that we now drop trailing for string entities inside of lists. They weren't needed and it makes the output look uniform whether we use a single or double newline between list elements. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - c7913535 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Allow escaping in URLs and pictures. Some tests were moved under parseString as they weren't about paragraph level markup. Conflicts: src/Haddock/Parser.hs test/Haddock/ParserSpec.hs - - - - - 32326680 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update documentation. - - - - - fbef6406 by Mateusz Kowalczyk at 2014-01-12T14:48:36-06:00 Update maintainer - - - - - b40e82f4 by Mateusz Kowalczyk at 2014-01-13T02:39:25-06:00 Fixes haskell/haddock#271 Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - f4eafbf8 by Gergő Érdi at 2014-01-19T15:35:16-06:00 Support for -XPatternSynonyms Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - a8939591 by Austin Seipp at 2014-01-29T08:09:04-06:00 Update CPP check for __GLASGOW_HASKELL__ Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 30d7e9d5 by Gergő Érdi at 2014-01-31T00:15:01+08:00 <+>: Don't insert a space when concatenating empty nodes - - - - - a25ccd4d by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Fix @ code blocks In cases where we had some horizontal space before the closing ‘@’, the parser would not accept the block as a code block and we'd get ugly output. - - - - - 0f67305a by Mateusz Kowalczyk at 2014-01-30T17:22:34+01:00 Update tests This updates tests due to Haddock Trac haskell/haddock#271 fix and due to removal of TypeHoles as an extension from GHC. - - - - - 157322a7 by Gergő Érdi at 2014-01-31T01:03:17+08:00 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context The basic idea is that "a" and "+" are either pretty-printed as "a" and "(+)" or "`a`" and "+" - - - - - aa6d9685 by Mateusz Kowalczyk at 2014-01-30T17:21:50+00:00 Correct whitespace in ‘hidden’ test for <+> change - - - - - 121872f0 by Mateusz Kowalczyk at 2014-02-09T17:59:12+00:00 Document module header. Fixes Haddock Trac haskell/haddock#270. - - - - - e3253746 by Mateusz Kowalczyk at 2014-02-10T21:37:48+00:00 Insert a space between module link and description Fixes Haddock Trac haskell/haddock#277. - - - - - 771d2384 by Mateusz Kowalczyk at 2014-02-10T23:27:21+00:00 Ensure a space between type signature and ‘Source’ This is briefly related to Haddock Trac haskell/haddock#249 and employs effectively the suggested fix _but_ it doesn't actually fix the reported issue. This commit simply makes copying the full line a bit less of a pain. - - - - - 8cda9eff by nand at 2014-02-11T15:48:30+00:00 Add support for type/data families This adds support for type/data families with their respective instances, as well as closed type families and associated type/data families. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 3f22c510 by nand at 2014-02-11T15:53:50+00:00 Improve display of poly-kinded type operators This now displays them as (==) k a b c ... to mirror GHC's behavior, instead of the old (k == a) b c ... which was just wrong. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - effb2d6b by nand at 2014-02-11T15:56:50+00:00 Add test case for PatternSynonyms This just tests various stuff including poly-kinded patterns and operator patterns to make sure the rendering isn't broken. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - b38faf0d by Niklas Haas at 2014-02-13T21:53:32+00:00 Get rid of re-implementation of sortBy I have no idea what this was doing lying around here, and due to the usage of tuples it's actually slower, too. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - ac1e0413 by Mateusz Kowalczyk at 2014-02-13T23:57:16+00:00 Only warn about missing docs when docs are missing This fixes the ‘Missing documentation for…’ message for modules with 100% coverage. - - - - - cae2e36a by Niklas Haas at 2014-02-15T21:56:18+00:00 Add test case for inter-module type/data family instances These should show up in every place where the class is visible, and indeed they do right now. Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - 8bea5c3a by Mateusz Kowalczyk at 2014-02-19T05:11:34+00:00 Use a bespoke data type to indicate fixity This deals with what I imagine was an ancient TODO and makes it much clearer what the argument actually does rather than having the user chase down the comment. - - - - - 5b52d57c by Niklas Haas at 2014-02-22T21:31:03+01:00 Strip a single leading space from bird tracks (#201) This makes bird tracks in the form > foo > bar > bat parse as if they had been written as >foo >bar >bat ie. without the leading whitespace in front of every line. Ideally we also want to look into how leading whitespace affects code blocks written using the @ @ syntax, which are currently unaffected by this patch. - - - - - 5a1315a5 by Simon Hengel at 2014-02-22T21:55:35+01:00 Turn a source code comment into specs - - - - - 784cfe58 by Mateusz Kowalczyk at 2014-02-23T05:02:22+00:00 Update test case for lifted GADT type rendering The parsing of these seems to have been fixed by GHC folk and it now renders differently. IMHO it now renders in a better way so I'm updating the test to reflect this. - - - - - c3c88c2f by Mateusz Kowalczyk at 2014-02-23T06:37:14+00:00 Don't shadow ‘strip’. -Wall complains - - - - - 293031d8 by Niklas Haas at 2014-02-23T15:21:52+01:00 Make ImplicitParams render correctly (#260) This introduces a new precedence level for single contexts (because implicit param contexts always need parens around them, but other types of contexts don't necessarily, even when alone) - - - - - 4200842d by Niklas Haas at 2014-02-23T15:37:13+01:00 Lower precedence of equality constraints This drops them to the new precedence pREC_CTX, which makes single eqaulity constraints show up as (a ~ b) => ty, in line with GHC's rendering. Additional tests added to make sure other type operators render as intended. Current behavior matches GHC - - - - - b59e3227 by Niklas Haas at 2014-02-23T16:11:22+01:00 Add RankNTypes test case to ImplicitParams.hs This test actually tests what haskell/haddock#260 originally reported - I omitted the RankNTypes scenario from the original fix because I realized it's not relevant to the underlying issue and indeed, this renders as intended now. Still good to have more tests. - - - - - c373dbf7 by Mateusz Kowalczyk at 2014-02-24T06:09:54+00:00 Fix rendering of Contents when links are present Fixes Haddock Trac haskell/haddock#267. - - - - - 9ecb0e56 by Mateusz Kowalczyk at 2014-02-24T06:26:50+00:00 Fix wording in the docs - - - - - 4f4dcd8e by Mateusz Kowalczyk at 2014-02-27T03:00:33+00:00 Change rendering of duplicate record field docs See Haddock Trac haskell/haddock#195. We now change this behaviour to only rendering the documentation attached to the first instance of a duplicate field. Perhaps we could improve this by rendering the first instance that has documentation attached to it but for now, we'll stick with this. - - - - - ad8aa609 by Niklas Haas at 2014-03-08T09:43:26+01:00 Render fixity information Affects functions, type synonyms, type families, class names, data type names, constructors, data families, associated TFs/DFs, type synonyms, pattern synonyms and everything else I could think of. - - - - - 6a39c917 by Niklas Haas at 2014-03-09T07:43:39+01:00 Reorder topDeclElem to move the source/wiki links to the top They appear in the same position due to the float: right attribute but now they're always at the top of the box instead of at the bottom. - - - - - 2d34b3b4 by Niklas Haas at 2014-03-09T07:53:46+01:00 Use optLast instead of listToMaybe for sourceUrls/wikiUrls This lets you override them using eg. cabal haddock --haddock-options, which can come in handy if you want to use a different layout or URL for your source code links than cabal-install generates. - - - - - 0eff4624 by Niklas Haas at 2014-03-09T07:53:46+01:00 Differentiate between TH splices (line-links) and regular names This adds a new type of source code link, to a specific line rather than a specific declaration/name - this is used to link to the location of a TH splice that defines a certain name. Rather hefty changes throughout and still one unresolved issue (the line URLs aren't parsed from the third form of --read-interface which means they're currently restricted to same-interface links). Not sure if this issue is really worth all the hassle, especially since we could just use line links in general. This commit also contains some cleanup/clarification of the types in Haddock.Backends.Xhtml.Decl and shortens some overlong lines in the process. Notably, the Bool parameter was replaced by a Unicode type synonym to help clarify its presence in type signatures. - - - - - 66d6f77b by Niklas Haas at 2014-03-09T20:02:43+01:00 Group similar fixities together Identical fixities declared for the same line should now render using syntax like: infix 4 <, >=, >, <= - - - - - 6587f9f5 by Mateusz Kowalczyk at 2014-03-10T04:24:18+00:00 Update changelog - - - - - 7387ddad by Niklas Haas at 2014-03-11T10:26:04+01:00 Include fixity information in the Interface file This resolves fixity information not appearing across package borders. The binary file version has been increased accordingly. - - - - - ab46ef44 by Niklas Haas at 2014-03-11T10:26:04+01:00 Update changelog - - - - - 565cab6f by Niklas Haas at 2014-03-11T10:26:04+01:00 Update appearance of fixity annotations This moves them in-line with their corresponding lines, similar to a presentation envision by @hvr and described in #ghc. Redundant operator names are also omitted when no ambiguity is present. - - - - - 5d7afd67 by Niklas Haas at 2014-03-11T10:26:05+01:00 Filter family instances of hidden types Currently, this check does not extend to hidden right hand sides, although it probably should hide them in that case. - - - - - ec291b0c by Niklas Haas at 2014-03-11T10:26:05+01:00 Add documentation for --source-entity-line - - - - - 0922e581 by Niklas Haas at 2014-03-11T10:37:32+01:00 Revert "Reorder topDeclElem to move the source/wiki links to the top" This reverts commit 843c42c4179526a2ad3526e4c7d38cbf4d50001d. This change is no longer needed with the new rendering style, and it messes with copy/pasting lines. - - - - - 30618e8b by Mateusz Kowalczyk at 2014-03-11T09:41:07+00:00 Bump version to 2.15.0 - - - - - adf3f1bb by Mateusz Kowalczyk at 2014-03-11T09:41:09+00:00 Fix up some whitespace - - - - - 8905f57d by Niklas Haas at 2014-03-13T19:18:06+00:00 Hide RHS of TFs with non-exported right hand sides Not sure what to do about data families yet, since technically it would not make a lot of sense to display constructors that cannot be used by the user. - - - - - 5c44d5c2 by Niklas Haas at 2014-03-13T19:18:08+00:00 Add UnicodeSyntax alternatives for * and -> I could not find a cleaner way to do this other than checking for string equality with the given built-in types. But seeing as it's actually equivalent to string rewriting in GHC's implementation of UnicodeSyntax, it's probably fitting. - - - - - b04a63e6 by Niklas Haas at 2014-03-13T19:18:10+00:00 Display minimal complete definitions for type classes This corresponds to the new {-# MINIMAL #-} pragma present in GHC 7.8+. I also cleaned up some of the places in which ExportDecl is used to make adding fields easier in the future. Lots of test cases have been updated since they now render with minimality information. - - - - - a4a20b16 by Niklas Haas at 2014-03-13T19:18:12+00:00 Strip links from recently added html tests These were accidentally left there when the tests were originally added - - - - - d624f315 by Mateusz Kowalczyk at 2014-03-13T19:19:31+00:00 Update changelog - - - - - d27a21ac by Mateusz Kowalczyk at 2014-03-13T21:19:07+00:00 Always read in prologue files as UTF8 (#286). - - - - - 54b2fd78 by Mateusz Kowalczyk at 2014-03-13T21:28:09+00:00 Style only - - - - - fa4fe650 by Simon Hengel at 2014-03-15T09:04:18+01:00 Add Fuuzetsu maintainers field in cabal file - - - - - f83484b7 by Niklas Haas at 2014-03-15T18:20:24+00:00 Hide minimal definition for only-method classes Previously this was not covered by the All xs check since here it is not actually an All, rather a single Var n. This also adds the previously missing html-test/src/Minimal.hs. - - - - - 0099d276 by Niklas Haas at 2014-03-15T18:20:26+00:00 Fix issue haskell/haddock#281 This is a regression from the data family instances change. Data instances are now distinguished from regular lists by usage of the new class "inst", and the style has been updated to only apply to those. I've also updated the appropriate test case to test this a bit better, including GADT instances with GADT-style records. - - - - - 1f9687bd by Mateusz Kowalczyk at 2014-03-21T17:48:37+00:00 Please cabal sdist - - - - - 75542693 by Mateusz Kowalczyk at 2014-03-22T16:36:16+00:00 Drop needless --split-objs which slows us down. Involves tiny cleanup of all the dynflag bindings. Fixes haskell/haddock#292. - - - - - 31214dc3 by Herbert Valerio Riedel at 2014-03-23T18:01:01+01:00 Fix a few typos Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 0b73e638 by Mateusz Kowalczyk at 2014-03-31T05:34:36+01:00 Print kind signatures on GADTs - - - - - 2bab42f3 by Mateusz Kowalczyk at 2014-03-31T16:53:25+01:00 Add default for new PlatformConstraints field - - - - - 42647c5f by Mateusz Kowalczyk at 2014-03-31T18:29:04+01:00 Drop leading whitespace in @-style blocks. Fixes haskell/haddock#201. - - - - - 98208294 by Niklas Haas at 2014-03-31T20:09:58+02:00 Crash when exporting record selectors of data family instances This fixes bug haskell/haddock#294. This also fixes a related but never-before-mentioned bug about the display of GADT record selectors with non-polymorphic type signatures. Note: Associated data type constructors fail to show up if nothing is exported that they could be attached to. Exporting any of the data types in the instance head, or the class + data family itself, causes them to show up, but in the absence of either of these, exporting just the associated data type with the constructor itself will result in it being hidden. The only scenario I can come up that would involve this kind of situation involved OverlappingInstances, and even then it can be mitigated by just exporting the class itself, so I'm not going to solve it since the logic would most likely be very complicated. - - - - - 3832d171 by Mateusz Kowalczyk at 2014-04-01T19:07:33+01:00 Make CHANGES consistent with what's now in 2.14.2 - - - - - c386ae89 by Mateusz Kowalczyk at 2014-04-01T19:18:36+01:00 Actually bundle extra spec tests in sdist - - - - - bd57a6d3 by Mateusz Kowalczyk at 2014-04-03T21:13:48+01:00 Update test cases for GHC bug haskell/haddock#8945, Haddock haskell/haddock#188 The order of signature groups has been corrected upstream. Here we add a test case and update some existing test-cases to reflect this change. We remove grouped signature in test cases that we can (Minimal, BugDeprecated &c) so that the test is as self-contained as possible. - - - - - 708b88b1 by Mateusz Kowalczyk at 2014-04-03T21:16:07+01:00 Enforce strict GHC version in cabal file This stops people with 7.6.3 trying to install 2.15.x which clearly won't work. Unfortunately we shipped 2.14.x without realising this. - - - - - 60334f7c by Mateusz Kowalczyk at 2014-04-03T21:19:24+01:00 Initialise some new PlatformConstants fields - - - - - ea77f668 by Mateusz Kowalczyk at 2014-04-11T16:52:23+01:00 We don't actually want unicode here - - - - - 0b651cae by Mateusz Kowalczyk at 2014-04-11T18:13:30+01:00 Parse identifiers with ^ and ⋆ in them. Fixes haskell/haddock#298. - - - - - e8ad0f5f by Mateusz Kowalczyk at 2014-04-11T18:47:41+01:00 Ignore version string during HTML tests. - - - - - de489089 by Mateusz Kowalczyk at 2014-04-11T18:59:30+01:00 Update CHANGES to follow 2.14.3 - - - - - beb464a9 by Gergő Érdi at 2014-04-13T16:31:10+08:00 remove Origin flag from LHsBindsLR - - - - - cb16f07c by Herbert Valerio Riedel at 2014-04-21T17:16:50+02:00 Replace local `die` by new `System.Exit.die` Starting with GHC 7.10, System.Exit exports the new `die` which is essentially the same as Haddock.Util.die, so this commit changes Haddock.Util.die to be a simple re-export of System.Exit.die. See also https://ghc.haskell.org/trac/ghc/ticket/9016 for more details. Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org> - - - - - 9b9b23c7 by Mateusz Kowalczyk at 2014-05-03T15:40:11+02:00 Disambiguate ‘die’ in test runners. - - - - - 5d28a2b8 by Mateusz Kowalczyk at 2014-05-05T09:19:49+02:00 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. - - - - - d3967ff3 by Mateusz Kowalczyk at 2014-05-05T11:00:41+02:00 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. - - - - - 522a448d by Mateusz Kowalczyk at 2014-05-05T11:14:47+02:00 Move out Show and Eq instances to Types They are much more useful to the users here. - - - - - 11a6f0f2 by Mateusz Kowalczyk at 2014-05-06T13:50:31+02:00 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. - - - - - 6992c924 by Mateusz Kowalczyk at 2014-05-14T02:23:55+02:00 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. - - - - - 7a8ad763 by Mateusz Kowalczyk at 2014-05-14T14:50:25+02:00 Update issue tracker URL - - - - - f616c521 by Mateusz Kowalczyk at 2014-05-14T14:53:32+02:00 Update issue tracker URL for haddock-library - - - - - 66580ded by Gergő Érdi at 2014-05-25T14:24:16+08:00 Accomodate change in PatSyn representation - - - - - 0e43b988 by Mateusz Kowalczyk at 2014-05-29T03:15:29+02:00 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. - - - - - e10d7ec8 by Mateusz Kowalczyk at 2014-05-29T03:24:11+02:00 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. - - - - - 5861aca9 by Mateusz Kowalczyk at 2014-06-05T19:49:27+02:00 Clear up highlighting of identifiers with ‘'’s. - - - - - d7cc420f by Simon Peyton Jones at 2014-06-06T12:41:09+01:00 Follow change in patSynSig - - - - - 938b4fd8 by Mateusz Kowalczyk at 2014-06-12T07:24:29+02:00 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. - - - - - c7799dea by Mateusz Kowalczyk at 2014-06-18T00:05:56+02:00 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. - - - - - a2750b6a by Simon Hengel at 2014-06-18T11:01:18+08:00 Compatibility with older versions of base and bytestring - - - - - 009b4b03 by Simon Hengel at 2014-06-18T11:14:01+08:00 Enable travis-ci for haddock-library - - - - - 9b5862eb by Simon Hengel at 2014-06-18T11:14:01+08:00 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). - - - - - fb1f3279 by Simon Hengel at 2014-06-18T11:49:05+08:00 haddock-library: Use -Wall for specs - - - - - 649340e1 by Mateusz Kowalczyk at 2014-06-18T06:58:54+02:00 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. - - - - - d7eeeec2 by Mateusz Kowalczyk at 2014-06-18T07:49:04+02:00 Comment improvements + few words in cabal file - - - - - 0f8db914 by Simon Hengel at 2014-06-18T13:52:23+08:00 Use doctest to check examples in documentation - - - - - 2888a8dc by Simon Hengel at 2014-06-18T14:16:48+08:00 Remove doctest dependency (so that we can use haddock-library with doctest) - - - - - 626d5e85 by Mateusz Kowalczyk at 2014-06-18T08:41:25+02:00 Travis tweaks - - - - - 41d4f9cc by Mateusz Kowalczyk at 2014-06-18T08:58:43+02:00 Don't actually forget to install specified GHC. - - - - - c6aa512a by John MacFarlane at 2014-06-18T10:43:57-07:00 Removed reliance on LambdaCase (which breaks build with ghc 7.4). - - - - - b9b93b6f by John MacFarlane at 2014-06-18T10:54:56-07:00 Fixed haddock warnings. - - - - - a41b0ab5 by Mateusz Kowalczyk at 2014-06-19T01:20:10+02:00 Update Travis, bump version - - - - - 864bf62a by Mateusz Kowalczyk at 2014-06-25T10:36:54+02:00 Fix anchors. Closes haskell/haddock#308. - - - - - 53df91bb by Mateusz Kowalczyk at 2014-06-25T15:04:49+02:00 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 haskell/haddock#307. - - - - - 29b5f2fa by Mateusz Kowalczyk at 2014-06-25T15:17:20+02:00 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 <p> tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. - - - - - 05cb6e9c by Mateusz Kowalczyk at 2014-06-25T15:19:45+02:00 Bump haddock-library to 1.1.0 for release - - - - - 70feab15 by Iavor Diatchki at 2014-07-01T03:37:07-07:00 Propagate overloading-mode for instance declarations in haddock (#9242) - - - - - d4ca34a7 by Simon Peyton Jones at 2014-07-14T16:23:15+01:00 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac haskell/haddock#9063. I'll push the corresponding changes to GHC shortly. - - - - - f91e2276 by Edward Z. Yang at 2014-07-21T08:14:19-07:00 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - b010f9ef by Edward Z. Yang at 2014-07-25T16:28:46-07:00 Track changes for module reexports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs - - - - - 8b85f9f9 by Mateusz Kowalczyk at 2014-07-28T13:25:43+02:00 Catch mid-line URLs. Fixes haskell/haddock#314. - - - - - 4c613a78 by Edward Z. Yang at 2014-08-05T03:11:00-07:00 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - e80b051c by Edward Z. Yang at 2014-08-05T17:34:26+01:00 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f9cccd29 by Edward Z. Yang at 2014-08-07T14:23:35+01:00 Ignore TAGS files. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 00b3af52 by Mateusz Kowalczyk at 2014-08-08T04:58:19+02:00 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. - - - - - 5457dc71 by Mateusz Kowalczyk at 2014-08-08T18:24:02+02:00 Fix forgotten src - - - - - 3520cb04 by Mateusz Kowalczyk at 2014-08-14T20:19:07+01:00 Bump down the version for master to 2.14.4 - - - - - dc98c21b by Mateusz Kowalczyk at 2014-08-14T20:23:27+01:00 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. - - - - - 3f2038c0 by Mateusz Kowalczyk at 2014-08-14T20:23:31+01:00 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. - - - - - 56d4e49e by Mateusz Kowalczyk at 2014-08-14T20:23:42+01:00 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. - - - - - 726ea3cb by Mateusz Kowalczyk at 2014-08-14T20:23:47+01:00 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. - - - - - 61a88ff0 by Mateusz Kowalczyk at 2014-08-14T20:23:52+01:00 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. - - - - - a32ba674 by Mateusz Kowalczyk at 2014-08-14T20:26:03+01:00 Revert "Disambiguate ‘die’ in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. - - - - - f335820f by Mateusz Kowalczyk at 2014-08-14T20:26:09+01:00 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. - - - - - 107078e4 by Mateusz Kowalczyk at 2014-08-14T20:27:34+01:00 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 - - - - - b44b3871 by Mateusz Kowalczyk at 2014-08-15T02:47:40+01:00 Fix haskell/haddock#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. - - - - - e1a62cde by Mateusz Kowalczyk at 2014-08-15T02:52:56+01:00 Stop testing haskell/haddock#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. - - - - - 54e8286d by Mateusz Kowalczyk at 2014-08-15T05:31:57+01:00 Add haskell/haddock#313 to CHANGES - - - - - 9df7ad5d by Simon Hengel at 2014-08-20T11:25:32+08:00 Fix warning - - - - - ee2574d6 by Simon Hengel at 2014-08-20T12:07:01+08:00 Fix travis builds - - - - - 384cf2e6 by Simon Hengel at 2014-08-20T12:14:31+08:00 Require GHC 7.8.3 - - - - - d4779863 by Simon Hengel at 2014-08-22T12:14:16+08:00 Move Haddock API to a separate package - - - - - 80f3e0e1 by Simon Hengel at 2014-08-22T14:57:38+08:00 Bump version to 2.15.0 and add version constraints - - - - - 309a94ce by Simon Hengel at 2014-08-22T15:18:06+08:00 Add deprecated compatibility module - - - - - 4d1e4e3f by Luite Stegeman at 2014-08-22T20:46:45+02:00 export things to allow customizing how the Ghc session is run - - - - - 47884591 by Luite Stegeman at 2014-08-22T20:46:51+02:00 ghc 7.8.2 compatibility - - - - - 5ea94e2c by Luite Stegeman at 2014-08-22T22:08:58+02:00 install dependencies for haddock-api on travis - - - - - 9fb845b2 by Mateusz Kowalczyk at 2014-08-23T10:09:34+01:00 Move sources under haddock-api/src - - - - - 85817dc4 by Mateusz Kowalczyk at 2014-08-23T10:10:48+01:00 Remove compat stuff - - - - - 151c6169 by Niklas Haas at 2014-08-24T08:14:10+02:00 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. - - - - - d320e0d2 by Niklas Haas at 2014-08-24T08:14:35+02:00 Omit unnecessary foralls and fix haskell/haddock#315 This also fixes haskell/haddock#86. - - - - - bdafe108 by Mateusz Kowalczyk at 2014-08-24T15:06:46+01:00 Update CHANGES - - - - - fafa6d6e by Mateusz Kowalczyk at 2014-08-24T15:14:23+01:00 Delete few unused/irrelevant/badly-place files. - - - - - 3634923d by Duncan Coutts at 2014-08-27T13:49:31+01:00 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. - - - - - 539a7e70 by Herbert Valerio Riedel at 2014-08-31T11:36:32+02:00 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 - - - - - 9e3a0e5b by Mateusz Kowalczyk at 2014-08-31T12:54:43+01:00 Bump version in doc - - - - - 4a177525 by Mateusz Kowalczyk at 2014-08-31T13:01:23+01:00 Bump haddock-library version - - - - - f99c1384 by Mateusz Kowalczyk at 2014-08-31T13:05:25+01:00 Remove references to deleted files - - - - - 5e51a247 by Mateusz Kowalczyk at 2014-08-31T14:18:44+01:00 Make the doc parser not complain - - - - - 2cedb49a by Mateusz Kowalczyk at 2014-09-03T03:33:15+01:00 CONTRIBUTING file for issues - - - - - 88027143 by Mateusz Kowalczyk at 2014-09-04T00:46:59+01:00 Mention --print-missing-docs - - - - - 42f6754f by Alan Zimmerman at 2014-09-05T18:13:24-05:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e712719e by Austin Seipp at 2014-09-09T01:03:27-05:00 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 71c29755 by Herbert Valerio Riedel at 2014-09-09T17:35:20+02:00 Bump `base` constraint for AMP - - - - - 0bf9f3ed by Mateusz Kowalczyk at 2014-09-12T19:18:32+01:00 Delete stale ANNOUNCE - - - - - cac89ee6 by Krzysztof Gogolewski at 2014-09-14T17:17:09+02:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 4d683426 by Edward Z. Yang at 2014-09-18T13:38:11-07:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 80697fd5 by Herbert Valerio Riedel at 2014-09-19T00:07:52+02:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. - - - - - c015eb70 by Herbert Valerio Riedel at 2014-09-19T00:10:36+02:00 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. - - - - - 38ded784 by Edward Z. Yang at 2014-09-18T15:32:15-07:00 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. - - - - - f55d59c9 by Herbert Valerio Riedel at 2014-09-26T19:18:28+02:00 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. - - - - - 467050f1 by David Feuer at 2014-10-09T20:07:36-04:00 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. - - - - - cc47b699 by Edward Z. Yang at 2014-10-09T21:38:19-07:00 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 <David.Feuer at gmail.com> Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 87babcbe by Austin Seipp at 2014-10-20T20:05:27-05:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - ab259516 by Austin Seipp at 2014-10-20T20:07:01-05:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - b918093c by Mateusz Kowalczyk at 2014-10-29T03:59:39+00:00 Experimental support for collapsable headers Closes haskell/haddock#335 - - - - - 849db129 by Mateusz Kowalczyk at 2014-10-29T10:07:26+01:00 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) - - - - - a4cc4789 by Herbert Valerio Riedel at 2014-10-31T11:08:26+01:00 Collapse user-defined section by default (re haskell/haddock#335) - - - - - 9da1b33e by Yuras Shumovich at 2014-10-31T16:11:04-05:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - c625aefc by Austin Seipp at 2014-10-31T19:34:10-05:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - c7738e5e by Simon Hengel at 2014-11-02T07:25:30+08:00 Remove -fobject-code from .ghci (this slows down reloads on modifications) - - - - - d4a86e95 by Simon Hengel at 2014-11-03T09:26:11+08:00 Get rid of StandaloneDeriving - - - - - a974e311 by Simon Hengel at 2014-11-03T09:26:11+08:00 Derive more instances - - - - - 8aa0c4d7 by Simon Hengel at 2014-11-03T09:27:08+08:00 Remove unused language extensions - - - - - 3052d46a by Simon Hengel at 2014-11-03T09:30:46+08:00 Minor refactoring - - - - - 4281d3cb by Simon Hengel at 2014-11-03T09:30:46+08:00 parser: Try to parse definition lists right before text paragraphs - - - - - 8ba12bf9 by Simon Hengel at 2014-11-03T09:34:19+08:00 Add support for markdown links (closes haskell/haddock#336) - - - - - a2f8d747 by Simon Hengel at 2014-11-03T09:34:19+08:00 Allow markdown links at the beginning of a paragraph - - - - - 53b11207 by Simon Hengel at 2014-11-03T09:34:20+08:00 Update documentation - - - - - 652267c6 by Simon Hengel at 2014-11-03T09:34:20+08:00 Add support for markdown images - - - - - 9d667502 by Simon Hengel at 2014-11-03T09:34:20+08:00 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. - - - - - 8167fc32 by Mateusz Kowalczyk at 2014-11-04T01:16:51+00:00 whitespace only - - - - - 3da62981 by Mateusz Kowalczyk at 2014-11-04T01:17:31+00:00 Fix re-exports of built-in type families Fixes haskell/haddock#310 - - - - - edc76b34 by Mateusz Kowalczyk at 2014-11-04T02:54:28+00:00 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. - - - - - 0a137400 by Mateusz Kowalczyk at 2014-11-04T04:09:44+00:00 Fix warnings - - - - - d068fc21 by Mateusz Kowalczyk at 2014-11-04T21:04:07+00:00 Fix parsing of identifiers written in infix way - - - - - 1a9f2f3d by Simon Hengel at 2014-11-08T11:32:42+08:00 Minor code simplification - - - - - 6475e9b1 by Simon Hengel at 2014-11-08T17:28:33+08:00 newtype-wrap parser monad - - - - - dc1ea105 by Herbert Valerio Riedel at 2014-11-15T11:55:43+01:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - fbb1aca4 by Simon Hengel at 2014-11-16T08:51:38+08:00 State intention rather than implementation details in Haddock comment - - - - - 97851ab2 by Simon Hengel at 2014-11-16T10:20:19+08:00 (wip) Add support for @since (closes haskell/haddock#26) - - - - - 34bcd18e by Gergő Érdi at 2014-11-20T22:35:38+08:00 Update Haddock to new pattern synonym type signature syntax - - - - - 304b7dc3 by Jan Stolarek at 2014-11-20T17:48:43+01:00 Follow changes from haskell/haddock#9812 - - - - - 920f9b03 by Richard Eisenberg at 2014-11-20T16:52:50-05:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 0bfe4e78 by Alan Zimmerman at 2014-11-21T11:23:09-06:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 356ed45a by Thomas Winant at 2014-11-28T16:11:22-06:00 Support for PartialTypeSignatures - - - - - 5dc8f3b1 by Gergő Érdi at 2014-11-29T15:39:09+08:00 For pattern synonyms, render "pattern" as a keyword - - - - - fe704480 by Mateusz Kowalczyk at 2014-12-09T03:38:32+00:00 List new module in cabal file - - - - - b9ad5a29 by Mateusz Kowalczyk at 2014-12-10T00:58:24+00:00 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 haskell/haddock#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. - - - - - 765af0e3 by Mateusz Kowalczyk at 2014-12-10T01:17:19+00:00 Update doctest parts of comments - - - - - 8670272b by jpmoresmau at 2014-12-10T01:35:31+00:00 header could contain several lines Closes haskell/haddock#348 - - - - - 4f9ae4f3 by Mateusz Kowalczyk at 2014-12-12T06:22:31+00:00 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - e974ac94 by Duncan Coutts at 2014-12-12T06:26:11+00:00 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 - - - - - 2f3a2365 by Herbert Valerio Riedel at 2014-12-12T06:26:51+00:00 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 - - - - - 1dbd6390 by Alan Zimmerman at 2014-12-12T06:32:07+00:00 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - bb6ff1f4 by Mateusz Kowalczyk at 2014-12-12T06:35:07+00:00 Bump ‘base’ constraint Follows the similar commit made on ghc-head branch - - - - - 466fe4ab by Krzysztof Gogolewski at 2014-12-12T06:37:42+00:00 Followup changes to addition of -fwarn-context-quantification (GHC Trac haskell/haddock#4426) - - - - - 97e080c9 by Edward Z. Yang at 2014-12-12T06:39:35+00:00 Properly render package ID (not package key) in index, fixes haskell/haddock#329. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> Conflicts: haddock-api/src/Haddock/ModuleTree.hs - - - - - 20b2af56 by Herbert Valerio Riedel at 2014-12-12T06:42:50+00:00 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs - - - - - b3ad269d by Austin Seipp at 2014-12-12T06:44:14+00:00 Add an .arcconfig file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - 072df0dd by Austin Seipp at 2014-12-12T06:45:01+00:00 Add .arclint file. Signed-off-by: Austin Seipp <austin at well-typed.com> - - - - - dbb9294a by Herbert Valerio Riedel at 2014-12-12T06:46:17+00:00 Collapse user-defined section by default (re haskell/haddock#335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs - - - - - f23ab545 by Yuras Shumovich at 2014-12-12T06:46:41+00:00 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 - - - - - 753a4b67 by Austin Seipp at 2014-12-12T06:46:51+00:00 Remove overlapping pattern match Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8954e8f5 by Herbert Valerio Riedel at 2014-12-12T06:50:53+00:00 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` - - - - - d2b06d61 by Gergő Érdi at 2014-12-12T07:07:30+00:00 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 1ff02426 by Jan Stolarek at 2014-12-12T07:13:24+00:00 Follow changes from haskell/haddock#9812 Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - 06ad7600 by Richard Eisenberg at 2014-12-12T07:13:43+00:00 Changes to reflect refactoring in GHC as part of haskell/haddock#7484 - - - - - 8fd2aa8b by Alan Zimmerman at 2014-12-12T07:22:25+00:00 Follow API changes in D426 Signed-off-by: Austin Seipp <aseipp at pobox.com> Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs - - - - - 95c3db98 by Thomas Winant at 2014-12-12T07:35:49+00:00 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 - - - - - 45494428 by Gergő Érdi at 2014-12-12T07:36:18+00:00 For pattern synonyms, render "pattern" as a keyword - - - - - a237e3eb by Mateusz Kowalczyk at 2014-12-12T12:27:13+00:00 Various fixups and bumps for next release - - - - - 22918bcd by Herbert Valerio Riedel at 2014-12-14T10:11:47+01:00 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) - - - - - 1d6ce947 by Herbert Valerio Riedel at 2014-12-14T10:17:06+01:00 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 - - - - - f434ea89 by Herbert Valerio Riedel at 2014-12-14T18:26:50+01:00 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) - - - - - 6fb839eb by Mateusz Kowalczyk at 2014-12-17T09:28:59+00:00 Only keep one Version instead of blindly appending - - - - - 40645489 by Mateusz Kowalczyk at 2014-12-18T07:09:44+00:00 Fix dependency version - - - - - 8b3b927b by Mateusz Kowalczyk at 2014-12-18T07:14:23+00:00 Print missing docs by default Adds --no-print-missing-docs - - - - - 59666694 by Mateusz Kowalczyk at 2014-12-18T07:21:37+00:00 update changelog - - - - - aa6d168e by Mateusz Kowalczyk at 2014-12-18T07:30:58+00:00 Update docs for @since - - - - - 2d7043ee by Luite Stegeman at 2014-12-19T18:29:35-06:00 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion - - - - - aaa70fc0 by Luite Stegeman at 2014-12-22T15:58:43+01:00 Add missing import for standalone haddock-api package - - - - - 9ce01269 by Herbert Valerio Riedel at 2014-12-22T17:48:45+01:00 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) - - - - - fcd6fec1 by Herbert Valerio Riedel at 2014-12-22T17:51:52+01:00 Bump versions for ghc-7.11 - - - - - 525ec900 by Mateusz Kowalczyk at 2014-12-23T13:36:24+00:00 travis-ci: test with HEAD - - - - - cbf494b5 by Simon Peyton Jones at 2014-12-23T15:22:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 50e01c99 by Mateusz Kowalczyk at 2014-12-29T15:28:47+00:00 Make travis use 7.10.x - - - - - 475e60b0 by Njagi Mwaniki at 2014-12-29T15:30:44+00:00 Turn the README into GitHub Markdown format. Closes haskell/haddock#354 - - - - - 8cacf48e by Luite Stegeman at 2015-01-05T16:25:37+01:00 bump haddock-api ghc dependency to allow release candidate and first release - - - - - 6ed6cf1f by Simon Peyton Jones at 2015-01-06T16:37:47+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 8b484f33 by Simon Peyton Jones at 2015-01-08T15:50:22+00:00 Track naming change in DataCon - - - - - 23c5c0b5 by Alan Zimmerman at 2015-01-16T10:15:11-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - e7a5532c by JP Moresmau at 2015-01-22T17:19:03+00:00 Ignore warnings, install Cabal 1.22 - - - - - 86942c84 by jpmoresmau at 2015-01-22T17:19:04+00:00 solve dataDir ambiguity - - - - - 5ceb743e by jpmoresmau at 2015-01-22T19:17:32+00:00 support GHC 7.10: no Safe-Inferred, Foldable instance - - - - - 6a3b3fb5 by Mateusz Kowalczyk at 2015-01-22T19:32:10+00:00 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 haskell/haddock#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. - - - - - 708f8b2f by jpmoresmau at 2015-01-22T19:36:59+00:00 Links to source location of class instance definitions - - - - - 5cf8a6da by Vincent Berthoux at 2015-01-22T19:59:58+00:00 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes haskell/haddock#359, fixes haskell/haddock#356. - - - - - 1749e6f0 by Mateusz Kowalczyk at 2015-01-22T20:31:27+00:00 Changelog only - - - - - c8145f90 by Mateusz Kowalczyk at 2015-01-22T23:34:05+00:00 --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 haskell/haddock#353. - - - - - 14248254 by Mateusz Kowalczyk at 2015-01-22T23:43:18+00:00 Sort out some module import warnings - - - - - d8a38989 by Simon Peyton Jones at 2015-01-23T07:10:16-06:00 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) - - - - - d3ac6ae4 by Alan Zimmerman at 2015-01-23T07:17:19-06:00 Follow API changes in D538 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) - - - - - 4c1ffeb0 by Simon Peyton Jones at 2015-02-10T12:10:33+00:00 Track changes in HsSyn for quasi-quotes - - - - - 775d20f7 by Mateusz Kowalczyk at 2015-03-15T08:11:48+01:00 --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 haskell/haddock#353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) - - - - - f9245e72 by Phil Ruffwind at 2015-03-16T04:32:01-04:00 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. - - - - - cd8fa415 by Mateusz Kowalczyk at 2015-03-17T21:59:39+00:00 Update changelog Closes haskell/haddock#151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc - - - - - b5248b47 by Ben Gamari at 2015-03-25T17:12:17+00:00 Make the error encountered when a package can't be found more user-friendly Closes haskell/haddock#369 - - - - - b756b772 by Mateusz Kowalczyk at 2015-03-26T16:31:40+00:00 Remove now redundant imports - - - - - 5ea5e8dd by Mateusz Kowalczyk at 2015-03-26T16:45:52+00:00 Update test to account for \r filtering - - - - - 6539bfb3 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 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 - - - - - 1a01d950 by Mateusz Kowalczyk at 2015-03-27T00:20:09+00:00 Clearly default to variables in out of scope case - - - - - 7943abe8 by Mateusz Kowalczyk at 2015-03-27T01:14:11+00:00 Fix Hoogle display of constructors Fixes haskell/haddock#361 - - - - - 6d6e587e by Mateusz Kowalczyk at 2015-03-27T01:45:18+00:00 Fully qualify names in Hoogle instances output Closes haskell/haddock#263 - - - - - 52dac365 by Mateusz Kowalczyk at 2015-03-27T01:55:01+00:00 Update changelog - - - - - ca5af9a8 by Mateusz Kowalczyk at 2015-03-27T02:43:55+00:00 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 haskell/haddock#259 - - - - - a33f0c10 by Mateusz Kowalczyk at 2015-03-27T03:04:21+00:00 Don't print instance safety information in Hoogle Fixes haskell/haddock#168 - - - - - df6c935a by Mateusz Kowalczyk at 2015-03-28T00:11:47+00:00 Post-release version bumps and changelog - - - - - dde8f7c0 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Loosen bounds on haddock-* - - - - - de93bf89 by Mateusz Kowalczyk at 2015-03-28T20:39:10+00:00 Expand response files in arguments Closes haskell/haddock#285 - - - - - 1f0b0856 by Zejun Wu at 2015-04-26T16:35:35-07:00 Do not insert anchor for section headings in contents box - - - - - 860439d7 by Simon Peyton Jones at 2015-05-01T09:36:47+01:00 Track change in API of TyCon - - - - - a32f3e5f by Adam Gundry at 2015-05-04T15:32:59+01:00 Track API changes to support empty closed type familes - - - - - 77e98bee by Ben Gamari at 2015-05-06T20:17:08+01:00 Ignore doc/haddock.{ps,pdf} - - - - - 663d0204 by Murray Campbell at 2015-05-11T04:47:37-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> - - - - - 8bb0dcf5 by Murray Campbell at 2015-05-11T06:35:06-05:00 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve haskell/haddock#385 Signed-off-by: Austin Seipp <aseipp at pobox.com> (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) - - - - - bad900ea by Adam Bergmark at 2015-05-11T15:29:39+01:00 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes haskell/haddock#394 Signed-off-by: Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk> - - - - - daceff85 by Simon Peyton Jones at 2015-05-13T12:04:21+01:00 Track the new location of setRdrNameSpace - - - - - 1937d1c4 by Alan Zimmerman at 2015-05-25T21:27:15+02:00 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. - - - - - ee0fb6c2 by Łukasz Hanuszczak at 2015-05-27T11:51:31+02:00 Create simple method for indentation parsing. - - - - - 7d6fcad5 by Łukasz Hanuszczak at 2015-05-27T21:36:13+02:00 Make nested lists count indentation according to first item. - - - - - d6819398 by Łukasz Hanuszczak at 2015-05-27T22:46:13+02:00 Add simple test case for arbitrary-depth list nesting. - - - - - 2929c54d by Łukasz Hanuszczak at 2015-06-03T02:11:31+02:00 Add arbitrary-indent spec test for parser. - - - - - 9a0a9bb0 by Mateusz Kowalczyk at 2015-06-03T05:25:29+01:00 Update docs with info on new list nesting rule Fixes haskell/haddock#278 through commits from PR haskell/haddock#401 - - - - - 12efc92c by Mateusz Kowalczyk at 2015-06-03T05:29:26+01:00 Update some meta data at the top of the docs - - - - - 765ee49f by Bartosz Nitka at 2015-06-07T08:40:59-07:00 Add some Hacking docs for getting started - - - - - 19aaf851 by Bartosz Nitka at 2015-06-07T08:44:30-07:00 Fix markdown - - - - - 2a90cb70 by Mateusz Kowalczyk at 2015-06-08T15:08:36+01:00 Refine hacking instructions slightly - - - - - 0894da6e by Thomas Winant at 2015-06-08T23:47:28-05:00 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: haskell/haddock#10098 - - - - - 10a9bb76 by Emanuel Borsboom at 2015-06-12T02:46:23+01:00 Build executable with '-threaded' (fixes haskell/haddock#399) - - - - - 7696b94f by Mateusz Kowalczyk at 2015-06-12T02:59:19+01:00 Update changelog for -threaded Closes haskell/haddock#400 - - - - - d3c118ec by Bartosz Nitka at 2015-06-12T03:00:58+01:00 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 haskell/haddock#207, but I got stuck at trying to run the test-suite. - - - - - b67e843b by Mateusz Kowalczyk at 2015-06-12T03:01:50+01:00 Changelog for haskell/haddock#207 Fixes haskell/haddock#207, closes haskell/haddock#402 - - - - - 841d785e by jpmoresmau at 2015-06-12T16:03:16+01:00 Attach to instance location the name that has the same location file Fixes haskell/haddock#383 - - - - - 98791cae by Mateusz Kowalczyk at 2015-06-12T16:08:27+01:00 Update changelog Closes haskell/haddock#398 - - - - - 7c0b5a87 by Phil Ruffwind at 2015-06-12T13:07:25-04:00 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 <span> 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 haskell/haddock#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 - - - - - cfe86e73 by Mateusz Kowalczyk at 2015-06-14T10:49:01+01:00 Update tests for the CSS changes - - - - - 2d4983c1 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding for Haskell source parser module. - - - - - 29548785 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement function for tagging parsed chunks with source spans. - - - - - 6a5e4074 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement simple string chunking based on HsColour library. - - - - - 6e52291f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create basic token classification method. - - - - - da971a27 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Adapt source span tagging to work with current whitespace handling. - - - - - 4feb5a22 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add record accessors to exports of hyperlinker parser module. - - - - - a8cc4e39 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Make parser module export all types and associated accessors. - - - - - fb8d468f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple HTML renderer for parsed source file. - - - - - 80747822 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for specifying the CSS file path in HTML source renderer. - - - - - 994dc1f5 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix identifier recognition in Haskell source parser. - - - - - b1bd0430 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix comment recognition in Haskell source parser. - - - - - 11db85ae by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for recognizing compiler pragmas in source parser. - - - - - 736c7bd3 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create scaffolding of module for associating tokens with AST names. - - - - - 7e149bc2 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement utility method for extracting variable identifiers from AST. - - - - - 32eb640a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Create simple mechanism for associating tokens with AST names. - - - - - d4eba5bc by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add dummy support for hyperlinking named tokens. - - - - - 2b76141f by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matcher bug causing wrong items being hyperlinked. - - - - - 2d48002e by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Constrain elements exported by hyperlinker modules. - - - - - 9715eec6 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for type token recognition. - - - - - 8fa401cb by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Add support for binding token recognition. - - - - - d062400b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement go-to-definition mechanism for local bindings. - - - - - f4dc229b by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Implement module export- and import-list item hyperlinking. - - - - - c9a46d58 by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix span matching to allow parenthesized operators hyperlinking. - - - - - 03aad95a by Łukasz Hanuszczak at 2015-06-30T22:37:48+02:00 Fix weird hyperlinking of parenthesized operators. - - - - - b4694a7d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for type declaration anchors. - - - - - 7358d2d2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for top-level function declaration anchors. - - - - - dfc24b24 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix external anchors to contain HTML file extension. - - - - - a045926c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Refactor the way AST names are handled within detailed tokens. - - - - - c76049b4 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement hyperlinking of imported module names. - - - - - 2d2a1572 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix parsing of single line comments with broken up newlines. - - - - - 11afdcf2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix bug with improper newline handling. - - - - - 8137f104 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issues with escaped newlines in comments. - - - - - 34759b19 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for parsing C preprocessor macros. - - - - - 09f0f847 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for parser module of source hyperlinker. - - - - - 709a8389 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add some documentation for AST module of source hyperlinker. - - - - - 4df5c227 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add command line option for generating hyperlinked source. - - - - - 7a755ea2 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Extend module interface with rich source token stream field. - - - - - 494f4ab1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement source tokenization during interface creation process. - - - - - 5f21c953 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create hyperlinker module and plug it into the Haddock pipeline. - - - - - 0cc8a216 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for providing custom CSS files for hyperlinked source. - - - - - a32bbdc1 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add support for fancy highlighting upon hovering over identifier. - - - - - d16d642a by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make source hyperlinker generate output in apropriate directory. - - - - - ae12953d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Create module with hyperlinker utility functions. - - - - - 6d4952c5 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make external hyperlinks point to locations specified by source URLs. - - - - - 8417555d by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Rewrite source generation to fixed links and directory structure. - - - - - ce9cec01 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Add basic support for cross-package hyperlink generation. - - - - - 7eaf025c by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Disable generating hyperlinks for module references. - - - - - a50bf92e by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make Haddock generate source for all interfaces (also hidden ones). - - - - - f5ae2838 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Prevent source parser from throwing exception when lexing fails. - - - - - db9ffbe0 by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Implement workaround for Chrome highlighting issues. - - - - - 0b6b453b by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate correct anchors for data constructors. - - - - - c86d38bc by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Make hyperlinker generate anchors for record field declarations. - - - - - 063abf7f by Łukasz Hanuszczak at 2015-06-30T22:37:49+02:00 Fix issue with hyperlink highlight styling in Chrome browser. - - - - - 880fc611 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking constructor names in patters. - - - - - c9e89b95 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record patterns. - - - - - 17a11996 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add support for hyperlinking field names in record expressions. - - - - - 0eef932d by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Make hyperlinker respect pretty-printer flag and add documentation. - - - - - f87c1776 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Unexpose hyperlinker modules in Cabal configuration. - - - - - 4c9e2b06 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Setup HSpec framework for Haddock API package. - - - - - 4b20cb30 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add basic tests related to comment parsing. - - - - - 6842e919 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add tests related to parsing basic language constructs. - - - - - 87bffb35 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add simple tests for do-notation parsing. - - - - - e7af1841 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add very simple QuickCheck properties for source parser spec. - - - - - c84efcf1 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Create simple test runner for hyperlinker tests. - - - - - 76b90447 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for basic identifier hyperlinking. - - - - - 0fbf4df6 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for operator hyperlinking. - - - - - 731aa039 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for constructor hyperlinking. - - - - - 995a78a2 by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for record expressions and patterns hyperlinking. - - - - - 3566875a by Łukasz Hanuszczak at 2015-06-30T22:37:50+02:00 Add test case for literal syntax highlighting. - - - - - 68469a35 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add hyperlinker test runner to .cabal and .gitignore files. - - - - - aa946c93 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Adapt hyperlinker test runner to have the same interface as HTML one. - - - - - ce34da16 by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Fix hyperlinker test runner file paths and add pretty-printing option. - - - - - 0d7dd65e by Łukasz Hanuszczak at 2015-06-30T22:38:33+02:00 Add reference files for hyperlinker test cases. - - - - - efa4a1e0 by Łukasz Hanuszczak at 2015-07-01T00:47:32+02:00 Make hyperlinker test runner strip local links from generated source. - - - - - 3e96e584 by Łukasz Hanuszczak at 2015-07-01T01:14:59+02:00 Create simple script for accepting hyperlinker test case references. - - - - - 526fe610 by Łukasz Hanuszczak at 2015-07-01T01:16:41+02:00 Re-accept hyperlinker test cases with local references stripped out. - - - - - 892e2cb3 by Łukasz Hanuszczak at 2015-07-01T01:22:09+02:00 Fix bug with diffing wrong files in hyperlinker test runner. - - - - - 9ff46039 by Łukasz Hanuszczak at 2015-07-01T18:04:46+02:00 Remove unused dependencies in Haddock API spec configuration. - - - - - 47969c07 by Łukasz Hanuszczak at 2015-07-01T18:32:19+02:00 Add support for hyperlinking synonyms in patterns. - - - - - a73449e0 by Łukasz Hanuszczak at 2015-07-01T18:33:44+02:00 Create test case for hyperlinking @-patterns. - - - - - c2077ed8 by Łukasz Hanuszczak at 2015-07-01T19:06:04+02:00 Add support for hyperlinking universally quantified type variables. - - - - - 68017342 by Łukasz Hanuszczak at 2015-07-01T19:28:32+02:00 Create hyperlinker test case with quantified type variables. - - - - - 51c01a78 by Łukasz Hanuszczak at 2015-07-01T19:34:22+02:00 Add scoped type variables test for polymorphism test case. - - - - - 13181ae2 by Łukasz Hanuszczak at 2015-07-01T19:56:27+02:00 Add record wildcards test for records hyperlinking test case. - - - - - 991b81dd by Łukasz Hanuszczak at 2015-07-01T21:01:42+02:00 Document some functions in XHTML utlity module. - - - - - 98c8dfe5 by Łukasz Hanuszczak at 2015-07-01T22:25:21+02:00 Make hyperlinker render qualified names as one entity. - - - - - 75e13b9b by Łukasz Hanuszczak at 2015-07-01T22:27:38+02:00 Add qualified name test for identifiers hyperlinking test case. - - - - - de1e143f by Łukasz Hanuszczak at 2015-07-02T12:32:59+02:00 Fix crash happening when hyperlinking type family declarations. - - - - - 7a8fb175 by Łukasz Hanuszczak at 2015-07-02T12:47:03+02:00 Add support for anchoring data family constructor declarations. - - - - - 3b404e49 by Łukasz Hanuszczak at 2015-07-02T13:31:05+02:00 Improve support for hyperlinking type families. - - - - - 59eb7143 by Łukasz Hanuszczak at 2015-07-02T13:33:34+02:00 Add hyperlinker test case for checking type and type family declarations. - - - - - d1cda0c0 by Łukasz Hanuszczak at 2015-07-02T13:41:38+02:00 Fix issue with operators being recognized as preprocessor directives. - - - - - da206c9d by Łukasz Hanuszczak at 2015-07-02T17:18:12+02:00 Fix broken tests for parsing and hyperlinking hash operators. - - - - - 53750d1b by Łukasz Hanuszczak at 2015-07-02T18:53:28+02:00 Add support for anchoring signatures in type class declarations. - - - - - 1fa5bb10 by Łukasz Hanuszczak at 2015-07-02T19:04:47+02:00 Make hyperlinker generate anchors only to top-level value bindings. - - - - - a542305c by Łukasz Hanuszczak at 2015-07-02T19:05:58+02:00 Create hyperlinker test case for type classes. - - - - - b0dd4581 by Łukasz Hanuszczak at 2015-07-04T16:28:26+02:00 Update docs with information about source hyperlinking. - - - - - 9795302a by Łukasz Hanuszczak at 2015-07-04T16:52:15+02:00 Update docs on using `--read-interface` option. - - - - - 9acdc002 by Łukasz Hanuszczak at 2015-07-04T17:15:26+02:00 Remove potentially dangerous record access in hyperlinker AST module. - - - - - fb3ab7be by Łukasz Hanuszczak at 2015-07-04T17:40:10+02:00 Make Haddock generate warnings about potential misuse of hyperlinker. - - - - - a324c504 by Łukasz Hanuszczak at 2015-07-04T17:43:22+02:00 Fix incorrect specification of source style option in doc file. - - - - - 3f01a8e4 by Łukasz Hanuszczak at 2015-07-05T17:06:36+02:00 Refactor source path mapping to use modules as indices. - - - - - ac70f5b1 by Łukasz Hanuszczak at 2015-07-05T17:47:34+02:00 Fix bug where not all module interfaces were added to source mapping. - - - - - f5e57da9 by Łukasz Hanuszczak at 2015-07-06T16:39:57+02:00 Extract main hyperlinker types to separate module. - - - - - 43974905 by Łukasz Hanuszczak at 2015-07-06T16:52:13+02:00 Move source paths types to hyperlinker types module. - - - - - 3e236055 by Łukasz Hanuszczak at 2015-07-06T17:06:19+02:00 Add support for hyperlinking modules in import lists. - - - - - 58233d9f by Łukasz Hanuszczak at 2015-07-06T17:26:49+02:00 Add short documentation for hyperlinker source map type. - - - - - 14da016d by Łukasz Hanuszczak at 2015-07-06T18:07:20+02:00 Fix bug with module name being hyperlinked to `Prelude`. - - - - - 8f79db52 by Łukasz Hanuszczak at 2015-07-06T18:23:47+02:00 Fix problem with spec build in Haddock API configuration. - - - - - e7cc056c by Adam Sandberg Eriksson at 2015-07-07T23:22:21+01:00 StrictData: print correct strictness marks - - - - - e8253ca8 by Mateusz Kowalczyk at 2015-07-07T23:58:28+01:00 Update changelog - - - - - 0aba676b by Mateusz Kowalczyk at 2015-07-07T23:58:33+01:00 Relax upper bound on GHC a bit - - - - - 7a595381 by Mateusz Kowalczyk at 2015-07-07T23:58:52+01:00 Delete trailing whitespace - - - - - 50976d5e by Adam Sandberg Eriksson at 2015-07-08T15:03:04+02:00 StrictData: changes in HsBang type - - - - - 83b045fa by Mateusz Kowalczyk at 2015-07-11T14:35:18+01:00 Fix expansion icon for user-collapsible sections Closes haskell/haddock#412 - - - - - b2a3b0d1 by Mateusz Kowalczyk at 2015-07-22T22:03:21+01:00 Make some version changes after 2.16.1 release - - - - - a8294423 by Ben Gamari at 2015-07-27T13:16:07+02:00 Merge pull request haskell/haddock#422 from adamse/adamse-D1033 Merge for GHC D1033 - - - - - c0173f17 by randen at 2015-07-30T14:49:08-07:00 Break the response file by line termination rather than spaces, since spaces may be within the parameters. This simple approach avoids having the need for any quoting and/or escaping (although a newline char will not be possible in a parameter and has no escape mechanism to allow it). - - - - - 47c0ca14 by Alan Zimmerman at 2015-07-31T10:41:52+02:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - 45a9d770 by Mateusz Kowalczyk at 2015-07-31T09:47:43+01:00 Update changelog - - - - - 347a20a3 by Phil Ruffwind at 2015-08-02T23:15:26+01:00 Avoid JavaScript error during page load in non-frame mode In non-frame mode, parent.window.synopsis refers to the synopsis div rather than the nonexistent frame. Unfortunately, the script wrongly assumes that if it exists it must be a frame, leading to an error where it tries to access the nonexistent attribute 'replace' of an undefined value (synopsis.location). Closes haskell/haddock#406 - - - - - 54ebd519 by Phil Ruffwind at 2015-08-02T23:27:10+01:00 Link to the definitions to themselves Currently, the definitions already have an anchor tag that allows URLs with fragment identifiers to locate them, but it is rather inconvenient to obtain such a URL (so-called "permalink") as it would require finding the a link to the corresponding item in the Synopsis or elsewhere. This commit adds hyperlinks to the definitions themselves, allowing users to obtain links to them easily. To preserve the original aesthetics of the definitions, we alter the color of the link so as to be identical to what it was, except it now has a hover effect indicating that it is clickable. Additionally, the anchor now uses the 'id' attribute instead of the (obsolete) 'name' attribute. Closes haskell/haddock#407 - - - - - 02cc8bb7 by Phil Ruffwind at 2015-08-02T23:28:02+01:00 Fix typo in Haddock.Backends.Xhtml.Layout: divSynposis -> divSynopsis Closes haskell/haddock#408 - - - - - 2eb0a458 by Phil Ruffwind at 2015-08-02T23:30:07+01:00 Fix record field alignment when name is too long Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug haskell/haddock#301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes haskell/haddock#301. Closes haskell/haddock#421 - - - - - 7abb3402 by Łukasz Hanuszczak at 2015-08-02T23:32:14+01:00 Add some utility definitions for generating line anchors. - - - - - e0b1d79b by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Make hyperlinked source renderer generate line anchors. - - - - - 24dd4c9f by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Re-accept test cases after adding line anchors for each of them. - - - - - 0372cfcb by Łukasz Hanuszczak at 2015-08-02T23:32:15+01:00 Override source line flags when source hyperlinker is enabled. - - - - - a81bcd07 by Mateusz Kowalczyk at 2015-08-02T23:58:25+01:00 Update tests to follow HTML changes - - - - - d2d7426f by Łukasz Hanuszczak at 2015-08-06T20:54:59+02:00 Fix quote syntax for promoted types. - - - - - 668cf029 by Łukasz Hanuszczak at 2015-08-06T21:12:00+02:00 Apply promoted type quoting to type-level consing. - - - - - 89f8e7c6 by Łukasz Hanuszczak at 2015-08-06T21:17:10+02:00 Extend advanced types test case with other examples. - - - - - 86494bca by Łukasz Hanuszczak at 2015-08-06T21:22:06+02:00 Rename advanced types test case and accept new output. - - - - - dbb7c7c0 by Adam Sandberg Eriksson at 2015-08-09T23:01:05+02:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 2a7704fa by Ben Gamari at 2015-08-10T13:18:05+02:00 Merge pull request haskell/haddock#433 from adamse/split-hsbang HsBang is split into HsSrcBang and HsImplBang - - - - - 891954bc by Thomas Miedema at 2015-08-15T14:51:18+02:00 Follow changes in GHC build system - - - - - b55d32ab by Mateusz Kowalczyk at 2015-08-21T18:06:09+01:00 Make Travis use 7.10.2 - - - - - 97348b51 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Move SYB utilities to standalone module. - - - - - 748ec081 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement `everywhere` transformation in SYB module. - - - - - 011cc543 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Implement generic transformation constructor. - - - - - b9510db2 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Create simple utility module for type specialization. - - - - - 43229fa6 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Make type of type specialization function more general. - - - - - fd844e90 by Łukasz Hanuszczak at 2015-08-21T18:22:29+01:00 Add basic HTML test case for checking instance specialization. - - - - - 6ea0ad04 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Make HTML class instance printer take optional signature argument. - - - - - 65aa41b6 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Refactor instance head type to record instead of a meaningless tuple. - - - - - 3fc3bede by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add expandable method section for each class instance declaration. - - - - - 99ceb107 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Move dummy post-family instances for `DocName` to `Types` module. - - - - - e98f4708 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create convenience functions for type specialization module. - - - - - b947552f by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Hook type specialization logic with HTML pretty-printer. - - - - - dcaa8030 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create stub functions for sugaring specialized types. - - - - - fa84bc65 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement list syntax sugaring logic for specialized types. - - - - - e8b05b07 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement tuple syntax sugaring logic for specialized types. - - - - - 68a2e5bc by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Get rid of code duplication in type specialization module. - - - - - 4721c336 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create scaffolding of a framework for renaming specialized types. - - - - - 271b488d by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in missing cases in specialized type renaming function. - - - - - bfa5f2a4 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Remove code duplication in specialized type renamer. - - - - - ea6bd0e8 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Change state of the type renaming monad. - - - - - 77c5496e by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Implement simple mechanism for generating new type names. - - - - - 91bfb48b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fill in stub behaviour with actual environment renaming. - - - - - d244517b by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix logic behind binder type renaming. - - - - - f3c5e360 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Add SYB-like utility function for performing stateful queries. - - - - - eb3f9154 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Create function for retrieving free variables from given type. - - - - - a94561d3 by Łukasz Hanuszczak at 2015-08-21T18:22:30+01:00 Fix compilation error caused by incorrect type signature. - - - - - 8bb707cf by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Move `SetName` class definition to types module. - - - - - 5800b13b by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Hook type renamer with instance method HTML pretty-printer. - - - - - 6a480164 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some test cases for type renamer. - - - - - 839842f7 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized signatures refer to original signature declaration. - - - - - 4880f7c9 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make specialized methods be nicely formatted again. - - - - - ab5a6a2e by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Attach source locations to the specialized class methods. - - - - - 43f8a559 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Extend instances test case to also test multi-name type signatures. - - - - - 59bc751c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix tab-based indentation in instances test case. - - - - - c2126815 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Improve placement of instance methods expander button. - - - - - 0a32e287 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add new data type declaration to instance specialization test case. - - - - - 5281af1f by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Make type renamer first try single-letter names as alternatives. - - - - - 7d509475 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix type renamer bug with incorrect names being generated. - - - - - 0f35bf7c by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Add some documentation and refactor type specialization module. - - - - - da1d0803 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix another bug where type renamer was generating incorrect names. - - - - - cd39b5cb by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Refactor type renamer to rebinding and pure renaming phases. - - - - - 850251f4 by Łukasz Hanuszczak at 2015-08-21T18:22:31+01:00 Fix unwitting compilation bug. - - - - - e5e9fc01 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Integrate instance specification type into class instance definition. - - - - - 825b0ea0 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer neccessary instance specification type. - - - - - cdba44eb by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix declaration converter to use more appropriate mode for methods. - - - - - bc45c309 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug with types not being specialized at all. - - - - - 5d8e5d89 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix bug where instance expander was opening wrong section. - - - - - 6001ee41 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix another type renamer bug where not all names were rebound. - - - - - 5f58ce2a by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Fix yet another renamer bug where some names were not unique. - - - - - 8265e521 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split instance subsection layout method to top-level declarations. - - - - - e5e66298 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Rearrange layout of instance methods in generated documentation. - - - - - a50b4eea by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Get rid of no longer used layout method. - - - - - 2ff36ec2 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach section title to the instance methods block. - - - - - 7ac15300 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Add basic tests for associated types in instances test case. - - - - - db0ea2f9 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Attach associated types information to instance header. - - - - - 71cad4d5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details section contain associated types information. - - - - - deee2809 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Improve look of rendered associated families in instance details. - - - - - 839d13a5 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Introduce alternative type for family declarations. - - - - - d397f03f by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Make instance details record use new type for family declarations. - - - - - 2b23fe97 by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Split printer of type family header to separate functions. - - - - - c3498cdc by Łukasz Hanuszczak at 2015-08-21T18:22:32+01:00 Implement HTML renderer for pseudo-family declarations. - - - - - c12bbb04 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Apply type specializer to associated type family declarations. - - - - - 2fd69ff2 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Create helper method for specializing type signatures. - - - - - 475826e7 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Refactor specializer module to be independent from XHTML backend. - - - - - f00b431c by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add some documentation for instance head specializer. - - - - - a9fef2dc by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix bug with missing space in documentation for associated types. - - - - - 50e29056 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with incorrect instance details sections being expanded. - - - - - e6dfdd03 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by adding instance details section. - - - - - 75565b2a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make section identifier of instance details more GHC-independent. - - - - - add0c23e by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Re-accept tests after applying deterministic section identifiers. - - - - - 878f2534 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Make identifier generation also architecture-independent. - - - - - 48be69f8 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Fix issue with instance expander hijacking type hyperlink click. - - - - - 47830c1f by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Get rid of dreadful hashing function for generating identifiers. - - - - - 956cd5af by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Move `InstOrigin` type declaration to more appropriate module. - - - - - bf672ed3 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Accept tests affected by changes related to instance expander. - - - - - 8f2a949a by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add examples with type operators to the instances test case. - - - - - 64600a84 by Łukasz Hanuszczak at 2015-08-21T18:22:33+01:00 Add basic support for sugaring infix type operators. - - - - - 747d71b8 by Łukasz Hanuszczak at 2015-08-21T18:22:34+01:00 Add support for sugaring built-in function syntax. - - - - - d4696ffb by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Remove default methods from Hoogle class output. - - - - - bf0e09d7 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add fixity declarations in Hoogle backend output. - - - - - 90e91a51 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix bug with incorrect fixities being generated in Hoogle backend. - - - - - 48f11d35 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve class type family declarations output in Hoogle backend. - - - - - 661e8e8f by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Add missing default family equations in Hoogle output. - - - - - e2d64103 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Improve formatting of class details output in Hoogle backend. - - - - - 490fc377 by Łukasz Hanuszczak at 2015-08-21T18:31:31+01:00 Fix weird-looking Hoogle output for familyless classes. - - - - - ea115b64 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create script file for new HTML test runner. - - - - - 609913d3 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Set default behaviour if no arguments given. - - - - - dc115f67 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for providing optional arguments for test runner. - - - - - d93ec867 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve output of test runner error messages. - - - - - 0be9fe12 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add support for executing Haddock process in test runner. - - - - - 4e4d00d9 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Add GHC path to test runner configuration. - - - - - d67a2086 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make GHC path a test runner command-line argument. - - - - - c810079a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Extend test runner configuration with Haddock arguments. - - - - - fee18845 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor test runner and create stub functions. - - - - - ff7c161f by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make test runner actually run Haddock executable. - - - - - 391f73e6 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with test runner not producing any output files. - - - - - 81a74e2d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Setup skeleton of framework for running tests. - - - - - f8a79ec4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Fix bug with modules not being found in global search mode. - - - - - 7e700b4d by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make Haddock standard output redirection be more configurable. - - - - - 53b4c17a by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Incorporate old, ugly functions for comparing output files. - - - - - 8277c8aa by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Refactor architecture of test runner output checking functions. - - - - - 587bb414 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement actual diffing mechanism. - - - - - 9ed2b5e4 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Improve code style to match popular guidelines. - - - - - 14bffaf8 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Make it possible to choose alternative diff tool. - - - - - 5cdfb005 by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Create stub methods for processing test output as XML documents. - - - - - 7ef8e12e by Łukasz Hanuszczak at 2015-08-22T23:40:26+02:00 Implement link-stripping logic as simple SYB transformation. - - - - - 8a1fcd4f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Incorporate link stripping to output diffing mechanism. - - - - - 37dba2bc by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement footer-stripping logic. - - - - - 9cd52120 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Add missing dependencies in Cabal configuration file. - - - - - e0f83c6e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix issue with output being printed in incorrect order. - - - - - 0a94fbb0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to run tests without generating diff. - - - - - 76a58c6f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor HTML test suite boilerplate to external package. - - - - - af41e6b0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utilities for storing directory configuration. - - - - - d8f0698f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move IO-dependent config of HTML test suite to test package. - - - - - 17369fa0 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Enable all compiler warnings in Haddock test package configuration. - - - - - 9d03b47a by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Move Haddock runner of HTML test suite to Haddock test package. - - - - - 4b3483c5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 03754194 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience wrappers to simplify in test entry points. - - - - - 27476ab7 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adjust module visibility and items they export. - - - - - c40002ba by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Remove no longer useful test option. - - - - - 55ab2541 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Change extension of test files used for diffing. - - - - - 136bf4e4 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Refactor and simplify XHTML helper module of test package. - - - - - 69f7e3df by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix typo in link stripper of HTML test suite runner. - - - - - 0c3c1c6b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create convenience script for running specific HTML tests. - - - - - 489e1b05 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement utility functions for conditional link stripping. - - - - - 0f985dc3 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt `hypsrc-test` module to work with new testing framework. - - - - - 927406f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Implement output accepting mechanism in test package. - - - - - 8545715e by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Create utility function for recursive obtaining directory contents. - - - - - cb70381f by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make Haddock test package more generic. - - - - - 019599b5 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix path handling in test runner. - - - - - 399b985b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Make it possible to specify ignored files for test output. - - - - - 41b3d93d by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Adapt HTML test runner to use new ignoring functionality. - - - - - e2091c8b by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Fix bug with not all test output files being checked. - - - - - b22134f9 by Łukasz Hanuszczak at 2015-08-22T23:40:27+02:00 Specify ignored files for hyperlinker source test runner. - - - - - 3301dfa1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Copy test runner script for hyperlinked source case. - - - - - d39a6dfa by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner invoking Haddock in incorrect mode. - - - - - f32c8ff3 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix path handling in test module loader. - - - - - 10f94ee9 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make test runner ignore test packages with no modules. - - - - - 5dc4239c by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create test runner entry points for LaTeX test suite. - - - - - 58d1f7cf by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with unnecessary checking old test output. - - - - - c7ce76e1 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Re-implement test acceptance functionality. - - - - - 13bbabe8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix warning about no longer needed definition. - - - - - 958a99b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Adapt Cabal configuration to execute LaTeX suite with new runner. - - - - - 550ff663 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Setup test suite for Hoogle backend. - - - - - 3aa969c4 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Make Hoogle backend create output directory if needed. - - - - - eb085b02 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Add appropriate .gitignore entry and configure Hoogle test suite. - - - - - a50bf915 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Fix bug with test runner failing when run on multiple test packages. - - - - - bf5368b8 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create simple test cases for Hoogle backend. - - - - - 6121ba4b by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Create helper function for conversion between XML and XHTML. - - - - - cb516061 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Refactor existing code to use XHTML printer instead of XML one. - - - - - e2de8c82 by Łukasz Hanuszczak at 2015-08-22T23:40:28+02:00 Improve portability of test runner scripts. - - - - - 9563e774 by Łukasz Hanuszczak at 2015-08-22T23:43:16+02:00 Remove redundant import statement. - - - - - 55353df1 by Łukasz Hanuszczak at 2015-08-24T23:09:20+02:00 Fix bug with accepting to non-existing directory. - - - - - 00a334ca by Łukasz Hanuszczak at 2015-08-24T23:09:47+02:00 Accept output for Hoogle and LaTeX backends. - - - - - 29191d8b by Łukasz Hanuszczak at 2015-08-24T23:14:18+02:00 Get rid of obsolete testing utilities. - - - - - bbb25db3 by Łukasz Hanuszczak at 2015-08-24T23:18:50+02:00 Update sandbox setup guide to work with Haddock test package. - - - - - cfd45248 by Łukasz Hanuszczak at 2015-08-24T23:51:30+02:00 Make Travis aware of Haddock test package. - - - - - 74185b7a by Łukasz Hanuszczak at 2015-08-25T17:41:59+02:00 Fix test suite failure when used with Stack. - - - - - 18769697 by Łukasz Hanuszczak at 2015-08-25T18:02:09+02:00 Add sample Stack setup to the hacking guide. - - - - - 22715eeb by Łukasz Hanuszczak at 2015-08-25T18:04:47+02:00 Fix Markdown formatting of README file. - - - - - b49ec386 by Łukasz Hanuszczak at 2015-08-25T18:13:36+02:00 Setup Haddock executable path in Travis configuration. - - - - - 5d29eb03 by Eric Seidel at 2015-08-30T09:55:58-07:00 account for changes to ipClass - - - - - f111740a by Ben Gamari at 2015-09-02T13:20:37+02:00 Merge pull request haskell/haddock#443 from bgamari/ghc-head account for changes to ipClass - - - - - a2654bf6 by Jan Stolarek at 2015-09-03T01:32:57+02:00 Follow changes from haskell/haddock#6018 - - - - - 2678bafe by Richard Eisenberg at 2015-09-21T12:00:47-04:00 React to refactoring CoAxiom branch lists. - - - - - ebc56e24 by Edward Z. Yang at 2015-09-21T11:53:46-07:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4a8c4198 by Tamar Christina at 2015-09-27T13:59:08+02:00 Create Process: removed PhaseFailed - - - - - 7e99b790 by Oleg Grenrus at 2015-09-27T20:52:10+03:00 Generate docs for orphan instances - - - - - 32e932e2 by Oleg Grenrus at 2015-09-28T07:21:11+03:00 Have source links for orphan instances - - - - - c2eb9f4f by Oleg Grenrus at 2015-09-28T07:24:58+03:00 Print orphan instances header only if required - - - - - ff96f978 by Oleg Grenrus at 2015-09-28T07:40:54+03:00 Add orphan instances link to contents box - - - - - d72490a6 by Oleg Grenrus at 2015-09-28T16:37:44+03:00 Fix orphan instance collapsing - - - - - 25d3dfe5 by Ben Gamari at 2015-10-03T12:38:09+02:00 Merge pull request haskell/haddock#448 from Mistuke/fix-silent-death-of-runInteractive Remove PhaseFailed - - - - - 1e45e43b by Edward Z. Yang at 2015-10-11T13:10:10-07:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b1370ac1 by Adam Gundry at 2015-10-16T16:26:42+01:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 60bef421 by Simon Peyton Jones at 2015-10-26T12:52:36+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 4c1898ca by Simon Peyton Jones at 2015-10-27T14:24:56+00:00 Track change to PatSyn.patSynSig - - - - - 25108e85 by Simon Peyton Jones at 2015-10-27T17:34:18+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - 693643ac by Ben Gamari at 2015-10-28T14:33:06+01:00 Account for Typeable changes The treatment of type families changed. - - - - - cd7c2221 by Simon Peyton Jones at 2015-10-30T13:03:51+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - 712032cb by Herbert Valerio Riedel at 2015-10-31T11:01:45+01:00 Relax upper bound on `base` to allow base-4.9 - - - - - 0bfa0475 by Simon Peyton Jones at 2015-10-31T19:08:13+00:00 More adaption to wildcard-refactor - - - - - 0a3c0cb7 by Simon Peyton Jones at 2015-10-31T22:14:43+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor Conflicts: haddock-api/src/Haddock/Convert.hs - - - - - c4fd4ec9 by Alan Zimmerman at 2015-11-01T11:16:34+01:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 42cdd882 by Matthew Pickering at 2015-11-06T20:02:16+00:00 Change for IEThingWith - - - - - f368b7be by Ben Gamari at 2015-11-11T11:35:51+01:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - e32965b8 by Simon Peyton Jones at 2015-11-13T12:18:17+00:00 Merge with origin/head - - - - - ebcf795a by Edward Z. Yang at 2015-11-13T21:56:27-08:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4e23989f by Simon Peyton Jones at 2015-11-18T11:32:54+00:00 Wibbles to Haddock - - - - - 2289cd4a by Simon Peyton Jones at 2015-11-20T23:12:49+00:00 Merge remote-tracking branch 'origin/ghc-head' into wip/spj-wildcard-refactor - - - - - 695975a6 by Alan Zimmerman at 2015-11-21T21:16:12+02:00 Update to match GHC wip/T11019 - - - - - bbba21e7 by Simon Peyton Jones at 2015-11-23T13:54:31+00:00 merge with origin/ghc-head - - - - - 3d664258 by Simon Peyton Jones at 2015-11-23T17:17:18+00:00 Wibble - - - - - e64cf586 by Herbert Valerio Riedel at 2015-12-05T00:29:55+01:00 Canonicalise Monad instances - - - - - a2de15a7 by Alan Zimmerman at 2015-12-05T17:33:52+02:00 Matching changes for haskell/haddock#11028 - - - - - cc29a3e4 by Alan Zimmerman at 2015-12-05T19:45:33+02:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 95dd15d1 by Richard Eisenberg at 2015-12-11T17:33:39-06:00 Update for type=kinds - - - - - cb5fd9ed by Herbert Valerio Riedel at 2015-12-14T15:07:30+00:00 Bump versions for ghc-7.11 - - - - - 4f286d96 by Simon Peyton Jones at 2015-12-14T15:10:56+00:00 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC - - - - - 13ea2733 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints - - - - - 098df8b8 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track changes in HsSyn for quasi-quotes - - - - - 716a64de by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track change in API of TyCon - - - - - 77a66bca by Adam Gundry at 2015-12-14T15:10:58+00:00 Track API changes to support empty closed type familes - - - - - f2808305 by Simon Peyton Jones at 2015-12-14T15:10:58+00:00 Track the new location of setRdrNameSpace - - - - - ba8b08a4 by Alan Zimmerman at 2015-12-14T15:10:59+00:00 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. - - - - - a4ded87e by Thomas Winant at 2015-12-14T15:14:05+00:00 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: haskell/haddock#10098 - - - - - 25c78107 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: print correct strictness marks - - - - - 6cbc41c4 by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 StrictData: changes in HsBang type - - - - - ad46821a by Alan Zimmerman at 2015-12-14T15:14:06+00:00 Replace (SourceText,FastString) with WithSourceText data type Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type data WithSourceText = WithSourceText SourceText FastString Trac ticket: haskell/haddock#10692 - - - - - abc0ae5b by Adam Sandberg Eriksson at 2015-12-14T15:14:06+00:00 HsBang is split into HsSrcBang and HsImplBang With recent changes in GHC handling of strictness annotations in Haddock is simplified. - - - - - 3308d06c by Thomas Miedema at 2015-12-14T15:14:07+00:00 Follow changes in GHC build system - - - - - 6c763deb by Eric Seidel at 2015-12-14T15:14:07+00:00 account for changes to ipClass - - - - - ae5b4eac by Jan Stolarek at 2015-12-14T15:17:00+00:00 Follow changes from haskell/haddock#6018 - - - - - ffbc40e0 by Richard Eisenberg at 2015-12-14T15:17:02+00:00 React to refactoring CoAxiom branch lists. - - - - - d1f531e9 by Edward Z. Yang at 2015-12-14T15:17:02+00:00 Track msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 79f73754 by Tamar Christina at 2015-12-14T15:17:02+00:00 Create Process: removed PhaseFailed - - - - - 3d37bebb by Edward Z. Yang at 2015-12-14T15:20:46+00:00 s/PackageKey/UnitId/g and s/packageKey/unitId/g Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 5f8a9e44 by Adam Gundry at 2015-12-14T15:20:48+00:00 Roughly fix up haddock for DuplicateRecordFields changes This compiles, but will probably need more work to produce good documentation when the DuplicateRecordFields extension is used. - - - - - 79dda70f by Simon Peyton Jones at 2015-12-14T15:26:02+00:00 Track wip/spj-wildcard-refactor on main repo - - - - - 959930fb by Simon Peyton Jones at 2015-12-14T15:37:50+00:00 Follow changes to HsTYpe Not yet complete (but on a wip/ branch) - - - - - e18a8df5 by Simon Peyton Jones at 2015-12-14T15:37:52+00:00 Work on updating Haddock to wip/spj-wildard-recactor Still incomplete - - - - - aa35ab52 by Simon Peyton Jones at 2015-12-14T15:40:18+00:00 More adaption to wildcard-refactor - - - - - 8ceef94b by Simon Peyton Jones at 2015-12-14T15:46:04+00:00 Track change to PatSyn.patSynSig - - - - - cd81e83d by Ben Gamari at 2015-12-14T15:46:06+00:00 Account for Typeable changes The treatment of type families changed. - - - - - 63c9117c by Herbert Valerio Riedel at 2015-12-14T15:46:34+00:00 Relax upper bound on `base` to allow base-4.9 - - - - - a484c613 by Alan Zimmerman at 2015-12-14T15:47:46+00:00 Matching change GHC haskell/haddock#11017 BooleanFormula located - - - - - 2c26fa51 by Matthew Pickering at 2015-12-14T15:47:47+00:00 Change for IEThingWith - - - - - 593baa0f by Ben Gamari at 2015-12-14T15:49:21+00:00 Eliminate support for deprecated GADT syntax Follows from GHC D1460. - - - - - b6b5ca78 by Edward Z. Yang at 2015-12-14T15:49:54+00:00 Undo msHsFilePath change. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b5b0e072 by Alan Zimmerman at 2015-12-14T15:54:20+00:00 Update to match GHC wip/T11019 - - - - - 14ddeb68 by Simon Peyton Jones at 2015-12-14T15:54:22+00:00 Wibble - - - - - 10a90ad8 by Herbert Valerio Riedel at 2015-12-14T15:54:22+00:00 Canonicalise Monad instances - - - - - ed68ac50 by Alan Zimmerman at 2015-12-14T15:55:48+00:00 Matching changes for haskell/haddock#11028 - - - - - 3f7e5a2d by Alan Zimmerman at 2015-12-14T15:55:49+00:00 Placeholder for record style GADT declaration A GADT Declaration is now presented as CmmCondBranch :: {..} -> CmmNode O C cml_pred :: CmmExpr cml_true, cml_false :: !Label cml_likely :: Maybe Bool for CmmCondBranch :: { -- conditional branch cml_pred :: CmmExpr, cml_true, cml_false :: ULabel, cml_likely :: Maybe Bool -- likely result of the conditional, -- if known } -> CmmNode O C - - - - - 6543a73f by Richard Eisenberg at 2015-12-14T15:59:55+00:00 Update for type=kinds - - - - - 193a5c48 by Matthew Pickering at 2015-12-14T18:17:00+00:00 Changes to compile with 8.0 - - - - - add669ec by Matthew Pickering at 2015-12-14T18:47:12+00:00 Warnings - - - - - 223f3fb4 by Ben Gamari at 2015-12-15T23:45:05+01:00 Update for D1200 - - - - - d058388f by Ben Gamari at 2015-12-16T05:40:17-05:00 Types: Add Outputable[Bndr] DocName instances - - - - - 62ecd7fb by Ben Gamari at 2015-12-16T09:23:09-05:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ddbc187a by Ben Gamari at 2015-12-16T17:54:55+01:00 Update for D1200 - - - - - cec83b52 by Ben Gamari at 2015-12-16T17:54:55+01:00 Types: Add Outputable[Bndr] DocName instances - - - - - d12ecc98 by Ben Gamari at 2015-12-16T17:54:55+01:00 Fix fallout from wildcards refactoring The wildcard refactoring was introduced a new type of signature, `ClassOpSig`, which is carried by typeclasses. The original patch adapting Haddock for this change missed a few places where this constructor needed to be handled, resulting in no class methods in documentation produced by Haddock. Additionally, this moves and renames the `isVanillaLSig` helper from GHC's HsBinds module into GhcUtils, since it is only used by Haddock. - - - - - ada1616f by Ben Gamari at 2015-12-16T17:54:58+01:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a4f0383d by Ben Gamari at 2015-12-16T23:32:38+01:00 Fix Hyperlinker GHC.con_names is now GHC.getConNames - - - - - a10e6849 by Ben Gamari at 2015-12-20T00:54:11+01:00 Merge remote-tracking branch 'mrhania/testing-framework-improvements' into ghc-head - - - - - f078b4fd by Ben Gamari at 2015-12-20T00:59:51+01:00 test: Compatibility with Cabal 1.23 - - - - - 88a511a9 by Ben Gamari at 2015-12-20T01:14:35+01:00 Merge remote-tracking branch 'phadej/orphans' into ghc-head - - - - - 4e250f36 by Ben Gamari at 2015-12-20T01:14:52+01:00 Add html-test for orphan instances output - - - - - 87fffbad by Alan Zimmerman at 2015-12-20T09:50:42+02:00 Update for GHC trac#11258 Adding locations to RdrName in FieldOcc and AmbiguousFieldOcc - - - - - 6b7e51c9 by idontgetoutmuch at 2015-12-20T21:01:47+00:00 Merge pull request haskell/haddock#1 from haskell/ghc-head Ghc head - - - - - 229c1fb5 by Dominic Steinitz at 2015-12-21T07:19:16+00:00 Handle inline math with mathjax. - - - - - 57902d66 by Dominic Steinitz at 2015-12-21T08:07:11+00:00 Fix the documentation for haddock itself. Change notation and add support for inline math. Allow newlines in display math. Add a command line option for the mathjax url (you might want to use a locally installed version). Rebase tests because of extra url and version change. Respond to (some of the) comments. Fix warnings in InterfaceFile.hs - - - - - 0e69f236 by Herbert Valerio Riedel at 2015-12-21T18:30:43+01:00 Fix-up left-over assumptions of GHC 7.12 into GHC 8.0 - - - - - c67f8444 by Simon Peyton Jones at 2015-12-22T16:26:56+00:00 Follow removal of NamedWildCard from HsType - - - - - da40327a by Ben Gamari at 2015-12-23T14:15:28+01:00 html-test/Operators: Clear up ambiguous types For reasons that aren't entirely clear a class with ambiguous types was accepted by GHC <8.0. I've added a functional dependency to clear up this ambiguity. - - - - - 541b7fa4 by Ben Gamari at 2015-12-23T14:18:51+01:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 0febc947 by Ben Gamari at 2015-12-24T00:30:20+01:00 hoogle-test/AssocTypes: Allow AmbiguousTypes GHC 8.0 complains otherwise - - - - - 25810841 by Ben Gamari at 2015-12-24T00:33:18+01:00 OrphanInstances: Accept test output - - - - - 841987f3 by Ben Gamari at 2015-12-25T11:03:11+01:00 Merge remote-tracking branch 'idontgetoutmuch/ghc-head' into ghc-head - - - - - 358391f0 by Ben Gamari at 2015-12-26T10:44:50+01:00 Add missing import - - - - - a8896885 by Ben Gamari at 2015-12-26T10:45:27+01:00 travis: Use Travis containers - - - - - 85e82134 by Herbert Valerio Riedel at 2015-12-30T17:25:39+01:00 tweak version bounds for GHC-8.1 - - - - - 672a5f75 by randen at 2016-01-01T23:45:25-08:00 The Haddock part for fully gcc-like response files " driver/Main.hs * Moved the response file handling into ResponseFile.hs, updating import section as appropriate. * driver/ResponseFile.hs * New file. In anticipation that maybe some day this could be provided by another library, and to make it possible to unit test, this functionality is pulled out of the Main.hs module, and expanded to support the style/format of response files which gcc uses. * The specification for the format of response files which gcc generates and consumes, seems to be best derived from the gcc code itself (libiberty/argv.c), so that is what has been done here. * This is intended to fix haskell/haddock#379 * driver-test/Main.hs * New file for testing code in the driver source tree * driver-test/ResponseFileSpec.hs * Tests, adapted/adopted from the same gcc code where the escaping/unescaping is from, in the hspec style of unit tests * haddock.cabal * Add the driver-test test-suite. Introduces a new library dependency (upon hspec) for the haddock driver target in the haddock.cabal file, but practically, this should not be a problem as the haddock-api tests already depend on hspec. - - - - - 498781df by Ben Gamari at 2016-01-06T13:41:04+01:00 Version bumps and changelog - - - - - 8451e46a by Ben Gamari at 2016-01-06T13:47:17+01:00 Merge remote-tracking branch 'randen/bug468' - - - - - fb2d9181 by Ben Gamari at 2016-01-06T08:14:42-05:00 Add ResponseFile to OtherModules - - - - - 2cb2d2e3 by Ben Gamari at 2016-01-06T14:35:00+01:00 Merge branch 'master' into ghc-head - - - - - 913477d4 by Eric Seidel at 2016-01-11T14:57:57-08:00 deal with un-wiring of IP class - - - - - c557a4b3 by Alan Zimmerman at 2016-01-15T11:14:35+02:00 Update to match wip/T11430 in GHC - - - - - 3e135093 by Alan Zimmerman at 2016-01-16T18:21:59+01:00 Update to match wip/T11430 in GHC - - - - - c48ef2f9 by Ben Gamari at 2016-01-18T09:50:06+01:00 Merge remote-tracking branch 'gridaphobe/ghc-head' into ghc-head - - - - - 9138a1b0 by Eric Seidel at 2016-01-18T12:50:15+01:00 deal with un-wiring of IP class (cherry picked from commit 17388b0f0029d969d79353be7737eb01c7b8dc5f) - - - - - b48c172e by Joachim Breitner at 2016-01-19T00:11:38+01:00 Make sure --mathjax affects all written HTML files This fixes haskell/haddock#475. - - - - - af61fe63 by Ryan Scott at 2016-02-07T23:25:57+01:00 Render */# instead of TYPE 'Lifted/TYPE 'Unlifted (fixes haskell/haddock#473) - - - - - b6458693 by Ben Gamari at 2016-02-07T23:29:27+01:00 Merge pull request haskell/haddock#477 from haskell/issue-475 Make sure --mathjax affects all written HTML files - - - - - adcc0071 by Ben Gamari at 2016-02-07T23:34:52+01:00 Merge branch 'master' into ghc-head - - - - - d0404e61 by Ben Gamari at 2016-02-08T12:46:49+01:00 doc: Switch to Sphinx - - - - - acb153b3 by Ben Gamari at 2016-02-08T12:46:56+01:00 Document --use-unicode flag - - - - - c20bdf1d by Ben Gamari at 2016-02-08T13:41:24+01:00 Fix GHC and haddock-library dependency bounds - - - - - 8d946801 by Ben Gamari at 2016-02-08T14:54:56+01:00 testsuite: Rework handling of output sanitization Previously un-cleaned artifacts were kept as reference output, making it difficult to tell what has changed and causing spurious changes in the version control history. Here we rework this, cleaning the output during acceptance. To accomplish this it was necessary to move to strict I/O to ensure the reference handle was closed before accept attempts to open the reference file. - - - - - c465705d by Ben Gamari at 2016-02-08T15:36:05+01:00 test: Compare on dump For reasons I don't understand the Xml representations differ despite their textual representations being identical. - - - - - 1ec0227a by Ben Gamari at 2016-02-08T15:36:05+01:00 html-test: Accept test output - - - - - eefbd63a by Ben Gamari at 2016-02-08T15:36:08+01:00 hypsrc-test: Accept test output And fix impredicative Polymorphism testcase. - - - - - d1df4372 by Ben Gamari at 2016-02-08T15:40:44+01:00 Merge branch 'fix-up-testsuite' - - - - - 206a3859 by Phil Ruffwind at 2016-02-08T17:51:21+01:00 Move the permalinks to "#" on the right side Since pull request haskell/haddock#407, the identifiers have been permalinked to themselves, but this makes it difficult to copy the identifier by double-clicking. To work around this usability problem, the permalinks are now placed on the far right adjacent to "Source", indicated by "#". Also, 'namedAnchor' now uses 'id' instead of 'name' (which is obsolete). - - - - - 6c89fa03 by Phil Ruffwind at 2016-02-08T17:54:44+01:00 Update tests for previous commit - - - - - effaa832 by Ben Gamari at 2016-02-08T17:56:17+01:00 Merge branch 'anchors-redux' - - - - - 9a2bec90 by Ben Gamari at 2016-02-08T17:58:40+01:00 Use -fprint-unicode-syntax when --use-unicode is enabled This allows GHC to render `*` as its Unicode representation, among other things. - - - - - 28ecac5b by Ben Gamari at 2016-02-11T18:53:03+01:00 Merge pull request haskell/haddock#480 from bgamari/sphinx Move documentation to ReStructuredText - - - - - 222e5920 by Ryan Scott at 2016-02-11T15:42:42-05:00 Collapse type/data family instances by default - - - - - a80ac03b by Ryan Scott at 2016-02-11T20:17:09-05:00 Ensure expanded family instances render correctly - - - - - 7f985231 by Ben Gamari at 2016-02-12T10:04:22+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - d4eda086 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Various cleanups - - - - - 79bee48d by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show kind signatures for type family variables Addresses GHC haskell/haddock#11588. - - - - - b2981d98 by Ben Gamari at 2016-02-18T00:05:56+01:00 Xhtml.Decl: Show 'where ...' after closed type family Seems like we should ideally show the actual equations as well but that seems like it would be a fair amount of work - - - - - cfc0e621 by Ben Gamari at 2016-02-18T22:48:12+01:00 Merge pull request haskell/haddock#483 from bgamari/T11588 Fix GHC haskell/haddock#11588 This fixes GHC haskell/haddock#11588: * Show where ... after closed type families * Show kind signatures on type family type variables - - - - - 256e8a0d by Ben Gamari at 2016-02-18T23:15:39+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 32402036 by Richard Eisenberg at 2016-02-24T13:21:44-05:00 Follow-on changes to support RuntimeRep - - - - - 2b1c572d by Matthew Pickering at 2016-03-04T21:04:02+00:00 Remove unused functions - - - - - eb906f50 by Richard Eisenberg at 2016-03-13T21:17:20+01:00 Follow-on changes to support RuntimeRep (cherry picked from commit ab954263a793d8ced734459d6194a5d89214b66c) - - - - - 8c34ef34 by Richard Eisenberg at 2016-03-14T23:47:23-04:00 Changes due to fix for GHC#11648. - - - - - 0e022014 by Richard Eisenberg at 2016-03-15T14:06:45+01:00 Changes due to fix for GHC#11648. (cherry picked from commit bb994de1ab0c76d1aaf1e39c54158db2526d31f1) - - - - - ed3f78ab by Rik Steenkamp at 2016-04-02T22:20:36+01:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 - - - - - d3210042 by Rik Steenkamp at 2016-04-04T15:43:32+02:00 Fix printing of pattern synonym types Removes the call to `patSynType :: PatSyn -> Type` in `Convert.hs` as this function will be removed from GHC. Instead, we use the function `patSynSig` and build the `HsDecl` manually. This also fixes the printing of the two contexts and the quantified type variables in a pattern synonym type. Reviewers: goldfire, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D2048 (cherry picked from commit 3ddcbd6b8e6884bd95028381176eb33bee6896fb) - - - - - 236eec90 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 692ee7e0 by Ben Gamari at 2016-04-10T23:40:15+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. - - - - - 79619f57 by Ben Gamari at 2016-04-10T23:46:22+02:00 doc: Only install if BUILD_SPHINX_HTML==YES Fixes GHC haskell/haddock#11818. (cherry picked from commit c6d6a18d85e5e2d9bb5904e6919e8a8d7e31c4c5) - - - - - 3358ccb4 by Ben Gamari at 2016-04-10T23:47:27+02:00 doc: Fix option references (cherry picked from commit f915fb3c74328fb994235bbbd42092a691539197) - - - - - 264949b1 by Ben Gamari at 2016-04-16T17:50:23+02:00 Merge pull request haskell/haddock#482 from RyanGlScott/ghc-head Collapse type/data family instances by default - - - - - 478c483a by Ben Gamari at 2016-04-16T17:51:09+02:00 Merge pull request haskell/haddock#489 from mpickering/unused-functions Remove some unused functions - - - - - c94e55f0 by Ryan Scott at 2016-04-16T17:57:54+02:00 Collapse type/data family instances by default (cherry picked from commit 2da130a8db8f995c119b544fad807533236cf088) - - - - - 31e633d3 by Ryan Scott at 2016-04-16T17:58:06+02:00 Ensure expanded family instances render correctly (cherry picked from commit 1338b5d7c32939de6bbc31af0049477e4f847103) - - - - - 03e4d197 by Matthew Pickering at 2016-04-16T17:58:21+02:00 Remove unused functions (cherry picked from commit b89d1c2456bdb2d4208d94ded56155f7088a37d0) - - - - - ed4116f6 by Ben Gamari at 2016-04-20T10:46:57+02:00 ghc: Install files for needed --hyperlinked-source - - - - - 0be999c4 by Ben Gamari at 2016-04-20T11:37:54+02:00 ghc: Install files for needed --hyperlinked-source (cherry picked from commit 5c82c9fc2d21ddaae4a2470f1c375426968f19c6) - - - - - 4d17544c by Simon Peyton Jones at 2016-04-20T12:42:28+01:00 Track change to HsGroup This relates to a big GHC patch for Trac haskell/haddock#11348 - - - - - 1700a50d by Ben Gamari at 2016-05-01T13:19:27+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. - - - - - 0b7c8125 by Ben Gamari at 2016-05-01T13:21:43+02:00 doc: At long last fix ghc.mk The variable reference was incorrectly escaped, meaning that Sphinx documentation was never installed. (cherry picked from commit 609018dd09c4ffe27f9248b2d8b50f6196cd42b9) - - - - - af115ce0 by Ryan Scott at 2016-05-04T22:15:50-04:00 Render Haddocks for derived instances Currently, one can document top-level instance declarations, but derived instances (both those in `deriving` clauses and standalone `deriving` instances) do not enjoy the same privilege. This makes the necessary changes to the Haddock API to enable rendering Haddock comments for derived instances. This is part of a fix for Trac haskell/haddock#11768. - - - - - 76fa1edc by Ben Gamari at 2016-05-10T18:13:25+02:00 haddock-test: A bit of refactoring for debuggability - - - - - 7d4c4b20 by Ben Gamari at 2016-05-10T18:13:25+02:00 Create: Mark a comment as TODO - - - - - 2a6d0c90 by Ben Gamari at 2016-05-10T18:13:25+02:00 html-test: Update reference output - - - - - bd60913d by Ben Gamari at 2016-05-10T18:13:25+02:00 hypsrc-test: Fix reference file path in cabal file It appears the haddock insists on prefixing --hyperlinked-sourcer output with directory which the source appeared in. - - - - - c1548057 by Ben Gamari at 2016-05-10T18:22:12+02:00 doc: Update extra-source-files in Cabal file - - - - - 41d5bae3 by Ben Gamari at 2016-05-10T18:29:21+02:00 Bump versions - - - - - ca75b779 by Ben Gamari at 2016-05-11T16:03:44+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 4e3cfd62 by Ben Gamari at 2016-05-11T16:06:45+02:00 Merge remote-tracking branch 'RyanGlScott/ghc-head' into ghc-head - - - - - a2379970 by Ben Gamari at 2016-05-11T23:15:11+02:00 doc: Add clean targets - - - - - f275212e by Ben Gamari at 2016-05-11T23:15:14+02:00 doc: Add html as an all-target for ghc Otherwise the html documentation won't be installed for binary-dist. - - - - - 388fc0af by Ben Gamari at 2016-05-12T09:49:12+02:00 Update CHANGES - - - - - bad81ad5 by Ben Gamari at 2016-05-12T09:49:38+02:00 Version bump - - - - - c01688a7 by Ben Gamari at 2016-05-12T10:04:58+02:00 Revert "Version bump" This bump was a bit premature. This reverts commit 7b238d9c5be9b07aa2d10df323b5c7b8d1634dc8. - - - - - 7ed05724 by Ben Gamari at 2016-05-12T10:05:33+02:00 doc: Fix GHC clean rule Apparently GHC's build system doesn't permit wildcards in clean paths. - - - - - 5d9611f4 by Ben Gamari at 2016-05-12T17:43:50+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 653566b2 by Ben Gamari at 2016-05-14T09:57:31+02:00 Version bump to 2.17.2 - - - - - b355c439 by Ben Gamari at 2016-05-14T09:57:51+02:00 doc: Use `$(MAKE)` instead of `make` This is necessary to ensure we use gmake. - - - - - 8a18537d by Ben Gamari at 2016-05-14T10:15:45+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - b3290ef1 by Sebastian Meric de Bellefon at 2016-05-14T11:29:47-04:00 Fix haskell/haddock#303. Hide footer when printing The "Produced by Haddock" footer was overlapping the page's body when printing. This patch hides the footer with a css media rule. - - - - - b4a76f89 by Sebastian Meric de Bellefon at 2016-05-15T02:12:46-04:00 Fix haskell/haddock#280. Parsing of module header The initial newlines were counted as indentation spaces, thus disturbing the parsing of next lines - - - - - ba797c9e by Ben Gamari at 2016-05-16T14:53:46+02:00 doc: Vendorize alabaster Sphinx theme Alabaster is now the default sphinx theme and is a significant improvement over the previous default that it's worthproviding it when unavailable (e.g. Sphinx <1.3). - - - - - c9283e44 by Ben Gamari at 2016-05-16T14:55:17+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 1c9ea198 by Sebastian Méric de Bellefon at 2016-05-16T12:30:40-04:00 Merge pull request haskell/haddock#502 from Helkafen/master Fix haskell/haddock#303. Hide footer when printing - - - - - 33631016 by Ben Gamari at 2016-05-16T19:56:11+02:00 Revert "doc: Vendorize alabaster Sphinx theme" This ended up causes far too many issues to be worthwhile. We'll just have to live with inconsistent haddock documentation. This reverts commit cec21957001143794e71bcd9420283df18e7de40. - - - - - 93317d26 by Ben Gamari at 2016-05-16T19:56:11+02:00 cabal: Fix README path - - - - - c8695b22 by Ben Gamari at 2016-05-16T19:58:51+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 0b50eaaa by Ben Gamari at 2016-05-16T21:02:08+02:00 doc: Use whichever theme sphinx deems appropriate - - - - - 857c1c9c by Ben Gamari at 2016-05-16T21:07:08+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 15fc5637 by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Remove redundant imports - - - - - 132ddc6a by Ben Gamari at 2016-05-22T12:43:59+02:00 Create: Better debug output For tracking down haskell/haddock#505 - - - - - 2252a149 by Ben Gamari at 2016-05-22T12:43:59+02:00 Don't consider default class ops when looking for decls When we are looking for an operation within a class we don't care about `default`-type declarations. This was the cause of haskell/haddock#505. - - - - - 4886b2ec by Oleg Grenrus at 2016-05-24T16:19:48+03:00 UnfelpfulSpan line number omitted Kind of resolves https://github.com/haskell/haddock/issues/508 - - - - - a4befd36 by Oleg Grenrus at 2016-05-24T16:53:35+03:00 Change Hyperlinked lexer to know about DataKinds ticks - - - - - f45cb52e by David Feuer at 2016-05-24T18:48:53-04:00 Make parser state a newtype Previously, it was `data` wrapping a `Maybe`, which seems a bit silly. Obviously, this can be changed back if anyone wants to add more fields some day. - - - - - 05013dd7 by Sebastian Meric de Bellefon at 2016-05-24T22:03:55-04:00 remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) Frames are a bit broken, ignored by Hackage, and considered obsolete in general. This patch disables frames generation. The mini_*.html files are still used in the synopsis. - - - - - b8163a88 by Ben Gamari at 2016-05-25T14:44:15+02:00 Merge pull request haskell/haddock#507 from bgamari/T505 Fix haskell/haddock#505 - - - - - ea1b30c6 by Sebastian Meric de Bellefon at 2016-05-25T14:17:00-04:00 Update CHANGES - - - - - eddfc258 by Sebastian Méric de Bellefon at 2016-05-25T15:17:40-04:00 Merge pull request haskell/haddock#514 from Helkafen/frames remove framed view of the HTML documentation (see haskell/haddock#114 and haskell/haddock#274) - - - - - 0e506818 by Alex Biehl at 2016-05-26T12:43:09+02:00 Remove misplaced haddock comment - - - - - a07d28c0 by Ben Gamari at 2016-05-27T11:34:59+02:00 Merge pull request haskell/haddock#515 from alexbiehl/master Remove misplaced haddock comment - - - - - 9001d267 by Ben Gamari at 2016-05-27T11:35:46+02:00 Merge pull request haskell/haddock#513 from treeowl/newtype-since Make parser state a newtype - - - - - 74e1a018 by Sebastian Méric de Bellefon at 2016-05-28T17:28:15-04:00 Merge pull request haskell/haddock#504 from Helkafen/issue-280 Fix haskell/haddock#280. Parsing of module header - - - - - 37557f4f by Alan Zimmerman at 2016-05-29T23:36:50+02:00 Matching changes for haskell/haddock#12105 - - - - - 7d09e5d6 by Sebastian Meric de Bellefon at 2016-06-03T18:07:48-04:00 Version bumps (2.17.3, 1.4.2) - - - - - 85b4bc15 by Sebastian Méric de Bellefon at 2016-06-06T18:35:13-04:00 Merge pull request haskell/haddock#521 from Helkafen/master Version bumps (2.17.3, 1.4.2) - - - - - e95f0dee by Sebastian Meric de Bellefon at 2016-06-06T19:11:35-04:00 publish haddock-test library - - - - - 4de40586 by Sebastian Méric de Bellefon at 2016-06-06T20:26:30-04:00 Merge pull request haskell/haddock#512 from phadej/oleg-fixes Fixes for haskell/haddock#508 and haskell/haddock#510 - - - - - ddfd0789 by Dominic Steinitz at 2016-06-09T09:27:28+01:00 Documentation for LaTeX markup. - - - - - 697a503a by Dominic Steinitz at 2016-06-09T09:33:59+01:00 Fix spelling mistake. - - - - - 246f6fff by Dominic Steinitz at 2016-06-09T09:37:15+01:00 Camel case MathJax. - - - - - 4684bd23 by Dominic Steinitz at 2016-06-09T09:44:53+01:00 Fix math typo and add link. - - - - - f20c037c by Simon Peyton Jones at 2016-06-13T18:26:03+01:00 Follow changes to LHsSigWcType - - - - - 0c58996d by Simon Peyton Jones at 2016-06-15T12:56:01+01:00 Follow GHC re-adding FunTy - - - - - 401b5ca7 by Sebastian Méric de Bellefon at 2016-06-15T12:16:47-04:00 Merge pull request haskell/haddock#525 from idontgetoutmuch/master Documentation for LaTeX markup. - - - - - 92d263b7 by Sebastian Méric de Bellefon at 2016-06-15T12:17:29-04:00 Merge pull request haskell/haddock#522 from Helkafen/master publish haddock-test library - - - - - 0953a2ca by Sebastian Meric de Bellefon at 2016-06-16T00:46:46-04:00 Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 65453e14 by Ben Gamari at 2016-06-16T11:16:32+02:00 ocean: Ensure that synopsis fully covers other content Previously MathJax content was being rendered on top of the synopsis due to ambiguous z-ordering. Here we explicitly give the synopsis block a higher z-index to ensure it is rendered on top. Fixes haskell/haddock#531. - - - - - 68e411a1 by Sebastian Méric de Bellefon at 2016-06-16T23:34:39-04:00 Merge pull request haskell/haddock#534 from bgamari/T531 ocean: Ensure that synopsis fully covers other content - - - - - fad6491b by Sebastian Méric de Bellefon at 2016-06-18T23:57:20-04:00 Merge pull request haskell/haddock#533 from Helkafen/master Copyright holders shown on several lines. Fix haskell/haddock#279 - - - - - 6108e21b by Sebastian Meric de Bellefon at 2016-06-22T23:08:28-04:00 do not create empty src directory Fix haskell/haddock#536. - - - - - 1ef23823 by Sebastian Méric de Bellefon at 2016-06-24T00:04:48-04:00 Merge pull request haskell/haddock#537 from Helkafen/master do not create empty src directory - - - - - 966baa96 by Omari Norman at 2016-06-29T21:59:34-04:00 Add $ as a special character If this character is not escaped, documentation built with Haddock 2.17.2 will fail. This was not an issue with 2.16 series, which causes builds to fail and there is nothing in the docs or error message giving a clue about why builds that used to succeed now don't. - - - - - 324adb60 by Ben Gamari at 2016-07-01T12:18:51+02:00 GhcUtils: Changes for multi-pattern signatures - - - - - d7571675 by Ömer Sinan Ağacan at 2016-07-21T13:30:47+02:00 Add support for unboxed sums - - - - - 29d0907b by Simon Marlow at 2016-07-22T13:55:48+01:00 Disable NFData instances for GHC types when GHC >= 8.2 - - - - - 702d95f3 by Simon Marlow at 2016-08-02T15:57:30+02:00 Disable NFData instances for GHC types when GHC >= 8.0.2 (cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a) - - - - - f4fa79c3 by Ben Gamari at 2016-08-07T13:51:18+02:00 ghc.mk: Don't attempt to install html/frames.html The frames business has been removed. - - - - - 9cd63daf by Ben Gamari at 2016-08-07T13:51:40+02:00 Haddock.Types: More precise version guard This allows haddock to be built with GHC 8.0.2 pre-releases. - - - - - f3d7e03f by Mateusz Kowalczyk at 2016-08-29T20:47:45+01:00 Merge pull request haskell/haddock#538 from massysett/master Add $ as a special character - - - - - 16dbf7fd by Bartosz Nitka at 2016-09-20T19:44:04+01:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 - - - - - 7c31c1ff by Bartosz Nitka at 2016-09-27T17:32:22-04:00 Fix rendering of class methods for Eq and Ord See haskell/haddock#549 and GHC issue haskell/haddock#12519 (cherry picked from commit 073d899a8f94ddec698f617a38d3420160a7fd0b) - - - - - 33a90dce by Ryan Scott at 2016-09-30T20:53:41-04:00 Haddock changes for T10598 See https://ghc.haskell.org/trac/ghc/ticket/10598 - - - - - 1f32f7cb by Ben Gamari at 2016-10-13T20:01:26-04:00 Update for refactoring of NameCache - - - - - 1678ff2e by Ben Gamari at 2016-11-15T17:42:48-05:00 Bump upper bound on base - - - - - 9262a7c5 by Alan Zimmerman at 2016-12-07T21:14:28+02:00 Match changes in GHC wip/T3384 branch - - - - - ac0eaf1a by Ben Gamari at 2016-12-09T09:48:41-05:00 haddock-api: Don't use stdcall calling convention on 64-bit Windows See GHC haskell/haddock#12890. - - - - - 04afe4f7 by Alan Zimmerman at 2016-12-12T20:07:21+02:00 Matching changes for GHC wip/T12942 - - - - - e1d1701d by Ben Gamari at 2016-12-13T16:50:41-05:00 Bump base upper bound - - - - - 3d3eacd1 by Alan Zimmerman at 2017-01-10T16:59:38+02:00 HsIParamTy now has a Located name - - - - - 7dbceefd by Kyrill Briantsev at 2017-01-12T13:23:50+03:00 Prevent GHC API from doing optimization passes. - - - - - d48d1e33 by Richard Eisenberg at 2017-01-19T08:41:41-05:00 Upstream changes re levity polymorphism - - - - - 40c25ed6 by Alan Zimmerman at 2017-01-26T15:16:18+02:00 Changes to match haskell/haddock#13163 in GHC - - - - - 504f586d by Ben Gamari at 2017-02-02T17:19:37-05:00 Kill remaining static flags - - - - - 49147ea0 by Justus Adam at 2017-03-02T15:33:34+01:00 Adding MDoc to exports of Documentation.Haddock - - - - - 1cfba9b4 by Justus Adam at 2017-03-09T11:41:44+01:00 Also exposing toInstalledIface - - - - - 53f0c0dd by Ben Gamari at 2017-03-09T13:10:08-05:00 Bump for GHC 8.3 - - - - - c7902d2e by Ben Gamari at 2017-03-09T23:46:02-05:00 Bump for GHC 8.2 - - - - - 4f3a74f8 by Ben Gamari at 2017-03-10T10:21:55-05:00 Merge branch 'ghc-head' - - - - - e273b72f by Richard Eisenberg at 2017-03-14T13:34:04-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - 6ec3d436 by Richard Eisenberg at 2017-03-14T15:15:52-04:00 Update Haddock w.r.t. new HsImplicitBndrs - - - - - eee3cda1 by Ben Gamari at 2017-03-15T15:19:59-04:00 Adapt to EnumSet - - - - - 017cf58e by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 736d6773 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 475f84a0 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 13240b53 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - cd16d529 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 3bea97ae by Edward Z. Yang at 2017-03-15T22:50:46-07:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - b2b051ce by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 0f082795 by Edward Z. Yang at 2017-03-15T22:50:46-07:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 20ef63c9 by Edward Z. Yang at 2017-03-22T13:48:12-07:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 45692dcb by Edward Z. Yang at 2017-03-22T14:11:25-07:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 4eae8caf by Ben Gamari at 2017-03-23T09:25:33-04:00 Merge commit '240bc38b94ed2d0af27333b23392d03eeb615e82' into HEAD - - - - - 0bbe03f5 by Ben Gamari at 2017-03-23T09:27:28-04:00 haddock-api: Bump bound on GHC - - - - - 65f3ac9d by Alex Biehl at 2017-03-23T17:36:11+01:00 Merge pull request haskell/haddock#581 from JustusAdam/master Adding more exports to Documentation.Haddock - - - - - 37d49a47 by Alex Biehl at 2017-03-23T17:39:14+01:00 Merge pull request haskell/haddock#568 from awson/ghc-head Prevent GHC API from doing optimization passes. - - - - - 1ed047e4 by Brian Huffman at 2017-03-23T17:45:58+01:00 Print any user-supplied kind signatures on type parameters. This applies to type parameters on data, newtype, type, and class declarations, and also to forall-bound type vars in type signatures. - - - - - 1b78ca5c by Brian Huffman at 2017-03-23T17:45:58+01:00 Update test suite to expect kind annotations on type parameters. - - - - - a856b162 by Alex Biehl at 2017-03-23T17:49:32+01:00 Include travis build indication badge - - - - - 8e2e2c56 by Ben Gamari at 2017-03-23T17:20:08-04:00 haddock-api: Bump bound on GHC - - - - - 4d2d9995 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Correctly handle Backpack identity/semantic modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 26d6c150b31bc4580ab17cfd07b6e7f9afe10737) - - - - - a650e20f by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Add a field marking if interface is a signature or not. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 930cfbe58e2e87f5a4d431d89a3c204934e6e858) - - - - - caa282c2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render signature module tree separately from modules. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 2067a2d0afa9cef381d26fb7140b67c62f433fc0) - - - - - 49684884 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Documentation. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 0671abfe7e8ceae2269467a30b77ed9d9656e2cc) - - - - - 4dcfeb1a by Edward Z. Yang at 2017-03-23T17:20:08-04:00 More docs. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 3d77b373dd5807d5d956719dd7c849a11534fa6a) - - - - - 74dd19d2 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 TODO on moduleExports. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 94610e9b446324f4231fa6ad4c6ac51e4eba8c0e) - - - - - a9b19a23 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Better Backpack support with signature merging. When we merge signatures, we gain exports that don't necessarily have a source-level declaration corresponding to them. This meant Haddock dropped them. There are two big limitations: * If there's no export list, we won't report inherited signatures. * If the type has a subordinate, the current hiDecl implementation doesn't reconstitute them. These are probably worth fixing eventually, but this gets us to minimum viable functionality. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 6cc832dfb1de6088a4abcaae62b25a7e944d55c3) - - - - - d3631064 by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Fix haddock-test to work with latest version of Cabal. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit bf3c4d72a0fda38561376eac7eda216158783267) - - - - - ef2148fc by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Annotate signature docs with (signature) Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 07b88c5d4e79b87a319fbb08f8ea01dbb41063c1) - - - - - 2f29518b by Edward Z. Yang at 2017-03-23T17:20:08-04:00 Render help documentation link next to (signature) in title. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit 4eb765ca4205c79539d60b7afa9b7e261a4a49fe) - - - - - 37de047d by Phil Ruffwind at 2017-04-03T11:57:14+02:00 Update MathJax URL MathJax is shutting down their CDN: https://www.mathjax.org/cdn-shutting-down/ They recommend migrating to cdnjs. - - - - - e9d24ba8 by David C. Turner at 2017-04-03T14:58:01+02:00 Add highlight for :target to ocean.css - - - - - 4819a202 by Alex Biehl at 2017-04-11T19:36:48+02:00 Allow base-4.10 for haddock-test - - - - - 44cec69c by Alex Biehl at 2017-04-11T19:39:22+02:00 cabal.project for haddock-api, haddock-library and haddock-test - - - - - 935d0f6a by Alex Biehl at 2017-04-11T19:46:29+02:00 Move dist scripts to scripts/ - - - - - 128e150c by Alex Biehl at 2017-04-11T20:34:46+02:00 Add haddock to cabal.project - - - - - cc8e08ea by Alex Biehl at 2017-04-11T20:35:08+02:00 Read files for hyperlinker eagerly This also exposes Documentation.Haddock.Utf8 - - - - - 152dda78 by Alex Biehl at 2017-04-11T20:37:06+02:00 Explicit import list ofr Control.DeepSeq in Haddock.Interface.Create - - - - - 501b33c4 by Kyrill Briantsev at 2017-04-11T21:01:42+02:00 Prevent GHC API from doing optimization passes. - - - - - c9f3f5ff by Alexander Biehl at 2017-04-12T16:36:53+02:00 Add @alexbiehl as maintaner - - - - - 76f214cc by Alex Biehl at 2017-04-13T07:27:18+02:00 Disable doctest with ghc-8.3 Currently doctest doesn't support ghc-head - - - - - 46b4f5fc by Edward Z. Yang at 2017-04-22T20:38:26-07:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - f0555235 by Alex Biehl at 2017-04-25T10:08:48+02:00 Travis: Use ghc-8.2.1 on master - - - - - 966ea348 by Alex Biehl at 2017-04-25T10:32:01+02:00 Travis: Verbose cabal output cf. https://travis-ci.org/haskell/haddock/jobs/225512194#L377 - - - - - 36972bcd by Alex Biehl at 2017-04-25T10:40:43+02:00 Use travis_retry for cabal invocations - - - - - b3a09d2c by Alex Biehl at 2017-04-25T17:02:20+02:00 Use new MathJax URL in html-test 18ed871afb82560d5433b2f53e31b4db9353a74e switched to a new MathJax URL but didn't update the tests. - - - - - ae331e5f by Alexander Biehl at 2017-04-25T17:02:20+02:00 Expand signatures for class declarations - - - - - e573c65a by Alexander Biehl at 2017-04-25T17:02:20+02:00 Hoogle: Correctly print classes with associated data types - - - - - 3fc6be9b by Edward Z. Yang at 2017-04-25T17:02:20+02:00 Render (signature) only if it actually is a signature! I forgot a conditional, oops! Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> (cherry picked from commit a0c4790e15a2d3fab8d830eee8fcd639fe6d39c9) - - - - - 6725c060 by Herbert Valerio Riedel at 2017-04-25T17:02:20+02:00 `html-test --accept` deltas to reference samples - - - - - 7d444d61 by Alex Biehl at 2017-04-26T07:13:50+02:00 Remove anything related to obsolete frames mode - - - - - b888972c by Alex Biehl at 2017-04-26T07:49:10+02:00 Cherry-picked remaining commits from haddock-2.17.4-release (#603) * Release haddock/haddock-api 2.17.4 and haddock-library 1.4.3 * Set version bounds for haddock-library NB: This allows GHC 8.2.1's base * Set version bounds for haddock & haddock-api The version bounds support GHC 8.2 * Merge (temporary) v2.17.3 branch into v2.17 This allows us to delete the v2.17.3 branch * Fixup changelog * Pin down haddock-api to a single version as otherwise `haddock`'s package version has no proper meaning * fix source-repo spec for haddock-api - - - - - 4161099b by Alex Biehl at 2017-04-26T11:11:20+02:00 Update changelog to reflect news in HEAD - - - - - eed72cb8 by Alex Biehl at 2017-04-26T11:11:20+02:00 Markdownify changelog - - - - - 5815cea1 by Alex Biehl at 2017-04-26T11:32:33+02:00 Bump to 2.18.0 (#605) - - - - - a551d558 by Alex Biehl at 2017-04-29T22:00:25+02:00 Update attoparsec-0.12.1.1 to attoparsec-0.13.1.0 - - - - - ea164a8d by Sergey Vinokurov at 2017-04-29T22:42:36+02:00 Improve error message - - - - - 2e10122f by Alex Biehl at 2017-04-30T10:07:46+02:00 Correctly remember collapsed sections (#608) Now the "collapsed" cookie stores which sections have changed state instead of which are collapsed. - - - - - f9b24d99 by Alex Biehl at 2017-05-01T17:40:36+02:00 Lazily decode docMap and argMap (#610) These are only used in case of a doc reexport so most of the time decoding these is wasted work. - - - - - 2372af62 by Alex Biehl at 2017-05-01T21:59:23+02:00 Fix Binary instance for InstalledInterface (#611) (#610) introduced lazy decoding for docs from InstalledInterface but forgot to remove the original calls to get and put_ - - - - - 6c633c13 by Nathan Collins at 2017-05-11T11:47:55+02:00 Improve documenation of Haddock markup (#614) * Improve documentation of Haddock markup. - document that Haddock supports inferring types top-level functions with without type signatures, but also explain why using this feature is discouraged. Looks like this feature has been around since version 2.0.0.0 in 2008! - rework the "Module description" section: - move the general discussion of field formatting to the section intro and add examples illustrating the prose for multiline fields. - mention that newlines are preserved in some multiline fields, but not in others (I also noticed that commas in the `Copyright` field are not preserved; I'll look into this bug later). - add a subsection for the module description fields documentation, and put the field keywords in code formatting (double back ticks) instead of double quotes, to be consistent with the typesetting of keywords in other parts of the documentation. - mention that "Named chunks" are not supported in the long-form "Module description" documentation. - fix formatting of keywords in the "Module attributes" section. Perhaps these errors were left over from an automatic translation to ReST from some other format as part of the transition to using Sphinx for Haddock documentation? Also, add a missing reference here; it just said "See ?"! - update footnote about special treatment for re-exporting partially imported modules not being implemented. In my tests it's not implemented at all -- I tried re-exporting both `import B hiding (f)` and `import B (a, b)` style partial imports, and in both cases got the same result as with full imports `import B`: I only get a module reference. * Rework the `Controlling the documentation structure` section. My main goal was to better explain how to use Haddock without an export list, since that's my most common use case, but I hope I improved the section overall: - remove the incomplete `Omitting the export list` section and fold it into the other sections. In particular, summarize the differences between using and not using an export list -- i.e. control over what and in what order is documented -- in the section lead. - add "realistic" examples that use the structure markup, both with and without an export list. I wanted a realistic example here to capture how it can be useful to explain the relationship between a group of functions in a section, in addition to documenting their individual APIs. - make it clear that you can associate documentation chunks with documentation sections when you aren't using an export list, and that doing it in the most obvious way -- i.e. with `-- |`, as you can in the export list -- doesn't work without an export list. It took me a while to figure this out the first time, since the docs didn't explain it at all before. - add a "no export list" example to the section header section. - add more cross references. * Add examples of gotchas for markup in `@...@`. I'm not sure this will help anyone, since I think most people first learn about `@...@` by reading other people's Haddocks, but I've documented the mistakes which I've made and then gotten confused by. * Use consistent Capitalization of Titles. Some titles were in usual title caps, and others only had the first word capitalized. I chose making them all use title caps because that seems to make the cross references look better. - - - - - d4734f45 by Ben Gamari at 2017-05-12T20:36:08+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 93883f37 by Alex Biehl at 2017-05-12T21:02:33+02:00 Haddock: Fix broken lazy IO in prologue reading (#615) We previously used withFile in conjunction with hGetContents. The list returned by the latter wasn't completely forced by the time we left the withFile block, meaning that we would try to read from a closed handle. - - - - - 5b8f179c by Alex Biehl at 2017-05-13T12:48:10+02:00 Consequently use inClass and notInClass in haddock-library (#617) These allow attoparsec to do some clever lookup optimization - - - - - 77984b82 by Doug Wilson at 2017-05-27T17:37:38+02:00 Don't enable compilation for template haskell (#624) This is no longer necessary after ghc commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa - - - - - 5a3de2b4 by Doug Wilson at 2017-05-27T19:54:53+02:00 Improve Syb code (#621) Specialize.hs and Ast.hs are modified to have their Syb code not recurse into Name or Id in HsSyn types. Specialize.hs is refactored to have fewer calls to Syb functions. Syb.hs has some foldl calls replaced with foldl' calls. There is still a lot of performance on the floor of Ast.hs. The RenamedSource is traversed many times, and lookupBySpan is very inefficient. everywhereBut and lookupBySpan dominate the runtime whenever --hyperlinked-source is passed. - - - - - 3d35a949 by Alex Biehl at 2017-05-30T19:01:37+02:00 Clear fixme comment (#625) - - - - - 2a44bd0c by Alex Biehl at 2017-05-30T19:02:12+02:00 Make haddock-library and haddock-api warning free (#626) - - - - - bd1a0e42 by Alex Biehl at 2017-06-01T10:40:33+02:00 Include `driver-test/*.hs` sdist (#630) This lead to haskell/haddock#629. - - - - - 184a3ab6 by Doug Wilson at 2017-06-03T12:02:08+02:00 Disable pattern match warnings (#628) This disables the pattern match checker which can be very expensive in some cases. The disabled warnings include: * Opt_WarnIncompletePatterns * Opt_WarnIncompleteUniPatterns * Opt_WarnIncompletePatternsRecUpd * Opt_WarnOverlappingPatterns - - - - - 0cf68004 by Alex Biehl at 2017-06-03T20:37:28+02:00 Allow user defined signatures for pattern synonyms (#631) - - - - - 7f51a58a by Alex Biehl at 2017-06-04T11:56:38+02:00 Use NameSet for isExported check (#632) - - - - - d8f044a9 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Match new AST as per GHC wip/new-tree-one-param See https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow - - - - - da1254e3 by Alan Zimmerman at 2017-06-05T22:26:55+02:00 Rename extension index tags - - - - - 538c7514 by Christiaan Baaij at 2017-06-09T08:26:43+02:00 Haddock support for bundled pattern synonyms (#627) * Haddock support for bundled pattern synonyms * Add fixities to bundled pattern synonyms * Add bundled pattern synonyms to the synopsis * Store bundled pattern fixities in expItemFixities * Add test for bundled pattern synonyms * Stop threading fixities * Include bundled pattern synonyms for re-exported data types Sadly, fixity information isn't found for re-exported data types * Support for pattern synonyms * Modify tests after haskell/haddock#631 * Test some reexport variations * Also lookup bundled pattern synonyms from `InstalledInterface`s * Check isExported for bundled pattern synonyms * Pattern synonym is exported check * Always look for pattern synonyms in the current module Another overlooked cornercase * Account for types named twice in export lists Also introduce a fast function for nubbing on a `Name` and use it throughout the code base. * correct fixities for reexported pattern synonyms * Fuse concatMap and map * Remove obsolete import * Add pattern synonyms to visible exports * Fix test * Remove corner case - - - - - a050bffd by Doug Wilson at 2017-06-21T09:27:33+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#636) There is some performance improvement. GHC compiler: | version | bytes allocated | cpu_seconds --------------------------------- | before | 56057108648 | 41.0 | after | 51592019560 | 35.1 base: | version | bytes allocated | cpu_seconds --------------------------------- | before | 25174011784 | 14.6 | after | 23712637272 | 13.1 Cabal: | version | bytes allocated | cpu_seconds --------------------------------- | before | 18754966920 | 12.6 | after | 18198208864 | 11.6 - - - - - 5d06b871 by Doug Wilson at 2017-06-22T20:23:29+02:00 Use new function getNameToInstancesIndex instead of tcRnGetInfo (#639) * Use new function getNameToInstancesIndex instead of tcRnGetInfo There is some significant performance improvement in the ghc testsuite. haddock.base: -23.3% haddock.Cabal: -16.7% haddock.compiler: -19.8% * Remove unused imports - - - - - b11bb73a by Alex Biehl at 2017-06-23T14:44:41+02:00 Lookup fixities for reexports without subordinates (#642) So we agree that reexported declarations which do not have subordinates (for example top-level functions) shouldn't have gotten fixities reexported according to the current logic. I wondered why for example Prelude.($) which is obviously reexported from GHC.Base has fixities attached (c.f. http://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#v:-36-). The reason is this: In mkMaps we lookup all the subordinates of top-level declarations, of course top-level functions don't have subordinates so for them the resulting list is empty. In haskell/haddock#644 I established the invariant that there won't be any empty lists in the subordinate map. Without the patch from haskell/haddock#642 top-level functions now started to fail reexporting their fixities. - - - - - d2a6dad6 by Alex Biehl at 2017-06-23T18:30:45+02:00 Don't include names with empty subordinates in maps (#644) These are unecessary anyway and just blow up interface size - - - - - 69c2aac4 by Alex Biehl at 2017-06-29T19:54:49+02:00 Make per-argument docs for class methods work again (#648) * Make per-argument docs for class methods work again * Test case - - - - - c9448d54 by Bartosz Nitka at 2017-07-02T12:12:01+02:00 Fix haddock: internal error: links: UnhelpfulSpan (#561) * Fix haddock: internal error: links: UnhelpfulSpan This fixes haskell/haddock#554 for me. I believe this is another fall out of `wildcard-refactor`, like haskell/haddock#549. * Comment to clarify why we take the methods name location - - - - - d4f29eb7 by Alex Biehl at 2017-07-03T19:43:04+02:00 Document record fields when DuplicateRecordFields is enabled (#649) - - - - - 9d6e3423 by Yuji Yamamoto at 2017-07-03T22:37:58+02:00 Fix test failures on Windows (#564) * Ignore .stack-work * Fix for windows: use nul instead of /dev/null * Fix for windows: canonicalize line separator * Also normalize osx line endings - - - - - 7d81e8b3 by Yuji Yamamoto at 2017-07-04T16:13:12+02:00 Avoid errors on non UTF-8 Windows (#566) * Avoid errors on non UTF-8 Windows Problem ==== haddock exits with errors like below: `(1)` ``` haddock: internal error: <stderr>: hPutChar: invalid argument (invalid character) ``` `(2)` ``` haddock: internal error: Language\Haskell\HsColour\Anchors.hs: hGetContents: invalid argument (invalid byte sequence) ``` `(1)` is caused by printing [the "bullet" character](http://www.fileformat.info/info/unicode/char/2022/index.htm) onto stderr. For example, this warning contains it: ``` Language\Haskell\HsColour\ANSI.hs:62:10: warning: [-Wmissing-methods] • No explicit implementation for ‘toEnum’ • In the instance declaration for ‘Enum Highlight’ ``` `(2)` is caused when the input file of `readFile` contains some Unicode characters. In the case above, '⇒' is the cause. Environment ---- OS: Windows 10 haddock: 2.17.3 GHC: 8.0.1 Solution ==== Add `hSetEncoding handle utf8` to avoid the errors. Note ==== - I found the detailed causes by these changes for debugging: - https://github.com/haskell/haddock/commit/8f29edb6b02691c1cf4c479f6c6f3f922b35a55b - https://github.com/haskell/haddock/commit/1dd23bf2065a1e1f2c14d0f4abd847c906b4ecb4 - These errors happen even after executing `chcp 65001` on the console. According to the debug code, `hGetEncoding stderr` returns `CP932` regardless of the console encoding. * Avoid 'internal error: <stderr>: hPutChar: invalid argument (invalid character)' non UTF-8 Windows Better solution for 59411754a6db41d17820733c076e6a72bcdbd82b's (1) - - - - - eded67d2 by Alex Biehl at 2017-07-07T19:17:15+02:00 Remove redudant import warning (#651) - - - - - 05114757 by Alex Biehl at 2017-07-08T00:33:12+02:00 Avoid missing home module warning (#652) * Avoid missing home module warning * Update haddock-library.cabal - - - - - e9cfc902 by Bryn Edwards at 2017-07-17T07:51:20+02:00 Fix haskell/haddock#249 (#655) - - - - - eb02792b by Herbert Valerio Riedel at 2017-07-20T09:09:15+02:00 Fix compilation of lib:haddock-library w/ GHC < 8 - - - - - 9200bfbc by Alex Biehl at 2017-07-20T09:20:38+02:00 Prepare 2.18.1 release (#657) - - - - - 46ddd22c by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Tweak haddock-api.cabal for pending release - - - - - 85e33d29 by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Avoid trivial use of LambdaCase otherwise we can't test w/ e.g. GHC 7.4.2 - - - - - 3afb4bfe by Herbert Valerio Riedel at 2017-07-20T10:05:14+02:00 Refactor .cabal to use sub-lib for vendored lib A practical benefit is that we can control the build-depends and also avoid some recompilation between library and test-suite. - - - - - e56a552e by Herbert Valerio Riedel at 2017-07-20T10:17:48+02:00 haddock-api: add changelog pointing to haddock's changelog This addresses https://github.com/haskell/haddock/issues/638#issuecomment-309283297 - - - - - 2222ff0d by Herbert Valerio Riedel at 2017-07-20T10:19:56+02:00 Drop obsolete/misleading `stability: experimental` This .cabal property has long been considered obsolete - - - - - 9b882905 by Alex Biehl at 2017-07-20T11:25:54+02:00 Beef up haddock description (#658) * Beef up haddock description * Handle empty lines - - - - - bb60e95c by Herbert Valerio Riedel at 2017-07-20T12:08:53+02:00 Import @aisamanra's Haddock cheatsheet from https://github.com/aisamanra/haddock-cheatsheet - - - - - 0761e456 by Herbert Valerio Riedel at 2017-07-20T12:12:55+02:00 Add cheatsheet to haddock.cabal - - - - - 2ece0f0f by Herbert Valerio Riedel at 2017-07-20T12:18:38+02:00 Mention new-build in README - - - - - 947b7865 by Herbert Valerio Riedel at 2017-07-20T12:32:16+02:00 Update README Also improves markup and removes/fixes redundant/obsolete parts [skip ci] - - - - - 785e09ad by Alex Biehl at 2017-07-27T07:28:57+02:00 Bump haddock to 2.18.2, haddock-library to 1.4.5 - - - - - e3ff1ca3 by Alex Biehl at 2017-07-31T20:15:32+02:00 Move `DocMarkup` from haddock-api to haddock-library (#659) * Move `DocMarkup` from haddock-api to haddock-library * Move more markup related functions * Markup module * CHANGELOG - - - - - cda7c20c by Alex Biehl at 2017-07-31T20:35:49+02:00 Fixup haddock - - - - - 583b6812 by Alex Biehl at 2017-07-31T21:20:45+02:00 Changelog for haddock-library - - - - - bac6a0eb by Alex Biehl at 2017-07-31T21:50:24+02:00 Prepare haddock-library-1.4.5 release - - - - - 58ce6877 by Moritz Drexl at 2017-08-05T16:44:40+02:00 Fix renaming after instance signature specializing (#660) * rework rename * Add regression test for Bug 613 * update tests * update changelog - - - - - b8137ec8 by Tim Baumann at 2017-08-06T11:33:38+02:00 Fix: Generate pattern signatures for constructors exported as patterns (#663) * Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes haskell/haddock#653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR haskell/haddock#663 * Fix extractPatternSyn error message - - - - - d037086b by Alex Biehl at 2017-08-06T12:43:25+02:00 Bump haddock-library - - - - - 99d7e792 by Alex Biehl at 2017-08-06T12:44:07+02:00 Bump haddock-library in haddock-api - - - - - 94802a5b by Alex Biehl at 2017-08-06T13:18:02+02:00 Provide --show-interface option to dump interfaces (#645) * WIP: Provide --show-interface option to dump interfaces Like ghcs own --show-iface this flag dumps a binary interface file to stdout in a human (and machine) readable fashion. Currently it uses json as output format. * Fill all the jsonNull stubs * Rework Bifunctor instance of DocH, update changelog and documentation * replace changelog, bring DocMarkupH doc back * Update CHANGES.md * Update CHANGES.md * Move Control.Arrow up It would result in unused import if the Bifunctor instance is not generated. - - - - - c662e476 by Ryan Scott at 2017-08-14T21:00:21-04:00 Adapt to haskell/haddock#14060 - - - - - b891eb73 by Alex Biehl at 2017-08-16T08:24:48+02:00 Bifoldable and Bitraversable for DocH and MetaDoc - - - - - 021bb56c by Alex Biehl at 2017-08-16T09:06:40+02:00 Refactoring: Make doc renaming monadic This allows us to later throw warnings if can't find an identifier - - - - - 39fbf022 by Alex Biehl at 2017-08-19T20:35:27+02:00 Hyperlinker: Avoid linear lookup in enrichToken (#669) * Make Span strict in Position * Hyperlinker: Use a proper map to enrich tokens - - - - - e13baedd by Alex Biehl at 2017-08-21T20:05:42+02:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 27dd6e87 by Alex Biehl at 2017-08-21T22:06:35+02:00 Drop Avails from export list - - - - - 86b247e2 by Alex Biehl at 2017-08-22T08:44:22+02:00 Bump ghc version for haddock-api tests - - - - - d4607ca0 by Alex Biehl at 2017-08-22T08:45:17+02:00 Revert "Drop Avails from export list" This reverts commit a850ba86d88a4fb9c0bd175453a2580e544e3def. - - - - - c9c54c30 by Alex Biehl at 2017-08-22T09:26:01+02:00 IntefaceFile version - - - - - a85b7c02 by Ben Gamari at 2017-08-22T09:29:52-04:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 34e976f5 by Ben Gamari at 2017-08-22T17:40:06+02:00 haddock: Add Documentation.Haddock.Markup to other-modules - - - - - 577abf06 by Ryan Scott at 2017-08-23T14:47:29-04:00 Update for haskell/haddock#14131 - - - - - da68fc55 by Florian Eggenhofer at 2017-08-27T18:21:56+02:00 Generate an index for package content search (#662) Generate an index for package content search - - - - - 39e62302 by Alex Biehl at 2017-08-27T18:50:16+02:00 Content search for haddock html doc - - - - - 91fd6fb2 by Alex Biehl at 2017-08-28T18:39:58+02:00 Fix tests for content search - - - - - b4a3798a by Alex Biehl at 2017-08-28T18:44:08+02:00 Add search button to #page-menu - - - - - 25a7ca65 by Alex Biehl at 2017-08-28T18:47:43+02:00 Load javascript below the fold - - - - - 8d323c1a by Alex Biehl at 2017-08-28T18:49:22+02:00 Accept tests - - - - - c5dac557 by Alex Biehl at 2017-08-28T19:14:55+02:00 Content search css - - - - - 89a5af57 by Paolo Veronelli at 2017-08-29T07:42:13+02:00 Removed `nowrap` for interface method sigs (#674) with nowrap the interfaces method sigs would expand at libitum - - - - - a505f6f7 by Alex Biehl at 2017-08-29T08:05:33+02:00 Include subordinates in content index - - - - - 4bb698c4 by Alexander Biehl at 2017-08-29T11:40:19+02:00 QuickNav: Make docbase configurable - - - - - c783bf44 by Alexander Biehl at 2017-08-29T11:48:36+02:00 QuickNav: Also use baseUrl for doc-index.json request - - - - - 47017510 by Alex Biehl at 2017-08-29T17:56:47+02:00 Fix test fallout (again) - - - - - 924fc318 by Alex Biehl at 2017-08-30T09:24:56+02:00 Write meta.json when generating html output (#676) - - - - - 717dea52 by Alex Biehl at 2017-09-01T09:20:34+02:00 Use relative URL when no docBaseUrl given - - - - - e5d85f3b by Alex Biehl at 2017-09-01T09:35:19+02:00 Add missing js files to data-files (#677) - - - - - 95b9231a by Alex Biehl at 2017-09-01T11:01:36+02:00 Rename "Search" tab to "Quick Jump" - - - - - da0ead0b by Alex Biehl at 2017-09-01T13:03:49+02:00 Make trigger link configurable (#678) QuickNav: Configurable show/hide trigger - - - - - de7da594 by Ben Gamari at 2017-09-05T06:49:55-04:00 Account for "Remember the AvailInfo for each IE" As of GHC commit f609374a55bdcf3b79f3a299104767aae2ffbf21 GHC retains the AvailInfo associated with each IE. @alexbiehl has a patch making proper use of this change, but this is just to keep things building. - - - - - b05cd3b3 by Ben Gamari at 2017-09-14T07:55:07-04:00 Bump upper bound on base - - - - - 79db899e by Herbert Valerio Riedel at 2017-09-21T23:27:52+02:00 Make compatible with Prelude.<> export in GHC 8.4/base-4.11 - - - - - 3405dd52 by Tim Baumann at 2017-09-23T22:02:01+02:00 Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme - - - - - df0b5742 by Alex Biehl at 2017-09-29T21:15:40+02:00 Bump base for haddock-library and haddock-test - - - - - 62b12ea0 by Merijn Verstraaten at 2017-10-04T16:03:13+02:00 Inhibit output of coverage information for hidden modules. (#687) * Inhibit output of coverage information for hidden modules. * Add changelog entry. - - - - - 8daf8bc1 by Alexander Biehl at 2017-10-05T11:27:05+02:00 Don't use subMap in attachInstances - - - - - ad75114e by Alexander Biehl at 2017-10-05T11:27:58+02:00 Revert "Don't use subMap in attachInstances" This reverts commit 3adf5bcb1a6c5326ab33dc77b4aa229a91d91ce9. - - - - - 7d4aa02f by Alex Biehl at 2017-10-08T15:32:28+02:00 Precise Haddock: Use Avails for export resolution (#688) * Use Avails for export resolution * Support reexported modules * Factor out availExportItem * Use avails for fullModuleExports * Don't use subMap in attachInstances * lookupDocs without subMap * Completely remove subMap * Only calculate unqualified modules when explicit export list is given * Refactor * Refine comment * return * Fix * Refactoring * Split avail if declaration is not exported itself * Move avail splitting - - - - - b9b4faa8 by Alex Biehl at 2017-10-08T19:38:21+02:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 43325295 by Alex Biehl at 2017-10-08T20:18:46+02:00 Fix merge fallout - - - - - c6423cc0 by Alex Biehl at 2017-10-08T20:36:12+02:00 Copy QuickJump files over - - - - - 1db587c3 by Tim Baumann at 2017-10-09T18:33:09+02:00 Use <details> element for collapsibles (#690) * Remove unnecessary call to 'collapseSection' The call is unnecessary since there is no corresponding toggle for hiding the section of orphan instances. * Use <details> for collapsibles This makes them work even when JS is disabled. Closes haskell/haddock#560. - - - - - 1b54c64b by Tim Baumann at 2017-10-10T09:50:59+02:00 Quick Jump: Show error when loading 'doc-index.json' failed (#691) - - - - - 910f716d by Veronika Romashkina at 2017-10-24T07:36:20+02:00 Fix tiny typo in docs (#693) - - - - - b21de7e5 by Ryan Scott at 2017-10-24T13:07:15+02:00 Overhaul Haddock's rendering of kind signatures (#681) * Overhaul Haddock's rendering of kind signatures * Strip off kind signatures when specializing As an added bonus, this lets us remove an ugly hack specifically for `(->)`. Yay! * Update due to 0390e4a0f61e37bd1dcc24a36d499e92f2561b67 * @alexbiehl's suggestions * Import injectiveVarsOfBinder from GHC - - - - - 6704405c by Ryan Scott at 2017-10-28T07:10:27+02:00 Fix Haddock rendering of kind-indexed data family instances (#694) - - - - - 470f6b9c by Alex Biehl at 2017-10-30T08:45:51+01:00 Add QuickJump version to meta.json (#696) - - - - - b89eccdf by Alex Biehl at 2017-10-30T10:15:49+01:00 Put Quickjump behind --quickjump flag (#697) - - - - - 3095fb58 by Alex Biehl at 2017-10-30T19:09:06+01:00 Add build command to package.json - - - - - f223fda9 by Alex Biehl at 2017-10-30T19:10:39+01:00 Decrease threshold for fuzzy matching - - - - - 80245dda by Edward Z. Yang at 2017-10-31T20:35:05+01:00 Supported reexported-modules via --reexport flag. Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu> - - - - - 7e389742 by Alex Biehl at 2017-10-31T20:37:56+01:00 Correct missing title in changelog - - - - - 1a2a1c03 by Alex Biehl at 2017-10-31T20:59:07+01:00 Copy quickjump.css for nicer error messages - - - - - db234bb9 by Alex Biehl at 2017-10-31T21:31:18+01:00 Reexported modules: Report warnings if argument cannot be parsed or ... module cannot be found - - - - - eea8a205 by Carlo Hamalainen at 2017-10-31T21:43:14+01:00 More general type for nameCacheFromGhc. (#539) - - - - - 580eb42a by Alex Biehl at 2017-10-31T21:46:52+01:00 Remote tab - - - - - 0e599498 by Alex Biehl at 2017-10-31T21:48:55+01:00 Merge remote-tracking branch 'origin/master' into ghc-head - - - - - 7b8539bb by Alex Biehl at 2017-10-31T22:28:34+01:00 fullModuleContents traverses exports in declaration order - - - - - 0c91fbf2 by Alex Biehl at 2017-10-31T22:32:31+01:00 Remove excessive use of list comprehensions - - - - - f7356e02 by Alex Biehl at 2017-11-01T19:11:03+01:00 Make better use of AvailInfo - - - - - f3e512d5 by Alex Biehl at 2017-11-02T12:16:22+01:00 Always return documentation for exported subordinates ... event if they have no documentation (e.g. noDocForDecl) By using the information in the AvailInfo we don't need additional export checks. - - - - - 7cf58898 by Alan Zimmerman at 2017-11-07T08:28:03+02:00 Match changes for Trees that Grow in GHC - - - - - e5105a41 by Alan Zimmerman at 2017-11-08T17:21:58+02:00 Match Trees That Grow - - - - - 55178266 by Alan Zimmerman at 2017-11-11T22:20:31+02:00 Match Trees that Grow in GHC for HsExpr - - - - - 2082ab02 by Ryan Scott at 2017-11-14T15:27:03+01:00 Actually render infix type operators as infix (#703) * Actually render infix type operators as infix * Account for things like `(f :*: g) p`, too - - - - - c52ab7d0 by Alan Zimmerman at 2017-11-14T23:14:26+02:00 Clean up use of PlaceHolder, to match TTG - - - - - 81cc9851 by Moritz Angermann at 2017-11-20T07:52:49+01:00 Declare use of `Paths_haddock` module in other-modules (#705) This was detected by `-Wmissing-home-modules` - - - - - f9d27598 by Moritz Angermann at 2017-11-20T12:47:34+01:00 Drop Paths_haddock from ghc.mk (#707) With haskell/haddock#705 and haskell/haddock#706, the custom addition should not be necessary any more. # Conflicts: # ghc.mk - - - - - f34818dc by Moritz Angermann at 2017-11-20T12:47:59+01:00 Add autogen-modules (#706) > Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. # Conflicts: # haddock.cabal - - - - - bb43a0aa by Ben Gamari at 2017-11-21T15:50:12-05:00 Revert "Clean up use of PlaceHolder, to match TTG" This reverts commit 134a7bb054ea730b13c8629a76232d73e3ace049. - - - - - af9ebb2b by Ben Gamari at 2017-11-21T15:50:14-05:00 Revert "Match Trees that Grow in GHC for HsExpr" This reverts commit 9f054dc365379c66668de6719840918190ae6e44. - - - - - 5d35c3af by Ben Gamari at 2017-11-21T15:50:15-05:00 Revert "Match Trees That Grow" This reverts commit 73a26af844ac50b8bec39de11d64452a6286b00c. - - - - - 99a8e43b by Ben Gamari at 2017-11-21T16:36:06-05:00 Revert "Match changes for Trees that Grow in GHC" This reverts commit 01eeeb048acd2dd05ff6471ae148a97cf0720547. - - - - - c4d650c2 by Ben Gamari at 2017-12-04T15:06:07-05:00 Bump GHC version - - - - - 027b2274 by Ben Gamari at 2017-12-04T17:06:31-05:00 Bump GHC bound to 8.4.* - - - - - 58eaf755 by Alex Biehl at 2017-12-06T15:44:24+01:00 Update changelog - - - - - d68f5584 by Simon Peyton Jones at 2017-12-07T14:39:56+00:00 Track changes to follow Trac haskell/haddock#14529 This tracks the refactoring of HsDecl.ConDecl. - - - - - dc519d6b by Alec Theriault at 2018-01-06T08:20:43-08:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - 8285118c by Alec Theriault at 2018-01-13T12:12:37+01:00 Constructor and pattern synonym argument docs (#709) * Support Haddocks on constructor arguments This is in conjunction with https://phabricator.haskell.org/D4094. Adds support for rendering Haddock's on (non-record) constructor arguments, both for regular and GADT constructors. * Support haddocks on pattern synonym arguments It appears that GHC already parsed these - we just weren't using them. In the process of doing this, I tried to deduplicate some code around handling patterns. * Update the markup guide Add some information about the new support for commenting constructor arguments, and mention pattern synonyms and GADT-style constructors. * Overhaul LaTeX support for data/pattern decls This includes at least * fixing several bugs that resulted in invalid LaTeX * fixing GADT data declaration headers * overhaul handling of record fields * overhaul handling of GADT constructors * overhaul handling of bundled patterns * add support for constructor argument docs * Support GADT record constructors This means changes what existing HTML docs look like. As for LaTeX, looks like GADT records were never even supported. Now they are. * Clean up code/comments Made code/comments consistent between the LaTeX and XHTML backend when possible. * Update changelog * Patch post-rebase regressions * Another post-rebase change We want return values to be documentable on record GADT constructors. - - - - - ca4fabb4 by Alec Theriault at 2018-01-15T17:12:18-08:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 4c472fea by Ryan Scott at 2018-01-19T10:44:02+01:00 Fix haskell/haddock#732 (#733) - - - - - bff14dbd by Alex Biehl at 2018-01-19T15:33:30+01:00 extractDecl: Extract associated types correctly (#736) - - - - - a2a94a73 by Alex Biehl at 2018-01-19T15:34:40+01:00 extractDecl: Extract associated types correctly (#736) - - - - - 26df93dc by Alex Biehl at 2018-01-20T10:18:22+01:00 haddock-api: bump ghc to ^>= 8.4 - - - - - f65aeb1d by Alex Biehl at 2018-01-20T19:18:20+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - 0e721b97 by Alex Biehl at 2018-01-20T19:20:19+01:00 Fix duplicate declarations and TypeFamilies specifics - - - - - cb6234f6 by Ben Gamari at 2018-01-26T13:40:55-05:00 Merge remote-tracking branch 'harpocrates/fix/missing-orphan-instances' into ghc-head - - - - - 0fc28554 by Alec Theriault at 2018-02-01T14:58:18+01:00 Pass to GHC visible modules for instance filtering The GHC-side `getNameToInstancesIndex` filters out incorrectly some instances because it is not aware of what modules are visible. On the Haddock side, we need to pass in the modules we are processing. On the GHC side, we need to check against _those_ modules when checking if an instance is visible. - - - - - b9123772 by Alec Theriault at 2018-02-01T14:58:18+01:00 Update the GblRdrEnv when processing modules Without a complete environment, we will miss some instances that were encountered during typechecking. - - - - - 0c12e274 by Ryan Scott at 2018-02-01T14:58:18+01:00 Fix haskell/haddock#548 by rendering datatype kinds more carefully (#702) - - - - - 8876d20b by Alec Theriault at 2018-02-01T14:58:18+01:00 Use the GHC lexer for the Hyperlinker backend (#714) * Start changing to use GHC lexer * better cpp * Change SrcSpan to RealSrcSpan * Remove error * Try to stop too many open files * wip * wip * Revert "wip" This reverts commit b605510a195f26315e3d8ca90e6d95a6737553e1. Conflicts: haddock-api/haddock-api.cabal haddock-api/src/Haddock/Interface.hs * Remove pointless 'caching' * Use dlist rather than lists when finding vars * Use a map rather than list * Delete bogus comment * Rebase followup Things now run using the GHC lexer. There are still - stray debug statements - unnecessary changes w.r.t. master * Cleaned up differences w.r.t. current Haddock HEAD Things are looking good. quasiquotes in particular look beautiful: the TH ones (with Haskell source inside) colour/link their contents too! Haven't yet begun to check for possible performance problems. * Support CPP and top-level pragmas The support for these is hackier - but no more hacky than the existing support. * Tests pass, CPP is better recognized The tests were in some cases altered: I consider the new output to be more correct than the old one.... * Fix shrinking of source without tabs in test * Replace 'Position'/'Span' with GHC counterparts Replaces 'Position' -> 'GHC.RealSrcLoc' and 'Span' -> 'GHC.RealSrcSpan'. * Nits * Forgot entry in .cabal * Update changelog - - - - - 95c6a771 by Alec Theriault at 2018-02-01T14:58:18+01:00 Clickable anchors for headings (#716) See haskell/haddock#579. This just adds an <a> tag around the heading, pointing to the heading itself. - - - - - 21463d28 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump: Matches on function names weight more than matches in ... module names. - - - - - 8023af39 by Alex Biehl at 2018-02-01T14:58:18+01:00 Treat escaped \] better in definition lists (#717) This fixes haskell/haddock#546. - - - - - e4866dc1 by Alex Biehl at 2018-02-01T14:58:18+01:00 Remove scanner, takeWhile1_ already takes care of escaping - - - - - 9bcaa49d by Alex Biehl at 2018-02-01T14:58:18+01:00 Take until line feed - - - - - 01d2af93 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Add simple framework for running parser fixtures (#668) * Add simple framework for running parser fixtures * Compatible with tree-diff-0.0.0.1 * Use parseParas to parse fixtures This allows to test all syntactic constructs available in haddock markup. - - - - - 31128417 by Alec Theriault at 2018-02-01T14:58:18+01:00 Patch flaky parser test (#720) * Patch flaky parser test This test was a great idea, but it doesn't port over too well to using the GHC lexer. GHC rewrites its input a bit - nothing surprising, but we need to guard against those cases for the test. * Change instance head * Change use site - - - - - 9704f214 by Herbert Valerio Riedel at 2018-02-01T14:58:18+01:00 Include secondary LICENSE file in source dist - - - - - 51f25074 by Oleg Grenrus at 2018-02-01T14:58:18+01:00 Grid Tables (#718) * Add table examples * Add table types and adopt simple parser Simple parser is done by Giovanni Cappellotto (@potomak) in https://github.com/haskell/haddock/pull/577 It seems to support single fine full tables, so far from full RST-grid tables, but it's good start. Table type support row- and colspans, but obviously parser is lacking. Still TODO: - Latex backend. Should we use multirow package https://ctan.org/pkg/multirow?lang=en? - Hoogle backend: ? * Implement grid-tables * Refactor table parser * Add two ill-examples * Update CHANGES.md * Basic documentation for tables * Fix documentation example - - - - - 670d6200 by Alex Biehl at 2018-02-01T14:58:18+01:00 Add grid table example to cheatsheet (pdf and svg need to be regenerated thought) - - - - - 4262dec9 by Alec Theriault at 2018-02-01T14:58:18+01:00 Fix infinite loop when specializing instance heads (#723) * Fix infinite loop when specializing instance heads The bug can only be triggered from TH, hence why it went un-noticed for so long. * Add test for haskell/haddock#679 and haskell/haddock#710 - - - - - 67ecd803 by Alec Theriault at 2018-02-01T14:58:18+01:00 Filter RTS arguments from 'ghc-options' arguments (#725) This fixes haskell/haddock#666. - - - - - 7db26992 by Alex Biehl at 2018-02-01T14:58:18+01:00 Quickjump Scrollable overlay - - - - - da9ff634 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Hyperlinker: Adjust parser to new PFailed constructor - - - - - 7b7cf8cb by Alexander Biehl at 2018-02-01T14:58:18+01:00 Specialize: Add missing IdP annotations - - - - - 78cd7231 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Convert: Correct pass type - - - - - a2d0f590 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Warning free compilation - - - - - cd861cf3 by Alexander Biehl at 2018-02-01T14:58:18+01:00 hadock-2.19.0 / haddock-api-2.19.0 / haddock-library-1.5.0 - - - - - c6651b72 by Alexander Biehl at 2018-02-01T14:58:18+01:00 Adjust changelogs - - - - - 1e93da0b by Alexander Biehl at 2018-02-01T14:58:18+01:00 haddock-library: Info about breaking changes - - - - - f9b11db8 by Alec Theriault at 2018-02-02T12:36:02+01:00 Properly color pragma contents in hyperlinker The hyperlinker backend now classifies the content of pragmas as 'TkPragma'. That means that in something like '{-# INLINE foo #-}', 'foo' still gets classified as a pragma token. - - - - - c40b0043 by Alec Theriault at 2018-02-02T12:36:02+01:00 Support the new 'ITcolumn_prag' token - - - - - 4a2a4d39 by Alex Biehl at 2018-02-03T12:11:55+01:00 QuickJump: Mitigate encoding problems on Windows - - - - - bb34503a by Alex Biehl at 2018-02-04T18:39:31+01:00 Use withBinaryFile - - - - - 637605bf by Herbert Valerio Riedel at 2018-02-05T09:48:32+01:00 Try GHC 8.4.1 for Travis CI job - - - - - 7abb67e4 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 try harder to build w/ GHC 8.4.1 - - - - - 8255cc98 by Herbert Valerio Riedel at 2018-02-05T10:05:42+01:00 Add `SPDX-License-Identifier` as alised for "license" module header tokens C.f. SPDX 2.1 - Appendix V https://spdx.org/spdx-specification-21-web-version#h.twlc0ztnng3b The tag should appear on its own line in the source file, generally as part of a comment. SPDX-License-Identifier: <SPDX License Expression> Cherry-picked from haskell/haddock#743 - - - - - 267cd23d by Herbert Valerio Riedel at 2018-02-05T10:24:34+01:00 Make test-suite SMP compatible - - - - - 95d4bf40 by Alec Theriault at 2018-02-05T22:01:04+01:00 Hyperlink pattern synonyms and 'module' imports (#744) Links to pattern synonyms are now generated, as well as links from modules in import lists. Fixes haskell/haddock#731. - - - - - 67838dcd by Alec Theriault at 2018-02-06T08:23:36+01:00 Don't warn about missing '~' (#746) This manually filters out '~' from the list of things to warn about. It truly makes no sense to warn on this since '~' has nothing it could link to - it is magical. This fixes haskell/haddock#532. - - - - - ab6c3f9f by Alec Theriault at 2018-02-06T08:24:47+01:00 Don't barf on 'HsSpliceTy' (#745) This handles 'HsSpliceTy's by replacing them with what they expand to. IIUC everything that is happening, 'renameHsSpliceTy' should not be able to fail for the inputs we feed it from GHC. This fixes haskell/haddock#574. - - - - - 92bf95ad by Alex Biehl at 2018-02-06T08:28:23+01:00 Rename: renameHsSpliceTy ttg - - - - - 3130b1e1 by Alex Biehl at 2018-02-06T09:02:14+01:00 Expand SigDs - - - - - c72adae5 by Alex Biehl at 2018-02-06T09:20:51+01:00 fullModuleContents: support named docs - - - - - de2e4dbf by Alex Biehl at 2018-02-06T13:56:17+01:00 Hyperlinker: Also link pattern synonym arguments - - - - - b7c98237 by Alex Biehl at 2018-02-09T18:44:23+01:00 Expand SigD in a better place In https://github.com/haskell/haddock/issues/287 we found that haddock-2.19.0 would miss documentation on class methods with multiples names. This patch uses expandSigDecls in a more sensible place. - - - - - 8f598b27 by Alec Theriault at 2018-02-11T12:29:56+01:00 Add module tooltips to linked identifiers (#753) No more clicking to figure out whether your bytestring is strict or lazy! - - - - - d812e65d by Alec Theriault at 2018-02-11T12:31:44+01:00 Add 'show' option to complement 'hide' (#752) * Add 'show' option to complement 'hide' The behaviour is for flags passed in the command line to override flags in file headers. In the command line, later flags override earlier ones. Fixes haskell/haddock#751 and haskell/haddock#266. * Add a '--show-all' option - - - - - 6676cecb by Alex Biehl at 2018-02-18T11:07:15-05:00 QuickJump: Mitigate encoding problems on Windows (cherry picked from commit 86292c54bfee2343aee84559ec01f1fc68f52231) - - - - - e753dd88 by Alex Biehl at 2018-02-18T17:59:54+01:00 Use withBinaryFile - - - - - 724dc881 by Tamar Christina at 2018-02-19T05:34:49+01:00 Haddock: support splitted include paths. (#689) - - - - - 9b6d6f50 by Alex Biehl at 2018-02-19T05:57:02+01:00 Teach the HTML backend how to render methods with multiple names - - - - - a74aa754 by Alexander Biehl at 2018-02-19T10:04:34+01:00 Hoogle/Latex: Remove use of partial function - - - - - 66d8bb0e by Alec Theriault at 2018-02-25T16:04:01+01:00 Fix file handle leak (#763) (#764) Brought back some mistakenly deleted code for handling encoding and eager reading of files from e0ada1743cb722d2f82498a95b201f3ffb303137. - - - - - bb92d03d by Alex Biehl at 2018-03-02T14:21:23+01:00 Enable running test suite with stock haddock and ghc using ``` $ cabal new-run -- html-test --haddock-path=$(which haddock) --ghc-path=$(which ghc) ``` - - - - - dddb3cb2 by Alex Biehl at 2018-03-02T15:43:21+01:00 Make testsuite work with haddock-1.19.0 release (#766) - - - - - f38636ed by Alec Theriault at 2018-03-02T15:48:36+01:00 Support unicode operators, proper modules Unicode operators are a pretty big thing in Haskell, so supporting linking them seems like it outweighs the cost of the extra machinery to force Attoparsec to look for unicode. Fixes haskell/haddock#458. - - - - - 09d89f7c by Alec Theriault at 2018-03-02T15:48:43+01:00 Remove bang pattern - - - - - d150a687 by Alex Biehl at 2018-03-02T15:48:48+01:00 fix test - - - - - d6fd71a5 by Alex Biehl at 2018-03-02T16:22:38+01:00 haddock-test: Be more explicit which packages to pass We now pass `-hide-all-packages` to haddock when invoking the testsuite. This ensures we don't accidentally pick up any dependencies up through ghc.env files. - - - - - 0932c78c by Alex Biehl at 2018-03-02T17:50:38+01:00 Revert "fix test" This reverts commit 1ac2f9569242f6cb074ba6e577285a4c33ae1197. - - - - - 52516029 by Alex Biehl at 2018-03-02T18:16:50+01:00 Fix Bug548 for real - - - - - 89df9eb5 by Alex Biehl at 2018-03-05T18:28:19+01:00 Hyperlinker: Links for TyOps, class methods and associated types - - - - - d019a4cb by Ryan Scott at 2018-03-06T13:43:56-05:00 Updates for haskell/haddock#13324 - - - - - 6d5a42ce by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump haddock-2.19.0.1, haddock-api-2.19.0.1, haddock-library-1.5.0.1 - - - - - c0e6f380 by Alex Biehl at 2018-03-10T18:25:57+01:00 Update changelogs for haddock-2.19.0.1 and haddock-library-1.5.0.1 - - - - - 500da489 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Update to QC 2.11 - - - - - ce8362e9 by Herbert Valerio Riedel at 2018-03-10T18:25:57+01:00 Restore backward-compat with base-4.5 through base-4.8 - - - - - baae4435 by Alex Biehl at 2018-03-10T18:25:57+01:00 Bump lower bound for haddock-library - - - - - 10b7a73e by Alex Biehl at 2018-03-10T18:25:57+01:00 Haddock: Straighten out base bound - - - - - a6096f7b by Alex Biehl at 2018-03-13T08:45:06+01:00 extractDecl: Extract constructor patterns from data family instances (#776) * extractDecl: Allow extraction of data family instance constructors * extractDecl: extract data family instance constructors - - - - - ba4a0744 by Simon Jakobi at 2018-03-14T08:26:42+01:00 Readme: Update GHC version (#778) - - - - - 8de157d4 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for definition lists - - - - - 425b46f9 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for links - - - - - d53945d8 by Simon Jakobi at 2018-03-14T20:39:29+01:00 Add fixture test for inline links - - - - - f1dc7c99 by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Slightly unmangle output - - - - - 0879d31c by Simon Jakobi at 2018-03-14T20:39:29+01:00 fixtures: Prevent stdout buffering - - - - - 1f9e5f1b by Simon Jakobi at 2018-03-14T20:39:29+01:00 haddock-library.cabal: Clean up GHC options - - - - - 066b891a by Simon Jakobi at 2018-03-14T20:39:29+01:00 Make a proper definition for the <link> parser - - - - - 573d6ba7 by Alec Theriault at 2018-03-21T09:16:57+01:00 Show where instances are defined (#748) * Indicate source module of instances Above instance, we now also display a link to the module where the instance was defined. This is sometimes helpful in figuring out what to import. * Source module for type/data families too * Remove parens * Accept tests - - - - - 99b5d28b by Alex Biehl at 2018-03-21T09:20:36+01:00 Prepare changelog for next release - - - - - 482d3a93 by Alex Biehl at 2018-03-23T15:57:36+01:00 Useful cost centres, timers and allocation counters (#785) * Add some useful cost-centres for profiling * Add withTiming for each haddock phase Invoking haddock with `--optghc=-ddump-timings` now shows the amount of time spent and the number of allocated bytes for each phase. - - - - - 773b41bb by Alec Theriault at 2018-03-27T08:35:59+02:00 @since includes package name (#749) * Metadoc stores a package name This means that '@since' annotations can be package aware. * Get the package name the right way This should extract the package name for `@since` annotations the right way. I had to move `modulePackageInfo` around to do this and, in the process, I took the liberty to update it. Since it appears that finding the package name is something that can fail, I added a warning for this case. * Silence warnings * Hide package for local 'since' annotations As discussed, this is still the usual case (and we should avoid being noisy for it). Although this commit is large, it is basically only about threading a 'Maybe Package' from 'Haddock.render' all the way to 'Haddock.Backends.Xhtml.DocMarkup.renderMeta'. * Bump binary interface version * Add a '--since-qual' option This controls when to qualify since annotations with the package they come from. The default is always, but I've left an 'external' variant where only those annotations coming from outside of the current package are qualified. * Make ParserSpec work * Make Fixtures work * Use package name even if package version is not available The @since stuff needs only the package name passed in, so it makes sense to not be forced to pass in a version too. - - - - - e42c57bc by Alex Biehl at 2018-03-27T08:42:50+02:00 haddock-2.19.1, haddock-api-2.19.1, haddock-library-1.6.0 - - - - - 8373a529 by Alex Biehl at 2018-03-28T10:17:11+02:00 Bump haddock and haddock-api to 2.20.0 - - - - - 5038eddd by Jack Henahan at 2018-04-03T13:28:12+02:00 Clear search string on hide for haskell/haddock#781 (#789) - - - - - 920ca1eb by Alex Biehl at 2018-04-03T16:35:50+02:00 Travis: Build with ghc-8.4.2 (#793) - - - - - a232f0eb by Alan Zimmerman at 2018-04-07T14:14:32+02:00 Match changes in GHC for D4199 Removing HasSourceText and SourceTextX classes. - - - - - ab85060b by Alan Zimmerman at 2018-04-09T21:20:24+02:00 Match GHC changes for TTG - - - - - 739302b6 by Alan Zimmerman at 2018-04-13T13:31:44+02:00 Match GHC for TTG implemented on HsBinds, D4581 - - - - - 2f56d3cb by Ryan Scott at 2018-04-19T11:42:58-04:00 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. - - - - - a49df92a by Alex Biehl at 2018-04-20T07:31:44+02:00 Don't treat fixity signatures like declarations - - - - - d02c103b by Ryan Scott at 2018-04-24T11:20:11-04:00 Add regression test for haskell/haddock#413 Fixes haskell/haddock#413. - - - - - c7577f52 by Ryan Scott at 2018-04-24T13:51:06-07:00 Improve the Hoogle backend's treatment of type families (#808) Fixes parts 1 and 2 of haskell/haddock#806. - - - - - d88f85b1 by Alec Theriault at 2018-04-25T11:24:07-07:00 Replace 'attoparsec' with 'parsec' (#799) * Remove attoparsec with parsec and start fixing failed parses * Make tests pass * Fix encoding issues The Haddock parser no longer needs to worry about bytestrings. All the internal parsing work in haddock-library happens over 'Text'. * Remove attoparsec vendor * Fix stuff broken in 'attoparsec' -> 'parsec' * hyperlinks * codeblocks * examples Pretty much all issues are due to attoparsec's backtracking failure behaviour vs. parsec's non-backtracking failure behaviour. * Fix small TODOs * Missing quote + Haddocks * Better handle spaces before/after paragraphs * Address review comments - - - - - fc25e2fe by Alan Zimmerman at 2018-04-27T15:36:53+02:00 Match changes in GHC for TTG - - - - - 06175f91 by Herbert Valerio Riedel at 2018-05-01T18:11:09+02:00 Merge branch 'ghc-head' with 'ghc-8.4' - - - - - 879caaa8 by Alec Theriault at 2018-05-07T18:53:15-07:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 3e0120cb by Simon Jakobi at 2018-05-07T19:00:18-07:00 Add docs for some DocH constructors (#814) - - - - - 0a32c6db by Alec Theriault at 2018-05-08T02:15:45-07:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 8816e783 by Simon Jakobi at 2018-05-08T10:48:11-07:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - ad60366f by Ryan Scott at 2018-05-10T11:19:47-04:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - 03b7cc3b by Ryan Scott at 2018-05-10T11:24:38-04:00 Wibbles - - - - - b03dd563 by Chaitanya Koparkar at 2018-05-10T11:44:58-04:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 9f298a40 by Ben Gamari at 2018-05-13T17:36:04-04:00 Account for refactoring of LitString - - - - - ea3dabe7 by Ryan Scott at 2018-05-16T09:21:43-04:00 Merge pull request haskell/haddock#826 from haskell/T825 Remove Hoogle backend hack that butchers infix datatype names - - - - - 0d234f7c by Alec Theriault at 2018-05-23T11:29:05+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 15fc9712 by Simon Jakobi at 2018-05-31T04:17:47+02:00 Adjust to new HsDocString internals - - - - - 6f1e19a8 by Ben Gamari at 2018-06-02T16:18:58-04:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 0d0355d9 by Ryan Scott at 2018-06-04T21:26:59-04:00 DerivingVia changes - - - - - 0d93475a by Simon Jakobi at 2018-06-05T19:47:05+02:00 Bump a few dependency bounds (#845) - - - - - 5cbef804 by Alec Theriault at 2018-06-05T19:47:16+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 9094c56f by Alec Theriault at 2018-06-05T22:53:25+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 70188719 by Simon Jakobi at 2018-06-08T22:20:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - 495cd1fc by Chaitanya Koparkar at 2018-06-13T23:01:34+02:00 Use the response file utilities defined in `base` (#821) Summary: The response file related modules were recently copied from `haddock` into `base`. This patch removes them from `haddock`. GHC Trac Issues: haskell/haddock#13896 - - - - - 81088732 by Ben Gamari at 2018-06-13T23:01:34+02:00 Account for refactoring of LitString - - - - - 7baf6587 by Simon Jakobi at 2018-06-13T23:05:08+02:00 Adjust to new HsDocString internals - - - - - bb61464d by Ben Gamari at 2018-06-13T23:05:22+02:00 Remove ParallelArrays and Data Parallel Haskell - - - - - 5d8cb87f by Ryan Scott at 2018-06-13T23:39:30+02:00 DerivingVia changes - - - - - 73d373a3 by Alec Theriault at 2018-06-13T23:39:30+02:00 Extract docs from strict/unpacked constructor args (#839) This fixes haskell/haddock#836. - - - - - 4865e254 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Remove `ITtildehsh` token - - - - - b867db54 by Alec Theriault at 2018-06-13T23:39:30+02:00 Filter out CRLFs in hyperlinker backend (#813) This prevents spurious lines from appearing in the final output. - - - - - 9598e392 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Add docs for some DocH constructors (#814) - - - - - 8a59035b by Alec Theriault at 2018-06-13T23:39:30+02:00 Remove 'TokenGroup' from Hyperlinker (#818) Since the hyperlinker backend now relies on the GHC tokenizer, something like 'Bar.Baz.foo' already gets bunched together into one token (as opposed to being spread across 'Bar', '.', 'Baz', '.', and 'foo'). - - - - - 29350fc8 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about out of scope identifiers. (#819) - - - - - 2590bbd9 by Ryan Scott at 2018-06-13T23:39:30+02:00 Remove Hoogle backend hack that butchers infix datatype names - - - - - a9939fdc by Ryan Scott at 2018-06-13T23:39:30+02:00 Wibbles - - - - - a22f7df4 by Alec Theriault at 2018-06-13T23:39:30+02:00 Use `ClassOpSig` instead of `TypeSig` for class methods (#835) * Fix minimal pragma handling Class declarations contain 'ClassOpSig' not 'Typesig'. This should fix haskell/haddock#834. * Accept html-test output - - - - - 8741015d by Simon Jakobi at 2018-06-13T23:39:30+02:00 Bump a few dependency bounds (#845) - - - - - 4791e1cc by Alec Theriault at 2018-06-13T23:39:30+02:00 Improve hyperlinker's 'spanToNewline' (#846) 'spanToNewline' is used to help break apart the source into lines which can then be partioned into CPP and non-CPP chunks. It is important that 'spanToNewline' not break apart tokens, so it needs to properly handle things like * block comments, possibly nested * string literals, possibly multi-line * CPP macros, possibly multi-line String literals in particular were not being properly handled. The fix is to to fall back in 'Text.Read.lex' to help lex things that are not comments. Fixes haskell/haddock#837. - - - - - 311d3216 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Renamer: Warn about ambiguous identifiers (#831) * Renamer: Warn about ambiguous identifiers Example: Warning: 'elem' is ambiguous. It is defined * in ‘Data.Foldable’ * at /home/simon/tmp/hdk/src/Lib.hs:7:1 You may be able to disambiguate the identifier by qualifying it or by hiding some imports. Defaulting to 'elem' defined at /home/simon/tmp/hdk/src/Lib.hs:7:1 Fixes haskell/haddock#830. * Deduplicate warnings Fixes haskell/haddock#832. - - - - - d0577817 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Complete FixitySig and FamilyDecl pattern matches - - - - - 055b3aa7 by Simon Jakobi at 2018-06-13T23:39:30+02:00 Fix redundant import warnings - - - - - f9ce19b1 by Simon Jakobi at 2018-06-13T23:49:52+02:00 html-test: Accept output - - - - - 04604ea7 by Simon Jakobi at 2018-06-13T23:54:37+02:00 Bump bounds on Cabal - - - - - 0713b692 by Simon Jakobi at 2018-06-14T00:00:12+02:00 Merge branch 'ghc-head' into ghc-head-update-3 - - - - - c6a56bfd by Simon Jakobi at 2018-06-14T02:33:27+02:00 Bump ghc bound for haddock-api spec test-suite - - - - - 119d04b2 by Simon Jakobi at 2018-06-14T12:37:48+02:00 Travis: `--allow-newer` for all packages - - - - - 0e876e2c by Alex Biehl at 2018-06-14T15:28:52+02:00 Merge pull request haskell/haddock#857 from sjakobi/ghc-head-update-3 Update ghc-head - - - - - 5be46454 by Alec Theriault at 2018-06-14T21:42:45+02:00 Improved handling of interfaces in 'haddock-test' (#851) This should now work with an inplace GHC where (for instance) HTML directories may not be properly recorded in the package DB. - - - - - 96ab1387 by Vladislav Zavialov at 2018-06-14T17:06:21-04:00 Handle -XStarIsType - - - - - e518f8c4 by Ben Gamari at 2018-06-14T17:48:00-04:00 Revert unintentional reversion of fix of haskell/haddock#548 - - - - - 01b9f96d by Alan Zimmerman at 2018-06-19T11:52:22+02:00 Match changes in GHC for haskell/haddock#14259 - - - - - 7f8c8298 by Ben Gamari at 2018-06-19T18:14:27-04:00 Bump GHC version to 8.6 - - - - - 11c6b5d2 by Ryan Scott at 2018-06-19T23:17:31-04:00 Remove HsEqTy and XEqTy - - - - - b33347c2 by Herbert Valerio Riedel at 2018-06-20T23:14:52+02:00 Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. - - - - - f0d2460e by Herbert Valerio Riedel at 2018-06-20T23:28:46+02:00 Update Travis CI job - - - - - ef239223 by Herbert Valerio Riedel at 2018-06-20T23:32:41+02:00 Drop GHC HEAD from CI and update GHC to 8.4.3 It's a waste of resource to even try to build this branch w/ ghc-head; so let's not do that... - - - - - 41c4a9fa by Ben Gamari at 2018-06-20T18:26:20-04:00 Bump GHC version to 8.7 - - - - - 8be593dc by Herbert Valerio Riedel at 2018-06-21T22:32:15+02:00 Update CI job to use GHC 8.7.* - - - - - b91d334a by Simon Jakobi at 2018-06-30T13:41:38+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section - - - - - f707d848 by Alec Theriault at 2018-07-05T10:43:35-04:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. - - - - - a6d2b8dc by Alec Theriault at 2018-07-06T10:06:32-04:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case - - - - - 13819f71 by Alan Zimmerman at 2018-07-15T19:33:51+02:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 - - - - - c346aa78 by Simon Jakobi at 2018-07-19T12:29:32+02:00 haddock-library: Bump bounds for containers - - - - - 722e733c by Simon Jakobi at 2018-07-19T13:36:45+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] - - - - - f0bd83fd by Alec Theriault at 2018-07-19T14:39:57+02:00 Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. - - - - - 394053a8 by Simon Jakobi at 2018-07-19T14:58:07+02:00 haddock-library: Bump bounds for containers - - - - - 1bda11a2 by Alec Theriault at 2018-07-20T09:04:03+02:00 Add HEAD.hackage overlay (#887) * Add HEAD.hackage overlay * Add HCPKG variable - - - - - c7b4ab45 by Alec Theriault at 2018-07-20T12:01:16+02:00 Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test - - - - - c05d32ad by Alec Theriault at 2018-07-20T12:01:49+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output - - - - - 24b39ee4 by Alec Theriault at 2018-07-20T12:02:16+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. - - - - - cb9d2099 by Simon Jakobi at 2018-07-20T13:39:29+02:00 README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) - - - - - 133f24f5 by Alec Theriault at 2018-07-20T13:39:29+02:00 Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) - - - - - 11024149 by Alec Theriault at 2018-07-20T13:39:29+02:00 Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) - - - - - de0c139e by Simon Jakobi at 2018-07-20T13:39:29+02:00 tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) - - - - - 6435e952 by Alec Theriault at 2018-07-20T13:39:29+02:00 Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) - - - - - 1461af39 by Alec Theriault at 2018-07-20T13:39:29+02:00 Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) - - - - - 69d3bde1 by Alec Theriault at 2018-07-20T13:49:47+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) - - - - - 6a5c73c7 by Alec Theriault at 2018-07-20T13:50:00+02:00 Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests - - - - - 92ca94c6 by Alec Theriault at 2018-07-20T13:55:36+02:00 Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) - - - - - 981bc7fa by Simon Jakobi at 2018-07-20T15:06:06+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers - - - - - 27e7c0c5 by Simon Jakobi at 2018-07-20T15:09:05+02:00 Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 49e1a415 by Simon Jakobi at 2018-07-20T16:02:02+02:00 Update the ghc-8.6 branch (#889) * Revert "Bump GHC version to 8.6" This was applied to the wrong branch; there's now a `ghc-8.6` branch; ghc-head is always supposed to point to GHC HEAD, i.e. an odd major version. The next version bump to `ghc-head` is supposed to go from e.g. 8.5 to 8.7 This reverts commit 5e3cf5d8868323079ff5494a8225b0467404a5d1. * README updates (#856) * README: Remove mentions of master branch * README: Add instructions for using html-test * README: Change command to run _all_ the testsuites * README: Add project overview section (cherry picked from commit 61d6f935da97eb96685f07bf385102c2dbc2a33c) * Export more fixities for Hoogle (#871) This exports fixities for more things, including class methods and type-level operators. (cherry picked from commit 88316b972e3d47197b1019111bae0f7f87275fce) * Avoid line breaks due to line length in Hoogle (#868) * Avoid line breaks due to line length in Hoogle Hoogle operates in a line-oriented fashion, so we should avoid ever breaking due to long lines. One way of doing this non-intrusively is to modify the 'DynFlags' that are threaded through the 'Hoogle' module (note this is anyways only passed through for use in the various 'showSDoc' functions). * Amend test case (cherry picked from commit 657b1b3d519545f8d4ca048c06210d6cbf0f0da0) * tyThingToLHsDecl: Preserve type synonyms that contain a forall (#880) * tyThingToLHsDecls: Preserve type synonyms that contain a forall Fixes haskell/haddock#879. * Add Note [Invariant: Never expand type synonyms] * Clarify Note [Invariant: Never expand type synonyms] (cherry picked from commit c3eb3f0581f69e816f9453b1747a9f2a3ba02bb9) * Fix HEAD html-test (#860) * Update tests for 'StarIsType' * Accept tests * Revert "Update tests for 'StarIsType'" This reverts commit 7f0c01383bbba6dc5af554ee82988d2cf44e407a. * Refactor handling of parens in types (#874) * Fix type parenthesization in Hoogle backend Ported the logic in the HTML and LaTeX backends for adding in parens into something top-level in 'GhcUtil'. Calling that from the Hoogle backend fixes haskell/haddock#873. * Remove parenthesizing logic from LaTeX and XHTML backends Now, the only times that parenthesis in types are added in any backend is through the explicit 'HsParTy' constructor. Precedence is also represented as its own datatype. * List out cases explicitly vs. catch-all * Fix printing of parens for QuantifiedConstraints The priority of printing 'forall' types was just one too high. Fixes haskell/haddock#877. * Accept HTML output for quantified contexts test * Preserve docs on type family instances (#867) * Preserve docs on type family instances The only problem was that the instance location was slightly off for type family instances. * Accept output (cherry picked from commit 133e9c2c168db19c1135479f7ab144c4e33af2a4) * Fix broken instance source links (#869) The problem manifests itself in instances that are defined in modules other than the module where the class is defined. The fix is just to thread through the 'Module' of the instance further along. Since orphan instances appear to already have been working, I didn't do anything there. (cherry picked from commit 2de7c2acf9b1ec85b09027a8bb58bf8512e91c05) * Add some more unicode related tests (#872) This has been fixed for sure ever since we switched from attoparsec to parsec. Parts of it may have been working before that, but there was a point where this would have failed (see haskell/haddock#191). A regression test never hurt anyone. :) (cherry picked from commit 5ec7715d418bfac0f26aec6039792a99a6e89370) * Misc tests (#858) * More tests * spliced types * constructor/pattern argument docs * strictness marks on fields with argument docs * latex test cases need seperate directory * Accept tests * Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers (cherry picked from commit 0861affeca4d72938f05a2eceddfae2c19199071) - - - - - 5ca14bed by Simon Jakobi at 2018-07-20T16:05:47+02:00 Revert "Revert "Bump GHC version to 8.6"" That commit didn't belong onto the ghc-8.6 branch. This reverts commit acbaef3b9daf1d2dea10017964bf886e77a8e967. - - - - - 2dd600dd by Simon Jakobi at 2018-07-20T16:18:21+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. - - - - - fceb2422 by Simon Jakobi at 2018-07-20T16:18:21+02:00 outOfScope: Recommend qualifying the identifier - - - - - acea5d23 by Simon Jakobi at 2018-07-20T16:19:35+02:00 outOfScope: Recommend qualifying the identifier (cherry picked from commit 73707ed58d879cc04cb644c5dab88c39ca1465b7) - - - - - 1a83ca55 by Simon Jakobi at 2018-07-20T16:19:35+02:00 Don't warn about ambiguous identifiers when the candidate names belong to the same type This also changes the defaulting heuristic for ambiguous identifiers. We now prefer local names primarily, and type constructors or class names secondarily. Partially fixes haskell/haddock#854. (cherry picked from commit d504a2864a4e1982e142cf88c023e7caeea3b76f) - - - - - 48374451 by Masahiro Sakai at 2018-07-20T17:06:42+02:00 Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. - - - - - 5e1a5275 by Alec Theriault at 2018-07-20T23:37:24+02:00 Let `haddock-test` bypass interface version check (#890) This means `haddock-test` might * crash during deserialization * deserialize incorrectly Still - it means things _might_ work where they were previously sure not to. - - - - - 27286754 by Yuji Yamamoto at 2018-07-23T08:16:01+02:00 Avoid "invalid argument (invalid character)" on non-unicode Windows (#892) Steps to reproduce and the error message ==== ``` > stack haddock basement ... snip ... Warning: 'A' is out of scope. Warning: 'haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character) ``` Environment ==== OS: Windows 10 ver. 1709 haddock: [HEAD of ghc-8.4 when I reproduce the error](https://github.com/haskell/haddock/commit/532b209d127e4cecdbf7e9e3dcf4f653a5605b5a). (I had to use this version to avoid another probrem already fixed in HEAD) GHC: 8.4.3 stack: Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2 Related pull request ==== https://github.com/haskell/haddock/pull/566 - - - - - 6729d361 by Alec Theriault at 2018-07-23T13:52:56-07:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). - - - - - 8cf4e6b5 by Ryan Scott at 2018-07-27T11:28:03-04:00 eqTyCon_RDR now lives in TysWiredIn After GHC commit http://git.haskell.org/ghc.git/commit/f265008fb6f70830e7e92ce563f6d83833cef071 - - - - - 1ad251a6 by Alan Zimmerman at 2018-07-30T13:28:09-04:00 Match XFieldOcc rename in GHC Trac haskell/haddock#15386 (cherry picked from commit e3926b50ab8a7269fd6904b06e881745f08bc5d6) - - - - - 8aea2492 by Richard Eisenberg at 2018-08-02T10:54:17-04:00 Update against new HsImplicitBndrs - - - - - e42cada9 by Alec Theriault at 2018-08-04T17:51:30+02:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 0e852512 by Alex Biehl at 2018-08-06T13:04:02+02:00 Make --package-version optional for --hoogle generation (#899) * Make --package-version optional for --hoogle generation * Import mkVersion * It's makeVersion not mkVersion - - - - - d2abd684 by Noel Bourke at 2018-08-21T09:34:18+02:00 Remove unnecessary backslashes from docs (#908) On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. - - - - - 7a578a9e by Matthew Pickering at 2018-08-21T09:34:50+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - aa3d4db3 by Matthew Pickering at 2018-08-21T09:37:34+02:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 - - - - - ede91744 by Alec Theriault at 2018-08-21T09:42:52+02:00 Better test output when Haddock crashes on a test (#902) In particular: we report the tests that crashed seperately from the tests that produced incorrect output. In order for tests to pass (and exit 0), they must not crash and must produce the right output. - - - - - 4a872b84 by Guillaume Bouchard at 2018-08-21T09:45:57+02:00 Fix a typo (#878) - - - - - 4dbf7595 by Ben Sklaroff at 2018-08-21T12:04:09-04:00 Add ITcomment_line_prag token to Hyperlinker Parser This token is necessary for parsing #line pragmas inside nested comments. Reviewers: bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D4935 - - - - - 9170b2a9 by Ben Gamari at 2018-08-21T17:55:15-04:00 Merge pull request haskell/haddock#893 from harpocrates/get-name-to-instances Accumulate explicitly which modules to load for 'attachInstances' - - - - - d57b57cc by Ben Gamari at 2018-08-21T17:59:13-04:00 Merge branch 'ghc-head' of github.com:haskell/haddock into ghc-head - - - - - 14601ca2 by Alec Theriault at 2018-08-21T19:09:37-04:00 Accumulate explicitly which modules to load for 'attachInstances' The old approach to fixing haskell/haddock#469, while correct, consumes a lot of memory. We ended up with a HUGE 'GblRdrEnv' in 'ic_rn_gbl_env'. However, 'getNameToInstancesIndex' takes that environment and compresses it down to a much smaller 'ModuleSet'. Now, we compute that 'ModuleSet' explicitly as we process modules. That way we can just tell 'getNameToInstancesIndex' what modules to load (instead of it trying to compute that information from the interactive context). (cherry picked from commit 5c7c596c51d69b92164e9ba920157b36ce2b2ec1) - - - - - 438c645e by Matthew Pickering at 2018-08-21T19:12:39-04:00 Load plugins when starting a GHC session (#905) Fixes haskell/haddock#900 (cherry picked from commit e6aa8fb47b9477cc5ef5e46097524fe83e080f6d) - - - - - a80c5161 by Alec Theriault at 2018-08-21T22:06:40-07:00 Better rendering of unboxed sums/tuples * adds space after/before the '#' marks * properly reify 'HsSumTy' in 'synifyType' - - - - - 88456cc1 by Alec Theriault at 2018-08-21T22:06:40-07:00 Handle promoted tuples in 'synifyType' When we have a fully applied promoted tuple, we can expand it out properly. - - - - - fd1c1094 by Alec Theriault at 2018-08-21T22:19:34-07:00 Accept test cases - - - - - 6e80d9e0 by Alec Theriault at 2018-08-21T22:24:03-07:00 Merge pull request haskell/haddock#914 from harpocrates/feature/unboxed-stuff Better rendering of unboxed sums, unboxed tuples, promoted tuples. - - - - - 181a23f1 by Ben Gamari at 2018-08-23T15:53:48-04:00 Merge remote-tracking branch 'origin/ghc-8.6' into ghc-8.6 - - - - - 3a18c1d8 by Alec Theriault at 2018-08-27T14:15:25-07:00 Properly synify promoted list types We reconstruct promoted list literals whenever possible. That means that 'synifyType' produces '[Int, Bool, ()] instead of (Int ': (() ': (Bool ': ([] :: [Type])))) - - - - - b4794946 by Alec Theriault at 2018-09-03T07:19:55-07:00 Only look at visible types when synifying a 'HsListTy' The other types are still looked at when considering whether to make a kind signature or not. - - - - - a231fce2 by Alec Theriault at 2018-09-03T07:38:10-07:00 Merge pull request haskell/haddock#922 from harpocrates/promoted-lists Properly synify promoted list types - - - - - 0fdf044e by Ningning Xie at 2018-09-15T10:25:58-04:00 Update according to GHC Core changes - - - - - 7379b115 by Ningning Xie at 2018-09-15T15:40:18-04:00 update dataFullSig to work with Co Quantification This should have been in the previous patch, but wasn't. - - - - - cf84a046 by Alec Theriault at 2018-09-17T20:12:18-07:00 Fix/add to various docs * Add documentation for a bunch of previously undocumented options (fixes haskell/haddock#870) * Extend the documentation of `--hoogle` considerably (see haskell/haddock#807) * Describe how to add docs to `deriving` clauses (fixes haskell/haddock#912) * Fix inaccurate docs about hyperlinking infix identifiers (fixes haskell/haddock#780) - - - - - ae017935 by Alec Theriault at 2018-09-22T08:32:16-07:00 Update Travis - - - - - d95ae753 by Alec Theriault at 2018-09-22T09:34:10-07:00 Accept failing tests Also silence orphan warnings. - - - - - f3e67024 by Alec Theriault at 2018-09-22T09:41:23-07:00 Bump haddock-api-2.21.0, haddock-library-1.7.0 * Update CHANGELOGS * Update new versions in Cabal files * Purge references to ghc-8.4/master branches in README - - - - - 3f136d4a by Alec Theriault at 2018-09-22T10:53:31-07:00 Turn haddock-library into a minor release Fix some version bounds in haddock-library too. - - - - - b9def006 by Alec Theriault at 2018-09-22T13:07:35-07:00 keep cabal.project file - - - - - 4909aca7 by Alec Theriault at 2018-10-16T09:36:30-07:00 Build on 7.4 and 7.8 - - - - - 99d20a28 by Herbert Valerio Riedel at 2018-10-16T18:45:52+02:00 Minor tweak to package description - - - - - a8059618 by Herbert Valerio Riedel at 2018-10-16T18:47:24+02:00 Merge pull request haskell/haddock#945 haddock-api 2.21.0 and haddock-library 1.6.1 release - - - - - 2d9bdfc1 by Alec Theriault at 2018-10-16T10:54:21-07:00 Bump haddock-library to 1.7.0 The 1.6.1 release should've been a major bump, since types in the `Documentation.Haddock.Parser.Monad` module changed. This version makes that module internal (as it morally should be). - - - - - ed340cef by Alec Theriault at 2018-10-16T14:59:13-07:00 Merge branch 'ghc-8.4' into ghc-8.6 - - - - - 2821a8df by Alec Theriault at 2018-10-16T15:14:48-07:00 Merge branch 'ghc-8.6' into ghc-head - - - - - a722dc84 by Alec Theriault at 2018-10-16T16:28:55-07:00 Latex type families (#734) * Support for type families in LaTeX The code is ported over from the XHTML backend. * Refactor XHTML and LaTeX family handling This is mostly a consolidation effort: stripping extra exports, inlining some short definitions, and trying to make the backends match. The LaTeX backend now has preliminary support for data families, although the only the data instance head is printed (not the actual constructors). Both backends also now use "newtype" for newtype data family instances. * Add some tests - - - - - 63377496 by Alec Theriault at 2018-10-16T16:39:07-07:00 Update changelog - - - - - 099a0110 by Alec Theriault at 2018-10-16T16:49:28-07:00 Merge pull request haskell/haddock#942 from harpocrates/update-docs Fix & add to documentation - - - - - 0927416f by Alec Theriault at 2018-10-16T16:50:14-07:00 Set UTF-8 encoding before writing files (#934) This should fix haskell/haddock#929, as well as guard against future problems of this sort in other places. Basically replaces 'writeFile' (which selects the users default locale) with 'writeUtf8File' (which always uses utf8). - - - - - 83b7b017 by Alec Theriault at 2018-10-16T17:42:05-07:00 Output pattern synonyms in Hoogle backend (#947) * Output pattern synonyms in Hoogle backend We were previously weren't outputting _any_ pattern synonyms, bundled or not. Now, we output both. Fixes haskell/haddock#946. * Update changelog - - - - - 81e5033d by Alec Theriault at 2018-10-16T18:04:40-07:00 Release `haddock{,-api}-2.22.0` This version will accompany ghc-8.6.2 - - - - - 9661744e by Alex Biehl at 2018-10-18T08:14:32-07:00 Add NewOcean theme And make it the default theme. - - - - - 7ae6d722 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Improve appearance and readability These changes include: - use latest Haskell's logo colors - decrease #content width to improve readability - use nicer font - improve sizes and distances - - - - - 37f8703d by NunoAlexandre at 2018-10-18T08:14:32-07:00 Include custom font in the html head - - - - - 1d5e1d79 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Update html test reference files - - - - - 53b7651f by NunoAlexandre at 2018-10-18T08:14:32-07:00 Make it responsive - It makes small screens taking more space than larger ones - fixes a few issues present in small screens currently - make it look good across different screen sizes. - - - - - 6aa1aeb1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make the style consistent with hackage Several things are addressed here: - better responsive behaviour on the header - better space usage - consistent colors overall - other nit PR comments - - - - - 3a250c5c by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Place the package name before the menu links This supports the expected responsive menu design, where the package name appears above the menu links. - - - - - cae699b3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update html-test reference files The package name element in the package-header is now a div instead of a paragraph, and it is now above the menu ul.links instead of below. - - - - - 2ec7fd2d by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve synopsis style and code - Use CSS3 instead of loading pictures to show "+" and "-" symbols - Drop redundant code - - - - - 0c874c01 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Decrease space between code blocks There was too much space between code blocks as pointed out by reviewers. - - - - - 85568ce2 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Add an initial-scale property to all haddock pages This solves an issue reported about the content looking incredibly small on mobile devices. - - - - - c1538926 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Address several PR comments - Darken text color like done for hackage - Move synopsis to left side - Make table of contents stick to the left on wide screens - Wrap links to avoid page overflow - Improve expand/collapse buttons - Fix issue with content size on mobile devices - Fix issue with font-size on landscape mode - Increase width of the content - Change colors of table of contents and synopsis - Etc - - - - - e6639e5f by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make synopsis scrollable on wide screens When the synopsis is longer than the screen, you can’t see its end and you can't scroll down either, making the content unreachable. - - - - - 1f0591ff by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve information density - Reduce font size - Improve space between and within code blocks - Improve alignments - Improve spacing within sub-blocks - - - - - bf083097 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Minor adjustments Bring in some adjustments made to hackage: - link colors - page header show everything when package title is too long - - - - - 10375fc7 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix responsive triggers overlap issue The min and max width triggers have the same values, which caused the style resolution to take an intersection of both style declarations when the screen resolution had the size of the limts (say 1280px), causing an odd behaviour and look. - - - - - 95ff2f95 by NunoAlexandre at 2018-10-18T08:14:32-07:00 Fix issue with menu alignment on firefox Reported and described here: https://github.com/haskell/haddock/pull/721#issuecomment-374668869 - - - - - dc86587e by Alex Biehl at 2018-10-18T08:14:32-07:00 Changelog entry for NewOcean - - - - - 27195e47 by Herbert Valerio Riedel at 2018-10-18T08:14:32-07:00 html-test --accept - - - - - 83f4f9c0 by Alex Biehl at 2018-10-18T08:14:32-07:00 Avoid name shadowing - - - - - 231487f1 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font to PT Sans Also migrate some general text related changes from hackage. - - - - - 313db81a by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Use 'flex' to fix header alignment - - - - - 5087367b by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Misc of tweaks - Update link colors to hackage scheme - Tune spacing between content elements - Update footer style - Fix and improve code blocks identation - - - - - b08020df by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update font in Xhtml.hs to PT Sans - - - - - 78ce06e3 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Improve code blocks styling - Fix and improve spacing - Improve colors and borders - - - - - 81262d20 by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Make package-header caption backward-compatible The current html generator of this branch wraps the package-header caption as a div, which does not work (without style adjustments) with the old themes. Changing it from div to span does the trick, without needing to adjust the old stylesheets. - - - - - dc4475cb by Nuno Alexandre at 2018-10-18T08:14:32-07:00 Update test-suite reference html pages - - - - - 393d35d8 by Alec Theriault at 2018-10-18T08:25:36-07:00 Accept tests - - - - - a94484ba by Alec Theriault at 2018-10-21T10:29:29-07:00 Fix CHANGELOG - - - - - 8797eca3 by Alec Theriault at 2018-10-21T10:36:19-07:00 Update 'data-files' to include NewOcean stuff - - - - - 1ae51e4a by Simon Jakobi at 2018-10-23T11:29:14+02:00 Fix typo in a warning - - - - - 009ad8e8 by Alec Theriault at 2018-10-24T12:47:47-07:00 Update JS dependencies This was done via `npm audit fix`. I think this fixes haskell/haddock#903 along with some more serious vulnerabilities that nobody seems to have noticed. - - - - - 051994db by Alec Theriault at 2018-10-24T17:31:09-07:00 Resurrect the style-switcher This fixes haskell/haddock#810. Looks like things were broken during the quickjump refactor of the JS. For the (git) record: I do not think the style switcher is a good idea. I'm fixing it for the same reason @mzero added it; as an answer to "rumblings from some that they didn't want their pixels changed on bit" - - - - - 2a1d620f by Alec Theriault at 2018-10-24T17:38:07-07:00 Fix copy-pasta error in data-files - - - - - ed5bfb7f by Alec Theriault at 2018-10-24T20:42:14-07:00 Fix the synopsis button Here's these changes are supposed to do: * put the synopsis back on the right side * properly have it on the edge of the screen on wide screens * adjust the background of the synopsis to match the button (otherwise the grey blends in with what is underneath) * get rid of the dotted purple line * the synopsis contents are now scrollable even when in wide screens (this has been a long-standing bug) - - - - - 883fd74b by Alec Theriault at 2018-10-25T20:16:46-07:00 Avoid more conflicts in generated ids (#954) This fixes haskell/haddock#953 by passing more names into the generated ids. - - - - - ea54e331 by Alec Theriault at 2018-10-25T21:07:12-07:00 Don't hide bullets in method docs I think thst CSS was meant only to deal with fields and the effect on bullets was accidental. Fixes haskell/haddock#926. - - - - - 9a14ef4a by Alec Theriault at 2018-10-25T22:02:07-07:00 Indent more things + slightly smaller font - - - - - b9f17e29 by Alec Theriault at 2018-10-25T22:10:01-07:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 096a3cfa by Alec Theriault at 2018-10-25T22:24:38-07:00 Accept HTML output - - - - - 2669517d by Alec Theriault at 2018-10-26T09:02:35-07:00 User manual + stuff for building GHC docs - - - - - 46b27687 by Alec Theriault at 2018-10-26T09:10:59-07:00 Make 'Contents' in NewOcean scrollable This only happens if the contents block on the left is so big that it doesn't fit (vertically) on the page. If that happens, we want it to be scrollable. - - - - - 3443dd94 by Alec Theriault at 2018-10-26T09:36:46-07:00 Revert "Make 'Contents' in NewOcean scrollable" This reverts commit f909ffd8353d6463fd5dd184998a32aa98d5c922. I missed the fact this also forces the 'Contents' to always go down to the bottom of the page. - - - - - ed081424 by Alec Theriault at 2018-10-26T14:22:23-07:00 Avoid some partiality AFAICT this wasn't causing any crashes, but that's mostly because we happen not to be forcing `pkgStr` when it would diverge. We come dangerously close to doing that in `ppHtmlIndex`. Fixes haskell/haddock#569. - - - - - 6a5bec41 by Alec Theriault at 2018-10-27T10:05:04-07:00 Fix documentation in `haddock-api` (#957) * Fix misplaced Haddocks in Haddock itself Haddock should be able to generate documentation for 'haddock-api' again. * Make CI check that documentation can be built. * Add back a doc that is OK - - - - - 5100450a by Matthew Yacavone at 2018-10-27T14:51:38-04:00 More explicit foralls (GHC Proposal 0007) - - - - - 8771a6b0 by Alec Theriault at 2018-11-05T13:58:11-08:00 Only run MathJax on entities with "mathjax" class (#960) Correspondingly, we wrap all inline/diplay math in <span class="mathjax"> ... the math .... </span> This fixes haskell/haddock#959. - - - - - bd7ff5c5 by Alec Theriault at 2018-11-05T15:54:22-08:00 Deduplicate some work in 'AttachInstances' Perf only change: * avoid needlessly union-ing maps * avoid synify-ing instances twice Took this opportunity to add some docs too - - - - - cf99fd8f by Alec Theriault at 2018-11-05T15:54:22-08:00 Specialize some SYB functions Perf only change: * Add a 'SPECIALIZE' pragma to help GHC optimize a 'Data a =>' constraint * Manually specialize the needlessly general type of 'specializeTyVarBndrs' - - - - - 4f91c473 by Alec Theriault at 2018-11-05T15:54:22-08:00 Improve perf of renaming Perf only change: * don't look up type variable names (they're never in the environment) * use a difference list for accumulating missing names * more efficient 'Functor'/'Applicative' instances for 'RnM' - - - - - 4bbab0d4 by Alec Theriault at 2018-11-05T15:54:22-08:00 Faster 'Text' driven parser combinators Perf only change: * use 'getParserState'/'setParserState' to make 'Text'-optimized parser combinators * minimize uses of 'Data.Text.{pack,unpack,cons,snoc}' - - - - - fa430c02 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support hyperlink labels with inline markup The parser for pictures hasn't been properly adjusted yet. - - - - - c1431035 by Alec Theriault at 2018-11-06T12:03:24-08:00 Support (and flatten) inline markup in image links Inline markup is supported in image links but, as per the [commonmark recommendation][0], it is stripped back to a plain text representation. [0]: https://spec.commonmark.org/0.28/#example-547 - - - - - d4ee1ba5 by Alec Theriault at 2018-11-06T12:03:24-08:00 Accept test case - - - - - 8088aeb1 by Alec Theriault at 2018-11-06T12:03:24-08:00 Fix/add to haddock-library test suite - - - - - e78f644d by Alec Theriault at 2018-11-06T13:26:31-08:00 Bump version bounds - - - - - 644335eb by Alec Theriault at 2018-11-06T13:53:30-08:00 Merge pull request haskell/haddock#875 from harpocrates/feature/markup-in-hyperlinks Inline markup in markdown-style links and images - - - - - e173ed0d by Alec Theriault at 2018-11-07T12:37:18-08:00 Fix issues around plus/minus * swap the minimize unicode to something more intuitive * use new unicode expander/collapser for instance lists * address some alignment issues in the "index" page - - - - - b2d92df7 by Alec Theriault at 2018-11-07T13:41:57-08:00 Allow "Contents" summary to scroll in a fixed div In the unfortunate event that the "Contents" summary doesn't fit vertically (like in the "Prelude"), it will be scrollable. - - - - - ca704c23 by Alec Theriault at 2018-11-07T13:45:15-08:00 Accept HTML output changes - - - - - 82c0ec6d by Alec Theriault at 2018-11-07T18:12:54-08:00 overflow-y 'scroll' -> 'auto' - - - - - 571d7657 by Alec Theriault at 2018-11-08T19:44:12-08:00 Clicking on "Contents" navigates to top of page - - - - - 8065a012 by Alec Theriault at 2018-11-08T19:44:17-08:00 Space out functions more Also, functions and data decls now have the same space before and after them. - - - - - cc650ede by Alec Theriault at 2018-11-09T08:13:35-08:00 Merge branch 'ghc-8.6' into wip/new-ocean - - - - - 65f8c17f by Alec Theriault at 2018-11-10T14:04:06-08:00 Update changelog - - - - - 20473847 by Alec Theriault at 2018-11-10T14:21:40-08:00 Replace oplus/ominus expander/collapser icons with triangles - - - - - 16592957 by Alec Theriault at 2018-11-10T14:35:10-08:00 Merge pull request haskell/haddock#949 from haskell/wip/new-ocean Introduce NewOcean theme. - - - - - 357cefe1 by Alec Theriault at 2018-11-10T16:02:13-08:00 Merge branch 'ghc-8.6' into ghc-head - - - - - de612267 by Alec Theriault at 2018-11-11T20:01:21-08:00 Rename 'NewOcean' theme to 'Linuwial' - - - - - 954b5baa by Alec Theriault at 2018-11-12T08:33:18-08:00 Add blockquote styling Matches b71da1feabf33efbbc517ac376bb690b5a604c2f from hackage-server. Fixes haskell/haddock#967. - - - - - d32c0b0b by Fangyi Zhou at 2018-11-12T10:24:13-08:00 Fix some broken links (#15733) Summary: For links in subpackages as well. https://phabricator.haskell.org/D5257 Test Plan: Manually verify links Reviewers: mpickering, bgamari, osa1 Reviewed By: osa1 GHC Trac Issues: haskell/haddock#15733 Differential Revision: https://phabricator.haskell.org/D5262 - - - - - 41098b1f by Alp Mestanogullari at 2018-11-15T22:40:09+01:00 Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change It got introduced in ghc/ghc at ae2c9b40f5b6bf272251d1f4107c60003f541b62. - - - - - c5c1c7e0 by Alec Theriault at 2018-11-15T13:48:13-08:00 Merge pull request haskell/haddock#970 from alpmestan/alp/fix-promotionflag Follow GHC HEAD's HsTypes.Promoted -> BasicTypes.PromotionFlag change - - - - - 6473d3a4 by Shayan-Najd at 2018-11-23T01:38:49+01:00 [TTG: Handling Source Locations] Foundation and Pat Trac Issues haskell/haddock#15495 This patch removes the ping-pong style from HsPat (only, for now), using the plan laid out at https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow/HandlingSourceLocations (solution A). - the class `HasSrcSpan`, and its functions (e.g., `cL` and `dL`), are introduced - some instances of `HasSrcSpan` are introduced - some constructors `L` are replaced with `cL` - some patterns `L` are replaced with `dL->L` view pattern - some type annotation are necessarily updated (e.g., `Pat p` --> `Pat (GhcPass p)`) - - - - - 7a088dfe by Alec Theriault at 2018-11-26T11:11:28-08:00 More uniform handling of `forall`'s in HTML/LaTeX * don't forget to print explicit `forall`'s when there are arg docs * when printing an explicit `forall`, print all tyvars Fixes haskell/haddock#973 - - - - - d735e570 by Alec Theriault at 2018-12-12T08:42:09-08:00 Fix warnings, accept output * remove redundant imports (only brought to light due to recent work for improving redundant import detection) * fix a bug that was casuing exports to appear in reverse order * fix something in haddock-library that prevented compilation on old GHC's - - - - - a3852f8a by Zejun Wu at 2018-12-14T09:37:47-05:00 Output better debug infromation on internal error in extractDecl This will make investigation of haskell/haddock#979 easier - - - - - 2eccb5b9 by Alec Theriault at 2018-12-17T09:25:10-05:00 Refactor names + unused functions (#982) This commit should not introduce any change in functionality! * consistently use `getOccString` to convert `Name`s to strings * compare names directly when possible (instead of comparing strings) * get rid of unused utility functions - - - - - e82e4df8 by Alec Theriault at 2018-12-20T16:16:30-05:00 Load plugins when compiling each module (#983) * WIP: Load (typechecker) plugins from language pragmas * Revert "Load plugins when starting a GHC session (#905)" This reverts commit 72d82e52f2a6225686d9668790ac33c1d1743193. * Simplify plugin initialization code - - - - - 96e86f38 by Alec Theriault at 2018-12-23T10:23:20-05:00 Properly synify and render promoted type variables (#985) * Synify and render properly promoted type variables Fixes haskell/haddock#923. * Accept output - - - - - 23343345 by Alec Theriault at 2018-12-27T16:39:38-05:00 Remove `haddock-test`'s dep. on `syb` (#987) The functionality is easily inlined into one short function: `gmapEverywhere`. This doesn't warrant pulling in another package. - - - - - d0734f21 by Alec Theriault at 2018-12-27T16:39:52-05:00 Address deprecation warnings in `haddock-test` (#988) Fixes haskell/haddock#885. - - - - - 4d9f144e by mynguyen at 2018-12-30T23:42:26-05:00 Visible kind application haddock update - - - - - ffe0e9ed by Alec Theriault at 2019-01-07T13:55:22-08:00 Print kinded tyvars in constructors for Hoogle (#993) Fixes haskell/haddock#992 - - - - - 2e18b55d by Alec Theriault at 2019-01-10T16:42:45-08:00 Accept new output `GHC.Maybe` -> `Data.Maybe` (#996) Since 53874834b779ad0dfbcde6650069c37926da1b79 in GHC, "GHC.Maybe" is marked as `not-home`. That changes around some test output. - - - - - 055da666 by Gabor Greif at 2019-01-22T14:41:51+01:00 Lone typofix - - - - - 01bb71c9 by Alec Theriault at 2019-01-23T11:46:46-08:00 Keep forall on H98 existential data constructors (#1003) The information about whether or not there is a source-level `forall` is already available on a `ConDecl` (as `con_forall`), so we should use it instead of always assuming `False`! Fixes haskell/haddock#1002. - - - - - f9b9bc0e by Ryan Scott at 2019-01-27T09:28:12-08:00 Fix haskell/haddock#1004 with a pinch of dropForAlls - - - - - 5cfcdd0a by Alec Theriault at 2019-01-28T16:49:57-08:00 Loosen 'QuickCheck' and 'hspec' bounds It looks like the new versions don't cause any breakage and loosening the bounds helps deps fit in one stack resolver. - - - - - 3545d3dd by Alec Theriault at 2019-01-31T01:37:25-08:00 Use `.hie` files for the Hyperlinker backend (#977) # Summary This is a large architectural change to the Hyperlinker. * extract link (and now also type) information from `.hie` instead of doing ad-hoc SYB traversals of the `RenamedSource`. Also adds a superb type-on-hover feature (#715). * re-engineer the lexer to avoid needless string conversions. By going directly through GHC's `P` monad and taking bytestring slices, we avoid a ton of allocation and have better handling of position pragmas and CPP. In terms of performance, the Haddock side of things has gotten _much_ more efficient. Unfortunately, much of this is cancelled out by the increased GHC workload for generating `.hie` files. For the full set of boot libs (including `ghc`-the-library) * the sum of total time went down by 9-10% overall * the sum of total allocations went down by 6-7% # Motivation Haddock is moving towards working entirely over `.hi` and `.hie` files. This change means we no longer need the `RenamedSource` from `TypecheckedModule` (something which is _not_ in `.hi` files). # Details Along the way a bunch of things were fixed: * Cross package (and other) links are now more reliable (#496) * The lexer tries to recover from errors on every line (instead of at CPP boundaries) * `LINE`/`COLUMN` pragmas are taken into account * filter out zero length tokens before rendering * avoid recomputing the `ModuleName`-based `SrcMap` * remove the last use of `Documentation.Haddock.Utf8` (see haskell/haddock#998) * restructure temporary folder logic for `.hi`/`.hie` model - - - - - 2ded3359 by Herbert Valerio Riedel at 2019-02-02T12:06:12+01:00 Update/modernise haddock-library.cabal file - - - - - 62b93451 by Herbert Valerio Riedel at 2019-02-02T12:19:31+01:00 Tentatively declare support for unreleased base-4.13/ghc-8.8 - - - - - 6041e767 by Herbert Valerio Riedel at 2019-02-02T16:04:32+01:00 Normalise LICENSE text w/ cabal's BSD2 template Also, correct the `.cabal` files to advertise `BSD2` instead of the incorrect `BSD3` license. - - - - - 0b459d7f by Alec Theriault at 2019-02-02T18:06:12-08:00 CI: fetch GHC from validate artifact Should help make CI be less broken - - - - - 6b5c07cf by Alec Theriault at 2019-02-02T18:06:12-08:00 Fix some Hyperlinker test suite fallout * Amend `ParserSpec` to match new Hyperlinker API - pass in compiler info - strip out null tokens * Make `hypsrc-test` pass reliably - strip out `local-*` ids - strip out `line-*` ids from the `ClangCppBug` test - re-accept output - - - - - ded34791 by Nathan Collins at 2019-02-02T18:31:23-08:00 Update README instructions for Stack No need to `stack install` Haddock to test it. Indeed, `stack install` changes the `haddock` on user's `PATH` if `~/.local/bin` is on user's `PATH` which may not be desirable when hacking on Haddock. - - - - - 723298c9 by Alec Theriault at 2019-02-03T09:11:05-08:00 Remove `Documentation.Haddock.Utf8` The circumstances under which this module appeared are completely gone. The Hyperlinker backend no longer needs this module (it uses the more efficient `Encoding` module from `ghc`). Why no deprecation? Because this module really shouldn't exist! - It isn't used in `haddock-library`/`haddock-api` anymore - It was copy pasted directly from `utf8-string` - Folks seeking a boot-lib only solution can use `ghc`'s `Encoding` - - - - - 51050006 by Alec Theriault at 2019-02-03T22:58:58-08:00 Miscellaneous improvements to `Convert` (#1020) Now that Haddock is moving towards working entirely over `.hi` and `.hie` files, all declarations and types are going to be synthesized via the `Convert` module. In preparation for this change, here are a bunch of fixes to this module: * Add kind annotations to type variables in `forall`'s whose kind is not `Type`, unless the kind can be inferred from some later use of the variable. See `implicitForAll` and `noKindTyVars` in particular if you wish to dive into this. * Properly detect `HsQualTy` in `synifyType`. This is done by following suit with what GHC's `toIfaceTypeX` does and checking the first argument of `FunTy{} :: Type` to see if it classified as a given/wanted in the typechecker (see `isPredTy`). * Beef up the logic around figuring out when an explicit `forall` is needed. This includes: observing if any of the type variables will need kind signatures, if the inferred type variable order _without_ a forall will still match the one GHC claims, and some other small things. * Add some (not yet used) functionality for default levity polymorphic type signatures. This functionality similar to `fprint-explicit-runtime-reps`. Couple other smaller fixes only worth mentioning: * Show the family result signature only when it isn't `Type` * Fix rendering of implicit parameters in the LaTeX and Hoogle backends * Better handling of the return kind of polykinded H98 data declarations * Class decls produced by `tyThingToLHsDecl` now contain associated type defaults and default method signatures when appropriate * Filter out more `forall`'s in pattern synonyms - - - - - 841980c4 by Oleg Grenrus at 2019-02-04T08:44:25-08:00 Make a fixture of weird parsing of lists (#997) The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature. - - - - - 7315c0c8 by Ryan Scott at 2019-02-04T12:17:56-08:00 Fix haskell/haddock#1015 with dataConUserTyVars (#1022) The central trick in this patch is to use `dataConUserTyVars` instead of `univ_tvs ++ ex_tvs`, which displays the foralls in a GADT constructor in a way that's more faithful to how the user originally wrote it. Fixes haskell/haddock#1015. - - - - - ee0b49a3 by Ryan Scott at 2019-02-04T15:25:17-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. - - - - - 1c850dc8 by Alan Zimmerman at 2019-02-05T21:54:18+02:00 Matching changes in GHC for haskell/haddock#16236 - - - - - ab03c38e by Simon Marlow at 2019-02-06T08:07:33+00:00 Merge pull request haskell/haddock#1014 from hvr/pr/bsd2-normalise Normalise LICENSE text w/ cabal's BSD2 template - - - - - 5a92ccae by Alec Theriault at 2019-02-10T06:21:55-05:00 Merge remote-tracking branch 'gitlab/wip/T16236-2' into ghc-head - - - - - c0485a1d by Alec Theriault at 2019-02-10T03:32:52-08:00 Removes `haddock-test`s dependency on `xml`/`xhtml` (#1027) This means that `html-test`, `latex-test`, `hoogle-test`, and `hypsrc-test` now only depend on GHC boot libs. So we should now be able to build and run these as part of GHC's testsuite. \o/ The reference output has changed very slightly, in three ways: * we don't convert quotes back into `&quot;` as the `xml` lib did * we don't add extra `&nbsp;` as the `xml` lib did * we now remove the entire footer `div` (instead of just emptying it) - - - - - 65a448e3 by Alec Theriault at 2019-02-11T12:27:41-05:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - 360ca937 by Alec Theriault at 2019-02-13T11:36:11-05:00 Clean up logic for guessing `-B` and `--lib` (#1026) Haddock built with the `in-ghc-tree` flag tries harder to find the GHC lib folder and its own resources. This should make it possible to use `in-ghc-tree`-built Haddock without having to specify the `-B` and `--lib` options (just how you can use in-tree GHC without always specifying the `-B` option). The logic to do this relies on `getExecutablePath`, so we only get this auto-detection on platforms where this function works. - - - - - d583e364 by Alec Theriault at 2019-02-16T10:41:22-05:00 Fix tests broken by GHC Changes in 19626218566ea709b5f6f287d3c296b0c4021de2 affected some of the hyperlinker output. Accepted the new output (hovering over a `..` now shows you what that wildcard binds). Also fixed some stray deprecation warnings. - - - - - da0c42cc by Vladislav Zavialov at 2019-02-17T11:39:19+03:00 Parser changes to match !380 - - - - - ab96bed7 by Ryan Scott at 2019-02-18T04:44:08-05:00 Bump ghc version to 8.9 - - - - - 44b7c714 by Alec Theriault at 2019-02-22T05:49:43-08:00 Match GHC changes for T16185 `FunTy` now has an `AnonArgFlag` that indicates whether the arrow is a `t1 => t2` or `t1 -> t2`. This commit shouldn't change any functionality in Haddock. - - - - - 2ee653b1 by Alec Theriault at 2019-02-24T18:53:33-08:00 Update .travis.yml Points to the new GHC CI artifact. - - - - - 90939d71 by Alec Theriault at 2019-02-25T00:42:41-08:00 Support value/type namespaces on identifier links Identifier links can be prefixed with a 'v' or 't' to indicate the value or type namespace of the desired identifier. For example: -- | Some link to a value: v'Data.Functor.Identity' -- -- Some link to a type: t'Data.Functor.Identity' The default is still the type (with a warning about the ambiguity) - - - - - d6ed496c by Alec Theriault at 2019-02-25T00:42:46-08:00 Better identifier parsing * '(<|>)' and '`elem`' now get parsed and rendered properly as links * 'DbModule'/'DbUnitId' now properly get split apart into two links * tuple names now get parsed properly * some more small niceties... The identifier parsing code is more precise and more efficient (although to be fair: it is also longer and in its own module). On the rendering side, we need to pipe through information about backticks/parens/neither all the way through from renaming to the backends. In terms of impact: a total of 35 modules in the entirety of the bootlib + ghc lib docs change. The only "regression" is things like '\0'. These should be changed to @\\0@ (the path by which this previously worked seems accidental). - - - - - 3c3b404c by Alec Theriault at 2019-02-25T22:12:11-08:00 Fix standalone deriving docs Docs on standalone deriving decls for classes with associated types should be associated with the class instance, not the associated type instance. Fixes haskell/haddock#1033 - - - - - d51ef69e by Alec Theriault at 2019-02-26T19:14:59-08:00 Fix bogus identifier defaulting This avoids a situation in which an identifier would get defaulted to a completely different identifier. Prior to this commit, the 'Bug1035' test case would hyperlink 'Foo' into 'Bar'! Fixes haskell/haddock#1035. - - - - - 88cbbdc7 by Ryan Scott at 2019-02-27T10:14:03-05:00 Visible dependent quantification (#16326) changes - - - - - 0dcf6cee by Xia Li-yao at 2019-02-27T21:53:27-05:00 Menu item controlling which instances are expanded/collapsed (#1007) Adds a menu item (like "Quick Jump") for options related to displaying instances. This provides functionality for: * expanding/collapsing all instances on the currently opened page * controlling whether instances are expanded/collapsed by default * controlling whether the state of instances should be "remembered" This new functionality is implemented in Typescript in `details-helper`. The built-in-themes style switcher also got a revamp so that all three of QuickJump, the style switcher, and instance preferences now have the same style and implementation structure. See also: https://mail.haskell.org/pipermail/haskell-cafe/2019-January/130495.html Fixes haskell/haddock#698. Co-authored-by: Lysxia <lysxia at gmail.com> Co-authored-by: Nathan Collins <conathan at galois.com> - - - - - 3828c0fb by Alec Theriault at 2019-02-28T12:42:49-05:00 `--show-interface` should output to stdout. (#1040) Fixes haskell/haddock#864. - - - - - a50f4cda by gbaz at 2019-03-01T07:43:16-08:00 Increase contrast of Linuwal theme (#1037) This is to address the concern that, on less nice and older screens, some of the shades of grey blend in too easily with the white background. * darken the font slightly * darken slightly the grey behind type signatures and such * add a border and round the corners on code blocks * knock the font down by one point - - - - - ab4d41de by Alec Theriault at 2019-03-03T09:23:26-08:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 12f509eb by Ben Gamari at 2019-03-04T22:13:20-05:00 Remove reference to Opt_SplitObjs flag Split-objects has been removed. - - - - - 5b3e4c9a by Ryan Scott at 2019-03-06T19:16:24-05:00 Update html-test output to reflect haskell/haddock#16391 changes - - - - - fc228af1 by Alec Theriault at 2019-03-09T08:29:23-08:00 Match changes for "Stop inferring over-polymorphic kinds" The `hsq_ext` field of `HsQTvs` is now just the implicit variables (instead of also including information about which of these variables are dependent). This commit shouldn't change any functionality in Haddock. - - - - - 6ac109eb by Alec Theriault at 2019-03-09T11:22:55-08:00 Add .hi, .dyn_hi, etc files to .gitignore Fixes haskell/haddock#1030. - - - - - b55f0c05 by Alec Theriault at 2019-03-09T11:22:55-08:00 Better support for default methods in classes * default methods now get rendered differently * default associated types get rendered * fix a forgotten `s/TypeSig/ClassOpSig/` refactor in LaTeX backend * LaTeX backend now renders default method signatures NB: there is still no way to document default class members and the NB: LaTeX backend still crashes on associated types - - - - - 10aea0cf by Alec Theriault at 2019-03-09T11:22:55-08:00 Avoid multi-line `emph` in LaTeX backend `markupWarning` often processes inputs which span across paragraphs. Unfortunately, LaTeX's `emph` is not made to handle this (and will crash). Fixes haskell/haddock#936. - - - - - d22dc2c9 by Alec Theriault at 2019-03-09T11:22:55-08:00 Many LaTeX backend fixes After this commit, we can run with `--latex` on all boot libraries without crashing (although the generated LaTeX still fails to compile in a handful of larger packages like `ghc` and `base`). * Add newlines after all block elements in LaTeX. This is important to prevent the final output from being more an more indented. See the `latext-test/src/Example` test case for a sample of this. * Support associated types in class declarations (but not yet defaults) * Several small issues for producing compiling LaTeX; - avoid empy `\haddockbeginargs` lists (ex: `type family Any`) - properly escape identifiers depending on context (ex: `Int#`) - add `vbox` around `itemize`/`enumerate` (so they can be in tables) * Several spacing fixes: - limit the width of `Pretty`-arranged monospaced code - cut out extra space characters in export lists - only escape spaces if there are _multiple_ spaces - allow type signatures to be multiline (even without docs) * Remove uninteresting and repetitive `main.tex`/`haddock.sty` files from `latex-test` test reference output. Fixes haskell/haddock#935, haskell/haddock#929 (LaTeX docs for `text` build & compile) Fixes haskell/haddock#727, haskell/haddock#930 (I think both are really about type families...) - - - - - 0e6cee00 by Alec Theriault at 2019-03-29T12:11:56-07:00 Remove workaround for now-fixed Clang CPP bug (#1028) Before LLVM 6.0.1 (or 10.0 on Apple LLVM), there was a bug where lines that started with an octothorpe but turned out not to lex like pragmas would have an extra line added after them. Since this bug has been fixed upstream and that it doesn't have dire consequences anyways, the workaround is not really worth it anymore - we can just tell people to update their clang version (or re-structure their pragma code). - - - - - ce05434d by Alan Zimmerman at 2019-03-29T12:12:11-07:00 Matching changes in GHC for haskell/haddock#16236 (cherry picked from commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576) - - - - - d85766b2 by Ben Gamari at 2019-03-29T12:14:04-07:00 Bump GHC to 8.8 - - - - - 5a82cbaf by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Redo ParseModuleHeader - - - - - b9033348 by Oleg Grenrus at 2019-05-05T13:02:00-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - bb55c8f4 by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove outdated `.ghci` files and `scripts` The `.ghci` files are actively annoying when trying to `cabal v2-repl`. As for the `scripts`, the distribution workflow is completely different. - - - - - 5ee244dc by Alec Theriault at 2019-05-13T16:10:07-07:00 Remove obsolete arcanist files + STYLE Now that GHC is hosted on Gitlab, the arcanist files don't make sense anymore. The STYLE file contains nothing more than a dead link too. - - - - - d07c1928 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Redo ParseModuleHeader - - - - - 492762d2 by Oleg Grenrus at 2019-05-13T16:41:43-07:00 Comment C, which clarifies why e.g. ReadP is not enough - - - - - af2ac773 by Ryan Scott at 2019-05-14T17:22:13-04:00 Changes for haskell/haddock#16110/#16356 - - - - - 6820ed0d by Alec Theriault at 2019-05-17T08:51:27-07:00 Unbreak haskell/haddock#1004 test case `fail` is no longer part of `Monad`. - - - - - 6bf7be98 by Alec Theriault at 2019-05-17T08:51:27-07:00 Fix haskell/haddock#1063 with better parenthesization logic for contexts The only other change in html/hoogle/hyperlinker output for the boot libraries that this caused is a fix to some Hoogle output for implicit params. ``` $ diff -r _build/docs/ old_docs diff -r _build/docs/html/libraries/base/base.txt old_docs/html/libraries/base/base.txt 13296c13296 < assertError :: (?callStack :: CallStack) => Bool -> a -> a --- > assertError :: ?callStack :: CallStack => Bool -> a -> a ``` - - - - - b5716b61 by Ryan Scott at 2019-05-22T17:24:32-04:00 Match changes with haskell/haddock#14332 - - - - - c115abf6 by Alec Theriault at 2019-05-26T16:01:58-04:00 Remove Haddock's dependency on `Cabal` At this point, Haddock depended on Cabal-the-library solely for a verbosity parser (which misleadingly accepts all sorts of verbosity options that Haddock never uses). Now, the only dependency on Cabal is for `haddock-test` (which uses Cabal to locate the Haddock interface files of a couple boot libraries). - - - - - e5b2d4a3 by Alec Theriault at 2019-05-26T16:16:25-04:00 Regression test: promoted lists in associated types When possible, associated types with promoted lists should use the promoted list literal syntax (instead of repeated applications of ': and '[]). This was fixed in 2122de5473fd5b434af690ff9ccb1a2e58491f8c. Closes haskell/haddock#466, - - - - - cc5ad5d3 by Alec Theriault at 2019-05-26T17:55:54-04:00 Merge branch 'ghc-8.6' into ghc-8.8 - - - - - 4b3301a6 by Alec Theriault at 2019-05-26T17:57:52-04:00 Release haddock-2.23, haddock-library-1.8.0 Tentatively adjust bounds and changelogs for the release to be bundled with GHC 8.8.1. - - - - - 69c7cfce by Matthew Pickering at 2019-05-30T10:54:27+01:00 Update hyperlinker tests for new types in .hie files - - - - - 29b7e738 by Zubin Duggal at 2019-05-30T10:57:51+01:00 update for new way to store hiefile headers - - - - - aeca5d5f by Zubin Duggal at 2019-06-04T18:57:42-04:00 update for new way to store hiefile headers - - - - - ba2ca518 by Ben Gamari at 2019-06-07T23:11:14+00:00 Update test output for introduction of Safe-Inferred - - - - - 3a975a6c by Ryan Scott at 2019-07-03T12:06:27-04:00 Changes for haskell/haddock#15247 - - - - - 0df46555 by Zubin Duggal at 2019-07-22T10:52:50+01:00 Fix haddockHypsrcTest - - - - - 2688686b by Sylvain Henry at 2019-09-12T23:19:39+02:00 Fix for GHC module renaming - - - - - 9ec0f3fc by Alec Theriault at 2019-09-20T03:21:00-04:00 Fix Travis CI, loosen .cabal bounds (#1089) Tentatively for the 2.23 release: * updated Travis CI to work again * tweaked bounds in the `.cabal` files * adjusted `extra-source-files` to properly identify test files - - - - - ca559beb by Matthías Páll Gissurarson at 2019-09-28T12:14:40-04:00 Small change in to facilitate extended typed-holes (#1090) This change has no functional effect on haddock itself, it just changes one pattern to use `_ (` rather than `_(`, so that we may use `_(` as a token for extended typed-holes later. - - - - - 02e28976 by Vladislav Zavialov at 2019-09-28T12:17:45-04:00 Remove spaces around @-patterns (#1093) This is needed to compile `haddock` when [GHC Proposal haskell/haddock#229](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0229-whitespace-bang-patterns.rst) is implemented. - - - - - 83cbbf55 by Alexis King at 2019-09-30T21:12:42-04:00 Fix the ignore-exports option (#1082) The `ignore-exports` option has been broken since haskell/haddock#688, as mentioned in https://github.com/haskell/haddock/pull/766#issue-172505043. This PR fixes it. - - - - - e127e0ab by Ben Gamari at 2019-10-06T15:12:06-04:00 Fix a few haddock issues - - - - - 3a0f5c89 by Zubin Duggal at 2019-10-07T17:56:13-04:00 Fix crash when there are no srcspans in the file due to CPP - - - - - 339c5ff8 by Alec Theriault at 2019-10-07T17:56:13-04:00 Prefer un-hyperlinked sources to no sources It is possible to fail to extract an HIE ast. This is however not a reason to produce _no_ output - we should still make a colorized HTML page. - - - - - d47ef478 by Alec Theriault at 2019-10-07T17:56:13-04:00 Add a regression test for haskell/haddock#1091 Previously, this input would crash Haddock. - - - - - ed7c8b0f by Alec Theriault at 2019-10-07T20:56:48-04:00 Add Hyperlinker test cases for TH-related stuff Hopefully this will guard against regressions around quasiquotes, TH quotes, and TH splices. - - - - - d00436ab by Andreas Klebinger at 2019-10-21T15:53:03+02:00 Refactor for withTiming changes. - - - - - 4230e712 by Ben Gamari at 2019-10-22T09:36:37-04:00 Merge pull request haskell/haddock#1101 from AndreasPK/withTimingRefactor Refactor for withTiming changes. - - - - - d155c5f4 by Ryan Scott at 2019-10-23T10:37:17-04:00 Reify oversaturated data family instances correctly (#1103) This fixes haskell/haddock#1103 by adapting the corresponding patch for GHC (see https://gitlab.haskell.org/ghc/ghc/issues/17296 and https://gitlab.haskell.org/ghc/ghc/merge_requests/1877). - - - - - 331a5adf by Sebastian Graf at 2019-10-25T17:14:40+02:00 Refactor for OutputableBndrId changes - - - - - 48a490e0 by Ben Gamari at 2019-10-27T10:16:16-04:00 Merge pull request haskell/haddock#1105 from sgraf812/wip/flexible-outputable Refactor for OutputableBndrId changes - - - - - f62a7dfc by Sebastian Graf at 2019-11-01T11:54:16+00:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - d9b242ed by Ryan Scott at 2019-11-03T13:20:03-05:00 Changes from haskell/haddock#14579 We now have a top-level `tyConAppNeedsKindSig` function, which means that we can delete lots of code in `Convert`. (cherry picked from commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70) - - - - - dfd42406 by Sebastian Graf at 2019-11-04T07:02:14-05:00 Define `XRec` for location information and get rid of `HasSrcSpan` In https://gitlab.haskell.org/ghc/ghc/merge_requests/1970 I propose a simpler way to encode location information into the GHC and Haddock AST while incurring no cost for e.g. TH which doesn't need location information. These are just changes that have to happen in lock step. - - - - - 0b15be7c by Ben Gamari at 2019-11-09T13:21:33-05:00 Import isRuntimeRepVar from Type rather than TyCoRep isRuntimeRepVar is not longer exported from TyCoRep due to ghc#17441. - - - - - 091f7283 by Ben Gamari at 2019-11-10T12:47:06-05:00 Bump to GHC 8.10 - - - - - e88c71f2 by Ben Gamari at 2019-11-14T00:22:24-05:00 Merge pull request haskell/haddock#1110 from haskell/wip/T17441 Import isRuntimeRepVar from Type rather than TyCoRep - - - - - 4e0bbc17 by Ben Gamari at 2019-11-14T00:22:45-05:00 Version bumps for GHC 8.11 - - - - - 0e85ceb4 by Ben Gamari at 2019-11-15T11:59:45-05:00 Bump to GHC 8.10 - - - - - 00d6d68b by Ben Gamari at 2019-11-16T18:35:58-05:00 Bump ghc version to 8.11 - - - - - dde1fc3f by Ben Gamari at 2019-11-16T20:40:37-05:00 Drop support for base 4.13 - - - - - f52e331d by Vladislav Zavialov at 2019-11-24T13:02:28+03:00 Update Hyperlinker.Parser.classify to use ITdollar - - - - - 1ad96198 by Vladislav Zavialov at 2019-11-28T16:12:33+03:00 Remove HasSrcSpan (#17494) - - - - - 651afd70 by Herbert Valerio Riedel at 2019-12-08T12:08:16+01:00 Document error-prone conditional definition of instances This can easily trip up people if one isn't aware of it. Usually it's better to avoid this kind of conditionality especially for typeclasses for which there's an compat-package as conditional instances like these tend to fragment the ecosystem into those packages that go the extra mile to provide backward compat via those compat-packages and those that fail to do so. - - - - - b521af56 by Herbert Valerio Riedel at 2019-12-08T12:09:54+01:00 Fix build-failure regression for base < 4.7 The `$>` operator definition is available only since base-4.7 which unfortunately wasn't caught before release to Hackage (but has been fixed up by a metadata-revision) This commit introduces a `CompatPrelude` module which allows to reduce the amount of CPP by ousting it to a central location, i.e. the new `CompatPrelude` module. This pattern also tends to reduce the tricks needed to silence unused import warnings. Addresses haskell/haddock#1119 - - - - - 556c375d by Sylvain Henry at 2020-01-02T19:01:55+01:00 Fix after Iface modules renaming - - - - - bd6c53e5 by Sylvain Henry at 2020-01-07T00:48:48+01:00 hsyl20-modules-renamer - - - - - fb23713b by Ryan Scott at 2020-01-08T07:41:13-05:00 Changes for GHC#17608 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2372 - - - - - 4a4dd382 by Ryan Scott at 2020-01-25T08:08:26-05:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - e782a44d by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename PackageConfig into UnitInfo - - - - - ba3c9f05 by Sylvain Henry at 2020-01-26T02:12:37+01:00 Rename lookupPackage - - - - - ab37f9b3 by Ben Gamari at 2020-01-29T13:00:44-05:00 Merge pull request haskell/haddock#1125 from haskell/wip/T17566-take-two Changes for GHC#17566 - - - - - 3ebd5ae0 by Ryan Scott at 2020-01-31T05:56:50-05:00 Merge branch 'wip-hsyl20-package-refactor' into ghc-head - - - - - 602a747e by Richard Eisenberg at 2020-02-04T09:05:43+00:00 Echo GHC's removal of PlaceHolder module This goes with GHC's !2083. - - - - - ccfe5679 by Sylvain Henry at 2020-02-10T10:13:56+01:00 Module hierarchy: runtime (cf haskell/haddock#13009) - - - - - 554914ce by Cale Gibbard at 2020-02-10T16:10:39-05:00 Fix build of haddock in stage1 We have to use the correct version of the GHC API, but the version of the compiler itself doesn't matter. - - - - - 5b6fa2a7 by John Ericson at 2020-02-10T16:18:07-05:00 Noramlize `tested-with` fields in cabal files - - - - - e6eb3ebe by Vladislav Zavialov at 2020-02-16T13:25:26+03:00 No MonadFail/Alternative for P - - - - - 90e181f7 by Ben Gamari at 2020-02-18T14:13:47-05:00 Merge pull request haskell/haddock#1129 from obsidiansystems/wip/fix-stage1-build Fix build of haddock in stage1 - - - - - 93b64636 by Sylvain Henry at 2020-02-19T11:20:27+01:00 Modules: Driver (#13009) - - - - - da4f6c7b by Vladislav Zavialov at 2020-02-22T15:33:02+03:00 Use RealSrcSpan in InstMap - - - - - 479b1b50 by Ben Gamari at 2020-02-23T10:28:13-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 55ecacf0 by Sylvain Henry at 2020-02-25T15:18:27+01:00 Modules: Core (#13009) - - - - - 60867b3b by Vladislav Zavialov at 2020-02-28T15:53:52+03:00 Ignore the BufLoc/BufSpan added in GHC's !2516 - - - - - 1e5506d3 by Sylvain Henry at 2020-03-02T12:32:43+01:00 Modules: Core (#13009) - - - - - 6fb53177 by Richard Eisenberg at 2020-03-09T14:49:40+00:00 Changes in GHC's !1913. - - - - - 30b792ea by Ben Gamari at 2020-03-16T12:45:02-04:00 Merge pull request haskell/haddock#1130 from hsyl20/wip/hsyl20-modules-core2 Modules: Core (#13009) - - - - - cd761ffa by Sylvain Henry at 2020-03-18T15:24:00+01:00 Modules: Types - - - - - b6646486 by Ben Gamari at 2020-03-18T14:42:43-04:00 Merge pull request haskell/haddock#1133 from hsyl20/wip/hsyl20/modules/types Modules: Types - - - - - 9325d734 by Kleidukos at 2020-03-19T12:38:31-04:00 Replace the 'caption' class so that the collapsible sections are shown - - - - - 5e2bb555 by Kleidukos at 2020-03-19T12:38:31-04:00 Force ghc-8.8.3 - - - - - c6fcd0aa by Kleidukos at 2020-03-19T12:38:31-04:00 Update test fixtures - - - - - 5c849cb1 by Sylvain Henry at 2020-03-20T09:34:39+01:00 Modules: Types - - - - - 7f439155 by Alec Theriault at 2020-03-20T20:17:01-04:00 Merge branch 'ghc-8.8' into ghc-8.10 - - - - - b7904e5c by Alina Banerjee at 2020-03-20T20:24:17-04:00 Update parsing to strip whitespace from table cells (#1074) * Update parsing to strip leading & trailing whitespace from table cells * Update fixture data to disallow whitespaces at both ends in table cells * Add test case for whitespaces stripped from both ends of table cells * Update table reference test data for html tests - - - - - b9d60a59 by Alec Theriault at 2020-03-22T11:46:42-04:00 Clean up warnings * unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal` - - - - - 0c317dbe by Alec Theriault at 2020-03-22T18:46:54-04:00 Fix NPM security warnings This was done by calling `npm audit fix`. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. - - - - - 6e306242 by Alec Theriault at 2020-03-22T20:10:52-04:00 Tentative 2.24 release Adjusted changelogs and versions in `.cabal` files in preparation for the upcoming release bundled with GHC 8.10. - - - - - 1bfb4645 by Ben Gamari at 2020-03-23T16:40:54-04:00 Merge commit '3c2944c037263b426c4fe60a3424c27b852ea71c' into HEAD More changes from the GHC types module refactoring. - - - - - be8c6f3d by Alec Theriault at 2020-03-26T20:10:53-04:00 Update `.travis.yml` to work with GHC 8.10.1 * Regenerated the Travis file with `haskell-ci` * Beef up `.cabal` files with more `tested-with` information - - - - - b025a9c6 by Alec Theriault at 2020-03-26T20:10:53-04:00 Update README Removed some out of date links/info, added some more useful links. * badge to Hackage * update old trac link * `ghc-head` => `ghc-8.10` * `cabal new-*` is now `cabal v2-*` and it should Just Work * `--test-option='--accept'` is the way to accept testsuite output - - - - - 564d889a by Alec Theriault at 2020-03-27T20:34:33-04:00 Fix crash in `haddock-library` on unicode space Our quickcheck tests for `haddock-library` stumbled across an edge case input that was causing Haddock to crash: it was a unicode space character. The root cause of the crash is that we were implicitly assuming that if a space character was not " \t\f\v\r", it would have to be "\n". We fix this by instead defining horizontal space as: any space character that is not '\n'. Fixes haskell/haddock#1142 - - - - - 2d360ba1 by Alec Theriault at 2020-03-27T21:57:32-04:00 Disallow qualified uses of reserved identifiers This a GHC bug (https://gitlab.haskell.org/ghc/ghc/issues/14109) too, but it is a relatively easy fix in Haddock. Note that the fix must live in `haddock-api` instead of `haddock-library` because we can only really decide if an identifier is a reserved one by asking the GHC lexer. Fixes haskell/haddock#952 - - - - - 47ae22ed by Alec Theriault at 2020-03-28T13:36:25-04:00 Remove unused `Haddock.Utils` functions * removed functions in `Haddock.Utils` that were not used anywhere (or exported from the `haddock-api` package) * moved GHC-specific utils from `Haddock.Utils` to `Haddock.GhcUtils` - - - - - c0291245 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use TTG empty extensions to remove some `error`'s None of these error cases should ever have been reachable, so this is just a matter of leveraging the type system to assert this. * Use the `NoExtCon` and `noExtCon` to handle case matches for no extension constructors, instead of throwing an `error`. * Use the extension field of `HsSpliceTy` to ensure that this variant of `HsType` cannot exist in an `HsType DocNameI`. - - - - - 0aff8dc4 by Alec Theriault at 2020-03-28T13:36:25-04:00 Use `unLoc`/`noLoc` from GHC instead of `unL`/`reL` * `unL` is already defined by GHC as `unLoc` * `reL` is already defined by GHC as `noLoc` (in a safer way too!) * Condense `setOutputDir` and add a about exporting from GHC Fixes haskell/haddock#978 - - - - - bf6f2fb7 by Alec Theriault at 2020-03-28T13:36:25-04:00 Cleanup up GHC flags in `.cabal` files * enable more useful warning flags in `haddock-api`, handle the new warnings generated * remove `-fwarn-tabs` (now we'd use `-Wtabs`, but this has been in `-Wall` for a while now) - - - - - c576fbf1 by Alec Theriault at 2020-03-28T13:36:25-04:00 `haddock-library` document header level Document the fact the header level is going to always be between 1 and 6 inclusive. Along the way, I also optimized the parsing code a bit. - - - - - 71bce0ee by Alec Theriault at 2020-03-28T14:26:27-04:00 Disallow links in section headers This is quite straightforward to implement, since we already had a function `docToHtmlNoAnchors` (which we used to generate the link in the sidebar "Contents"). This breaks test `Bug387`, but that test case has aged badly: we now automatically generate anchors for all headings, so manually adding an anchor in a section makes no sense. Nested anchors are, as pointed out in haskell/haddock#1054, disallowed by the HTML standard. Fixes haskell/haddock#1054 - - - - - b461b0ed by Sylvain Henry at 2020-03-30T10:34:23+02:00 Modules: type checker - - - - - cd8cd1ee by Ben Gamari at 2020-03-31T12:45:02-04:00 Merge pull request haskell/haddock#1152 from hsyl20/wip/hsyl20/modules/tc Module renaming - - - - - 5e8f8ea7 by Felix Yan at 2020-04-01T17:58:06-07:00 Allow QuickCheck 2.14 Builds fine and all tests pass. - - - - - dc6b1633 by Sylvain Henry at 2020-04-05T16:43:44+02:00 Module renaming: amend previous patch - - - - - eee2f4ae by Ryan Scott at 2020-04-05T09:04:43-07:00 Fix haskell/haddock#1050 by filtering out invisible AppTy arguments This makes the `synifyType` case for `AppTy` more intelligent by taking into consideration the visibilities of each `AppTy` argument and filtering out any invisible arguments, as they aren't intended to be displayed in the source code. (See haskell/haddock#1050 for an example of what can happen if you fail to filter these out.) Along the way, I noticed that a special `synifyType` case for `AppTy t1 (CoercionTy {})` could be consolidated with the case below it, so I took the opportunity to tidy this up. - - - - - 23eb99e8 by Ben Gamari at 2020-04-07T11:19:58-04:00 Merge pull request haskell/haddock#1154 from hsyl20/wip/hsyl20/modules/tc Module renaming: amend previous patch - - - - - 072d994d by Ryan Scott at 2020-04-07T19:32:47-04:00 Make NoExtCon fields strict These changes are a part of a fix for [GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992). - - - - - d8ebf6c8 by Ignat Insarov at 2020-04-09T21:15:01-04:00 Recode Doc to Json. (#1159) * Recode Doc to Json. * More descriptive field labels. - - - - - 52df4b4e by Sylvain Henry at 2020-04-10T12:39:18+02:00 Module renaming - - - - - d9ab8ec8 by Cale Gibbard at 2020-04-14T11:43:34-04:00 Add instance of XCollectPat for DocNameI - - - - - 323d221d by Cale Gibbard at 2020-04-14T11:43:34-04:00 Rename XCollectPat -> CollectPass - - - - - 2df80867 by Alec Theriault at 2020-04-15T07:30:51-07:00 Prune docstrings that are never rendered When first creating a Haddock interface, trim `ifaceDocMap` and `ifaceArgMap` to not include docstrings that can never appear in the final output. Besides checking with GHC which names are exported, we also need to keep all the docs attached to instance declarations (it is much tougher to detect when an instance is fully private). This change means: * slightly smaller interface files (7% reduction on boot libs) * slightly less work to do processing docstrings that aren't used * no warnings in Haddock's output about private docstrings (see haskell/haddock#1070) I've tested manually that this does not affect any of the boot library generated docs (the only change in output was some small re-ordering in a handful of instance lists). This should mean no docstrings have been incorrectly dropped. - - - - - f49c90cc by Alec Theriault at 2020-04-15T07:30:51-07:00 Don't warn about missing links in miminal sigs When renaming the Haddock interface, never emit warnings when renaming a minimal signature. Also added some documention around `renameInterface`. Minimal signatures intentionally include references to potentially un-exported methods (see the discussion in haskell/haddock#330), so it is expected that they will not always have a link destination. On the principle that warnings should always be resolvable, this shouldn't produce a warning. See haskell/haddock#1070. - - - - - a9eda64d by Ben Gamari at 2020-04-17T09:27:35-04:00 Merge pull request haskell/haddock#1160 from hsyl20/wip/hsyl20/modules/systools Module renaming - - - - - f40d7879 by Cale Gibbard at 2020-04-20T11:30:38-04:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ttg-con-pat - - - - - a50e7753 by Ben Gamari at 2020-04-20T11:36:10-04:00 Merge pull request haskell/haddock#1165 from obsidiansystems/wip/ttg-con-pat Trees that Grow refactor (GHC !2553) - - - - - 6a24795c by Alec Theriault at 2020-04-21T08:06:45-07:00 Fallback to `hiDecl` when `extractDecl` fails Sometimes, the declaration being exported is a subdecl (for instance, a record accessor getting exported at the top-level). For these cases, Haddock has to find a way to produce some synthetic sensible top-level declaration. This is done with `extractDecl`. As is shown by haskell/haddock#1067, this is sometimes impossible to do just at a syntactic level (for instance when the subdecl is re-exported). In these cases, the only sensible thing to do is to try to reify a declaration based on a GHC `TyThing` via `hiDecl`. - - - - - eee1a8b7 by Sylvain Henry at 2020-04-24T15:46:05+02:00 Module structure - - - - - 50b9259c by Iñaki at 2020-04-25T18:38:11-04:00 Add support for custom section anchors (#1179) This allows to have stable anchors for groups, even if the set of groups in the documentation is altered. The syntax for setting the anchor of a group is -- * Group name #desiredAnchor# Which will produce an html anchor of the form '#g:desiredAnchor' Co-authored-by: Iñaki García Etxebarria <git at inaki.blueleaf.cc> - - - - - 4003c97a by Ben Gamari at 2020-04-26T09:35:15-04:00 Merge pull request haskell/haddock#1166 from hsyl20/wip/hsyl20/modules/utils Module structure - - - - - 5206ab60 by Sylvain Henry at 2020-04-27T16:47:39+02:00 Renamed UnitInfo fields - - - - - c32c333b by Sylvain Henry at 2020-04-27T17:32:58+02:00 UnitId has been renamed into Unit - - - - - 3e87db64 by Sylvain Henry at 2020-04-27T17:36:00+02:00 Fix for GHC.Unit.* modules - - - - - ae3323a7 by Ben Gamari at 2020-04-29T12:36:37-04:00 Merge pull request haskell/haddock#1183 from hsyl20/wip/hsyl20/unitid Refactoring of Unit code - - - - - b105564a by Artem Pelenitsyn at 2020-05-03T08:14:10+01:00 add dependency on exceptions because GHC.Exception was boiled down (ghc haskell/haddock#18075) - - - - - 9857eff3 by Zubin Duggal at 2020-05-04T18:48:25+01:00 Atomic update of NameCache in readHieFile - - - - - 86bbb226 by Sylvain Henry at 2020-05-14T16:36:27+02:00 Fix after Config module renaming - - - - - a4bbdbc2 by Gert-Jan Bottu at 2020-05-15T22:09:44+02:00 Explicit Specificity Support for Haddock - - - - - 46199daf by Ben Gamari at 2020-05-19T09:59:56-04:00 Merge pull request haskell/haddock#1192 from hsyl20/hsyl20/modules-config Fix after Config module renaming - - - - - f9a9d2ba by Gert-Jan Bottu at 2020-05-20T16:48:38-04:00 Explicit Specificity Support for Haddock - - - - - 55c5b7ea by Ben Gamari at 2020-05-21T00:32:02-04:00 Merge commit 'a8d7e66da4dcc3b242103271875261604be42d6e' into ghc-head - - - - - a566557f by Cale Gibbard at 2020-05-21T16:02:06-04:00 isBootSummary now produces a result of type IsBootInterface - - - - - ea52f905 by Zubin Duggal at 2020-05-24T17:55:48+01:00 update for hiefile-typeclass-info - - - - - 49ba7a67 by Willem Van Onsem at 2020-05-25T12:23:01-04:00 Use floor over round to calculate the percentage (#1195) If we compile documentation where only a small fraction is undocumented, it is misleading to see 100% coverage - 99% is more intuitive. Fixes haskell/haddock#1194 - - - - - c025ebf1 by Ben Gamari at 2020-05-29T14:32:42-04:00 Merge pull request haskell/haddock#1185 from obsidiansystems/boot-disambig isBootSummary now produces a result of type IsBootInterface - - - - - 74ab9415 by Ben Gamari at 2020-05-29T20:23:39-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - b40be944 by Ben Gamari at 2020-06-03T17:02:31-04:00 testsuite: Update expected output for simplified subsumption - - - - - 624be71c by Ryan Scott at 2020-06-05T12:43:23-04:00 Changes for GHC#18191 See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3337. - - - - - fbd8f7ce by Sylvain Henry at 2020-06-08T15:31:47+02:00 Fix after unit refactoring - - - - - 743fda4d by Ben Gamari at 2020-06-09T12:09:58-04:00 Merge pull request haskell/haddock#1202 from hsyl20/wip/hsyl20/unitid-ii Fix after unit refactoring - - - - - d07a06a9 by Ryan Scott at 2020-06-13T07:16:55-04:00 Use HsForAllTelescope (GHC#18235) - - - - - 389bb60d by Ben Gamari at 2020-06-13T15:30:52-04:00 haddock: Bounds bumps for GHC 8.12 - - - - - 7a377f5f by Ben Gamari at 2020-06-17T14:53:16-04:00 Merge pull request haskell/haddock#1199 from bgamari/wip/ghc-8.12 haddock: Bounds bumps for GHC 8.12 - - - - - 9fd9e586 by Krzysztof Gogolewski at 2020-06-17T16:09:07-04:00 Adapt Haddock to LinearTypes See ghc/ghc!852. - - - - - 46fe7636 by Ben Gamari at 2020-06-18T14:20:02-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - 35a3c9e2 by Zubin Duggal at 2020-06-21T21:19:18+05:30 Use functions exported from HsToCore - - - - - 8abe3928 by Ben Gamari at 2020-06-24T13:53:39-04:00 Merge pull request haskell/haddock#1204 from wz1000/wip/haddock-hstocore Use functions exported from GHC.HsToCore.Docs - - - - - 22f2c937 by Matthías Páll Gissurarson at 2020-06-26T19:07:03+02:00 Adapt Haddock for QualifiedDo - - - - - 3f6208d7 by Vladislav Zavialov at 2020-06-28T14:28:16+03:00 Handle LexicalNegation's ITprefixminus - - - - - 03a19f41 by Sylvain Henry at 2020-07-02T09:37:38+02:00 Rename hsctarget into backend - - - - - ea17ff23 by Andreas Klebinger at 2020-07-02T17:44:18+02:00 Update for UniqFM changes. - - - - - 9872f2f3 by Ben Gamari at 2020-07-09T10:39:19-04:00 Merge pull request haskell/haddock#1209 from AndreasPK/wip/typed_uniqfm Update for UniqFM changes. - - - - - 68f7b668 by Krzysztof Gogolewski at 2020-07-12T18:16:57+02:00 Sync with GHC removing {-# CORE #-} pragma See ghc ticket haskell/haddock#18048 - - - - - eb372681 by Sylvain Henry at 2020-07-20T11:41:30+02:00 Rename hscTarget into backend - - - - - fb7f78bf by Ben Gamari at 2020-07-21T12:15:25-04:00 Merge pull request haskell/haddock#1214 from hsyl20/wip/hsyl20/hadrian/ncg Rename hscTarget into backend - - - - - 1e8f5b56 by Ben Gamari at 2020-07-23T09:11:50-04:00 Merge commit '904dce0cafe0a241dd3ef355775db47fc12f434d' into ghc-head - - - - - d8fd1775 by Zubin Duggal at 2020-07-23T18:46:40+05:30 Update for modular ping pong - - - - - 8416f872 by Ben Gamari at 2020-07-23T09:35:03-04:00 Merge pull request haskell/haddock#1200 from wz1000/wip/wz1000-modular-ping-pong Modular ping pong - - - - - a24a8577 by Ben Gamari at 2020-07-28T15:23:36-04:00 Bump GHC version to 9.0 - - - - - 6a51c9dd by Sylvain Henry at 2020-08-05T18:47:05+02:00 Fix after Outputable refactoring - - - - - c05e1c99 by Ben Gamari at 2020-08-10T14:41:41-04:00 Merge pull request haskell/haddock#1223 from hsyl20/wip/hsyl20/dynflags/exception Fix after Outputable refactoring - - - - - d964f15b by Sylvain Henry at 2020-08-12T11:58:49+02:00 Fix after HomeUnit - - - - - 8e6d5b23 by Ben Gamari at 2020-08-12T14:25:30-04:00 Merge pull request haskell/haddock#1225 from hsyl20/wip/hsyl20/plugins/homeunit Fix after HomeUnit - - - - - 8c7880fe by Sylvain Henry at 2020-08-17T14:13:29+02:00 Remove Ord FastString instance - - - - - 8ea410db by Alex Biehl at 2020-08-19T10:56:32+02:00 Another round of `npm audit fix` (#1228) This should shut down the warnings on Github. Note that the security issues seem to have been entirely in the build dependencies, since the output JS has not changed. Last NPM dependency audit happend in d576b2327e2bc117f912fe0a9d595e9ae62614e0 Co-authored-by: Alex Biehl <alex.biehl at target.com> - - - - - 7af6e2a8 by Ben Gamari at 2020-08-31T13:59:34-04:00 Merge pull request haskell/haddock#1226 from hsyl20/wip/hsyl20/fs_ord Remove Ord FastString instance - - - - - ffbc8702 by Alan Zimmerman at 2020-09-07T21:47:41+01:00 Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - a93f1268 by Alan Zimmerman at 2020-09-07T23:11:38+01:00 Merge pull request haskell/haddock#1232 from haskell/wip/T18639-remove-generated-pragma, Match GHC for haskell/haddock#18639, remove GENERATED pragma - - - - - 1f605d50 by Ben Gamari at 2020-09-14T18:30:01-04:00 Bump GHC version to 9.1 - - - - - 6599df62 by Vladislav Zavialov at 2020-09-18T14:05:15+03:00 Bump base upper bound to 4.16 - - - - - a01b3c43 by Ben Gamari at 2020-09-22T15:41:48-04:00 Update hypsrc-test for QuickLook This appears to be a spurious change. - - - - - e9cc6cac by Vladislav Zavialov at 2020-09-26T21:00:12+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 30e3ca7c by Sylvain Henry at 2020-09-29T11:18:32-04:00 Update for parser (#1234) - - - - - b172f3e3 by Vladislav Zavialov at 2020-09-30T01:01:30+03:00 Updates for the new linear types syntax: a %p -> b - - - - - 0b9c08d3 by Sylvain Henry at 2020-09-30T11:02:33+02:00 Adapt to GHC parser changes - - - - - b9540b7a by Sylvain Henry at 2020-10-12T09:13:38-04:00 Don't pass the HomeUnitId (#1239) - - - - - 34762e80 by HaskellMouse at 2020-10-13T12:58:04+03:00 Changed tests due to unification of `Nat` and `Natural` in the follwing merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3583 - - - - - 256f86b6 by Vladislav Zavialov at 2020-10-15T10:48:03+03:00 Add whitespace in: map ($ v) - - - - - 4a3f711b by Alan Zimmerman at 2020-10-19T08:57:27+01:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled - - - - - 072cdd21 by Alan Zimmerman at 2020-10-21T14:48:28-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 9e09a445 by Alan Zimmerman at 2020-10-21T23:53:34-04:00 Match GHC, adding IsUnicodeSyntax field to HsFunTy and HsScaled (cherry picked from commit a7d1d8e034d25612d5d08ed8fdbf6f472aded4a1) - - - - - 636d7de3 by Sylvain Henry at 2020-10-26T14:31:54-04:00 GHC.Driver.Types refactoring (#1242) - - - - - a597f000 by Ryan Scott at 2020-10-29T04:18:05-04:00 Adapt to the removal of Hs{Boxed,Constraint}Tuple See ghc/ghc!4097 and GHC#18723. - - - - - b96660fb by Ryan Scott at 2020-10-30T04:53:05-04:00 Adapt to HsConDecl{H98,GADT}Details split Needed for GHC#18844. - - - - - c287d82c by Ryan Scott at 2020-10-30T19:35:59-04:00 Adapt to HsOuterTyVarBndrs These changes accompany ghc/ghc!4107, which aims to be a fix for haskell/haddock#16762. - - - - - a34c31a1 by Ryan Scott at 2020-11-13T13:38:34-05:00 Adapt to splitPiTysInvisible being renamed to splitInvisPiTys This is a part of !4434, a fix for GHC#18939. - - - - - 66ea459d by Sylvain Henry at 2020-11-16T10:59:30+01:00 Fix after Plugins moved into HscEnv - - - - - 508556d8 by Ben Gamari at 2020-11-18T15:47:40-05:00 Merge pull request haskell/haddock#1253 from hsyl20/wip/hsyl20/plugins/hscenv Fix after Plugins moved into HscEnv - - - - - 620fec1a by Andreas Klebinger at 2020-11-24T20:51:59+01:00 Update for changes in GHC's Pretty - - - - - 01cc13ab by Richard Eisenberg at 2020-11-25T23:18:35-05:00 Avoid GHC#18932. - - - - - 8d29ba21 by Cale Gibbard at 2020-11-25T23:18:35-05:00 Add type arguments to PrefixCon - - - - - 414d5f87 by Sylvain Henry at 2020-11-30T17:06:04+01:00 DynFlags's unit fields moved to HscEnv - - - - - e356668c by Ben Gamari at 2020-11-30T11:11:37-05:00 Merge pull request haskell/haddock#1258 from hsyl20/wip/hsyl20/hscenv/unitstate Unit fields moved from DynFlags to HscEnv - - - - - 7cf552f1 by Ben Gamari at 2020-12-03T10:31:27-05:00 Merge pull request haskell/haddock#1257 from AndreasPK/wip/andreask/opt_dumps Update for changes in GHC's Pretty - - - - - fc0871c3 by Veronika Romashkina at 2020-12-08T16:35:33+01:00 Fix docs links from Darcs to GitHub in intro (#1262) - - - - - 7059e808 by Veronika Romashkina at 2020-12-08T16:36:16+01:00 Use gender neutral word in docs (#1260) - - - - - 1b16e5ee by Maximilian Tagher at 2020-12-08T16:40:03+01:00 Allow scrolling search results (#1235) Closes https://github.com/haskell/haddock/issues/1231 - - - - - 8a118c01 by dependabot[bot] at 2020-12-08T16:40:25+01:00 Bump bl from 1.2.2 to 1.2.3 in /haddock-api/resources/html (#1255) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - c89ff587 by Xia Li-yao at 2020-12-08T16:42:17+01:00 Allow more characters in anchor following module reference (#1220) - - - - - 14af7d64 by Xia Li-yao at 2020-12-08T16:43:05+01:00 Add dangling changes from branches ghc-8.6 and ghc-8.8 (#1243) * Fix multiple typos and inconsistencies in doc/markup.rst Note: I noticed some overlap with haskell/haddock#1112 from @wygulmage and haskell/haddock#1081 from @parsonsmatt after creating these proposed changes - mea culpa for not looking at the open PRs sooner. * Fix haskell/haddock#1113 If no Signatures, no section of index.html * Change the formatting of missing link destinations The current formatting of the missing link destination does not really help user to understand the reasons of the missing link. To address this, I've changed the formatting in two ways: - the missing link symbol name is now fully qualified. This way you immediately know which haskell module cannot be linked. It is then easier to understand why this module does not have documentation (hidden module or broken documentation). - one line per missing link, that's more readable now that symbol name can be longer due to qualification. For example, before haddock was listing missing symbol such as: ``` could not find link destinations for: Word8 Word16 mapMaybe ``` Now it is listed as: ``` could not find link destinations for: - Data.Word.Word8 - Data.Word.Word16 - Data.Maybe.mapMaybe ``` * Add `--ignore-link-symbol` command line argument This argument can be used multiples time. A missing link to a symbol listed by `--ignore-link-symbol` won't trigger "missing link" warning. * Forbid spaces in anchors (#1148) * Improve error messages with context information (#1060) Co-authored-by: Matt Audesse <matt at mattaudesse.com> Co-authored-by: Mike Pilgrem <mpilgrem at users.noreply.github.com> Co-authored-by: Guillaume Bouchard <guillaume.bouchard at tweag.io> Co-authored-by: Pepe Iborra <pepeiborra at gmail.com> - - - - - 89e3af13 by tomjaguarpaw at 2020-12-08T18:00:04+01:00 Enable two warnings (#1245) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - c3320f8d by Willem Van Onsem at 2020-12-08T18:26:55+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 685df308 by Alex Biehl at 2020-12-08T20:06:26+01:00 Changes for GHC#17566 See https://gitlab.haskell.org/ghc/ghc/merge_requests/2469 - - - - - be3ec3c0 by Alex Biehl at 2020-12-08T20:06:26+01:00 Import intercalate - - - - - 32c33912 by Matthías Páll Gissurarson at 2020-12-08T21:15:30+01:00 Adapt Haddock for QualifiedDo - - - - - 31696088 by Alex Biehl at 2020-12-08T22:06:02+01:00 Fix haddock-library tests - - - - - fbc0998a by Alex Biehl at 2020-12-08T23:08:23+01:00 Move to GitHub CI (#1266) * Initial version of ci.yml This is a straight copy from Dmitrii Kovanikov's blog post at https://kodimensional.dev/github-actions. Will adapt to haddock in successive commits. * Delete .travis.yml * Modify to only test on ghc-8.10.{1,2} * Use actions/setup-haskell at v1.1.4 * Relax QuickCheck bound on haddock-api * Remove stack matrix for now * Nail down to ghc-8.10 branch for now * Pin index state to 2020-12-08T20:13:44Z for now * Disable macOS and Windows tests for now for speed up - - - - - 5b946b9a by tomjaguarpaw at 2020-12-10T19:01:41+01:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - bc5a408f by dependabot[bot] at 2020-12-10T19:02:16+01:00 Bump ini from 1.3.5 to 1.3.7 in /haddock-api/resources/html (#1269) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - d02995f1 by Andrew Martin at 2020-12-14T16:48:40-05:00 Update for boxed rep - - - - - a381aeff by Ben Gamari at 2020-12-15T15:13:30-05:00 Revert "Enable two warnings (#1245) (#1268)" As this does not build on GHC `master`. This reverts commit 7936692badfe38f23ae95b51fb7bd7c2ff7e9bce. - - - - - a63c0a9e by Ben Gamari at 2020-12-15T15:17:59-05:00 Revert "Update for boxed rep" This reverts commit 4ffb30d8b637ccebecc81ce610f0af451ac8088d. - - - - - 53bfbb29 by Ben Gamari at 2020-12-15T15:37:24-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - bae76a30 by Ben Gamari at 2020-12-16T02:44:42+00:00 Update output for nullary TyConApp optimisation (ghc/ghc!2952) - - - - - 4b733b57 by Krzysztof Gogolewski at 2020-12-16T20:03:14+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. - - - - - ee463bd3 by Ryan Scott at 2020-12-16T16:55:23-05:00 Adapt to HsCoreTy (formerly NewHsTypeX) becoming a type synonym Needed for !4417, the fix for GHC#15706 and GHC#18914. - - - - - ed0b02f8 by tomjaguarpaw at 2020-12-19T10:17:19+00:00 Enable two warnings (#1245) (#1268) because they will be soon be added to -Wall. See https://gitlab.haskell.org/ghc/ghc/-/issues/15656 - - - - - d80bf8f5 by Sylvain Henry at 2020-12-21T10:09:25+01:00 Fix after binder collect changes - - - - - bf4c9d32 by Adam Gundry at 2020-12-23T21:35:01+00:00 Adapt to changes to GlobalRdrElt and AvailInfo Needed for ghc/ghc!4467 - - - - - 37736c4c by John Ericson at 2020-12-28T12:27:02-05:00 Support a new ghc --make node type for parallel backpack upsweep - - - - - 717bdeac by Vladislav Zavialov at 2020-12-29T10:50:02+03:00 Inline and fix getGADTConTypeG The getGADTConTypeG used HsRecTy, which is at odds with GHC issue haskell/haddock#18782. I noticed that getGADTConTypeG was only used in the Hoogle backend. Interestingly, when handling H98 constructors, Hoogle converts RecCon to PrefixCon (see Haddock.Backends.Hoogle.ppCtor). So I changed getGADTConTypeG to handle RecConGADT in the same manner as PrefixConGADT, and after this simplification moved it into the 'where' clause of ppCtor, to the only place where it is used. The practical effect of this change is as follows. Consider this example: data TestH98 = T98 { bar::Int } data TestGADT where TG :: { foo :: Int } -> TestGADT Before this patch, haddock --hoogle used to produce: T98 :: Int -> TestH98 [TG] :: {foo :: Int} -> TestGADT Notice how the record syntax was discarded in T98 but not TG. With this patch, we always produce signatures without record syntax: T98 :: Int -> TestH98 [TG] :: Int -> TestGADT I suspect this might also be a bugfix, as currently Hoogle doesn't seem to render GADT record constructors properly. - - - - - cb1b8c56 by Andreas Abel at 2020-12-30T21:12:37+01:00 Build instructions: haddock-library and -api first! - - - - - b947f6ad by Ben Gamari at 2020-12-31T13:04:19-05:00 Merge pull request haskell/haddock#1281 from obsidiansystems/wip/backpack-j Changes to support -j with backpack - - - - - 120e1cfd by Hécate Moonlight at 2021-01-04T19:54:58+01:00 Merge pull request haskell/haddock#1282 from andreasabel/master Build instructions: haddock-library and -api first! - - - - - fd45e41a by Ben Gamari at 2021-01-05T16:14:31-05:00 Merge remote-tracking branch 'origin/ghc-8.10' into ghc-9.0 - - - - - b471bdec by Ben Gamari at 2021-01-05T16:23:02-05:00 Merge commit '1e56f63c3197e7ca1c1e506e083c2bad25d08793' into ghc-9.0 - - - - - 81cdbc41 by Alex Biehl at 2021-01-09T12:14:41+01:00 Prepare Haddock for being a GHC Plugin - - - - - b646d952 by Alex Biehl at 2021-01-09T12:14:41+01:00 Make Haddock a GHC Plugin - - - - - cc044674 by Alex Biehl at 2021-01-09T12:14:41+01:00 Add -j[n] CLI param to Haddock executable It translates to `--ghcopt=-j[n]` - - - - - 84a04073 by Alex Biehl at 2021-01-09T12:14:41+01:00 Abstract Monad for interface creation I found that when running as a plugin the lookupName function (which runs in Ghc monad) does not work correctly from the typeCheckResultAction hook. Instead, we abstracted the monad used when creating interfaces, so that access to GHC session specific parts is explicit and so that the TcM can provide their (correct) implementation of lookupName. - - - - - 5be2c4f7 by Alex Biehl at 2021-01-09T12:14:41+01:00 Accept tests - - - - - 8cefee9d by Alex Biehl at 2021-01-09T16:10:47+01:00 Add missing dependency for mtl - - - - - 3681f919 by Ben Gamari at 2021-01-13T18:39:25-05:00 Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head - - - - - 33c6b152 by Hécate Moonlight at 2021-01-14T16:04:20+01:00 Merge pull request haskell/haddock#1273 from hsyl20/wip/hsyl20/arrows Fix after binder collect changes - - - - - 70d13e8e by Joachim Breitner at 2021-01-22T19:03:45+01:00 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) - - - - - 7d6dd57a by John Ericson at 2021-01-22T22:02:02+00:00 Add `NoGhcTc` instance now that it's not closed - - - - - e5fdaf0a by Alan Zimmerman at 2021-01-23T22:57:44+00:00 Merge pull request haskell/haddock#1293 from obsidiansystems/wip/fix-18936 Add `NoGhcTc` instance now that it's not closed - - - - - 989a1e05 by Oleg Grenrus at 2021-01-24T16:11:46+03:00 Add import list to Data.List - - - - - 368e144a by Ben Gamari at 2021-01-28T22:15:48+01:00 Adapt to "Make PatSyn immutable" - - - - - abe66c21 by Alfredo Di Napoli at 2021-02-01T08:05:35+01:00 Rename pprLogErrMsg to new name - - - - - e600e75c by Hécate Moonlight at 2021-02-05T14:53:00+01:00 Move CI to ghc-9.0 - - - - - dd492961 by Vladislav Zavialov at 2021-02-05T14:53:00+01:00 Update cabal.project and README build instructions - - - - - 31bd292a by Hécate Moonlight at 2021-02-05T15:03:56+01:00 Merge pull request haskell/haddock#1296 from Kleidukos/ghc-9.0 Merge the late additions to ghc-8.10 into ghc-9.0 - - - - - 6388989e by Vladislav Zavialov at 2021-02-05T17:41:57+03:00 Cleanup: fix build warnings - - - - - f99407ef by Daniel Rogozin at 2021-02-05T18:11:48+03:00 type level characters support for haddock (required for haskell/haddock#11342) - - - - - d8c6b26f by Hécate Moonlight at 2021-02-05T17:44:50+01:00 Add a CONTRIBUTING.md file - - - - - 6a01ad98 by Hécate Moonlight at 2021-02-05T17:58:16+01:00 Merge pull request haskell/haddock#1312 from Kleidukos/proper-branch-etiquette Add a CONTRIBUTING.md file - - - - - 955eecc4 by Vladislav Zavialov at 2021-02-05T20:29:00+03:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into ghc-head - - - - - 47b3d6ab by Hécate Moonlight at 2021-02-05T19:09:38+01:00 Amend the CONTRIBUTING.md file - - - - - 23de6137 by Hécate Moonlight at 2021-02-05T19:16:49+01:00 Merge pull request haskell/haddock#1313 from Kleidukos/amend-contributing Amend the CONTRIBUTING.md file - - - - - 69026b59 by Krzysztof Gogolewski at 2021-02-05T23:05:56+01:00 Display linear/multiplicity arrows correctly (#1238) Previously we were ignoring multiplicity and displayed a %1 -> b as a -> b. (cherry picked from commit b4b4d896d2d68d6c48e7db7bfe95c185ca0709cb) - - - - - ea026b78 by Oleg Grenrus at 2021-02-06T17:14:45+01:00 Add import list to Data.List - - - - - 5204326f by Hécate Moonlight at 2021-02-06T17:15:44+01:00 Merge pull request haskell/haddock#1316 from Kleidukos/explicit-imports-to-data-list Add import list to Data.List - - - - - 1f4d2136 by Ben Gamari at 2021-02-06T11:53:31-05:00 Merge remote-tracking branch 'origin/ghc-head' into wip/ghc-head-merge - - - - - 13f0d09a by Ben Gamari at 2021-02-06T11:53:45-05:00 Fix partial record selector warning - - - - - 5c115f7e by Ben Gamari at 2021-02-06T11:55:52-05:00 Merge commit 'a917dfd29f3103b69378138477514cbfa38558a9' into wip/ghc-head-merge - - - - - b6fd8b75 by Ben Gamari at 2021-02-06T12:01:31-05:00 Merge commit '41964cb2fd54b5a10f8c0f28147015b7d5ad2c02' into wip/ghc-head-merge - - - - - a967194c by Ben Gamari at 2021-02-06T18:30:35-05:00 Merge branch 'wip/ghc-head-merge' into ghc-head - - - - - 1f4c3a91 by MorrowM at 2021-02-07T01:52:33+02:00 Fix search div not scrolling - - - - - 684b1287 by Iñaki García Etxebarria at 2021-02-07T16:13:04+01:00 Add support for labeled module references Support a markdown-style way of annotating module references. For instance -- | [label]("Module.Name#anchor") will create a link that points to the same place as the module reference "Module.Name#anchor" but the text displayed on the link will be "label". - - - - - bdb55a5d by Hécate Moonlight at 2021-02-07T16:18:10+01:00 Merge pull request haskell/haddock#1319 from alexbiehl/alex/compat Backward compat: Add support for labeled module references - - - - - 6ca70991 by Hécate Moonlight at 2021-02-07T16:21:29+01:00 Merge pull request haskell/haddock#1314 from tweag/show-linear-backport Backport haskell/haddock#1238 (linear types) to ghc-9.0 - - - - - d9d73298 by Alex Biehl at 2021-02-07T17:46:25+01:00 Remove dubious parseModLink Instead construct the ModLink value directly when parsing. - - - - - 33b4d020 by Hécate Moonlight at 2021-02-07T17:52:05+01:00 Merge pull request haskell/haddock#1320 from haskell/alex/fix Remove dubious parseModLink - - - - - 54211316 by Hécate Moonlight at 2021-02-07T18:12:07+01:00 Merge pull request haskell/haddock#1318 from MorrowM/ghc-9.0 Fix search div not scrolling - - - - - 19db679e by alexbiehl-gc at 2021-02-07T18:14:46+01:00 Merge pull request haskell/haddock#1317 from bgamari/wip/ghc-head-merge Merge ghc-8.10 into ghc-head - - - - - 6bc1e9e4 by Willem Van Onsem at 2021-02-07T18:25:30+01:00 simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - c8537cf8 by alexbiehl-gc at 2021-02-07T18:30:40+01:00 Merge pull request haskell/haddock#1322 from haskell/alex/forward-port simplify calculating percentages fixing haskell/haddock#1194 (#1236) - - - - - 2d47ae4e by alexbiehl-gc at 2021-02-07T18:39:59+01:00 Merge branch 'ghc-head' into ghc-9.0 - - - - - 849e4733 by Hécate Moonlight at 2021-02-07T18:43:19+01:00 Merge pull request haskell/haddock#1321 from Kleidukos/ghc-9.0 Merge ghc-9.0 into ghc-head - - - - - ee6095d7 by Sylvain Henry at 2021-02-08T11:36:38+01:00 Update for Logger - - - - - 4ad688c9 by Alex Biehl at 2021-02-08T18:11:24+01:00 Merge pull request haskell/haddock#1310 from hsyl20/wip/hsyl20/logger2 Logger refactoring - - - - - 922a9e0e by Ben Gamari at 2021-02-08T12:54:33-05:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - 991649d2 by Sylvain Henry at 2021-02-09T10:55:17+01:00 Fix to build with HEAD - - - - - a8348dc2 by Hécate Moonlight at 2021-02-09T10:58:51+01:00 Merge pull request haskell/haddock#1327 from hsyl20/wip/hsyl20/logger2 Fix to build with HEAD - - - - - 0abdbca6 by Fendor at 2021-02-09T20:06:15+01:00 Add UnitId to Target record - - - - - d5790a0e by Alex Biehl at 2021-02-11T10:32:32+01:00 Stable sort for (data/newtype) instances - - - - - 8e6036f5 by Alex Biehl at 2021-02-11T10:32:32+01:00 Also make TyLit deterministic - - - - - f76d2945 by Hécate Moonlight at 2021-02-11T11:00:31+01:00 Merge pull request haskell/haddock#1329 from hsyl20/hsyl20/stabe_iface Stable sort for instances - - - - - 5e0469ea by Oleg Grenrus at 2021-02-14T15:28:15+02:00 Add import list to Data.List in Haddock.Interface.Create - - - - - fa57cd24 by Hécate Moonlight at 2021-02-14T17:19:27+01:00 Merge pull request haskell/haddock#1331 from phadej/more-explicit-data-list-imports Add import list to Data.List in Haddock.Interface.Create - - - - - f0cd629c by Hécate Moonlight at 2021-02-21T00:22:01+01:00 Merge pull request haskell/haddock#1311 from fendor/wip/add-targetUnitId-to-target Add UnitId to Target record - - - - - 674ef723 by Joachim Breitner at 2021-02-22T10:39:18+01:00 html-test: Always set language from ghc-9.2 on, the “default” langauge of GHC is expected to change more wildly. To prepare for that (and unblock https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4853), this sets the language for all the test files to `Haskell2010`. This should insolate this test suite against changes to the default. Cherry-picked from https://github.com/haskell/haddock/pull/1341 - - - - - f072d623 by Hécate Moonlight at 2021-02-22T10:56:51+01:00 Merge pull request haskell/haddock#1342 from nomeata/joachim/haskell2010-in-tests-ghc-head html-test: Always set language - - - - - caebbfca by Hécate Moonlight at 2021-02-22T11:53:07+01:00 Clean-up of Interface and Interface.Create's imports and pragmata - - - - - f6caa89d by Hécate Moonlight at 2021-02-22T11:54:58+01:00 Merge pull request haskell/haddock#1345 from Kleidukos/head/fix-interface-imports [ghc-head] Clean-up of Interface and Interface.Create's imports and pragmata - - - - - 7395c9cb by Hécate Moonlight at 2021-02-22T18:44:57+01:00 Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 6e9fb5d5 by Hécate Moonlight at 2021-02-22T18:45:28+01:00 Merge pull request haskell/haddock#1348 from Kleidukos/head/explicit-imports-interface Explicit imports for Haddock.Interface and Haddock.Interface.Create - - - - - 9198b118 by Alan Zimmerman at 2021-02-22T20:04:24+00:00 Context becomes a Maybe in the GHC AST This prevents noLoc's appearing in the ParsedSource. Match the change in GHC. - - - - - 0af20f64 by Hécate Moonlight at 2021-02-23T12:36:12+01:00 Fix the call-site of guessTarget in Interface.hs Explicit the imports from GHC.HsToCore.Docs - - - - - b7886885 by Hécate Moonlight at 2021-02-23T12:37:54+01:00 Merge pull request haskell/haddock#1349 from Kleidukos/fix-interface-guesstarget-call Fix the call-site of guessTarget in Interface.hs - - - - - 9cf041ba by Sylvain Henry at 2021-02-24T11:08:20+01:00 Fix haddockHypsrcTest output in ghc-head - - - - - b194182a by Hécate Moonlight at 2021-02-24T11:12:36+01:00 Merge pull request haskell/haddock#1351 from hsyl20/wip/hsyl20/fix-head Fix haddockHypsrcTest output in ghc-head - - - - - 3ce8b375 by Shayne Fletcher at 2021-03-06T09:55:03-05:00 Add ITproj to parser - - - - - d2abf762 by Ben Gamari at 2021-03-06T19:26:49-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - a0f6047d by Andrew Martin at 2021-03-07T11:25:23-05:00 Update for boxed rep - - - - - 6f63c99e by Ben Gamari at 2021-03-10T13:20:21-05:00 Update for "FastString: Use FastMutInt instead of IORef Int" - - - - - e13f01df by Luke Lau at 2021-03-10T15:38:40-05:00 Implement template-haskell's putDoc This catches up to GHC using the new extractTHDocs function, which returns documentation added via the putDoc function (provided it was compiled with Opt_Haddock). Since it's already a map from names -> docs, there's no need to do traversal etc. It also matches the change from the argument map being made an IntMap rather than a Map Int - - - - - 89263d94 by Alan Zimmerman at 2021-03-15T17:15:26+00:00 Match changes in GHC AST for in-tree API Annotations As landed via https://gitlab.haskell.org/ghc/ghc/-/merge_requests/2418 - - - - - 28db1934 by Alan Zimmerman at 2021-03-15T20:40:09+00:00 Change some type family test results. It is not clear to me whether the original was printing incorrectly (since we did not have the TopLevel flag before now), or if this behaviour is expected. For the time being I am assuming the former. - - - - - 7c11c989 by Sylvain Henry at 2021-03-22T10:05:19+01:00 Fix after NameCache changes - - - - - addbde15 by Sylvain Henry at 2021-03-22T10:05:19+01:00 NameCache doesn't store a UniqSupply anymore - - - - - 15ec6cec by Ben Gamari at 2021-03-22T17:53:44-04:00 Bump GHC version to 9.2 - - - - - dbd6aa63 by Hécate Moonlight at 2021-03-24T14:28:36+01:00 Merge pull request haskell/haddock#1365 from hsyl20/wip/hsyl20/iface1 NameCache refactoring - - - - - 2d32da7e by Oleg Grenrus at 2021-03-27T01:12:00+02:00 Specialization of Data.List - - - - - 32b84fa6 by Fendor at 2021-03-27T10:50:17+01:00 Add UnitId to Target record This way we always know to which home-unit a given target belongs to. So far, there only exists a single home-unit at a time, but it enables having multiple home-units at the same time. - - - - - 54bf9f0e by Hécate Moonlight at 2021-03-28T14:08:35+02:00 Merge pull request haskell/haddock#1368 from fendor/target-unit-id-revert Add UnitId to Target record - - - - - 7dea168a by Alan Zimmerman at 2021-03-29T08:45:52+01:00 EPA : Rename ApiAnn to EpAnn - - - - - 72967f65 by Alfredo Di Napoli at 2021-03-29T09:47:01+02:00 pprError changed name in GHC - - - - - 4bc61035 by Alan Zimmerman at 2021-03-29T16:16:27-04:00 EPA : Rename ApiAnn to EpAnn - - - - - 108d031d by Ben Gamari at 2021-03-29T18:49:36-04:00 Merge commit '36418c4f70d7d2b179a77925b3ad5caedb08c9b5' into HEAD - - - - - 1444f700 by Ben Gamari at 2021-03-31T09:18:39-04:00 Merge pull request haskell/haddock#1370 from adinapoli/wip/adinapoli-diag-reason-severity Rename pprError to mkParserErr - - - - - d3087b79 by Ben Gamari at 2021-03-31T11:34:17-04:00 Merge commit 'd8d8024ad6796549a8d3b5512dabf3288d14e30f' into ghc-head - - - - - 170b79e9 by Ben Gamari at 2021-03-31T12:24:56-04:00 Merge remote-tracking branch 'upstream/ghc-head' into ghc-head - - - - - db0d6bae by Ben Gamari at 2021-04-10T09:34:35-04:00 Bump GHC version to 9.3 - - - - - a9f2c421 by Alan Zimmerman at 2021-04-19T18:26:46-04:00 Update for EPA changes in GHC (cherry picked from commit cafb48118f7c111020663776845897e225607b41) - - - - - 1ee4b7c7 by Sylvain Henry at 2021-05-11T10:00:06+02:00 Removal of HsVersions.h (#1388) * Update for EPA changes in GHC * Account for HsVersions.h removal Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - 79e819e9 by Hécate Moonlight at 2021-05-11T10:14:47+02:00 Revert "Removal of HsVersions.h (#1388)" This reverts commit 72118896464f94d81f10c52f5d9261efcacc57a6. - - - - - 3dbd3f8b by Alan Zimmerman at 2021-05-11T10:15:17+02:00 Update for EPA changes in GHC - - - - - 2ce80c17 by Sylvain Henry at 2021-05-11T10:15:19+02:00 Account for HsVersions.h removal - - - - - 00e4c918 by Christiaan Baaij at 2021-05-13T08:21:56+02:00 Add Haddock support for the OPAQUE pragma (#1380) - - - - - 8f9049b2 by Hécate Moonlight at 2021-05-13T08:40:22+02:00 fixup! Use GHC 9.2 in CI runner - - - - - 27ddec38 by Alan Zimmerman at 2021-05-13T22:51:20+01:00 EPA: match changes from GHC T19834 - - - - - f8a1d714 by Felix Yan at 2021-05-14T17:10:04+02:00 Allow hspec 2.8 (#1389) All tests are passing. - - - - - df44453b by Divam Narula at 2021-05-20T15:42:42+02:00 Update ref, the variables got renamed. (#1391) This is due to ghc/ghc!5555 which caused a change in ModDetails in case of NoBackend. Now the initModDetails is used to recreate the ModDetails from interface and in-memory ModDetails is not used. - - - - - e46bfc87 by Alan Zimmerman at 2021-05-20T19:05:09+01:00 Remove Maybe from HsQualTy Match changes in GHC for haskell/haddock#19845 - - - - - 79bd7b62 by Shayne Fletcher at 2021-05-22T08:20:39+10:00 FieldOcc: rename extFieldOcc to foExt - - - - - 6ed68c74 by Ben Gamari at 2021-05-21T22:29:30-04:00 Merge commit '3b6a8774bdb543dad59b2618458b07feab8a55e9' into ghc-head - - - - - f9a02d34 by Alfredo Di Napoli at 2021-05-24T13:53:00+02:00 New Parser diagnostics interface - - - - - 392807d0 by Ben Gamari at 2021-05-24T09:57:40-04:00 Merge pull request haskell/haddock#1394 from adinapoli/wip/adinapoli-align-ps-messages Align Haddock to use the new Parser diagnostics interface - - - - - 33023cd8 by Ben Gamari at 2021-05-24T11:19:16-04:00 Revert "Add Haddock support for the OPAQUE pragma (#1380)" This reverts commit a1337c599ef7720b0482a25c55f11794112496dc. The GHC patch associated with this change is not yet ready to be merged. - - - - - 8c005af7 by Ben Simms at 2021-05-28T07:56:20+02:00 CI configuration for ghc-head (#1395) - - - - - 1e947612 by Hécate Moonlight at 2021-05-28T12:27:35+02:00 Use GHC 9.2 in CI runner (#1378) - - - - - e6fa10ab by CGenie at 2021-05-31T09:02:13+02:00 Add page about common errors (#1396) * Update index.rst Common errors page * Create common-errors.rst * Update common-errors.rst * Use GHC 9.2 in CI runner (#1378) * [haddock-api] remove .hspec-failures Co-authored-by: Hécate Moonlight <Kleidukos at users.noreply.github.com> - - - - - abc72a8d by Sylvain Henry at 2021-06-01T10:02:06+02:00 Adapt Haddock to Logger and Parser changes (#1399) - - - - - 91373656 by Zubin Duggal at 2021-06-01T20:45:10+02:00 Update haddockHypSrc tests since we now compute slighly more type info (#1397) - - - - - ed712822 by Marcin Szamotulski at 2021-06-02T08:54:33+02:00 Added myself to contributors - - - - - 49fdbcb7 by Marcin Szamotulski at 2021-06-02T08:57:24+02:00 Document multi component support - - - - - 9ddc8d7d by Hécate Moonlight at 2021-06-02T09:35:55+02:00 Merge pull request haskell/haddock#1379 from coot/coot/document-multi-component-support Document multi component support - - - - - 585b5c5e by Ben Simms at 2021-06-02T19:46:54+02:00 Update CONTRIBUTING.md (#1402) - - - - - 1df4a605 by Ben Simms at 2021-06-02T19:47:14+02:00 Update CONTRIBUTING.md (#1403) - - - - - 58ea43d2 by sheaf at 2021-06-02T22:09:06+02:00 Update Haddock Bug873 to account for renaming - - - - - c5d0ab23 by Vladislav Zavialov at 2021-06-10T13:35:42+03:00 HsToken in FunTy, RecConGADT - - - - - 1ae2f40c by Hécate Moonlight at 2021-06-11T11:19:09+02:00 Update the CI badges - - - - - 6fdc4de2 by Sylvain Henry at 2021-06-28T19:21:17+02:00 Fix mkParserOpts (#1411) - - - - - 18201670 by Alfredo Di Napoli at 2021-07-05T07:55:12+02:00 Rename getErrorMessages Lexer import This commit renames the Lexer import in `Hyperlinker.Parser` from `getErrorMessages` to `getPsErrorMessages` to eliminate the ambiguity with the `getErrorMessages` function defined in `GHC.Types.Error`. - - - - - 23173ca3 by Ben Gamari at 2021-07-07T11:31:44-04:00 Merge pull request haskell/haddock#1413 from adinapoli/wip/adinapoli-issue-19920 Rename getErrorMessages Lexer import - - - - - b3dc4ed8 by Alan Zimmerman at 2021-07-28T22:30:59+01:00 EPA: match changes from GHC T19834 (cherry picked from commit 2fec1b44e0ee7e263286709aa528b4ecb99ac6c2) - - - - - 5f177278 by Ben Gamari at 2021-08-06T01:17:37-04:00 Merge commit '2a966c8ca37' into HEAD - - - - - cdd81d08 by Marcin Szamotulski at 2021-08-08T17:19:06+02:00 coot/multiple packages (ghc-9.2) (#1418) - - - - - be0d71f1 by Marcin Szamotulski at 2021-08-16T08:46:03+02:00 coot/multiple package (ghc-head) (#1419) * FromJSON class Aeson style FromJSON class with Parsec based json parser. * doc-index.json file for multiple packages When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files. * Render doc-index.json When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`. * base url option New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".". - - - - - 3b09dbdf by Hécate Moonlight at 2021-10-07T23:26:03+02:00 Update GHC 9.2 to latest pre-release in CI - - - - - 7ac55417 by Zubin Duggal at 2021-10-11T12:10:19+02:00 Enable Haddock tests in GHC windows CI (#1428) * testsuite: strip windows line endings for haddock * hyperlinker: Work around double escaping (#19236) * deterministic SCC - - - - - 1cb81f25 by Andrew Lelechenko at 2021-10-12T15:23:19+02:00 haddock-library does not depend on bytestring or transformers (#1426) - - - - - a890b9aa by sheaf at 2021-10-15T22:19:42+02:00 update haddockHypsrcTest for GHC MR !6705 (#1430) - - - - - 42a55c6c by Sylvain Henry at 2021-10-15T22:20:10+02:00 Fix after PkgQual refactoring (#1429) - - - - - 91659238 by Alan Zimmerman at 2021-10-28T18:57:10+01:00 Update for changes in GHC for branch wip/az/no-srcspan-anno-instances - - - - - acf23e60 by Vladislav Zavialov at 2021-11-05T02:09:47+03:00 Do not use forall as an identifier See GHC ticket haskell/haddock#20609 - - - - - c565db0e by Krzysztof Gogolewski at 2021-11-27T02:42:35+01:00 Update after NoExtCon -> DataConCantHappen rename - - - - - b5f55590 by Artem Pelenitsyn at 2021-11-27T11:14:17+01:00 fix CI for 9.2 (#1436) - - - - - 25cd621e by Matthew Pickering at 2021-12-02T11:46:54+00:00 Update html-test for Data.List revert - - - - - 1d5ff85f by malteneuss at 2021-12-15T07:56:55+01:00 Add hint about inline link issue (#1444) - - - - - 791fde81 by Sylvain Henry at 2021-12-16T09:29:51+01:00 Bump ghc-head (#1445) * Update after NoExtCon -> DataConCantHappen rename * Update html-test for Data.List revert * Fix for new Plugins datatype Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io> Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com> - - - - - 44236317 by Sylvain Henry at 2021-12-17T09:39:00+01:00 Fix for new Plugins datatype - - - - - 80ada0fa by Hécate Moonlight at 2021-12-17T17:28:48+01:00 Remove ghc-head workflow (#1446) Contributions of GHC glue code are now done on the GHC gitlab, not in the GitHub repo anymore. - - - - - 49e171cd by Matthew Pickering at 2021-12-28T09:47:09+00:00 Remove use of ExtendedModSummary - - - - - 0e91b5ea by askeblad at 2022-01-04T09:18:35+01:00 update URLs - - - - - 9f13c212 by Hécate Moonlight at 2022-02-25T10:19:46+01:00 Fix solver for GHC 9.2 - - - - - 386751a1 by Meng Weng Wong at 2022-02-25T19:19:11+01:00 IDoc link has bitrotted; replaced with web.archive.org cache. (#1454) - - - - - d877cbe6 by Hécate Moonlight at 2022-02-25T19:21:58+01:00 Fix haddock user guide (#1456) - - - - - cc47f036 by Andrew Lelechenko at 2022-03-04T17:29:36+01:00 Allow text-2.0 in haddock-library (#1459) - - - - - 7b3685a3 by malteneuss at 2022-03-07T19:27:24+01:00 Add multi-line style hint to style section (#1460) - - - - - c51088b8 by John Ericson at 2022-03-11T16:46:26+01:00 Fix CollectPass instance to match TTG refactor Companion to GHC !7614 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7614) - - - - - b882195b by Vladislav Zavialov at 2022-03-14T20:32:30+01:00 Link to (~) - - - - - 877349b8 by Christiaan Baaij at 2022-03-16T09:20:43+01:00 Add Haddock support for the OPAQUE pragma - - - - - 0ea22721 by askeblad at 2022-03-16T09:44:27+01:00 typos (#1464) - - - - - a6d13da1 by Matthew Pickering at 2022-03-22T13:41:17+00:00 Minimum changes needed for compilation with hi-haddock With hi-haddock, of course there is a much large refactoring of haddock which could be achieved but that is left for a future patch which can implemented at any time independently of GHC. - - - - - e7ac9129 by Matthew Pickering at 2022-03-22T21:17:50+00:00 Update test output - - - - - 6d916214 by Matthew Pickering at 2022-03-24T15:06:26+00:00 Merge branch 'wip/opaque_pragma' into 'ghc-head' Add Haddock support for the OPAQUE pragma See merge request ghc/haddock!2 - - - - - 42208183 by Steve Hart at 2022-03-25T20:43:50+01:00 Fix CI (#1467) * CI: Reinstall GHC with docs CI tests were failing because the GHC preinstalled to the CI environment does not include documentation, which is required for running the Haddock tests. This commit causes the CI workflow to reinstall GHC with docs so that tests can succeed. - - - - - 9676fd79 by Steve Hart at 2022-03-25T21:33:34+01:00 Make links in Synopsis functional again (#1458) Commit e41c1cbe9f0476997eac7b4a3f17cbc6b2262faf added a call to e.preventDefault() when handling click events that reach a toggle element. This prevents the browser from following hyperlinks within the Synopsis section when they are clicked by a user. This commit restores functioning hyperlinks within the Synopsis section by removing the call to e.preventDefault(), as it does not appear to be necessary, and removing it increases the flexibility of the details-helper code. - - - - - d1edd637 by sheaf at 2022-04-01T12:02:02+02:00 Keep track of promotion ticks in HsOpTy Keeping track of promotion ticks in HsOpTy allows us to properly pretty-print promoted constructors such as lists. - - - - - 9dcb2dfc by Jakob Brünker at 2022-04-01T15:46:22+00:00 Add support for \cases See merge request ghc/ghc!7873 - - - - - b0412ee5 by askeblad at 2022-04-06T17:47:57+02:00 spelling errors (#1471) - - - - - 6b18829b by Vladislav Zavialov at 2022-04-06T18:53:58+02:00 Rename [] to List - - - - - 2d046691 by Vladislav Zavialov at 2022-04-07T20:25:54+03:00 HsToken ConDeclGADT con_dcolon - - - - - 90b43da4 by Steve Hart at 2022-04-12T13:29:46+02:00 Parse Markdown links at beginning of line within a paragraph (#1470) * Catch Markdown links at beginning of line within paragraph Per Issue haskell/haddock#774, Markdown links were being parsed as ordinary text when they occurred at the beginning of a line other than the first line of the paragraph. This occurred because the parser was not interpreting a left square bracket as a special character that could delimit special markup. A space character was considered a special character, so, if a space occurred at the beginning of the new line, then the parser would interpret the space by itself and then continue parsing, thereby catching the Markdown link. '\n' was not treated as a special character, so the parser did not catch a Markdown link that may have followed. Note that this will allow for Markdown links that are not surrounded by spaces. For example, the following text includes a Markdown link that will be parsed: Hello, world[label](url) This is consistent with how the parser handles other types of markup. * Remove obsolete documentation hint Commit 6b9aeafddf20efc65d3725c16e3fc43a20aac343 should eliminate the need for the workaround suggested in the documentation. - - - - - 5b08312d by Hécate Moonlight at 2022-04-12T13:36:38+02:00 Force ghc-9.2 in the cabal.project - - - - - 0d0ea349 by dependabot[bot] at 2022-04-12T13:57:41+02:00 Bump path-parse from 1.0.5 to 1.0.7 in /haddock-api/resources/html (#1469) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 2b9fc65e by dependabot[bot] at 2022-04-12T13:57:54+02:00 Bump copy-props from 2.0.4 to 2.0.5 in /haddock-api/resources/html (#1468) Bumps [copy-props](https://github.com/gulpjs/copy-props) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/gulpjs/copy-props/releases) - [Changelog](https://github.com/gulpjs/copy-props/blob/master/CHANGELOG.md) - [Commits](https://github.com/gulpjs/copy-props/compare/2.0.4...2.0.5) --- updated-dependencies: - dependency-name: copy-props dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - ea98a6fb by Ben Gamari at 2022-04-23T22:54:37-04:00 Update for GHC 9.4 - - - - - 9e11864f by Ben Gamari at 2022-04-25T16:24:31-04:00 Merge remote-tracking branch 'upstream/ghc-9.2' into ghc-head - - - - - f83cc506 by Ben Gamari at 2022-04-25T17:00:25-04:00 Bump ghc version to 9.5 - - - - - e01c2e7d by Ben Gamari at 2022-04-28T16:19:04-04:00 Revert "Bump ghc-head (#1445)" This reverts commit b29a78ef6926101338f62e84f456dac8659dc9d2. This should not have been merged. - - - - - a2b5ee8c by Ben Gamari at 2022-04-28T16:19:24-04:00 Merge commit '2627a86c' into ghc-head - - - - - 0c6fe4f9 by Ben Gamari at 2022-04-29T10:05:54-04:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-9.4 - - - - - b6e5cb0a by Ben Gamari at 2022-04-29T11:46:06-04:00 Revert "HsToken ConDeclGADT con_dcolon" This reverts commit 24208496649a02d5f87373052c430ea4a97842c5. - - - - - 15a62888 by Ben Gamari at 2022-04-29T15:12:55-04:00 Bump base upper bound - - - - - 165b9031 by Ben Gamari at 2022-04-29T23:58:38-04:00 Update test output - - - - - e0c3e5da by Phil de Joux at 2022-05-02T14:46:38+02:00 Add hlint action .hlint.yaml with ignores & CPP. (#1475) - - - - - ead1158d by Raphael Das Gupta at 2022-05-02T14:46:48+02:00 fix grammar in docs: "can the" → "can be" (#1477) - - - - - cff97944 by Ben Gamari at 2022-05-02T18:38:56-04:00 Allow base-4.17 - - - - - e4ecb201 by Phil de Joux at 2022-05-03T13:14:55+02:00 Remove unused imports that GHC warned about. (#1480) - - - - - 222890b1 by Phil de Joux at 2022-05-03T13:15:46+02:00 Follow hlint suggestion to remove redundant bang. (#1479) - - - - - 058b671f by Phil de Joux at 2022-05-03T13:34:04+02:00 Follow hlint, remove language pragmas in libs. (#1478) - - - - - 0a645049 by Ben Simms at 2022-05-03T14:19:24+02:00 Keep track of ordered list indexes and render them (#1407) * Keep track of ordered list indexes and render them * Rename some identifiers to clarify - - - - - f0433304 by Norman Ramsey at 2022-05-04T15:13:34-04:00 update for changes in GHC API - - - - - 3740cf71 by Emily Martins at 2022-05-06T18:23:48+02:00 Add link to the readthedocs in cabal description to show on hackage. (cherry picked from commit 52e2d40d47295c02d3181aac0c53028e730f1e3b) - - - - - 5d754f1e by Hécate Moonlight at 2022-05-06T18:44:57+02:00 remove Bug873 - - - - - 968fc267 by Hécate Moonlight at 2022-05-06T18:48:28+02:00 Ignore "Use second" HLint suggestion. It increases laziness. - - - - - 02d14e97 by Jade Lovelace at 2022-05-07T17:42:08+02:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` - - - - - b22b87ed by Artem Pelenitsyn at 2022-05-08T16:19:47+02:00 fix parsing trailing quotes in backticked identifiers (#1408) (#1483) - - - - - 80ae107b by Alex Biehl at 2022-05-08T16:37:16+02:00 Fix "Defined by not used" error (cherry picked from commit 6e02a620a26c3a44f98675dd1b93b08070c36c0a) - - - - - 4c838e84 by Hécate Moonlight at 2022-05-08T16:37:16+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - fc9827b4 by Hécate Moonlight at 2022-05-08T16:40:40+02:00 Fix the changelog and bump the version of haddock-library on ghc-9.2 - - - - - b153b555 by Xia Li-yao at 2022-05-20T17:52:42+02:00 Hide synopsis from search when hidden (#1486) Fix haskell/haddock#1451 - - - - - f3e38b85 by Marcin Szamotulski at 2022-05-21T23:32:31+02:00 Allow to hide interfaces when rendering multiple components (#1487) This is useful when one wishes to `--gen-contents` when rendering multiple components, but one does not want to render all modules. This is in particular useful when adding base package. - - - - - f942863b by Marcin Szamotulski at 2022-05-24T08:29:59+02:00 Check if doc-index.json exists before reading it (#1488) - - - - - 31e92982 by Marcin Szamotulski at 2022-05-25T16:22:13+02:00 Version bump 2.26.1 (#1489) * Version bump 2.26.1 We extended format accepted by `--read-interface` option, which requires updating the minor version. * Update documentation of --read-interface option - - - - - 7cc873e0 by sheaf at 2022-05-25T16:42:31+02:00 Updated HaddockHypsrcTest output for record update changes (MR !7981) - - - - - cd196942 by Marcin Szamotulski at 2022-05-25T20:28:47+02:00 Use visibility to decide which interfaces are included in quickjump (#1490) This is also consistent with how html index is build. See haskell/cabal#7669 for rationale behind this decision. - - - - - 00c713c5 by Hécate Moonlight at 2022-05-26T17:09:15+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 2f3039f1 by Hécate Moonlight at 2022-05-26T17:10:59+02:00 Add code of conduct and hspec failure files in .gitignore - - - - - 63a5650c by romes at 2022-05-31T12:43:22+01:00 TTG: Match new GHC AST - - - - - dd7d1617 by romes at 2022-06-02T16:11:00+01:00 Update for IE changes in !8228 - - - - - c23aaab7 by cydparser at 2022-06-06T08:48:14+02:00 Fix and improve CI (#1495) * Pin GHC version before creating the freeze file * Use newest action versions * Improve caching * Avoid unnecessarily reinstalling GHC * Use GHC 9.2.2 for CI Co-authored-by: Cyd Wise <cwise at tripshot.com> - - - - - c156fa77 by Hécate Moonlight at 2022-06-06T11:59:35+02:00 Add Mergify configuration (#1496) - - - - - 2dba4188 by Hécate Moonlight at 2022-06-06T16:12:50+02:00 Bump haddock's version in cabal file to 2.26.1 (#1497) - - - - - d7d4b8b9 by Marcin Szamotulski at 2022-06-07T06:09:40+00:00 Render module tree per package in the content page (#1492) * Render module tree per package in the content page When rendering content page for multiple packages it is useful to split the module tree per package. Package names in this patch are inferred from haddock's interface file names. * Write PackageInfo into interface file To keep interface file format backward compatible, instead of using `Binary` instance for `InterfaceFile` we introduce functions to serialise and deserialise, which depends on the interface file version. - - - - - 77765665 by Mike Pilgrem at 2022-06-12T21:57:19+01:00 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - b0e079b0 by mergify[bot] at 2022-06-13T11:49:37+00:00 Merge pull request haskell/haddock#1108 from mpilgrem/fix783 Fix haskell/haddock#783 Don't show button if --quickjump not present - - - - - 6c0292b1 by Hécate Moonlight at 2022-06-21T17:21:08+02:00 Update the contribution guide - - - - - e413b9fa by dependabot[bot] at 2022-06-21T23:38:19+02:00 Bump shell-quote from 1.6.1 to 1.7.3 in /haddock-api/resources/html (#1500) Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.6.1 to 1.7.3. - [Release notes](https://github.com/substack/node-shell-quote/releases) - [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md) - [Commits](https://github.com/substack/node-shell-quote/compare/1.6.1...1.7.3) --- updated-dependencies: - dependency-name: shell-quote dependency-type: indirect ... Signed-off-by: dependabot[bot] <support at github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> - - - - - 29d0ef70 by romes at 2022-07-06T11:29:39+02:00 TTG: AST Updates for !8308 - - - - - 1bae7c87 by Alan Zimmerman at 2022-07-06T22:50:43+01:00 Match GHC changes for T21805 This brings in a newtype for FieldLabelString - - - - - 6fe8b988 by Phil de Joux at 2022-07-16T20:54:26+00:00 Bump hlint version to 3.4.1, the version with counts. (#1503) Redo the counts available with the --default option. - - - - - 48fb43af by Phil de Joux at 2022-07-19T09:32:55+02:00 Follow hlint suggestion: unused LANGUAGE pragma. (#1504) * Follow hlint suggestion: unused LANGUAGE pragma. * Ignore within modules to pass linting and pass tests. - - - - - c1cf1fa7 by Phil de Joux at 2022-07-24T13:45:59+02:00 Follow hlint suggestion: redundant $. (#1505) * Follow hlint suggestion: redundant $. * Remove $ and surplus blank lines in Operators. - - - - - 74777eb2 by Jade Lovelace at 2022-07-29T11:02:41+01:00 Fix hyperlinks to external items and modules (#1482) Fixes haskell/haddock#1481. There were two bugs in this: * We were assuming that we were always getting a relative path to the module in question, while Nix gives us file:// URLs sometimes. This change checks for those and stops prepending `..` to them. * We were not linking to the file under the module. This seems to have been a regression introduced by haskell/haddock#977. That is, the URLs were going to something like file:///nix/store/3bwbsy0llxxn1pixx3ll02alln56ivxy-ghc-9.0.2-doc/share/doc/ghc/html/libraries/base-4.15.1.0/src which does not have the appropriate HTML file or fragment for the item in question at the end. There is a remaining instance of the latter bug, but not in the hyperlinker: the source links to items reexported from other modules are also not including the correct file name. e.g. the reexport of Entity in esqueleto, from persistent. NOTE: This needs to get tested with relative-path located modules. It seems correct for Nix based on my testing. Testing strategy: ``` nix-shell '<nixpkgs>' --pure -A haskell.packages.ghc922.aeson mkdir /tmp/aesonbuild && cd /tmp/aesonbuild export out=/tmp/aesonbuild/out genericBuild ln -sf $HOME/co/haddock/haddock-api/resources . ./Setup haddock --with-haddock=$HOME/path/to/haddock/exec --hyperlink-source ``` (cherry picked from commit ab53ccf089ea703b767581ac14be0f6c78a7678a) - - - - - faa4cfcf by Hécate Moonlight at 2022-07-29T20:31:20+02:00 Merge pull request haskell/haddock#1516 from duog/9-4-backport-fix-hyperlinks Backport 9-4: Fix hyperlinks to external items and modules (#1482) - - - - - 5d2450f3 by Ben Gamari at 2022-08-05T17:41:15-04:00 Merge remote-tracking branch 'origin/ghc-9.4' - - - - - 63954f73 by Ben Gamari at 2022-08-05T19:08:36-04:00 Clean up build and testsuite for GHC 9.4 - - - - - d4568cb8 by Hécate Moonlight at 2022-08-05T19:10:49-04:00 Bump the versions - - - - - 505583a4 by Ben Gamari at 2022-08-06T13:58:27-04:00 Merge pull request haskell/haddock#1518 from bgamari/wip/ghc-9.4-merge Merge GHC 9.4 into `main` - - - - - 5706f6a4 by Ben Gamari at 2022-08-06T22:57:21-04:00 html-test: Testsuite changes for GHC 9.4.1 - - - - - 5f2a45a2 by Ben Gamari at 2022-08-15T14:33:05-04:00 doc: Fix a few minor ReST issues Sphinx was complaining about too-short title underlines. - - - - - 220e6410 by Ben Gamari at 2022-08-15T14:41:24-04:00 Merge branch 'main' into ghc-head - - - - - fbeb1b02 by Ben Gamari at 2022-08-15T14:45:16-04:00 Updates for GHC 9.5 - - - - - eee562eb by Vladislav Zavialov at 2022-08-15T14:46:13-04:00 HsToken ConDeclGADT con_dcolon - - - - - c5f073db by Ben Gamari at 2022-08-15T16:55:35-04:00 Updates for GHC 9.5 - - - - - 3f7ab242 by Vladislav Zavialov at 2022-08-15T16:55:35-04:00 HsToken ConDeclGADT con_dcolon - - - - - a18e473d by Ben Gamari at 2022-08-16T08:35:19-04:00 Merge branch 'wip/ghc-head-bump' into ghc-head - - - - - af0ff3a4 by M Farkas-Dyck at 2022-09-15T21:16:05+00:00 Disuse `mapLoc`. - - - - - a748fc38 by Matthew Farkas-Dyck at 2022-09-17T10:44:18+00:00 Scrub partiality about `NewOrData`. - - - - - 2758fb6c by John Ericson at 2022-09-18T03:27:37+02:00 Test output changed because of change to `base` Spooky, but I guess that is intended? - - - - - a7eec128 by Torsten Schmits at 2022-09-21T11:06:55+02:00 update tests for the move of tuples to GHC.Tuple.Prim - - - - - 461e7b9d by Ross Paterson at 2022-09-24T22:01:25+00:00 match implementation of GHC proposal haskell/haddock#106 (Define Kinds Without Promotion) - - - - - f7fd77ef by sheaf at 2022-10-17T14:53:01+02:00 Update Haddock for GHC MR !8563 (configuration of diagnostics) - - - - - 3d3e85ab by Vladislav Zavialov at 2022-10-22T23:04:06+03:00 Class layout info - - - - - cbde4cb0 by Simon Peyton Jones at 2022-10-25T23:19:18+01:00 Adapt to Constraint-vs-Type See haskell/haddock#21623 and !8750 - - - - - 7108ba96 by Tom Smeding at 2022-11-01T22:33:23+01:00 Remove outdated footnote about module re-exports The footnote is invalid with GHC 9.2.4 (and possibly earlier): the described behaviour in the main text works fine. - - - - - 206c6bc7 by Hécate Moonlight at 2022-11-01T23:00:46+01:00 Merge pull request haskell/haddock#1534 from tomsmeding/patch-1 - - - - - a57b4c4b by Andrew Lelechenko at 2022-11-21T00:39:52+00:00 Support mtl-2.3 - - - - - e9d62453 by Simon Peyton Jones at 2022-11-25T13:49:12+01:00 Track small API change in TyCon.hs - - - - - eb1c73f7 by Ben Gamari at 2022-12-07T08:46:21-05:00 Update for GhC 9.6 - - - - - 063268dd by Ben Gamari at 2022-12-07T11:26:32-05:00 Merge remote-tracking branch 'upstream/ghc-head' into HEAD - - - - - 4ca722fe by Ben Gamari at 2022-12-08T14:43:26-05:00 Bump bounds to accomodate base-4.18 - - - - - 340b7511 by Vladislav Zavialov at 2022-12-10T12:31:28+00:00 HsToken in HsAppKindTy - - - - - 946226ec by Ben Gamari at 2022-12-13T20:12:56-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - fd8faa66 by Ben Gamari at 2022-12-22T13:44:28-05:00 Bump GHC version to 9.7 - - - - - 2958aa9c by Ben Gamari at 2022-12-22T14:49:16-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 9e0fefd8 by Andrei Borzenkov at 2023-01-30T14:02:04+04:00 Rename () to Unit, Rename (,,...,,) to Tuple<n> - - - - - eb3968b5 by Ben Gamari at 2023-03-10T02:32:43-05:00 Bump versions for ghc-9.6 release - - - - - 4aeead36 by Adam Gundry at 2023-03-23T13:53:47+01:00 Adapt to warning categories changes - - - - - 642d8d60 by sheaf at 2023-03-29T13:35:56+02:00 Adapt to record field refactor This commit adapts to the changes in GHC MR !8686, which overhauls the treatment of record fields in the renamer, adding separate record field namespaces and entirely removing the GreName datatype. - - - - - ac8d4333 by doyougnu at 2023-03-29T11:11:44-04:00 Update UniqMap API - - - - - 7866fc86 by Ben Orchard at 2023-04-20T11:29:33+02:00 update classify with new tokens - - - - - ffcdd683 by Finley McIlwaine at 2023-04-24T09:36:18-06:00 Remove index-state - - - - - 05b70982 by Finley McIlwaine at 2023-04-26T08:16:31-06:00 `renameInterface` space leak fixes - Change logic for accumulation of names for which link warnings will be generated - Change handling of `--ignore-link-symbol` to allow qualified and unqualified names. Added to CHANGES.md - Some formatting changes and comments here and there - - - - - e5697d7c by Finley McIlwaine at 2023-04-27T18:46:36-06:00 Messy things - ghc-debug dependency and instrumentation - cabal.project custom with-compiler - hie.yaml files - traces and such - - - - - 0b8ef80b by Finley McIlwaine at 2023-05-02T18:08:52-06:00 Stop retaining GRE closures GRE closures should never be necessary to Haddock, so we never want to keep them on the heap. Despite that, they are retained by a lot of the data structures that Haddock makes use of. - Attempt to fix that situation by adding strictness to various computations and pruning the `ifaceInstances` field of `Interface` to a much thinner data type. - Removes the `ifaceFamInstances` field, as it was never used. - Move some of the attach instances types (e.g. `SimpleType`) to the types module - - - - - 8bda991b by Finley McIlwaine at 2023-05-08T16:07:51-06:00 Memory usage fixes - Refactor `ifaceDeclMap` to drastically reduce memory footprint. We no longer store all declarations associated with a given name, since we only cared to determine if the only declaration associated with a name was a value declaration. Change the `DeclMap` type to better reflect this. - Drop pre-renaming export items after the renaming step. Since the Hoogle backend used the pre-renamed export items, this isn't trivial. We now generate Hoogle output for exported declarations during the renaming step (if Hoogle output /should/ be generated), and store that with the renamed export item. - Slightly refactor Hoogle backend to handle the above change and allow for early generation of Hoogle output. - Remove the `ifaceRnDocMap` and `ifaceRnArgMap` fields of the `Interface` type, as they were never used. - Remove some unnecessary strictness - Remove a lot of dead code from `Syb` module - - - - - 1611ac0c by Finley McIlwaine at 2023-05-09T11:51:57-06:00 Unify ErrMsgM and IfM - Delete ErrMsgM, stop accumulating warnings in a writer - Make IfM a state monad, print warnings directly to stdout, move IfM type into types module - Drop ErrMsg = String synonym - Unset IORefs from plugin after they are read, preventing unnecessary retention of interfaces - - - - - 42d696ab by Finley McIlwaine at 2023-05-11T15:52:07-06:00 Thunk leak fixes The strictness introduced in this commit was motivated by observing thunk leaks in the eventlog2html output. - Refactor attach instances list comprehension to avoid large intermediate thunks - Refactor some HTML backend list comprehensions to avoid large intermediate thunks - Avoid thunks accumulating in documentation types or documentation parser - A lot of orphan NFData instances to allow us to force documentation values - - - - - 68561cf6 by Finley McIlwaine at 2023-05-11T17:02:10-06:00 Remove GHC debug dep - - - - - 10519e3d by Finley McIlwaine at 2023-05-15T12:40:48-06:00 Force HIE file path Removes a potential retainer of `ModSummary`s - - - - - 1e4a6ec6 by Finley McIlwaine at 2023-05-15T14:20:34-06:00 Re-add index-state, with-compiler, delete hie.yamls - - - - - a2363fe9 by Hécate Moonlight at 2023-05-15T22:45:16+02:00 Merge pull request haskell/haddock#1594 from FinleyMcIlwaine/finley/ghc-9.6-mem-fixes Reduce memory usage - - - - - e8a78383 by Finley McIlwaine at 2023-05-17T12:19:16-06:00 Merge branch ghc-9.6 into ghc-head - - - - - 22e25581 by Finley McIlwaine at 2023-05-17T12:20:23-06:00 Merge branch 'ghc-head' of gitlab.haskell.org:ghc/haddock into ghc-head - - - - - 41bbf0df by Bartłomiej Cieślar at 2023-05-24T08:57:58+02:00 changes to the WarningTxt cases Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - c686ba9b by Hécate Moonlight at 2023-06-01T14:03:02-06:00 Port the remains of Hi-Haddock - - - - - 9d8a85fd by Hécate Moonlight at 2023-06-01T14:03:06-06:00 Stdout for tests - - - - - 36331d07 by Finley McIlwaine at 2023-06-01T14:06:02-06:00 Formatting, organize imports - - - - - a06059b1 by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix empty context confusion in Convert module - - - - - 379346ae by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix associated type families in Hoogle output - - - - - fc6ea7ed by Finley McIlwaine at 2023-06-01T14:06:04-06:00 Fix test refs Accept several changes in Hoogle tests: Pretty printing logic no longer prints the `(Proxy (Proxy (...))` chain in Bug806 with parentheses. Since this test was only meant to verify that line breaks do not occur, accept the change. `tyThingToLHsDecl` is called for class and data declarations, which ends up "synifying" the type variables and giving unlifted types kind signatures. As a result, type variables of kind `Type -> Type` are now printed with kind signatures in Hoogle output. This could be changed by manually drop kind signatures from class variables in the Hoogle backend if the behavior is deemed unacceptable. Sometimes subordinate declarations are exported separate from their parent declarations (e.g. record selectors). In this case, a type signature is cobbled together for the export item in `extractDecl`. Since this type signature is very manually constructed, it may lack kind signatures of decls constructed from `tyThingToLHsDecl`. An example of this is the `type-sigs` Hoogle test. Change `*` to `Type` in Hoogle test refs. I don't think this will break Hoogle behavior, since it appears to not consider type signatures in search. I have not fully verified this. - - - - - e14b7e58 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix LaTeX backend test refs Changes to GHC pretty printing code have resulted in some differences to Haddock's LaTeX output. - Type variables are printed explicitly quantified in the LinearTypes test - Wildcard types in type family equations are now printed numbered, e.g. _1 _2, in the TypeFamilies3 test - Combined signatures in DefaultSignatures test are now documented as separate signatures - - - - - 41b5b296 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and test source updates - Stop using kind `*` in html test sources - Add TypeOperators where necessary to avoid warnings and future errors - Rename some test modules to match their module names - - - - - c640e2a2 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Fix missing deprecation warnings on record fields `lookupOccEnv` was used to resolve `OccNames` with warnings attached, but it doesn't look in the record field namespace. Thus, if a record field had a warning attached, it would not resolve and the warning map would not include it. This commit fixes by using `lookupOccEnv_WithFields` instead. - - - - - fad0c462 by Finley McIlwaine at 2023-06-01T14:06:05-06:00 Formatting and some comments - - - - - 751fd023 by Finley McIlwaine at 2023-06-01T14:11:41-06:00 Accept HTML test diffs All diffs now boil down to the expected differences resulting from declarations being reified from TyThings in hi-haddock. Surface syntax now has much less control over the syntax used in the documentation. - - - - - d835c845 by Finley McIlwaine at 2023-06-01T14:11:45-06:00 Adapt to new load' type - - - - - dcf776c4 by Finley McIlwaine at 2023-06-01T14:13:13-06:00 Update mkWarningMap and moduleWarning - - - - - 8e8432fd by Finley McIlwaine at 2023-06-01T14:28:54-06:00 Revert load' changes - - - - - aeb2982c by Finley McIlwaine at 2023-06-01T14:40:24-06:00 Accept change to Instances test in html-test Link to Data.Tuple instead of GHC.Tuple.Prim - - - - - 8adfdbac by Finley McIlwaine at 2023-06-01T15:53:17-06:00 Reset ghc dep to ^>= 9.6 - - - - - 2b1ce93d by Finley McIlwaine at 2023-06-06T07:50:04-06:00 Update CHANGES.md, user guide, recomp avoidance * Add --trace-args flag for tracing arguments received to standard output * Avoid recompiling due to changes in optimization flags * Update users guide and changes.md - - - - - f3da6676 by Finley McIlwaine at 2023-06-06T14:12:56-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - bf36c467 by Matthew Pickering at 2023-06-07T10:16:09+01:00 Revert back to e16e20d592a6f5d9ed1af17b77fafd6495242345 Neither of these MRs are ready to land yet which causes issues with other MRs which are ready to land and need haddock changes. - - - - - 421510a9 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 atSign has no unicode variant Prior to this change, atSign was defined as follows: atSign unicode = text (if unicode then "@" else "@") Yes, this is the same symbol '\64' and not your font playing tricks on you. Now we define: atSign = char '@' Both the LaTeX and the Xhtml backend are updated accordingly. - - - - - 3785c276 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 LaTeX: fix printing of type variable bindings Consider this type signature: kindOf :: forall {k} (a :: k). Proxy a -> Proxy k Prior to this fix, the LaTeX backend rendered it like this: kindOf :: forall k a. Proxy a -> Proxy k Now we preserve explicit specificity and kind annotations. - - - - - 0febf3a8 by Vladislav Zavialov at 2023-06-07T09:36:30+00:00 Add support for invisible binders in type declarations - - - - - 13e33bb3 by Finley McIlwaine at 2023-06-08T07:51:59-06:00 Add "Avoiding Recompilation" section to docs This section is a bit of a WIP due to the unstable nature of hi-haddock and the lack of tooling supporting it, but its a good start. - - - - - 3e5340ce by Finley McIlwaine at 2023-06-08T07:54:27-06:00 Add note about stubdir to recompilation docs - - - - - db7e84dc by Finley at 2023-06-08T08:11:03-06:00 Merge pull request haskell/haddock#1597 from haskell/finley/hi-haddock-9.6 hi-haddock for ghc 9.6 - - - - - 4e085d17 by Finley McIlwaine at 2023-06-14T13:41:06-06:00 Replace SYB traversals - - - - - 7b39aec5 by Finley McIlwaine at 2023-06-14T14:20:17-06:00 Test ref accepts, remove unused HaddockClsInst - - - - - df9c2090 by Finley McIlwaine at 2023-06-15T08:02:51-06:00 Use batchMsg for progress reporting during load With hi-haddock as is, there is an awkward silence during the load operation. This commit makes haddock use the default `batchMsg` Messager for progress reporting, and makes the default GHC verbosity level 1, so the user can see what GHC is doing. - - - - - f23679a8 by Hécate Moonlight at 2023-06-15T20:31:53+02:00 Merge pull request haskell/haddock#1600 from haskell/finley/hi-haddock-optim - - - - - a7982192 by Finley McIlwaine at 2023-06-15T15:02:16-06:00 hi-haddock squashed - - - - - c34f0c8d by Finley McIlwaine at 2023-06-15T16:22:03-06:00 Merge remote-tracking branch 'origin/ghc-9.6' into finley/hi-haddock-squashed - - - - - 40452797 by Bartłomiej Cieślar at 2023-06-16T12:26:04+02:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - e58673bf by Ben Gamari at 2023-06-16T09:33:35-04:00 Bump GHC version to 9.8 - - - - - 74bdf972 by Ben Gamari at 2023-06-16T09:36:18-04:00 Merge commit 'fcaaad06770a26d35d4aafd65772dedadf17669c' into ghc-head - - - - - 418ee3dc by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Remove NFData SourceText, IfaceWarnings updates The NFData SourceText instance is now available in GHC Handle mod_iface mi_warns now being IfaceWarnings - - - - - 62f31380 by Finley McIlwaine at 2023-06-20T15:39:05-04:00 Accept Instances.hs test output Due to ghc!10469. - - - - - a8f2fc0e by Ben Gamari at 2023-06-20T15:48:08-04:00 Test fixes for "Fix associated data family doc structure items" Associated data families were being given their own export DocStructureItems, which resulted in them being documented separately from their classes in haddocks. This commit fixes it. - - - - - cb1ac33e by Bartłomiej Cieślar at 2023-06-21T12:56:02-04:00 Changes related to MR !10283 MR !10283 changes the alternatives for WarningTxt pass. This MR reflects those changes in the haddock codebase. Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com> - - - - - 9933e10b by Ben Gamari at 2023-06-21T12:56:02-04:00 Bump GHC version to 9.8 - - - - - fe8c18b6 by Ben Gamari at 2023-06-21T15:36:29-04:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - c61a0d5b by Ben Gamari at 2023-06-21T16:10:51-04:00 Bump GHC version to 9.9 - - - - - 0c2a756e by sheaf at 2023-07-07T13:45:12+02:00 Avoid incomplete record update in Haddock Hoogle This commit avoids running into an incomplete record update warning in the Hoogle backend of Haddock. This was only noticed now, because incomplete record updates were broken in GHC 9.6. Now that they are fixed, we have to avoid running into them! - - - - - f9b952a7 by Ben Gamari at 2023-07-21T11:58:05-04:00 Bump base bound to <4.20 For GHC 9.8. - - - - - 1b27e151 by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Check for puns (see ghc#23368) - - - - - 457341fd by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Remove fake exports for (~), List, and Tuple<n> The old reasoning no longer applies, nowadays those names can be mentioned in export lists. - - - - - bf3dcddf by Vladislav Zavialov at 2023-08-02T10:42:11+00:00 Fix pretty-printing of Solo and MkSolo - - - - - 495b2241 by Matthew Pickering at 2023-09-01T13:02:07+02:00 Fix issue with duplicate reexported definitions (T23616) When a class method was reexported, it's default methods were also showing up in the generated html page. The simplest and most non-invasive fix is to not look for the default method if we are just exporting the class method.. because the backends are just showing default methods when the whole class is exported. In general it would be worthwhile to rewrite this bit of code I think as the logic and what gets included is split over `lookupDocs` and `availExportDecl` it would be clearer to combine the two. The result of lookupDocs is always just passed to availExportDecl so it seems simpler and more obvious to just write the function directly. - - - - - 6551824d by Finley McIlwaine at 2023-09-05T13:06:57-07:00 Remove fake export of `FUN` from Prelude This prevents `data FUN` from being shown at the top of the Prelude docs. Fixes \#23920 on GHC. - - - - - 9ab5a448 by Alan Zimmerman at 2023-09-08T18:26:53+01:00 Match changes in wip/az/T23885-unicode-funtycon - - - - - 4d08364e by Alan Zimmerman at 2023-10-31T19:46:45+00:00 EPA: match changes in GHC - EPA: Comments in AnchorOperation - EPA: Remove EpaEofComment - - - - - e7da0d25 by Alan Zimmerman at 2023-11-05T11:20:31+00:00 EPA: match changes in GHC, l2l cleanup - - - - - 4ceac14d by Alan Zimmerman at 2023-11-11T15:16:41+00:00 EPA: Replace Anchor with EpaLocation Match GHC - - - - - 94fb8d47 by Alan Zimmerman at 2023-11-29T18:10:26+00:00 Match GHC, No comments in EpaDelta for comments - - - - - 32d208e1 by Vladislav Zavialov at 2023-12-12T20:41:36+03:00 EPA: Match changes to LHsToken removal - - - - - eebdd316 by Apoorv Ingle at 2024-01-23T13:49:12+00:00 Changes for haskell/haddock#18324 - - - - - ae856a82 by Matthew Pickering at 2024-02-05T12:22:39+00:00 ghc-internals fallout - - - - - f8429266 by Jade at 2024-02-08T14:56:50+01:00 Adjust test for ghc MR !10993 - - - - - 6d1e2386 by Alan Zimmerman at 2024-02-13T22:00:28+03:00 EPA: Match changes to HsParTy and HsFunTy - - - - - 9c588f19 by Fendor at 2024-02-14T11:05:36+01:00 Adapt to GHC giving better Name's for linking - - - - - 264a4fa9 by Owen Shepherd at 2024-02-15T09:41:06-05:00 feat: Add sortOn to Data.List.NonEmpty Adds `sortOn` to `Data.List.NonEmpty`, and adds comments describing when to use it, compared to `sortWith` or `sortBy . comparing`. The aim is to smooth out the API between `Data.List`, and `Data.List.NonEmpty`. This change has been discussed in the [clc issue](https://github.com/haskell/core-libraries-committee/issues/227). - - - - - b57200de by Fendor at 2024-02-15T09:41:47-05:00 Prefer RdrName over OccName for looking up locations in doc renaming step Looking up by OccName only does not take into account when functions are only imported in a qualified way. Fixes issue #24294 Bump haddock submodule to include regression test - - - - - 8ad02724 by Luite Stegeman at 2024-02-15T17:33:32-05:00 JS: add simple optimizer The simple optimizer reduces the size of the code generated by the JavaScript backend without the complexity and performance penalty of the optimizer in GHCJS. Also see #22736 Metric Decrease: libdir size_hello_artifact - - - - - 20769b36 by Matthew Pickering at 2024-02-15T17:34:07-05:00 base: Expose `--no-automatic-time-samples` in `GHC.RTS.Flags` API This patch builds on 5077416e12cf480fb2048928aa51fa4c8fc22cf1 and modifies the base API to reflect the new RTS flag. CLC proposal #243 - https://github.com/haskell/core-libraries-committee/issues/243 Fixes #24337 - - - - - 778e1db3 by Andrei Borzenkov at 2024-02-16T16:12:07+03:00 Namespace specifiers for fixity signatures - - - - - 08031ada by Teo Camarasu at 2024-02-16T13:37:00-05:00 base: export System.Mem.performBlockingMajorGC The corresponding C function was introduced in ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264. Resolves #24228 The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230 Co-authored-by: Ben Gamari <bgamari.foss at gmail.com> - - - - - 1f534c2e by Florian Weimer at 2024-02-16T13:37:42-05:00 Fix C output for modern C initiative GCC 14 on aarch64 rejects the C code written by GHC with this kind of error: error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion] 68 | *(ffi_arg*)resp = cret; | ^ Add the correct cast. For more information on this see: https://fedoraproject.org/wiki/Changes/PortingToModernC Tested-by: Richard W.M. Jones <rjones at redhat.com> - - - - - 5d3f7862 by Matthew Craven at 2024-02-16T13:38:18-05:00 Bump bytestring submodule to 0.12.1.0 - - - - - 902ebcc2 by Ian-Woo Kim at 2024-02-17T06:01:01-05:00 Add missing BCO handling in scavenge_one. - - - - - 97d26206 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Make cast between words and floats real primops (#24331) First step towards fixing #24331. Replace foreign prim imports with real primops. - - - - - a40e4781 by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: add constant folding for bitcast between float and word (#24331) - - - - - 5fd2c00f by Sylvain Henry at 2024-02-17T06:01:44-05:00 Perf: replace stack checks with assertions in casting primops There are RESERVED_STACK_WORDS free words (currently 21) on the stack, so omit the checks. Suggested by Cheng Shao. - - - - - 401dfe7b by Sylvain Henry at 2024-02-17T06:01:44-05:00 Reexport primops from GHC.Float + add deprecation - - - - - 4ab48edb by Ben Gamari at 2024-02-17T06:02:21-05:00 rts/Hash: Don't iterate over chunks if we don't need to free data When freeing a `HashTable` there is no reason to walk over the hash list before freeing it if the user has not given us a `dataFreeFun`. Noticed while looking at #24410. - - - - - bd5a1f91 by Cheng Shao at 2024-02-17T06:03:00-05:00 compiler: add SEQ_CST fence support In addition to existing Acquire/Release fences, this commit adds SEQ_CST fence support to GHC, allowing Cmm code to explicitly emit a fence that enforces total memory ordering. The following logic is added: - The MO_SeqCstFence callish MachOp - The %prim fence_seq_cst() Cmm syntax and the SEQ_CST_FENCE macro in Cmm.h - MO_SeqCstFence lowering logic in every single GHC codegen backend - - - - - 2ce2a493 by Cheng Shao at 2024-02-17T06:03:38-05:00 testsuite: fix hs_try_putmvar002 for targets without pthread.h hs_try_putmvar002 includes pthread.h and doesn't work on targets without this header (e.g. wasm32). It doesn't need to include this header at all. This was previously unnoticed by wasm CI, though recent toolchain upgrade brought in upstream changes that completely removes pthread.h in the single-threaded wasm32-wasi sysroot, therefore we need to handle that change. - - - - - 1fb3974e by Cheng Shao at 2024-02-17T06:03:38-05:00 ci: bump ci-images to use updated wasm image This commit bumps our ci-images revision to use updated wasm image. - - - - - 56e3f097 by Andrew Lelechenko at 2024-02-17T06:04:13-05:00 Bump submodule text to 2.1.1 T17123 allocates less because of improvements to Data.Text.concat in 1a6a06a. Metric Decrease: T17123 - - - - - a7569495 by Cheng Shao at 2024-02-17T06:04:51-05:00 rts: remove redundant rCCCS initialization This commit removes the redundant logic of initializing each Capability's rCCCS to CCS_SYSTEM in initProfiling(). Before initProfiling() is called during RTS startup, each Capability's rCCCS has already been assigned CCS_SYSTEM when they're first initialized. - - - - - 7a0293cc by Ben Gamari at 2024-02-19T07:11:00-05:00 Drop dependence on `touch` This drops GHC's dependence on the `touch` program, instead implementing it within GHC. This eliminates an external dependency and means that we have one fewer program to keep track of in the `configure` script - - - - - 0dbd729e by Andrei Borzenkov at 2024-02-19T07:11:37-05:00 Parser, renamer, type checker for @a-binders (#17594) GHC Proposal 448 introduces binders for invisible type arguments (@a-binders) in various contexts. This patch implements @-binders in lambda patterns and function equations: {-# LANGUAGE TypeAbstractions #-} id1 :: a -> a id1 @t x = x :: t -- @t-binder on the LHS of a function equation higherRank :: (forall a. (Num a, Bounded a) => a -> a) -> (Int8, Int16) higherRank f = (f 42, f 42) ex :: (Int8, Int16) ex = higherRank (\ @a x -> maxBound @a - x ) -- @a-binder in a lambda pattern in an argument -- to a higher-order function Syntax ------ To represent those @-binders in the AST, the list of patterns in Match now uses ArgPat instead of Pat: data Match p body = Match { ... - m_pats :: [LPat p], + m_pats :: [LArgPat p], ... } + data ArgPat pass + = VisPat (XVisPat pass) (LPat pass) + | InvisPat (XInvisPat pass) (HsTyPat (NoGhcTc pass)) + | XArgPat !(XXArgPat pass) The VisPat constructor represents patterns for visible arguments, which include ordinary value-level arguments and required type arguments (neither is prefixed with a @), while InvisPat represents invisible type arguments (prefixed with a @). Parser ------ In the grammar (Parser.y), the lambda and lambda-cases productions of aexp non-terminal were updated to accept argpats instead of apats: aexp : ... - | '\\' apats '->' exp + | '\\' argpats '->' exp ... - | '\\' 'lcases' altslist(apats) + | '\\' 'lcases' altslist(argpats) ... + argpat : apat + | PREFIX_AT atype Function left-hand sides did not require any changes to the grammar, as they were already parsed with productions capable of parsing @-binders. Those binders were being rejected in post-processing (isFunLhs), and now we accept them. In Parser.PostProcess, patterns are constructed with the help of PatBuilder, which is used as an intermediate data structure when disambiguating between FunBind and PatBind. In this patch we define ArgPatBuilder to accompany PatBuilder. ArgPatBuilder is a short-lived data structure produced in isFunLhs and consumed in checkFunBind. Renamer ------- Renaming of @-binders builds upon prior work on type patterns, implemented in 2afbddb0f24, which guarantees proper scoping and shadowing behavior of bound type variables. This patch merely defines rnLArgPatsAndThen to process a mix of visible and invisible patterns: + rnLArgPatsAndThen :: NameMaker -> [LArgPat GhcPs] -> CpsRn [LArgPat GhcRn] + rnLArgPatsAndThen mk = mapM (wrapSrcSpanCps rnArgPatAndThen) where + rnArgPatAndThen (VisPat x p) = ... rnLPatAndThen ... + rnArgPatAndThen (InvisPat _ tp) = ... rnHsTyPat ... Common logic between rnArgPats and rnPats is factored out into the rn_pats_general helper. Type checker ------------ Type-checking of @-binders builds upon prior work on lazy skolemisation, implemented in f5d3e03c56f. This patch extends tcMatchPats to handle @-binders. Now it takes and returns a list of LArgPat rather than LPat: tcMatchPats :: ... - -> [LPat GhcRn] + -> [LArgPat GhcRn] ... - -> TcM ([LPat GhcTc], a) + -> TcM ([LArgPat GhcTc], a) Invisible binders in the Match are matched up with invisible (Specified) foralls in the type. This is done with a new clause in the `loop` worker of tcMatchPats: loop :: [LArgPat GhcRn] -> [ExpPatType] -> TcM ([LArgPat GhcTc], a) loop (L l apat : pats) (ExpForAllPatTy (Bndr tv vis) : pat_tys) ... -- NEW CLAUSE: | InvisPat _ tp <- apat, isSpecifiedForAllTyFlag vis = ... In addition to that, tcMatchPats no longer discards type patterns. This is done by filterOutErasedPats in the desugarer instead. x86_64-linux-deb10-validate+debug_info Metric Increase: MultiLayerModulesTH_OneShot - - - - - 486979b0 by Jade at 2024-02-19T07:12:13-05:00 Add specialized sconcat implementation for Data.Monoid.First and Data.Semigroup.First Approved CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/246 Fixes: #24346 - - - - - 17e309d2 by John Ericson at 2024-02-19T07:12:49-05:00 Fix reST in users guide It appears that aef587f65de642142c1dcba0335a301711aab951 wasn't valid syntax. - - - - - 35b0ad90 by Brandon Chinn at 2024-02-19T07:13:25-05:00 Fix searching for errors in sphinx build - - - - - 4696b966 by Cheng Shao at 2024-02-19T07:14:02-05:00 hadrian: fix wasm backend post linker script permissions The post-link.mjs script was incorrectly copied and installed as a regular data file without executable permission, this commit fixes it. - - - - - a6142e0c by Cheng Shao at 2024-02-19T07:14:40-05:00 testsuite: mark T23540 as fragile on i386 See #24449 for details. - - - - - 249caf0d by Matthew Craven at 2024-02-19T20:36:09-05:00 Add @since annotation to Data.Data.mkConstrTag - - - - - cdd939e7 by Jade at 2024-02-19T20:36:46-05:00 Enhance documentation of Data.Complex - - - - - d04f384f by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian/bindist: Ensure that phony rules are marked as such Otherwise make may not run the rule if file with the same name as the rule happens to exist. - - - - - efcbad2d by Ben Gamari at 2024-02-21T04:59:23-05:00 hadrian: Generate HSC2HS_EXTRAS variable in bindist installation We must generate the hsc2hs wrapper at bindist installation time since it must contain `--lflag` and `--cflag` arguments which depend upon the installation path. The solution here is to substitute these variables in the configure script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in the install rules. Fixes #24050. - - - - - c540559c by Matthew Pickering at 2024-02-21T04:59:23-05:00 ci: Show --info for installed compiler - - - - - ab9281a2 by Matthew Pickering at 2024-02-21T04:59:23-05:00 configure: Correctly set --target flag for linker opts Previously we were trying to use the FP_CC_SUPPORTS_TARGET with 4 arguments, when it only takes 3 arguments. Instead we need to use the `FP_PROG_CC_LINKER_TARGET` function in order to set the linker flags. Actually fixes #24414 - - - - - 9460d504 by Rodrigo Mesquita at 2024-02-21T04:59:59-05:00 configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS - - - - - 77629e76 by Andrei Borzenkov at 2024-02-21T05:00:35-05:00 Namespacing for fixity signatures (#14032) Namespace specifiers were added to syntax of fixity signatures: - sigdecl ::= infix prec ops | ... + sigdecl ::= infix prec namespace_spec ops | ... To preserve namespace during renaming MiniFixityEnv type now has separate FastStringEnv fields for names that should be on the term level and for name that should be on the type level. makeMiniFixityEnv function was changed to fill MiniFixityEnv in the right way: - signatures without namespace specifiers fill both fields - signatures with 'data' specifier fill data field only - signatures with 'type' specifier fill type field only Was added helper function lookupMiniFixityEnv that takes care about looking for a name in an appropriate namespace. Updates haddock submodule. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 84357d11 by Teo Camarasu at 2024-02-21T05:01:11-05:00 rts: only collect live words in nonmoving census when non-concurrent This avoids segfaults when the mutator modifies closures as we examine them. Resolves #24393 - - - - - 9ca56dd3 by Ian-Woo Kim at 2024-02-21T05:01:53-05:00 mutex wrap in refreshProfilingCCSs - - - - - 1387966a by Cheng Shao at 2024-02-21T05:02:32-05:00 rts: remove unused HAVE_C11_ATOMICS macro This commit removes the unused HAVE_C11_ATOMICS macro. We used to have a few places that have fallback paths when HAVE_C11_ATOMICS is not defined, but that is completely redundant, since the FP_CC_SUPPORTS__ATOMICS configure check will fail when the C compiler doesn't support C11 style atomics. There are also many places (e.g. in unreg backend, SMP.h, library cbits, etc) where we unconditionally use C11 style atomics anyway which work in even CentOS 7 (gcc 4.8), the oldest distro we test in our CI, so there's no value in keeping HAVE_C11_ATOMICS. - - - - - 0f40d68f by Andreas Klebinger at 2024-02-21T05:03:09-05:00 RTS: -Ds - make sure incall is non-zero before dereferencing it. Fixes #24445 - - - - - e5886de5 by Ben Gamari at 2024-02-21T05:03:44-05:00 rts/AdjustorPool: Use ExecPage abstraction This is just a minor cleanup I found while reviewing the implementation. - - - - - 826c5b47 by Torsten Schmits at 2024-02-21T13:17:05+01:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 09941666 by Adam Gundry at 2024-02-21T13:53:12+00:00 Define GHC2024 language edition (#24320) See https://github.com/ghc-proposals/ghc-proposals/pull/613. Also fixes #24343 and improves the documentation of language editions. Co-authored-by: Joachim Breitner <mail at joachim-breitner.de> - - - - - 2cff14d5 by Ben Gamari at 2024-02-22T09:35:56-05:00 Bump bounds - - - - - f49376b3 by Ben Gamari at 2024-02-22T09:35:56-05:00 Allow `@since` annotations in export lists Here we extend Haddock to admit `@since` annotations in export lists. These can be attached to most export list items (although not subordinate lists). These annotations supercede the declaration's `@since` annotation in produced Haddocks. - - - - - b5aa93df by Ben Gamari at 2024-02-22T12:09:06-05:00 Allow package-qualified @since declarations - - - - - 8f5957f2 by Ben Gamari at 2024-02-22T13:55:19-05:00 Documentation changes from ghc-internal restructuring Previously many declarations (e.g. `Int`) were declared to have a "home" in `Prelude`. However, now Haddock instead chooses to put these in more specific homes (e.g. `Data.Int`). Given that the "home" decision is driven by heuristics and in general these changes seem quite reasonable I am accepting them: * `Int` moved from `Prelude` to `Data.Int` * `(~)` moved from `Prelude` to `Data.Type.Equality` * `Type` moved from `GHC.Types` to `Data.Kind` * `Maybe` moved from `Prelude` to `Data.Maybe` * `Bool` moved from `Prelude` to `Data.Bool` * `Ordering` moved from `Prelude` to `Data.Ord` As well, more identifiers are now hyperlinked; it's not immediately clear *why*, but it is an improvement nevertheless. - - - - - ec33fec3 by Ben Gamari at 2024-02-22T20:36:24-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 5121a4ed by Ben Gamari at 2024-02-23T06:40:55-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. Bumps haddock submodule. - - - - - 30cfd251 by Torsten Schmits at 2024-02-24T13:00:42-05:00 rename GHC.Tuple.Prim to GHC.Tuple - - - - - 0eb2265d by Hécate Moonlight at 2024-02-24T16:02:16-05:00 Improve the synopsis and description of base - - - - - 2e36f5d2 by Jade at 2024-02-24T16:02:51-05:00 Error Messages: Properly align cyclic module error Fixes: #24476 - - - - - bbfb051c by Ben Gamari at 2024-02-24T19:10:23-05:00 Allow docstrings after exports Here we extend the parser and AST to preserve docstrings following export items. We then extend Haddock to parse `@since` annotations in such docstrings, allowing changes in export structure to be properly documented. - - - - - d8d6ad8c by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Move modules into GHC.Internal.* namespace Bumps haddock submodule due to testsuite output changes. - - - - - a82af7cd by Ben Gamari at 2024-02-24T19:10:23-05:00 ghc-internal: Rewrite `@since ` to `@since base-` These will be incrementally moved to the export sites in `base` where possible. - - - - - ca3836e1 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Migrate Haddock `not-home` pragmas from `ghc-internal` This ensures that we do not use `base` stub modules as declarations' homes when not appropriate. - - - - - c8cf3e26 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Partially freeze exports of GHC.Base Sadly there are still a few module reexports. However, at least we have decoupled from the exports of `GHC.Internal.Base`. - - - - - 272573c6 by Ben Gamari at 2024-02-24T19:10:23-05:00 Move Haddock named chunks - - - - - 2d8a881d by Ben Gamari at 2024-02-24T19:10:23-05:00 Drop GHC.Internal.Data.Int - - - - - 55c4c385 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler: Fix mention to `GHC....` modules in wasm desugaring Really, these references should be via known-key names anyways. I have fixed the proximate issue here but have opened #24472 to track the additional needed refactoring. - - - - - 64150911 by Ben Gamari at 2024-02-24T19:10:23-05:00 Accept performance shifts from ghc-internal restructure As expected, Haddock now does more work. Less expected is that some other testcases actually get faster, presumably due to less interface file loading. As well, the size_hello_artifact test regressed a bit when debug information is enabled due to debug information for the new stub symbols. Metric Decrease: T12227 T13056 Metric Increase: haddock.Cabal haddock.base MultiLayerModulesTH_OneShot size_hello_artifact - - - - - 317a915b by Ben Gamari at 2024-02-24T19:10:23-05:00 Expose GHC.Wasm.Prim from ghc-experimental Previously this was only exposed from `ghc-internal` which violates our agreement that users shall not rely on things exposed from that package. Fixes #24479. - - - - - 3bbd2bf2 by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Small optimisation of evCallStack Don't lookupIds unless we actually need them. - - - - - 3e5c9e3c by Ben Gamari at 2024-02-24T19:10:23-05:00 compiler/tc: Use toException instead of SomeException - - - - - 125714a6 by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Factor out errorBelch This was useful when debugging - - - - - 3d6aae7c by Ben Gamari at 2024-02-24T19:10:23-05:00 base: Clean up imports of GHC.Stack.CloneStack - - - - - 6900306e by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move PrimMVar to GHC.Internal.MVar - - - - - 28f8a148 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Move prettyCallStack to GHC.Internal.Stack - - - - - 4892de47 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Explicit dependency to workaround #24436 Currently `ghc -M` fails to account for `.hs-boot` files correctly, leading to issues with cross-package one-shot builds failing. This currently manifests in `GHC.Exception` due to the boot file for `GHC.Internal.Stack`. Work around this by adding an explicit `import`, ensuring that `GHC.Internal.Stack` is built before `GHC.Exception`. See #24436. - - - - - 294c93a5 by Ben Gamari at 2024-02-24T19:10:24-05:00 base: Use displayException in top-level exception handler Happily this also allows us to eliminate a special case for Deadlock exceptions. Implements [CLC #198](https://github.com/haskell/core-libraries-committee/issues/198). - - - - - 732db81d by Ben Gamari at 2024-02-24T19:12:18-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - cf756a25 by Ben Gamari at 2024-02-24T22:11:53-05:00 rts: Fix symbol references in Wasm RTS - - - - - 4e4d47a0 by Jade at 2024-02-26T15:17:20-05:00 GHCi: Improve response to unloading, loading and reloading modules Fixes #13869 - - - - - f3de8a3c by Zubin Duggal at 2024-02-26T15:17:57-05:00 rel-eng/fetch-gitlab.py: Fix name of aarch64 alpine 3_18 release job - - - - - c71bfdff by Cheng Shao at 2024-02-26T15:18:35-05:00 hadrian/hie-bios: pass -j to hadrian This commit passes -j to hadrian in the hadrian/hie-bios scripts. When the user starts HLS in a fresh clone that has just been configured, it takes quite a while for hie-bios to pick up the ghc flags and start actual indexing, due to the fact that the hadrian build step defaulted to -j1, so -j speeds things up and improve HLS user experience in GHC. Also add -j flag to .ghcid to speed up ghcid, and sets the Windows build root to .hie-bios which also works and unifies with other platforms, the previous build root _hie-bios was missing from .gitignore anyway. - - - - - 50bfdb46 by Cheng Shao at 2024-02-26T15:18:35-05:00 ci: enable parallelism in hadrian/ghci scripts This commit enables parallelism when the hadrian/ghci scripts are called in CI. The time bottleneck is in the hadrian build step, but previously the build step wasn't parallelized. - - - - - 61a78231 by Felix Yan at 2024-02-26T15:19:14-05:00 m4: Correctly detect GCC version When calling as `cc`, GCC does not outputs lowercased "gcc" at least in 13.2.1 version here. ``` $ cc --version cc (GCC) 13.2.1 20230801 ... ``` This fails the check and outputs the confusing message: `configure: $CC is not gcc; assuming it's a reasonably new C compiler` This patch makes it check for upper-cased "GCC" too so that it works correctly: ``` checking version of gcc... 13.2.1 ``` - - - - - 001aa539 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Fix formatting in whereFrom docstring Previously it used markdown syntax rather than Haddock syntax for code quotes - - - - - e8034d15 by Teo Camarasu at 2024-02-27T13:26:46-05:00 Move ClosureType type to ghc-internal - Use ClosureType for InfoProv.ipDesc. - Use ClosureType for CloneStack.closureType. - Now ghc-heap re-exports this type from ghc-internal. See the accompanying CLC proposal: https://github.com/haskell/core-libraries-committee/issues/210 Resolves #22600 - - - - - 3da0a551 by Matthew Craven at 2024-02-27T13:27:22-05:00 StgToJS: Simplify ExprInline constructor of ExprResult Its payload was used only for a small optimization in genAlts, avoiding a few assignments for programs of this form: case NormalDataCon arg1 arg2 of x { NormalDataCon x1 x2 -> ... ; } But when compiling with optimizations, this sort of code is generally eliminated by case-of-known-constructor in Core-to-Core. So it doesn't seem worth tracking and cleaning up again in StgToJS. - - - - - 61bc92cc by Cheng Shao at 2024-02-27T16:58:42-05:00 rts: add missing ccs_mutex guard to internal_dlopen See added comment for details. Closes #24423. - - - - - dd29d3b2 by doyougnu at 2024-02-27T16:59:23-05:00 cg: Remove GHC.Cmm.DataFlow.Collections In pursuit of #15560 and #17957 and generally removing redundancy. - - - - - d3a050d2 by Cheng Shao at 2024-02-27T17:00:00-05:00 utils: remove unused lndir from tree Ever since the removal of the make build system, the in tree lndir hasn't been actually built, so this patch removes it. - - - - - 86bf7010 by Ben Gamari at 2024-02-27T19:28:10-05:00 Merge remote-tracking branch 'origin/ghc-head' into HEAD - - - - - 74b24a9b by Teo Camarasu at 2024-02-28T16:32:58+00:00 rts: avoid checking bdescr of value outside of Haskell heap In nonmovingTidyWeaks we want to check if the key of a weak pointer lives in the non-moving heap. We do this by checking the flags of the block the key lives in. But we need to be careful with values that live outside the Haskell heap, since they will lack a block descriptor and looking for one may lead to a segfault. In this case we should just accept that it isn't on the non-moving heap. Resolves #24492 - - - - - b4cae4ec by Simon Peyton Jones at 2024-02-29T02:10:08-05:00 In mkDataConRep, ensure the in-scope set is right A small change that fixes #24489 - - - - - 3836a110 by Cheng Shao at 2024-02-29T21:25:45-05:00 testsuite: fix T23540 fragility on 32-bit platforms T23540 is fragile on 32-bit platforms. The root cause is usage of `getEvidenceTreesAtPoint`, which internally relies on `Name`'s `Ord` instance, which is indeterministic. The solution is adding a deterministic `Ord` instance for `EvidenceInfo` and sorting the evidence trees before pretty printing. Fixes #24449. - - - - - 960c8d47 by Teo Camarasu at 2024-02-29T21:26:20-05:00 Reduce AtomicModifyIORef increment count This test leads to a lot of contention when N>2 and becomes very slow. Let's reduce the amount of work we do to compensate. Resolves #24490 - - - - - 2e46c8ad by Matthew Pickering at 2024-03-01T05:48:06-05:00 hadrian: Improve parallelism in binary-dist-dir rule I noticed that the "docs" target was needed after the libraries and executables were built. We can improve the parallelism by needing everything at once so that documentation can be built immediately after a library is built for example. - - - - - cb6c11fe by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Bump windows and freebsd boot compilers to 9.6.4 We have previously bumped the docker images to use 9.6.4, but neglected to bump the windows images until now. - - - - - 30f06996 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: darwin: Update to 9.6.2 for boot compiler 9.6.4 is currently broken due to #24050 Also update to use LLVM-15 rather than LLVM-11, which is out of date. - - - - - d9d69e12 by Matthew Pickering at 2024-03-01T05:48:07-05:00 Bump minimum bootstrap version to 9.6 - - - - - 67ace1c5 by Matthew Pickering at 2024-03-01T05:48:07-05:00 ci: Enable more documentation building Here we enable documentation building on 1. Darwin: The sphinx toolchain was already installed so we enable html and manpages. 2. Rocky8: Full documentation (toolchain already installed) 3. Alpine: Full documetnation (toolchain already installed) 4. Windows: HTML and manpages (toolchain already installed) Fixes #24465 - - - - - 39583c39 by Matthew Pickering at 2024-03-01T05:48:42-05:00 ci: Bump ci-images to allow updated aarch64-alpine image with llvm15 and clang15 - - - - - d91d00fc by Torsten Schmits at 2024-03-01T15:01:50-05:00 Introduce ListTuplePuns extension This implements Proposal 0475, introducing the `ListTuplePuns` extension which is enabled by default. Disabling this extension makes it invalid to refer to list, tuple and sum type constructors by using built-in syntax like `[Int]`, `(Int, Int)`, `(# Int#, Int# #)` or `(# Int | Int #)`. Instead, this syntax exclusively denotes data constructors for use with `DataKinds`. The conventional way of referring to these data constructors by prefixing them with a single quote (`'(Int, Int)`) is now a parser error. Tuple declarations have been moved to `GHC.Tuple.Prim` and the `Solo` data constructor has been renamed to `MkSolo` (in a previous commit). Unboxed tuples and sums now have real source declarations in `GHC.Types`. Unit and solo types for tuples are now called `Unit`, `Unit#`, `Solo` and `Solo#`. Constraint tuples now have the unambiguous type constructors `CTuple<n>` as well as `CUnit` and `CSolo`, defined in `GHC.Classes` like before. A new parser construct has been added for the unboxed sum data constructor declarations. The type families `Tuple`, `Sum#` etc. that were intended to provide nicer syntax have been omitted from this change set due to inference problems, to be implemented at a later time. See the MR discussion for more info. Updates the submodule utils/haddock. Updates the cabal submodule due to new language extension. Metric Increase: haddock.base Metric Decrease: MultiLayerModulesTH_OneShot size_hello_artifact Proposal document: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst Merge request: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8820 Tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/21294 - - - - - bbdb6286 by Sylvain Henry at 2024-03-01T15:01:50-05:00 JS linker: filter unboxed tuples - - - - - dec6d8d3 by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Improve error messages coming from non-linear patterns This enriched the `CtOrigin` for non-linear patterns to include data of the pattern that created the constraint (which can be quite useful if it occurs nested in a pattern) as well as an explanation why the pattern is non-restricted in (at least in some cases). - - - - - 6612388e by Arnaud Spiwack at 2024-03-01T15:02:30-05:00 Adjust documentation of linear lets according to committee decision - - - - - 1c064ef1 by Cheng Shao at 2024-03-02T17:11:19-05:00 compiler: start deprecating cmmToRawCmmHook cmmToRawCmmHook was added 4 years ago in d561c8f6244f8280a2483e8753c38e39d34c1f01. Its only user is the Asterius project, which has been archived and deprecated in favor of the ghc wasm backend. This patch starts deprecating cmmToRawCmmHook by placing a DEPRECATED pragma, and actual removal shall happen in a future GHC major release if no issue to oppose the deprecation has been raised in the meantime. - - - - - 9b74845f by Andrew Lelechenko at 2024-03-02T17:11:55-05:00 Data.List.NonEmpty.unzip: use WARNING with category instead of DEPRECATED CLC proposal: https://github.com/haskell/core-libraries-committee/issues/258 - - - - - 61bb5ff6 by Finley McIlwaine at 2024-03-04T09:01:40-08:00 add -fprof-late-overloaded and -fprof-late-overloaded-calls * Refactor late cost centre insertion for extensibility * Add two more late cost centre insertion methods that add SCCs to overloaded top level bindings and call sites with dictionary arguments. * Some tests for the basic functionality of the new insertion methods Resolves: #24500 - - - - - 82ccb801 by Andreas Klebinger at 2024-03-04T19:59:14-05:00 x86-ncg: Fix fma codegen when arguments are globals Fix a bug in the x86 ncg where results would be wrong when the desired output register and one of the input registers were the same global. Also adds a tiny optimization to make use of the memory addressing support when convenient. Fixes #24496 - - - - - 18ad1077 by Matthew Pickering at 2024-03-05T14:22:31-05:00 rel_eng: Update hackage docs upload scripts This adds the upload of ghc-internal and ghc-experimental to our scripts which upload packages to hackage. - - - - - bf47c9ba by Matthew Pickering at 2024-03-05T14:22:31-05:00 docs: Remove stray module comment from GHC.Profiling.Eras - - - - - 37d9b340 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix ghc-internal cabal file The file mentioned some artifacts relating to the base library. I have renamed these to the new ghc-internal variants. - - - - - 23f2a478 by Matthew Pickering at 2024-03-05T14:22:31-05:00 Fix haddock source links and hyperlinked source There were a few issues with the hackage links: 1. We were using the package id rather than the package name for the package links. This is fixed by now allowing the template to mention %pkg% or %pkgid% and substituing both appropiatly. 2. The `--haddock-base-url` flag is renamed to `--haddock-for-hackage` as the new base link works on a local or remote hackage server. 3. The "src" path including too much stuff, so cross-package source links were broken as the template was getting double expanded. Fixes #24086 - - - - - 2fa336a9 by Ben Gamari at 2024-03-05T14:23:07-05:00 filepath: Bump submodule to 1.5.2.0 - - - - - 31217944 by Ben Gamari at 2024-03-05T14:23:07-05:00 os-string: Bump submodule to 2.0.2 - - - - - 4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00 base: Reflect new era profiling RTS flags in GHC.RTS.Flags * -he profiling mode * -he profiling selector * --automatic-era-increment CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254 - - - - - a8c0e31b by Sylvain Henry at 2024-03-05T21:45:14-05:00 JS: faster implementation for some numeric primitives (#23597) Use faster implementations for the following primitives in the JS backend by not using JavaScript's BigInt: - plusInt64 - minusInt64 - minusWord64 - timesWord64 - timesInt64 Co-authored-by: Josh Meredith <joshmeredith2008 at gmail.com> - - - - - 21e3f325 by Cheng Shao at 2024-03-05T21:45:52-05:00 rts: add -xr option to control two step allocator reserved space size This patch adds a -xr RTS option to control the size of virtual memory address space reserved by the two step allocator on a 64-bit platform, see added documentation for explanation. Closes #24498. - - - - - dedcf102 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: expose HeapAlloc.h as public header This commit exposes HeapAlloc.h as a public header. The intention is to expose HEAP_ALLOCED/HEAP_ALLOCED_GC, so they can be used in assertions in other public headers, and they may also be useful for user code. - - - - - d19441d7 by Cheng Shao at 2024-03-06T13:39:04-05:00 rts: assert pointer is indeed heap allocated in Bdescr() This commit adds an assertion to Bdescr() to assert the pointer is indeed heap allocated. This is useful to rule out RTS bugs that attempt to access non-existent block descriptor of a static closure, #24492 being one such example. - - - - - 9a656a04 by Ben Gamari at 2024-03-06T13:39:39-05:00 ghc-experimental: Add dummy dependencies to work around #23942 This is a temporary measure to improve CI reliability until a proper solution is developed. Works around #23942. - - - - - 1e84b924 by Simon Peyton Jones at 2024-03-06T13:39:39-05:00 Three compile perf improvements with deep nesting These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425 - - - - - c4b13113 by Hécate Moonlight at 2024-03-06T13:40:17-05:00 Use "module" instead of "library" when applicable in base haddocks - - - - - 9cd9efb4 by Vladislav Zavialov at 2024-03-07T13:01:54+03:00 Rephrase error message to say "visible arguments" (#24318) * Main change: make the error message generated by mkFunTysMsg more accurate by changing "value arguments" to "visible arguments". * Refactor: define a new type synonym VisArity and use it instead of Arity in a few places. It might be the case that there other places in the compiler that should talk about visible arguments rather than value arguments, but I haven't tried to find them all, focusing only on the error message reported in the ticket. - - - - - 4b6e76b5 by Patrick at 2024-03-07T22:09:30+08:00 fix haskell/haddock#24493, with module name introduced in hieAst The accompanies haddoc PR with GHC PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12153 Two things have been done: 1. Link is introduced to every `X` in `module X where`, since we introduce the module name to HieAst, 2. `{-# LINE 4 "hypsrc-test/src/PositionPragmas.hs" #-}` is added before the `module PositionPragmas where` in ` hypsrc-test/ref/src/PositionPragmas.html `.It ensures only a single hieAst for file `hypsrc-test/src/PositionPragmas.hs` is generated. - - - - - d523a6a7 by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump array submodule - - - - - 7e55003c by Ben Gamari at 2024-03-07T19:40:45-05:00 Bump stm submodule - - - - - 32d337ef by Ben Gamari at 2024-03-07T19:40:45-05:00 Introduce exception context Here we introduce the `ExceptionContext` type and `ExceptionAnnotation` class, allowing dynamically-typed user-defined annotations to be attached to exceptions. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 - - - - - 39f3d922 by Ben Gamari at 2024-03-07T19:40:46-05:00 testsuite/interface-stability: Update documentation - - - - - fdea7ada by Ben Gamari at 2024-03-07T19:40:46-05:00 ghc-internal: comment formatting - - - - - 4fba42ef by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Default and warn ExceptionContext constraints - - - - - 3886a205 by Ben Gamari at 2024-03-07T19:40:46-05:00 base: Introduce exception backtraces Here we introduce the `Backtraces` type and associated machinery for attaching these via `ExceptionContext`. These has a few compile-time regressions (`T15703` and `T9872d`) due to the additional dependencies in the exception machinery. As well, there is a surprisingly large regression in the `size_hello_artifact` test. This appears to be due to various `Integer` and `Read` bits now being reachable at link-time. I believe it should be possible to avoid this but I have accepted the change for now to get the feature merged. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/199 GHC Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/330 Metric Increase: T15703 T9872d size_hello_artifact - - - - - 18c5409f by Ben Gamari at 2024-03-07T19:40:46-05:00 users guide: Release notes for exception backtrace work - - - - - f849c5fc by Ben Gamari at 2024-03-07T19:40:46-05:00 compiler: Don't show ExceptionContext of GhcExceptions Most GhcExceptions are user-facing errors and therefore the ExceptionContext has little value. Ideally we would enable it in the DEBUG compiler but I am leaving this for future work. - - - - - dc646e6f by Sylvain Henry at 2024-03-07T19:40:46-05:00 Disable T9930fail for the JS target (cf #19174) - - - - - bfc09760 by Alan Zimmerman at 2024-03-07T19:41:22-05:00 Update showAstData to honour blanking of AnnParen Also tweak rendering of SrcSpan to remove extra blank line. - - - - - 50454a29 by Ben Gamari at 2024-03-08T03:32:42-05:00 ghc-internal: Eliminate GHC.Internal.Data.Kind This was simply reexporting things from `ghc-prim`. Instead reexport these directly from `Data.Kind`. Also add build ordering dependency to work around #23942. - - - - - 38a4b6ab by Ben Gamari at 2024-03-08T03:33:18-05:00 rts: Fix SET_HDR initialization of retainer set This fixes a regression in retainer set profiling introduced by b0293f78cb6acf2540389e22bdda420d0ab874da. Prior to that commit the heap traversal word would be initialized by `SET_HDR` using `LDV_RECORD_CREATE`. However, the commit added a `doingLDVProfiling` check in `LDV_RECORD_CREATE`, meaning that this initialization no longer happened. Given that this initialization was awkwardly indirectly anyways, I have fixed this by explicitly initializating the heap traversal word to `NULL` in `SET_PROF_HDR`. This is equivalent to the previous behavior, but much more direct. Fixes #24513. - - - - - 635abccc by Ben Gamari at 2024-03-08T17:09:06-05:00 Bump ghc version to 9.10 - - - - - 2859a637 by Ben Gamari at 2024-03-08T18:26:47-05:00 base: Use strerror_r instead of strerror As noted by #24344, `strerror` is not necessarily thread-safe. Thankfully, POSIX.1-2001 has long offered `strerror_r`, which is safe to use. Fixes #24344. CLC discussion: https://github.com/haskell/core-libraries-committee/issues/249 - - - - - 5b934048 by Ben Gamari at 2024-03-08T18:50:12-05:00 Bump base upper bound - - - - - b30d134e by Ben Gamari at 2024-03-08T18:50:44-05:00 Testsuite output update - - - - - edb9bf77 by Jade at 2024-03-09T03:39:38-05:00 Error messages: Improve Error messages for Data constructors in type signatures. This patch improves the error messages from invalid type signatures by trying to guess what the user did and suggesting an appropriate fix. Partially fixes: #17879 - - - - - cfb197e3 by Patrick at 2024-03-09T03:40:15-05:00 HieAst: add module name #24493 The main purpose of this is to tuck the module name `xxx` in `module xxx where` into the hieAst. It should fix #24493. The following have been done: 1. Renamed and update the `tcg_doc_hdr :: Maybe (LHsDoc GhcRn)` to `tcg_hdr_info :: (Maybe (LHsDoc GhcRn), Maybe (XRec GhcRn ModuleName))` To store the located module name information. 2. update the `RenamedSource` and `RenamedStuff` with extra `Maybe (XRec GhcRn ModuleName)` located module name information. 3. add test `testsuite/tests/hiefile/should_compile/T24493.hs` to ensure the module name is added and update several relevent tests. 4. accompanied submodule haddoc test update MR in https://gitlab.haskell.org/ghc/haddock/-/merge_requests/53 - - - - - 2341d81e by Vaibhav Sagar at 2024-03-09T03:40:54-05:00 GHC.Utils.Binary: fix a couple of typos - - - - - 5580e1bd by Ben Gamari at 2024-03-09T03:41:30-05:00 rts: Drop .wasm suffix from .prof file names This replicates the behavior on Windows, where `Hi.exe` will produce profiling output named `Hi.prof` instead of `Hi.exe.prof`. While in the area I also fixed the extension-stripping logic, which incorrectly rewrote `Hi.exefoo` to `Hi.foo`. Closes #24515. - - - - - 259495ee by Cheng Shao at 2024-03-09T03:41:30-05:00 testsuite: drop exe extension from .hp & .prof filenames See #24515 for details. - - - - - c477a8d2 by Ben Gamari at 2024-03-09T03:42:05-05:00 rts/linker: Enable GOT support on all platforms There is nothing platform-dependent about our GOT implementation and GOT support is needed by `T24171` on i386. - - - - - 2e592857 by Vladislav Zavialov at 2024-03-09T03:42:41-05:00 Drop outdated comment on TcRnIllformedTypePattern This should have been done in 0f0c53a501b but I missed it. - - - - - c554b4da by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Bounds check array write - - - - - 15c590a5 by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/CloneStack: Don't expose helper functions in header - - - - - e831ce31 by Ben Gamari at 2024-03-09T09:39:20-05:00 base: Move internals of GHC.InfoProv into GHC.InfoProv.Types Such that we can add new helpers into GHC.InfoProv.Types without breakage. - - - - - 6948e24d by Ben Gamari at 2024-03-09T09:39:20-05:00 rts: Lazily decode IPE tables Previously we would eagerly allocate `InfoTableEnt`s for each info table registered in the info table provenance map. However, this costs considerable memory and initialization time. Instead we now lazily decode these tables. This allows us to use one-third the memory *and* opens the door to taking advantage of sharing opportunities within a module. This required considerable reworking since lookupIPE now must be passed its result buffer. - - - - - 9204a04e by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Don't expose helper in header - - - - - 308926ff by Ben Gamari at 2024-03-09T09:39:20-05:00 rts/IPE: Share module_name within a Node This allows us to shave a 64-bit word off of the packed IPE entry size. - - - - - bebdea05 by Ben Gamari at 2024-03-09T09:39:20-05:00 IPE: Expose unit ID in InfoTableProv Here we add the unit ID to the info table provenance structure. - - - - - 6519c9ad by Ben Gamari at 2024-03-09T09:39:35-05:00 rts: Refactor GHC.Stack.CloneStack.decode Don't allocate a Ptr constructor per frame. - - - - - ed0b69dc by Ben Gamari at 2024-03-09T09:39:35-05:00 base: Do not expose whereFrom# from GHC.Exts - - - - - 2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00 docs: Update info on TypeAbstractions * Mention TypeAbstractions in 9.10.1-notes.rst * Set the status to "Experimental". * Add a "Since: GHC 9.x" comment to each section. - - - - - f8b88918 by Ben Gamari at 2024-03-09T21:21:46-05:00 ci-images: Bump Alpine image to bootstrap with 9.8.2 - - - - - 705e6927 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark T24171 as fragile due to #24512 I will fix this but not in time for 9.10.1-alpha1 - - - - - c74196e1 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Mark linker_unload_native as fragile In particular this fails on platforms without `dlinfo`. I plan to address this but not before 9.10.1-alpha1. - - - - - f4d87f7a by Ben Gamari at 2024-03-09T21:21:46-05:00 configure: Bump version to 9.10 - - - - - 88df9a5f by Ben Gamari at 2024-03-09T21:21:46-05:00 Bump transformers submodule to 0.6.1.1 - - - - - 8176d5e8 by Ben Gamari at 2024-03-09T21:21:46-05:00 testsuite: Increase ulimit for T18623 1 MByte was just too tight and failed intermittently on some platforms (e.g. CentOS 7). Bumping the limit to 8 MByte should provide sufficient headroom. Fixes #23139. - - - - - c74b38a3 by Ben Gamari at 2024-03-09T21:21:46-05:00 base: Bump version to 4.20.0.0 - - - - - b2937fc3 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-internal: Set initial version at 9.1001.0 This provides PVP compliance while maintaining a clear correspondence between GHC releases and `ghc-internal` versions. - - - - - 4ae7d868 by Ben Gamari at 2024-03-09T21:21:46-05:00 ghc-prim: Bump version to 0.11.0 - - - - - 50798dc6 by Ben Gamari at 2024-03-09T21:21:46-05:00 template-haskell: Bump version to 2.22.0.0 - - - - - 8564f976 by Ben Gamari at 2024-03-09T21:21:46-05:00 base-exports: Accommodate spurious whitespace changes in 32-bit output It appears that this was - - - - - 9d4f0e98 by Ben Gamari at 2024-03-09T21:21:46-05:00 users-guide: Move exception backtrace relnotes to 9.10 This was previously mistakenly added to the GHC 9.8 release notes. - - - - - 145eae60 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix name of Rocky8 artifact - - - - - 39c2a630 by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/rel_eng: Fix path of generate_jobs_metadata - - - - - aed034de by Ben Gamari at 2024-03-09T21:21:46-05:00 gitlab/upload: Rework recompression The old `combine` approach was quite fragile due to use of filename globbing. Moreover, it didn't parallelize well. This refactoring makes the goal more obvious, parallelizes better, and is more robust. - - - - - 9bdf3586 by Ben Gamari at 2024-03-09T21:37:44-05:00 Merge branch 'ghc-9.10' into ghc-head - - - - - cec76981 by Ben Gamari at 2024-03-09T21:54:00-05:00 Bump GHC version to 9.11 - - - - - 4c59feb7 by Ben Gamari at 2024-03-09T22:15:01-05:00 Merge remote-tracking branch 'origin/ghc-head' into ghc-head - - - - - dc207d06 by Ben Gamari at 2024-03-10T08:56:08-04:00 configure: Bump GHC version to 9.11 Bumps haddock submodule. - - - - - 8b2513e8 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload code when profiling is enabled The heap census may contain references (e.g. `Counter.identity`) to static data which must be available when the census is reported at the end of execution. Fixes #24512. - - - - - 7810b4c3 by Ben Gamari at 2024-03-11T01:20:03-04:00 rts/linker: Don't unload native objects when dlinfo isn't available To do so is unsafe as we have no way of identifying references to symbols provided by the object. Fixes #24513. Fixes #23993. - - - - - 0590764c by Ben Gamari at 2024-03-11T01:20:39-04:00 rel_eng/upload: Purge both $rel_name/ and $ver/ This is necessary for prereleases, where GHCup accesses the release via `$ver/` - - - - - b85a4631 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Remove duplicate code normalising slashes - - - - - c91946f9 by Brandon Chinn at 2024-03-12T19:25:56-04:00 Simplify regexes with raw strings - - - - - 1a5f53c6 by Brandon Chinn at 2024-03-12T19:25:57-04:00 Don't normalize backslashes in characters - - - - - 7ea971d3 by Andrei Borzenkov at 2024-03-12T19:26:32-04:00 Fix compiler crash caused by implicit RHS quantification in type synonyms (#24470) - - - - - 39f3ac3e by Cheng Shao at 2024-03-12T19:27:11-04:00 Revert "compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms" This reverts commit 615eb855416ce536e02ed935ecc5a6f25519ae16. It was originally intended to fix #24449, but it was merely sweeping the bug under the rug. 3836a110577b5c9343915fd96c1b2c64217e0082 has properly fixed the fragile test, and we no longer need the C version of genSym. Furthermore, the C implementation causes trouble when compiling with clang that targets i386 due to alignment warning and libatomic linking issue, so it makes sense to revert it. - - - - - e6bfb85c by Cheng Shao at 2024-03-12T19:27:11-04:00 compiler: fix out-of-bound memory access of genSym on 32-bit This commit fixes an unnoticed out-of-bound memory access of genSym on 32-bit. ghc_unique_inc is 32-bit sized/aligned on 32-bit platforms, but we mistakenly treat it as a Word64 pointer in genSym, and therefore will accidentally load 2 garbage higher bytes, or with a small but non-zero chance, overwrite something else in the data section depends on how the linker places the data segments. This regression was introduced in !11802 and fixed here. - - - - - 77171cd1 by Ben Orchard at 2024-03-14T09:00:40-04:00 Note mutability of array and address access primops Without an understanding of immutable vs. mutable memory, the index primop family have a potentially non-intuitive type signature: indexOffAddr :: Addr# -> Int# -> a readOffAddr :: Addr# -> Int# -> State# d -> (# State# d, a #) indexOffAddr# might seem like a free generality improvement, which it certainly is not! This change adds a brief note on mutability expectations for most index/read/write access primops. - - - - - 7da7f8f6 by Alan Zimmerman at 2024-03-14T09:01:15-04:00 EPA: Fix regression discarding comments in contexts Closes #24533 - - - - - 73be65ab by Fendor at 2024-03-19T01:42:53-04:00 Fix sharing of 'IfaceTyConInfo' during core to iface type translation During heap analysis, we noticed that during generation of 'mi_extra_decls' we have lots of duplicates for the instances: * `IfaceTyConInfo NotPromoted IfaceNormalTyCon` * `IfaceTyConInfo IsPromoted IfaceNormalTyCon` which should be shared instead of duplicated. This duplication increased the number of live bytes by around 200MB while loading the agda codebase into GHCi. These instances are created during `CoreToIface` translation, in particular `toIfaceTyCon`. The generated core looks like: toIfaceTyCon = \ tc_sjJw -> case $wtoIfaceTyCon tc_sjJw of { (# ww_sjJz, ww1_sjNL, ww2_sjNM #) -> IfaceTyCon ww_sjJz (IfaceTyConInfo ww1_sjNL ww2_sjNM) } whichs removes causes the sharing to work propery. Adding explicit sharing, with NOINLINE annotations, changes the core to: toIfaceTyCon = \ tc_sjJq -> case $wtoIfaceTyCon tc_sjJq of { (# ww_sjNB, ww1_sjNC #) -> IfaceTyCon ww_sjNB ww1_sjNC } which looks much more like sharing is happening. We confirmed via ghc-debug that all duplications were eliminated and the number of live bytes are noticeably reduced. - - - - - bd8209eb by Alan Zimmerman at 2024-03-19T01:43:28-04:00 EPA: Address more 9.10.1-alpha1 regressions from recent changes Closes #24533 Hopefully for good this time - - - - - 31bf85ee by Fendor at 2024-03-19T14:48:08-04:00 Escape multiple arguments in the settings file Uses responseFile syntax. The issue arises when GHC is installed on windows into a location that has a space, for example the user name is 'Fake User'. The $topdir will also contain a space, consequentially. When we resolve the top dir in the string `-I$topdir/mingw/include`, then `words` will turn this single argument into `-I/C/Users/Fake` and `User/.../mingw/include` which trips up the flag argument parser of various tools such as gcc or clang. We avoid this by escaping the $topdir before replacing it in `initSettngs`. Additionally, we allow to escape spaces and quotation marks for arguments in `settings` file. Add regression test case to count the number of options after variable expansion and argument escaping took place. Additionally, we check that escaped spaces and double quotation marks are correctly parsed. - - - - - f45f700e by Matthew Pickering at 2024-03-19T14:48:44-04:00 Read global package database from settings file Before this patch, the global package database was always assumed to be in libdir </> package.conf.d. This causes issues in GHC's build system because there are sometimes situations where the package database you need to use is not located in the same place as the settings file. * The stage1 compiler needs to use stage1 libraries, so we should set "Global Package DB" for the stage1 compiler to the stage1 package database. * Stage 2 cross compilers need to use stage2 libraries, so likewise, we should set the package database path to `_build/stage2/lib/` * The normal situation is where the stage2 compiler uses stage1 libraries. Then everything lines up. * When installing we have rearranged everything so that the settings file and package database line up properly, so then everything should continue to work as before. In this case we set the relative package db path to `package.conf.d`, so it resolves the same as before. * ghc-pkg needs to be modified as well to look in the settings file fo the package database rather than assuming the global package database location relative to the lib folder. * Cabal/cabal-install will work correctly because they query the global package database using `--print-global-package-db`. A reasonable question is why not generate the "right" settings files in the right places in GHC's build system. In order to do this you would need to engineer wrappers for all executables to point to a specific libdir. There are also situations where the same package db is used by two different compilers with two different settings files (think stage2 cross compiler and stage3 compiler). In short, this 10 line patch allows for some reasonable simplifications in Hadrian at very little cost to anything else. Fixes #24502 - - - - - 4c8f1794 by Matthew Pickering at 2024-03-19T14:48:44-04:00 hadrian: Remove stage1 testsuite wrappers logic Now instead of producing wrappers which pass the global package database argument to ghc and ghc-pkg, we write the location of the correct package database into the settings file so you can just use the intree compiler directly. - - - - - da0d8ba5 by Matthew Craven at 2024-03-19T14:49:20-04:00 Remove unused ghc-internal module "GHC.Internal.Constants" - - - - - b56d2761 by Matthew Craven at 2024-03-19T14:49:20-04:00 CorePrep: Rework lowering of BigNat# literals Don't use bigNatFromWord#, because that's terrible: * We shouldn't have to traverse a linked list at run-time to build a BigNat# literal. That's just silly! * The static List object we have to create is much larger than the actual BigNat#'s contents, bloating code size. * We have to read the corresponding interface file, which causes un-tracked implicit dependencies. (#23942) Instead, encode them into the appropriate platform-dependent sequence of bytes, and generate code that copies these bytes at run-time from an Addr# literal into a new ByteArray#. A ByteArray# literal would be the correct thing to generate, but these are not yet supported; see also #17747. Somewhat surprisingly, this change results in a slight reduction in compiler allocations, averaging around 0.5% on ghc's compiler performance tests, including when compiling programs that contain no bignum literals to begin with. The specific cause of this has not been investigated. Since this lowering no longer reads the interface file for GHC.Num.BigNat, the reasoning in Note [Depend on GHC.Num.Integer] is obsoleted. But the story of un-tracked built-in dependencies remains complex, and Note [Tracking dependencies on primitives] now exists to explain this complexity. Additionally, many empty imports have been modified to refer to this new note and comply with its guidance. Several empty imports necessary for other reasons have also been given brief explanations. Metric Decrease: MultiLayerModulesTH_OneShot - - - - - 349ea330 by Fendor at 2024-03-19T14:50:00-04:00 Eliminate thunk in 'IfaceTyCon' Heap analysis showed that `IfaceTyCon` retains a thunk to `IfaceTyConInfo`, defeating the sharing of the most common instances of `IfaceTyConInfo`. We make sure the indirection is removed by adding bang patterns to `IfaceTyCon`. Experimental results on the agda code base, where the `mi_extra_decls` were read from disk: Before this change, we observe around 8654045 instances of: `IfaceTyCon[Name,THUNK_1_0]` But these thunks almost exclusively point to a shared value! Forcing the thunk a little bit more, leads to `ghc-debug` reporting: `IfaceTyCon[Name:Name,IfaceTyConInfo]` and a noticeable reduction of live bytes (on agda ~10%). - - - - - 594bee0b by Krzysztof Gogolewski at 2024-03-19T14:50:36-04:00 Minor misc cleanups - GHC.HsToCore.Foreign.JavaScript: remove dropRuntimeRepArgs; boxed tuples don't take RuntimeRep args - GHC.HsToCore.Foreign.Call: avoid partial pattern matching - GHC.Stg.Unarise: strengthen the assertion; we can assert that non-rubbish literals are unary rather than just non-void - GHC.Tc.Gen.HsType: make sure the fsLit "literal" rule fires - users_guide/using-warnings.rst: remove -Wforall-identifier, now deprecated and does nothing - users_guide/using.rst: fix formatting - andy_cherry/test.T: remove expect_broken_for(23272...), 23272 is fixed The rest are simple cleanups. - - - - - cf55a54b by Ben Gamari at 2024-03-19T14:51:12-04:00 mk/relpath: Fix quoting Previously there were two instances in this script which lacked proper quoting. This resulted in `relpath` invocations in the binary distribution Makefile producing incorrect results on Windows, leading to confusing failures from `sed` and the production of empty package registrations. Fixes #24538. - - - - - 5ff88389 by Bryan Richter at 2024-03-19T14:51:48-04:00 testsuite: Disable T21336a on wasm - - - - - 60023351 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian/bindist: Eliminate extraneous `dirname` invocation Previously we would call `dirname` twice per installed library file. We now instead reuse this result. This helps appreciably on Windows, where processes are quite expensive. - - - - - 616ac300 by Ben Gamari at 2024-03-19T22:33:10-04:00 hadrian: Package mingw toolchain in expected location This fixes #24525, a regression due to 41cbaf44a6ab5eb9fa676d65d32df8377898dc89. Specifically, GHC expects to find the mingw32 toolchain in the binary distribution root. However, after this patch it was packaged in the `lib/` directory. - - - - - de9daade by Ben Gamari at 2024-03-19T22:33:11-04:00 gitlab/rel_eng: More upload.sh tweaks - - - - - 1dfe12db by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_eng: Drop dead prepare_docs codepath - - - - - dd2d748b by Ben Gamari at 2024-03-19T22:33:11-04:00 rel_env/recompress_all: unxz before recompressing Previously we would rather compress the xz *again*, before in addition compressing it with the desired scheme. Fixes #24545. - - - - - 9d936c57 by Ben Gamari at 2024-03-19T22:33:11-04:00 mk-ghcup-metadata: Fix directory of testsuite tarball As reported in #24546, the `dlTest` artifact should be extracted into the `testsuite` directory. - - - - - 6d398066 by Ben Gamari at 2024-03-19T22:33:11-04:00 ghcup-metadata: Don't populate dlOutput unless necessary ghcup can apparently infer the output name of an artifact from its URL. Consequently, we should only include the `dlOutput` field when it would differ from the filename of `dlUri`. Fixes #24547. - - - - - 576f8b7e by Zubin Duggal at 2024-03-19T22:33:46-04:00 Revert "Apply shellcheck suggestion to SUBST_TOOLDIR" This reverts commit c82770f57977a2b5add6e1378f234f8dd6153392. The shellcheck suggestion is spurious and results in SUBST_TOOLDIR being a no-op. `set` sets positional arguments for bash, but we want to set the variable given as the first autoconf argument. Fixes #24542 Metric decreases because the paths in the settings file are now shorter, so we allocate less when we read the settings file. ------------------------- Metric Decrease: T12425 T13035 T9198 ------------------------- - - - - - cdfe6e01 by Fendor at 2024-03-19T22:34:22-04:00 Compact serialisation of IfaceAppArgs In #24563, we identified that IfaceAppArgs serialisation tags each cons cell element with a discriminator byte. These bytes add up quickly, blowing up interface files considerably when '-fwrite-if-simplified-core' is enabled. We compact the serialisation by writing out the length of 'IfaceAppArgs', followed by serialising the elements directly without any discriminator byte. This improvement can decrease the size of some interface files by up to 35%. - - - - - 97a2bb1c by Simon Peyton Jones at 2024-03-20T17:11:29+00:00 Expand untyped splices in tcPolyExprCheck Fixes #24559 - - - - - 5f275176 by Alan Zimmerman at 2024-03-20T22:44:12-04:00 EPA: Clean up Exactprint helper functions a bit - Introduce a helper lens to compose on `EpAnn a` vs `a` versions - Rename some prime versions of functions back to non-prime They were renamed during the rework - - - - - da2a10ce by Vladislav Zavialov at 2024-03-20T22:44:48-04:00 Type operators in promoteOccName (#24570) Type operators differ from term operators in that they are lexically classified as (type) constructors, not as (type) variables. Prior to this change, promoteOccName did not account for this difference, causing a scoping issue that affected RequiredTypeArguments. type (!@#) = Bool f = idee (!@#) -- Not in scope: ‘!@#’ (BUG) Now we have a special case in promoteOccName to account for this. - - - - - 247fc0fa by Preetham Gujjula at 2024-03-21T10:19:18-04:00 docs: Remove mention of non-existent Ord instance for Complex The documentation for Data.Complex says that the Ord instance for Complex Float is deficient, but there is no Ord instance for Complex a. The Eq instance for Complex Float is similarly deficient, so we use that as an example instead. - - - - - 6fafc51e by Andrei Borzenkov at 2024-03-21T10:19:54-04:00 Fix TH handling in `pat_to_type_pat` function (#24571) There was missing case for `SplicePat` in `pat_to_type_at` function, hence patterns with splicing that checked against `forall->` doesn't work properly because they fall into the "illegal pattern" case. Code example that is now accepted: g :: forall a -> () g $([p| a |]) = () - - - - - 52072f8e by Sylvain Henry at 2024-03-21T21:01:59-04:00 Type-check default declarations before deriving clauses (#24566) See added Note and #24566. Default declarations must be type-checked before deriving clauses. - - - - - 7dfdf3d9 by Sylvain Henry at 2024-03-21T21:02:40-04:00 Lexer: small perf changes - Use unsafeChr because we know our values to be valid - Remove some unnecessary use of `ord` (return Word8 values directly) - - - - - 864922ef by Sylvain Henry at 2024-03-21T21:02:40-04:00 JS: fix some comments - - - - - 3e0b2b1f by Sebastian Graf at 2024-03-21T21:03:16-04:00 Simplifier: Re-do dependency analysis in abstractFloats (#24551) In #24551, we abstracted a string literal binding over a type variable, triggering a CoreLint error when that binding floated to top-level. The solution implemented in this patch fixes this by re-doing dependency analysis on a simplified recursive let binding that is about to be type abstracted, in order to find the minimal set of type variables to abstract over. See wrinkle (AB5) of Note [Floating and type abstraction] for more details. Fixes #24551 - - - - - 8a8ac65a by Matthew Craven at 2024-03-23T00:20:52-04:00 Improve toInteger @Word32 on 64-bit platforms On 64-bit platforms, every Word32 fits in an Int, so we can convert to Int# without having to perform the overflow check integerFromWord# uses internally. - - - - - 0c48f2b9 by Apoorv Ingle at 2024-03-23T00:21:28-04:00 Fix for #24552 (see testcase T24552) Fixes for a bug in desugaring pattern synonyms matches, introduced while working on on expanding `do`-blocks in #18324 The `matchWrapper` unecessarily (and incorrectly) filtered out the default wild patterns in a match. Now the wild pattern alternative is simply ignored by the pm check as its origin is `Generated`. The current code now matches the expected semantics according to the language spec. - - - - - b72705e9 by Simon Peyton Jones at 2024-03-23T00:22:04-04:00 Print more info about kinds in error messages This fixes #24553, where GHC unhelpfully said error: [GHC-83865] • Expected kind ‘* -> * -> *’, but ‘Foo’ has kind ‘* -> * -> *’ See Note [Showing invisible bits of types in error messages] - - - - - 8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00 docs: remove the don't use float hint This hint is outdated, ``Complex Float`` are now specialised, and the heap space suggestion needs more nuance so it should be explained in the unboxed/storable array documentation. - - - - - 5bd8ed53 by Andreas Klebinger at 2024-03-23T16:18:33-04:00 NCG: Fix a bug in jump shortcutting. When checking if a jump has more than one destination account for the possibility of some jumps not being representable by a BlockId. We do so by having isJumpishInstr return a `Maybe BlockId` where Nothing represents non-BlockId jump destinations. Fixes #24507 - - - - - 8d67f247 by Ben Gamari at 2024-03-23T16:19:09-04:00 docs: Drop old release notes, add for 9.12.1 - - - - - 7db8c992 by Cheng Shao at 2024-03-25T13:45:46-04:00 rts: fix clang compilation on aarch64 This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h which causes "error: address argument to atomic operation must be a pointer to _Atomic type" when compiling with clang on aarch64. - - - - - 237194ce by Sylvain Henry at 2024-03-25T13:46:27-04:00 Lexer: fix imports for Alex 3.5.1 (#24583) - - - - - 810660b7 by Cheng Shao at 2024-03-25T22:19:16-04:00 libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6 This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which includes numerous upstream libffi fixes, especially https://github.com/libffi/libffi/issues/760. - - - - - d2ba41e8 by Alan Zimmerman at 2024-03-25T22:19:51-04:00 EPA: do not duplicate comments in signature RHS - - - - - 32a8103f by Rodrigo Mesquita at 2024-03-26T21:16:12-04:00 configure: Use LDFLAGS when trying linkers A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to check for a working linker. If either of these fail, we try the next in line. However, we were not considering the `$LDFLAGS` when checking if these linkers worked. So we would pick a linker that does not support the current $LDFLAGS and fail further down the line when we used that linker with those flags. Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not supported by `ld.gold` but that was being picked still. - - - - - bf65a7c3 by Rodrigo Mesquita at 2024-03-26T21:16:48-04:00 bindist: Clean xattrs of bin and lib at configure time For issue #21506, we started cleaning the extended attributes of binaries and libraries from the bindist *after* they were installed to workaround notarisation (#17418), as part of `make install`. However, the `ghc-toolchain` binary that is now shipped with the bindist must be run at `./configure` time. Since we only cleaned the xattributes of the binaries and libs after they were installed, in some situations users would be unable to run `ghc-toolchain` from the bindist, failing at configure time (#24554). In this commit we move the xattr cleaning logic to the configure script. Fixes #24554 - - - - - cfeb70d3 by Rodrigo Mesquita at 2024-03-26T21:17:24-04:00 Revert "NCG: Fix a bug in jump shortcutting." This reverts commit 5bd8ed53dcefe10b72acb5729789e19ceb22df66. Fixes #24586 - - - - - 13223f6d by Serge S. Gulin at 2024-03-27T07:28:51-04:00 JS: `h$rts_isProfiled` is removed from `profiling` and left its version at `rts/js/config.js` - - - - - 0acfe391 by Alan Zimmerman at 2024-03-27T07:29:27-04:00 EPA: Do not extend declaration range for trailine zero len semi The lexer inserts virtual semicolons having zero width. Do not use them to extend the list span of items in a list. - - - - - cd0fb82f by Alan Zimmerman at 2024-03-27T19:33:08+00:00 EPA: Fix FamDecl range The span was incorrect if opt_datafam_kind_sig was empty - - - - - f8f384a8 by Ben Gamari at 2024-03-29T01:23:03-04:00 Fix type of _get_osfhandle foreign import Fixes #24601. - - - - - 00d3ecf0 by Alan Zimmerman at 2024-03-29T12:19:10+00:00 EPA: Extend StringLiteral range to include trailing commas This goes slightly against the exact printing philosophy where trailing decorations should be in an annotation, but the practicalities of adding it to the WarningTxt environment, and the problems caused by deviating do not make a more principles approach worthwhile. - - - - - efab3649 by brandon s allbery kf8nh at 2024-03-31T20:04:01-04:00 clarify Note [Preproccesing invocations] - - - - - c8a4c050 by Ben Gamari at 2024-04-02T12:50:35-04:00 rts: Fix TSAN_ENABLED CPP guard This should be `#if defined(TSAN_ENABLED)`, not `#if TSAN_ENABLED`, lest we suffer warnings. - - - - - e91dad93 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix errors when compiling with TSAN This commit fixes rts compilation errors when compiling with TSAN: - xxx_FENCE macros are redefined and trigger CPP warnings. - Use SIZEOF_W. WORD_SIZE_IN_BITS is provided by MachDeps.h which Cmm.h doesn't include by default. - - - - - a9ab9455 by Cheng Shao at 2024-04-02T12:50:35-04:00 rts: fix clang-specific errors when compiling with TSAN This commit fixes clang-specific rts compilation errors when compiling with TSAN: - clang doesn't have -Wtsan flag - Fix prototype of ghc_tsan_* helper functions - __tsan_atomic_* functions aren't clang built-ins and sanitizer/tsan_interface_atomic.h needs to be included - On macOS, TSAN runtime library is libclang_rt.tsan_osx_dynamic.dylib, not libtsan. -fsanitize-thread as a link-time flag will take care of linking the TSAN runtime library anyway so remove tsan as an rts extra library - - - - - 865bd717 by Cheng Shao at 2024-04-02T12:50:35-04:00 compiler: fix github link to __tsan_memory_order in a comment - - - - - 07cb627c by Cheng Shao at 2024-04-02T12:50:35-04:00 ci: improve TSAN CI jobs - Run TSAN jobs with +thread_sanitizer_cmm which enables Cmm instrumentation as well. - Run TSAN jobs in deb12 which ships gcc-12, a reasonably recent gcc that @bgamari confirms he's using in #GHC:matrix.org. Ideally we should be using latest clang release for latest improvements in sanitizers, though that's left as future work. - Mark TSAN jobs as manual+allow_failure in validate pipelines. The purpose is to demonstrate that we have indeed at least fixed building of TSAN mode in CI without blocking the patch to land, and once merged other people can begin playing with TSAN using their own dev setups and feature branches. - - - - - a1c18c7b by Andrei Borzenkov at 2024-04-02T12:51:11-04:00 Merge tc_infer_hs_type and tc_hs_type into one function using ExpType philosophy (#24299, #23639) This patch implements refactoring which is a prerequisite to updating kind checking of type patterns. This is a huge simplification of the main worker that checks kind of HsType. It also fixes the issues caused by previous code duplication, e.g. that we didn't add module finalizers from splices in inference mode. - - - - - 817e8936 by Rodrigo Mesquita at 2024-04-02T20:13:05-04:00 th: Hide the Language.Haskell.TH.Lib.Internal module from haddock Fixes #24562 - - - - - b36ee57b by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: reenable h$appendToHsString optimization (#24495) The optimization introducing h$appendToHsString wasn't kicking in anymore (while it did in 9.8.1) because of the changes introduced in #23270 (7e0c8b3bab30). This patch reenables the optimization by matching on case-expression, as done in Cmm for unpackCString# standard thunks. The test is also T24495 added in the next commits (two commits for ease of backporting to 9.8). - - - - - 527616e9 by Sylvain Henry at 2024-04-02T20:13:46-04:00 JS: fix h$appendToHsString implementation (#24495) h$appendToHsString needs to wrap its argument in an updatable thunk to behave like unpackAppendCString#. Otherwise if a SingleEntry thunk is passed, it is stored as-is in a CONS cell, making the resulting list impossible to deepseq (forcing the thunk doesn't update the contents of the CONS cell)! The added test checks that the optimization kicks in and that h$appendToHsString works as intended. Fix #24495 - - - - - faa30b41 by Simon Peyton Jones at 2024-04-02T20:14:22-04:00 Deal with duplicate tyvars in type declarations GHC was outright crashing before this fix: #24604 - - - - - e0b0c717 by Simon Peyton Jones at 2024-04-02T20:14:58-04:00 Try using MCoercion in exprIsConApp_maybe This is just a simple refactor that makes exprIsConApp_maybe a little bit more direct, simple, and efficient. Metrics: compile_time/bytes allocated geo. mean -0.1% minimum -2.0% maximum -0.0% Not a big gain, but worthwhile given that the code is, if anything, easier to grok. - - - - - 15f4d867 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Initial ./configure support for selecting I/O managers In this patch we just define new CPP vars, but don't yet use them or replace the existing approach. That will follow. The intention here is that every I/O manager can be enabled/disabled at GHC build time (subject to some constraints). More than one I/O manager can be enabled to be built. At least one I/O manager supporting the non-threaded RTS must be enabled as well as at least one supporting the non-threaded RTS. The I/O managers enabled here will become the choices available at runtime at RTS startup (in later patches). The choice can be made with RTS flags. There are separate sets of choices for the threaded and non-threaded RTS ways, because most I/O managers are specific to these ways. Furthermore we must establish a default I/O manager for the threaded and non-threaded RTS. Most I/O managers are platform-specific so there are checks to ensure each one can be enabled on the platform. Such checks are also where (in future) any system dependencies (e.g. libraries) can be checked. The output is a set of CPP flags (in the mk/config.h file), with one flag per named I/O manager: * IOMGR_BUILD_<name> : which ones should be built (some) * IOMGR_DEFAULT_NON_THREADED_<name> : which one is default (exactly one) * IOMGR_DEFAULT_THREADED_<name> : which one is default (exactly one) and a set of derived flags in IOManager.h * IOMGR_ENABLED_<name> : enabled for the current RTS way Note that IOMGR_BUILD_<name> just says that an I/O manager will be built for _some_ RTS way (i.e. threaded or non-threaded). The derived flags IOMGR_ENABLED_<name> in IOManager.h say if each I/O manager is enabled in the "current" RTS way. These are the ones that can be used for conditional compilation of the I/O manager code. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - 85b0f87a by Duncan Coutts at 2024-04-03T01:27:17-04:00 Change the handling of the RTS flag --io-manager= Now instead of it being just used on Windows to select between the WinIO vs the MIO or Win32-legacy I/O managers, it is now used on all platforms for selecting the I/O manager to use. Right now it remains the case that there is only an actual choice on Windows, but that will change later. Document the --io-manager flag in the user guide. This change is also reflected in the RTS flags types in the base library. Deprecate the export of IoSubSystem from GHC.RTS.Flags with a message to import it from GHC.IO.Subsystem. The way the 'IoSubSystem' is detected also changes. Instead of looking at the RTS flag, there is now a C bool global var in the RTS which gets set on startup when the I/O manager is selected. This bool var says whether the selected I/O manager classifies as "native" on Windows, which in practice means the WinIO I/O manager has been selected. Similarly, the is_io_mng_native_p RTS helper function is re-implemented in terms of the selected I/O manager, rather than based on the RTS flags. We do however remove the ./configure --native-io-manager flag because we're bringing the WinIO/MIO/Win32-legacy choice under the new general scheme for selecting I/O managers, and that new scheme involves no ./configure time user choices, just runtime RTS flag choices. - - - - - 1a8f020f by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert {init,stop,exit}IOManager to switch style Rather than ad-hoc cpp conitionals on THREADED_RTS and mingw32_HOST_OS, we use a style where we switch on the I/O manager impl, with cases for each I/O manager impl. - - - - - a5bad3d2 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Split up the CapIOManager content by I/O manager Using the new IOMGR_ENABLED_<name> CPP defines. - - - - - 1d36e609 by Duncan Coutts at 2024-04-03T01:27:17-04:00 Convert initIOManagerAfterFork and wakeupIOManager to switch style - - - - - c2f26f36 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of waitRead#/Write# from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. - - - - - 457705a8 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move most of the delay# impl from cmm to C Moves it into the IOManager.c where we can follow the new pattern of switching on the selected I/O manager. Uses a new IOManager API: syncDelay, following the naming convention of sync* for thread-synchronous I/O & timer/delay operations. As part of porting from cmm to C, we maintain the rule that the why_blocked gets accessed using load acquire and store release atomic memory operations. There was one exception to this rule: in the delay# primop cmm code on posix (not win32), the why_blocked was being updated using a store relaxed, not a store release. I've no idea why. In this convesion I'm playing it safe here and using store release consistently. - - - - - e93058e0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 insertIntoSleepingQueue is no longer public No longer defined in IOManager.h, just a private function in IOManager.c. Since it is no longer called from cmm code, just from syncDelay. It ought to get moved further into the select() I/O manager impl, rather than living in IOManager.c. On the other hand appendToIOBlockedQueue is still called from cmm code in the win32-legacy I/O manager primops async{Read,Write}#, and it is also used by the select() I/O manager. Update the CPP and comments to reflect this. - - - - - 60ce9910 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move anyPendingTimeoutsOrIO impl from .h to .c The implementation is eventually going to need to use more private things, which will drag in unwanted includes into IOManager.h, so it's better to move the impl out of the header file and into the .c file, at the slight cost of it no longer being inline. At the same time, change to the "switch (iomgr_type)" style. - - - - - f70b8108 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Take a simpler approach to gcc warnings in IOManager.c We have lots of functions with conditional implementations for different I/O managers. Some functions, for some I/O managers, naturally have implementations that do nothing or barf. When only one such I/O manager is enabled then the whole function implementation will have an implementation that does nothing or barfs. This then results in warnings from gcc that parameters are unused, or that the function should be marked with attribute noreturn (since barf does not return). The USED_IF_THREADS trick for fine-grained warning supression is fine for just two cases, but an equivalent here would need USED_IF_THE_ONLY_ENABLED_IOMGR_IS_X_OR_Y which would have combinitorial blowup. So we take a coarse grained approach and simply disable these two warnings for the whole file. So we use a GCC pragma, with its handy push/pop support: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn" #pragma GCC diagnostic ignored "-Wunused-parameter" ... #pragma GCC diagnostic pop - - - - - b48805b9 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add a new trace class for the iomanager It makes sense now for it to be separate from the scheduler class of tracers. Enabled with +RTS -Do. Document the -Do debug flag in the user guide. - - - - - f0c1f862 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Have the throwTo impl go via (new) IOManager APIs rather than directly operating on the IO manager's data structures. Specifically, when thowing an async exception to a thread that is blocked waiting for I/O or waiting for a timer, then we want to cancel that I/O waiting or cancel the timer. Currently this is done directly in removeFromQueues() in RaiseAsync.c. We want it to go via proper APIs both for modularity but also to let us support multiple I/O managers. So add sync{IO,Delay}Cancel, which is the cancellation for the corresponding sync{IO,Delay}. The implementations of these use the usual "switch (iomgr_type)" style. - - - - - 4f9e9c4e by Duncan Coutts at 2024-04-03T01:27:18-04:00 Move awaitEvent into a proper IOManager API and have the scheduler use it. Previously the scheduler calls awaitEvent directly, and awaitEvent is implemented directly in the RTS I/O managers (select, win32). This relies on the old scheme where there's a single active I/O manager for each platform and RTS way. We want to move that to go via an API in IOManager.{h,c} which can then call out to the active I/O manager. Also take the opportunity to split awaitEvent into two. The existing awaitEvent has a bool wait parameter, to say if the call should be blocking or non-blocking. We split this into two separate functions: pollCompletedTimeoutsOrIO and awaitCompletedTimeoutsOrIO. We split them for a few reasons: they have different post-conditions (specifically the await version is supposed to guarantee that there are threads runnable when it completes). Secondly, it is also anticipated that in future I/O managers the implementations of the two cases will be simpler if they are separated. - - - - - 5ad4b30f by Duncan Coutts at 2024-04-03T01:27:18-04:00 Rename awaitEvent in select and win32 I/O managers These are now just called from IOManager.c and are the per-I/O manager backend impls (whereas previously awaitEvent was the entry point). Follow the new naming convention in the IOManager.{h,c} of awaitCompletedTimeoutsOrIO, with the I/O manager's name as a suffix: so awaitCompletedTimeoutsOrIO{Select,Win32}. - - - - - d30c6bc6 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Tidy up a couple things in Select.{h,c} Use the standard #include {Begin,End}Private.h style rather than RTS_PRIVATE on individual decls. And conditionally build the code for the select I/O manager based on the new CPP IOMGR_ENABLED_SELECT rather than on THREADED_RTS. - - - - - 4161f516 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add an IOManager API for scavenging TSO blocked_info When the GC scavenges a TSO it needs to scavenge the tso->blocked_info but the blocked_info is a big union and what lives there depends on the two->why_blocked, which for I/O-related reasons is something that in principle is the responsibility of the I/O manager and not the GC. So the right thing to do is for the GC to ask the I/O manager to sscavenge the blocked_info if it encounters any I/O-related why_blocked reasons. So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style. Now as it happens, right now, there is no special scavenging to do, so the implementation of scavengeTSOIOManager is a fancy no-op. That's because the select I/O manager uses only the fd and target members, which are not GC pointers, and the win32-legacy I/O manager _ought_ to be using GC-managed heap objects for the StgAsyncIOResult but it is actually usingthe C heap, so again no GC pointers. If the win32-legacy were doing this more sensibly, then scavengeTSOIOManager would be the right place to do the GC magic. Future I/O managers will need GC heap objects in the tso->blocked_info and will make use of this functionality. - - - - - 94a87d21 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add I/O manager API notifyIOManagerCapabilitiesChanged Used in setNumCapabilities. It only does anything for MIO on Posix. Previously it always invoked Haskell code, but that code only did anything on non-Windows (and non-JS), and only threaded. That currently effectively means the MIO I/O manager on Posix. So now it only invokes it for the MIO Posix case. - - - - - 3be6d591 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Select an I/O manager early in RTS startup We need to select the I/O manager to use during startup before the per-cap I/O manager initialisation. - - - - - aaa294d0 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Make struct CapIOManager be fully opaque Provide an opaque (forward) definition in Capability.h (since the cap contains a *CapIOManager) and then only provide a full definition in a new file IOManagerInternals.h. This new file is only supposed to be included by the IOManager implementation, not by its users. So that means IOManager.c and individual I/O manager implementations. The posix/Signals.c still needs direct access, but that should be eliminated. Anything that needs direct access either needs to be clearly part of an I/O manager (e.g. the sleect() one) or go via a proper API. - - - - - 877a2a80 by Duncan Coutts at 2024-04-03T01:27:18-04:00 The select() I/O manager does have some global initialisation It's just to make sure an exception CAF is a GC root. - - - - - 9c51473b by Duncan Coutts at 2024-04-03T01:27:18-04:00 Add tracing for the main I/O manager actions Using the new tracer class. Note: The unconditional definition of showIOManager should be compatible with the debugTrace change in 7c7d1f6. Co-authored-by: Pi Delport <pi at well-typed.com> - - - - - c7d3e3a3 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Include the default I/O manager in the +RTS --info output Document the extra +RTS --info output in the user guide - - - - - 8023bad4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 waitRead# / waitWrite# do not work for win32-legacy I/O manager Previously it was unclear that they did not work because the code path was shared with other I/O managers (in particular select()). Following the code carefully shows that what actually happens is that the calling thread would block forever: the thread will be put into the blocked queue, but no other action is scheduled that will ever result in it getting unblocked. It's better to just fail loudly in case anyone accidentally calls it, also it's less confusing code. - - - - - 83a74d20 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Conditionally ignore some GCC warnings Some GCC versions don't know about some warnings, and they complain that we're ignoring unknown warnings. So we try to ignore the warning based on the GCC version. - - - - - 1adc6fa4 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept changes to base-exports All the changes are in fact not changes at all. Previously, the IoSubSystem data type was defined in GHC.RTS.Flags and exported from both GHC.RTS.Flags and GHC.IO.SubSystem. Now, the data type is defined in GHC.IO.SubSystem and still exported from both modules. Therefore, the same exports and same instances are still available from both modules. But the base-exports records only the defining module, and so it looks like a change when it is fully compatible. Related: we do add a deprecation to the export of the type via GHC.RTS.Flags, telling people to use the export from GHC.IO.SubSystem. Also the sort order for some unrelated Show instances changed. No idea why. The same changes apply in the other versions, with a few more changes due to sort order weirdness. - - - - - 8d950968 by Duncan Coutts at 2024-04-03T01:27:18-04:00 Accept metric decrease in T12227 I can't think of any good reason that anything in this MR should have changed the number of allocations, up or down. (Yes this is an empty commit.) Metric Decrease: T12227 - - - - - e869605e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Several improvements to the handling of coercions * Make `mkSymCo` and `mkInstCo` smarter Fixes #23642 * Fix return role of `SelCo` in the coercion optimiser. Fixes #23617 * Make the coercion optimiser `opt_trans_rule` work better for newtypes Fixes #23619 - - - - - 1efd0714 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 FloatOut: improve floating for join point See the new Note [Floating join point bindings]. * Completely get rid of the complicated join_ceiling nonsense, which I have never understood. * Do not float join points at all, except perhaps to top level. * Some refactoring around wantToFloat, to treat Rec and NonRec more uniformly - - - - - 9c00154d by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve eta-expansion through call stacks See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity This is a one-line change, that fixes an inconsistency - || isCallStackPredTy ty + || isCallStackPredTy ty || isCallStackTy ty - - - - - 95a9a172 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Spelling, layout, pretty-printing only - - - - - bdf1660f by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Improve exprIsConApp_maybe a little Eliminate a redundant case at birth. This sometimes reduces Simplifier iterations. See Note [Case elim in exprIsConApp_maybe]. - - - - - 609cd32c by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Inline GHC.HsToCore.Pmc.Solver.Types.trvVarInfo When exploring compile-time regressions after meddling with the Simplifier, I discovered that GHC.HsToCore.Pmc.Solver.Types.trvVarInfo was very delicately balanced. It's a small, heavily used, overloaded function and it's important that it inlines. By a fluke it was before, but at various times in my journey it stopped doing so. So I just added an INLINE pragma to it; no sense in depending on a delicately-balanced fluke. - - - - - ae24c9bc by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Slight improvement in WorkWrap Ensure that WorkWrap preserves lambda binders, in case of join points. Sadly I have forgotten why I made this change (it was while I was doing a lot of meddling in the Simplifier, but * it does no harm, * it is slightly more efficient, and * presumably it made something better! Anyway I have kept it in a separate commit. - - - - - e9297181 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Use named record fields for the CastIt { ... } data constructor This is a pure refactor - - - - - b4581e23 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Remove a long-commented-out line Pure refactoring - - - - - e026bdf2 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Simplifier improvements This MR started as: allow the simplifer to do more in one pass, arising from places I could see the simplifier taking two iterations where one would do. But it turned into a larger project, because these changes unexpectedly made inlining blow up, especially join points in deeply-nested cases. The main changes are below. There are also many new or rewritten Notes. Avoiding simplifying repeatedly ~~~~~~~~~~~~~~~ See Note [Avoiding simplifying repeatedly] * The SimplEnv now has a seInlineDepth field, which says how deep in unfoldings we are. See Note [Inline depth] in Simplify.Env. Currently used only for the next point: avoiding repeatedly simplifying coercions. * Avoid repeatedly simplifying coercions. see Note [Avoid re-simplifying coercions] in Simplify.Iteration As you'll see from the Note, this makes use of the seInlineDepth. * Allow Simplify.Iteration.simplAuxBind to inline used-once things. This is another part of Note [Post-inline for single-use things], and is really good for reducing simplifier iterations in situations like case K e of { K x -> blah } wher x is used once in blah. * Make GHC.Core.SimpleOpt.exprIsConApp_maybe do some simple case elimination. Note [Case elim in exprIsConApp_maybe] * Improve the case-merge transformation: - Move the main code to `GHC.Core.Utils.mergeCaseAlts`, to join `filterAlts` and friends. See Note [Merge Nested Cases] in GHC.Core.Utils. - Add a new case for `tagToEnum#`; see wrinkle (MC3). - Add a new case to look through join points: see wrinkle (MC4) postInlineUnconditionally ~~~~~~~~~~~~~~~~~~~~~~~~~ * Allow Simplify.Utils.postInlineUnconditionally to inline variables that are used exactly once. See Note [Post-inline for single-use things]. * Do not postInlineUnconditionally join point, ever. Doing so does not reduce allocation, which is the main point, and with join points that are used a lot it can bloat code. See point (1) of Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration. * Do not postInlineUnconditionally a strict (demanded) binding. It will not allocate a thunk (it'll turn into a case instead) so again the main point of inlining it doesn't hold. Better to check per-call-site. * Improve occurrence analyis for bottoming function calls, to help postInlineUnconditionally. See Note [Bottoming function calls] in GHC.Core.Opt.OccurAnal Inlining generally ~~~~~~~~~~~~~~~~~~ * In GHC.Core.Opt.Simplify.Utils.interestingCallContext, use RhsCtxt NonRecursive (not BoringCtxt) for a plain-seq case. See Note [Seq is boring] Also, wrinkle (SB1), inline in that `seq` context only for INLINE functions (UnfWhen guidance). * In GHC.Core.Opt.Simplify.Utils.interestingArg, - return ValueArg for OtherCon [c1,c2, ...], but - return NonTrivArg for OtherCon [] This makes a function a little less likely to inline if all we know is that the argument is evaluated, but nothing else. * isConLikeUnfolding is no longer true for OtherCon {}. This propagates to exprIsConLike. Con-like-ness has /positive/ information. Join points ~~~~~~~~~~~ * Be very careful about inlining join points. See these two long Notes Note [Duplicating join points] in GHC.Core.Opt.Simplify.Iteration Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline * When making join points, don't do so if the join point is so small it will immediately be inlined; check uncondInlineJoin. * In GHC.Core.Opt.Simplify.Inline.tryUnfolding, improve the inlining heuristics for join points. In general we /do not/ want to inline join points /even if they are small/. See Note [Duplicating join points] GHC.Core.Opt.Simplify.Iteration. But sometimes we do: see Note [Inlining join points] in GHC.Core.Opt.Simplify.Inline; and the new `isBetterUnfoldingThan` function. * Do not add an unfolding to a join point at birth. This is a tricky one and has a long Note [Do not add unfoldings to join points at birth] It shows up in two places - In `mkDupableAlt` do not add an inlining - (trickier) In `simplLetUnfolding` don't add an unfolding for a fresh join point I am not fully satisifed with this, but it works and is well documented. * In GHC.Core.Unfold.sizeExpr, make jumps small, so that we don't penalise having a non-inlined join point. Performance changes ~~~~~~~~~~~~~~~~~~~ * Binary sizes fall by around 2.6%, according to nofib. * Compile times improve slightly. Here are the figures over 1%. I investiate the biggest differnce in T18304. It's a very small module, just a few hundred nodes. The large percentage difffence is due to a single function that didn't quite inline before, and does now, making code size a bit bigger. I decided gains outweighed the losses. Metrics: compile_time/bytes allocated (changes over +/- 1%) ------------------------------------------------ CoOpt_Singletons(normal) -9.2% GOOD LargeRecord(normal) -23.5% GOOD MultiComponentModulesRecomp(normal) +1.2% MultiLayerModulesTH_OneShot(normal) +4.1% BAD PmSeriesS(normal) -3.8% PmSeriesV(normal) -1.5% T11195(normal) -1.3% T12227(normal) -20.4% GOOD T12545(normal) -3.2% T12707(normal) -2.1% GOOD T13253(normal) -1.2% T13253-spj(normal) +8.1% BAD T13386(normal) -3.1% GOOD T14766(normal) -2.6% GOOD T15164(normal) -1.4% T15304(normal) +1.2% T15630(normal) -8.2% T15630a(normal) NEW T15703(normal) -14.7% GOOD T16577(normal) -2.3% GOOD T17516(normal) -39.7% GOOD T18140(normal) +1.2% T18223(normal) -17.1% GOOD T18282(normal) -5.0% GOOD T18304(normal) +10.8% BAD T18923(normal) -2.9% GOOD T1969(normal) +1.0% T19695(normal) -1.5% T20049(normal) -12.7% GOOD T21839c(normal) -4.1% GOOD T3064(normal) -1.5% T3294(normal) +1.2% BAD T4801(normal) +1.2% T5030(normal) -15.2% GOOD T5321Fun(normal) -2.2% GOOD T6048(optasm) -16.8% GOOD T783(normal) -1.2% T8095(normal) -6.0% GOOD T9630(normal) -4.7% GOOD T9961(normal) +1.9% BAD WWRec(normal) -1.4% info_table_map_perf(normal) -1.3% parsing001(normal) +1.5% geo. mean -2.0% minimum -39.7% maximum +10.8% * Runtimes generally improve. In the testsuite perf/should_run gives: Metrics: runtime/bytes allocated ------------------------------------------ Conversions(normal) -0.3% T13536a(optasm) -41.7% GOOD T4830(normal) -0.1% haddock.Cabal(normal) -0.1% haddock.base(normal) -0.1% haddock.compiler(normal) -0.1% geo. mean -0.8% minimum -41.7% maximum +0.0% * For runtime, nofib is a better test. The news is mostly good. Here are the number more than +/- 0.1%: # bytes allocated ==========================++========== imaginary/digits-of-e1 || -14.40% imaginary/digits-of-e2 || -4.41% imaginary/paraffins || -0.17% imaginary/rfib || -0.15% imaginary/wheel-sieve2 || -0.10% real/compress || -0.47% real/fluid || -0.10% real/fulsom || +0.14% real/gamteb || -1.47% real/gg || -0.20% real/infer || +0.24% real/pic || -0.23% real/prolog || -0.36% real/scs || -0.46% real/smallpt || +4.03% shootout/k-nucleotide || -20.23% shootout/n-body || -0.42% shootout/spectral-norm || -0.13% spectral/boyer2 || -3.80% spectral/constraints || -0.27% spectral/hartel/ida || -0.82% spectral/mate || -20.34% spectral/para || +0.46% spectral/rewrite || +1.30% spectral/sphere || -0.14% ==========================++========== geom mean || -0.59% real/smallpt has a huge nest of local definitions, and I could not pin down a reason for a regression. But there are three big wins! Metric Decrease: CoOpt_Singletons LargeRecord T12227 T12707 T13386 T13536a T14766 T15703 T16577 T17516 T18223 T18282 T18923 T21839c T20049 T5321Fun T5030 T6048 T8095 T9630 T783 Metric Increase: MultiLayerModulesTH_OneShot T13253-spj T18304 T18698a T9961 T3294 - - - - - 27db3c5e by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Testsuite message changes from simplifier improvements - - - - - 271a7812 by Simon Peyton Jones at 2024-04-03T01:27:55-04:00 Account for bottoming functions in OccurAnal This fixes #24582, a small but long-standing bug - - - - - 0fde229f by Ben Gamari at 2024-04-04T07:04:58-04:00 testsuite: Introduce template-haskell-exports test - - - - - 0c4a9686 by Luite Stegeman at 2024-04-04T07:05:39-04:00 Update correct counter in bumpTickyAllocd - - - - - 5f085d3a by Fendor at 2024-04-04T14:47:33-04:00 Replace `SizedSeq` with `FlatBag` for flattened structure LinkedLists are notoriously memory ineffiecient when all we do is traversing a structure. As 'UnlinkedBCO' has been identified as a data structure that impacts the overall memory usage of GHCi sessions, we avoid linked lists and prefer flattened structure for storing. We introduce a new memory efficient representation of sequential elements that has special support for the cases: * Empty * Singleton * Tuple Elements This improves sharing in the 'Empty' case and avoids the overhead of 'Array' until its constant overhead is justified. - - - - - 82cfe10c by Fendor at 2024-04-04T14:47:33-04:00 Compact FlatBag array representation `Array` contains three additional `Word`'s we do not need in `FlatBag`. Move `FlatBag` to `SmallArray`. Expand the API of SmallArray by `sizeofSmallArray` and add common traversal functions, such as `mapSmallArray` and `foldMapSmallArray`. Additionally, allow users to force the elements of a `SmallArray` via `rnfSmallArray`. - - - - - 36a75b80 by Andrei Borzenkov at 2024-04-04T14:48:10-04:00 Change how invisible patterns represented in haskell syntax and TH AST (#24557) Before this patch: data ArgPat p = InvisPat (LHsType p) | VisPat (LPat p) With this patch: data Pat p = ... | InvisPat (LHsType p) ... And the same transformation in the TH land. The rest of the changes is just updating code to handle new AST and writing tests to check if it is possible to create invalid states using TH. Metric Increase: MultiLayerModulesTH_OneShot - - - - - 28009fbc by Matthew Pickering at 2024-04-04T14:48:46-04:00 Fix off by one error in seekBinNoExpand and seekBin - - - - - 9b9e031b by Ben Gamari at 2024-04-04T21:30:08-04:00 compiler: Allow more types in GHCForeignImportPrim For many, many years `GHCForeignImportPrim` has suffered from the rather restrictive limitation of not allowing any non-trivial types in arguments or results. This limitation was justified by the code generator allegely barfing in the presence of such types. However, this restriction appears to originate well before the NCG rewrite and the new NCG does not appear to have any trouble with such types (see the added `T24598` test). Lift this restriction. Fixes #24598. - - - - - 1324b862 by Alan Zimmerman at 2024-04-04T21:30:44-04:00 EPA: Use EpaLocation not SrcSpan in ForeignDecls This allows us to update them for makeDeltaAst in ghc-exactprint - - - - - 19883a23 by Alan Zimmerman at 2024-04-05T16:58:17-04:00 EPA: Use EpaLocation for RecFieldsDotDot So we can update it to a delta position in makeDeltaAst if needed. - - - - - e8724327 by Matthew Pickering at 2024-04-05T16:58:53-04:00 Remove accidentally committed test.hs - - - - - 88cb3e10 by Fendor at 2024-04-08T09:03:34-04:00 Avoid UArray when indexing is not required `UnlinkedBCO`'s can occur many times in the heap. Each `UnlinkedBCO` references two `UArray`'s but never indexes them. They are only needed to encode the elements into a `ByteArray#`. The three words for the lower bound, upper bound and number of elements are essentially unused, thus we replace `UArray` with a wrapper around `ByteArray#`. This saves us up to three words for each `UnlinkedBCO`. Further, to avoid re-allocating these words for `ResolvedBCO`, we repeat the procedure for `ResolvedBCO` and add custom `Binary` and `Show` instances. For example, agda's repl session has around 360_000 UnlinkedBCO's, so avoiding these three words is already saving us around 8MB residency. - - - - - f2cc1107 by Fendor at 2024-04-08T09:04:11-04:00 Never UNPACK `FastMutInt` for counting z-encoded `FastString`s In `FastStringTable`, we count the number of z-encoded FastStrings that exist in a GHC session. We used to UNPACK the counters to not waste memory, but live retainer analysis showed that we allocate a lot of `FastMutInt`s, retained by `mkFastZString`. We lazily compute the `FastZString`, only incrementing the counter when the `FastZString` is forced. The function `mkFastStringWith` calls `mkZFastString` and boxes the `FastMutInt`, leading to the following core: mkFastStringWith = \ mk_fs _ -> = case stringTable of { FastStringTable _ n_zencs segments# _ -> ... case ((mk_fs (I# ...) (FastMutInt n_zencs)) `cast` <Co:2> :: ...) ... Marking this field as `NOUNPACK` avoids this reboxing, eliminating the allocation of a fresh `FastMutInt` on every `FastString` allocation. - - - - - c6def949 by Matthew Pickering at 2024-04-08T16:06:51-04:00 Force in_multi to avoid retaining entire hsc_env - - - - - fbb91a63 by Fendor at 2024-04-08T16:06:51-04:00 Eliminate name thunk in declaration fingerprinting Thunk analysis showed that we have about 100_000 thunks (in agda and `-fwrite-simplified-core`) pointing to the name of the name decl. Forcing this thunk fixes this issue. The thunk created here is retained by the thunk created by forkM, it is better to eagerly force this because the result (a `Name`) is already retained indirectly via the `IfaceDecl`. - - - - - 3b7b0c1c by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Use EpaLocation in WarningTxt This allows us to use an EpDelta if needed when using makeDeltaAst. - - - - - 12b997df by Alan Zimmerman at 2024-04-08T16:07:27-04:00 EPA: Move DeltaPos and EpaLocation' into GHC.Types.SrcLoc This allows us to use a NoCommentsLocation for the possibly trailing comma location in a StringLiteral. This in turn allows us to correctly roundtrip via makeDeltaAst. - - - - - 868c8a78 by Fendor at 2024-04-09T08:51:50-04:00 Prefer packed representation for CompiledByteCode As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost. When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers. - - - - - be3bddde by Alan Zimmerman at 2024-04-09T08:52:26-04:00 EPA: Capture all comments in a ClassDecl Hopefully the final fix needed for #24533 - - - - - 3d0806fc by Jade at 2024-04-10T05:39:53-04:00 Validate -main-is flag using parseIdentifier Fixes #24368 - - - - - dd530bb7 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: free error message before returning Fixes a memory leak in rts/linker/PEi386.c - - - - - e008a19a by Alexis King at 2024-04-10T05:40:29-04:00 linker: Avoid linear search when looking up Haskell symbols via dlsym See the primary Note [Looking up symbols in the relevant objects] for a more in-depth explanation. When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this commit we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded. This commit drastically improves symbol loading performance by introducing a mapping from units to the handles of corresponding loaded dlls. These handles are returned by dlopen when we load a dll, and can then be used to look up in a specific dynamic library. Looking up a given Name is now much more precise because we can get lookup its unit in the mapping and lookup the symbol solely in the handles of the dynamic libraries loaded for that unit. In one measurement, the wait time before the expression was executed went from +-38 seconds down to +-2s. This commit also includes Note [Symbols may not be found in pkgs_loaded], explaining the fallback to the old behaviour in case no dll can be found in the unit mapping for a given Name. Fixes #23415 Co-authored-by: Rodrigo Mesquita (@alt-romes) - - - - - dcfaa190 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 rts: Make addDLL a wrapper around loadNativeObj Rewrite the implementation of `addDLL` as a wrapper around the more principled `loadNativeObj` rts linker function. The latter should be preferred while the former is preserved for backwards compatibility. `loadNativeObj` was previously only available on ELF platforms, so this commit further refactors the rts linker to transform loadNativeObj_ELF into loadNativeObj_POSIX, which is available in ELF and MachO platforms. The refactor made it possible to remove the `dl_mutex` mutex in favour of always using `linker_mutex` (rather than a combination of both). Lastly, we implement `loadNativeObj` for Windows too. - - - - - 12931698 by Rodrigo Mesquita at 2024-04-10T05:40:29-04:00 Use symbol cache in internal interpreter too This commit makes the symbol cache that was used by the external interpreter available for the internal interpreter too. This follows from the analysis in #23415 that suggests the internal interpreter could benefit from this cache too, and that there is no good reason not to have the cache for it too. It also makes it a bit more uniform to have the symbol cache range over both the internal and external interpreter. This commit also refactors the cache into a function which is used by both `lookupSymbol` and also by `lookupSymbolInDLL`, extending the caching logic to `lookupSymbolInDLL` too. - - - - - dccd3ea1 by Ben Gamari at 2024-04-10T05:40:29-04:00 testsuite: Add test for lookupSymbolInNativeObj - - - - - 1b1a92bd by Alan Zimmerman at 2024-04-10T05:41:05-04:00 EPA: Remove unnecessary XRec in CompleteMatchSig The XRec for [LIdP pass] is not needed for exact printing, remove it. - - - - - 6e18ce2b by Ben Gamari at 2024-04-12T08:16:09-04:00 users-guide: Clarify language extension documentation Over the years the users guide's language extension documentation has gone through quite a few refactorings. In the process some of the descriptions have been rendered non-sensical. For instance, the description of `NoImplicitPrelude` actually describes the semantics of `ImplicitPrelude`. To fix this we: * ensure that all extensions are named in their "positive" sense (e.g. `ImplicitPrelude` rather than `NoImplicitPrelude`). * rework the documentation to avoid flag-oriented wording like "enable" and "disable" * ensure that the polarity of the documentation is consistent with reality. Fixes #23895. - - - - - a933aff3 by Zubin Duggal at 2024-04-12T08:16:45-04:00 driver: Make `checkHomeUnitsClosed` faster The implementation of `checkHomeUnitsClosed` was traversing every single path in the unit dependency graph - this grows exponentially and quickly grows to be infeasible on larger unit dependency graphs. Instead we replace this with a faster implementation which follows from the specificiation of the closure property - there is a closure error if there are units which are both are both (transitively) depended upon by home units and (transitively) depend on home units, but are not themselves home units. To compute the set of units required for closure, we first compute the closure of the unit dependency graph, then the transpose of this closure, and find all units that are reachable from the home units in the transpose of the closure. - - - - - 23c3e624 by Andreas Klebinger at 2024-04-12T08:17:21-04:00 RTS: Emit warning when -M < -H Fixes #24487 - - - - - d23afb8c by Ben Gamari at 2024-04-12T08:17:56-04:00 testsuite: Add broken test for CApiFFI with -fprefer-bytecode See #24634. - - - - - a4bb3a51 by Ben Gamari at 2024-04-12T08:18:32-04:00 base: Deprecate GHC.Pack As proposed in #21461. Closes #21540. - - - - - 55eb8c98 by Ben Gamari at 2024-04-12T08:19:08-04:00 ghc-internal: Fix mentions of ghc-internal in deprecation warnings Closes #24609. - - - - - b0fbd181 by Ben Gamari at 2024-04-12T08:19:44-04:00 rts: Implement set_initial_registers for AArch64 Fixes #23680. - - - - - 14c9ec62 by Ben Gamari at 2024-04-12T08:20:20-04:00 ghcup-metadata: Use Debian 9 binaries on Ubuntu 16, 17 Closes #24646. - - - - - 35a1621e by Ben Gamari at 2024-04-12T08:20:55-04:00 Bump unix submodule to 2.8.5.1 Closes #24640. - - - - - a1c24df0 by Finley McIlwaine at 2024-04-12T08:21:31-04:00 Correct default -funfolding-use-threshold in docs - - - - - 0255d03c by Oleg Grenrus at 2024-04-12T08:22:07-04:00 FastString is a __Modified__ UTF-8 - - - - - c3489547 by Matthew Pickering at 2024-04-12T13:13:44-04:00 rts: Improve tracing message when nursery is resized It is sometimes more useful to know how much bigger or smaller the nursery got when it is resized. In particular I am trying to investigate situations where we end up with fragmentation due to the nursery (#24577) - - - - - 5e4f4ba8 by Simon Peyton Jones at 2024-04-12T13:14:20-04:00 Don't generate wrappers for `type data` constructors with StrictData Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by: Ryan Scott <ryan.gl.scott at gmail.com> - - - - - dbdf1995 by Alex Mason at 2024-04-15T15:28:26+10:00 Implements MO_S_Mul2 and MO_U_Mul2 using the UMULH, UMULL and SMULH instructions for AArch64 Also adds a test for MO_S_Mul2 - - - - - 42bd0407 by Teo Camarasu at 2024-04-16T20:06:39-04:00 Make template-haskell a stage1 package Promoting template-haskell from a stage0 to a stage1 package means that we can much more easily refactor template-haskell. We implement this by duplicating the in-tree `template-haskell`. A new `template-haskell-next` library is autogenerated to mirror `template-haskell` `stage1:ghc` to depend on the new interface of the library including the `Binary` instances without adding an explicit dependency on `template-haskell`. This is controlled by the `bootstrap-th` cabal flag When building `template-haskell` modules as part of this vendoring we do not have access to quote syntax, so we cannot use variable quote notation (`'Just`). So we either replace these with hand-written `Name`s or hide the code behind CPP. We can remove the `th_hack` from hadrian, which was required when building stage0 packages using the in-tree `template-haskell` library. For more details see Note [Bootstrapping Template Haskell]. Resolves #23536 Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> Co-Authored-By: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org> - - - - - 3d973e47 by Ben Gamari at 2024-04-16T20:07:15-04:00 Bump parsec submodule to 3.1.17.0 - - - - - 9d38bfa0 by Simon Peyton Jones at 2024-04-16T20:07:51-04:00 Clone CoVars in CorePrep This MR addresses #24463. It's all explained in the new Note [Cloning CoVars and TyVars] - - - - - 0fe2b410 by Andreas Klebinger at 2024-04-16T20:08:27-04:00 NCG: Fix a bug where we errounously removed a required jump instruction. Add a new method to the Instruction class to check if we can eliminate a jump in favour of fallthrough control flow. Fixes #24507 - - - - - 9f99126a by Teo Camarasu at 2024-04-16T20:09:04-04:00 Fix documentation preview from doc-tarball job - Include all the .html files and assets in the job artefacts - Include all the .pdf files in the job artefacts - Mark the artefact as an "exposed" artefact meaning it turns up in the UI. Resolves #24651 - - - - - 3a0642ea by Ben Gamari at 2024-04-16T20:09:39-04:00 rts: Ignore EINTR while polling in timerfd itimer implementation While the RTS does attempt to mask signals, it may be that a foreign library unmasks them. This previously caused benign warnings which we now ignore. See #24610. - - - - - 9a53cd3f by Alan Zimmerman at 2024-04-16T20:10:15-04:00 EPA: Add additional comments field to AnnsModule This is used in exact printing to store comments coming after the `where` keyword but before any comments allocated to imports or decls. It is used in ghc-exactprint, see https://github.com/alanz/ghc-exactprint/commit/44bbed311fd8f0d053053fef195bf47c17d34fa7 - - - - - e5c43259 by Bryan Richter at 2024-04-16T20:10:51-04:00 Remove unrunnable FreeBSD CI jobs FreeBSD runner supply is inelastic. Currently there is only one, and it's unavailable because of a hardware issue. - - - - - 914eb49a by Ben Gamari at 2024-04-16T20:11:27-04:00 rel-eng: Fix mktemp usage in recompress-all We need a temporary directory, not a file. - - - - - f30e4984 by Teo Camarasu at 2024-04-16T20:12:03-04:00 Fix ghc API link in docs/index.html This was missing part of the unit ID meaning it would 404. Resolves #24674 - - - - - d7a3d6b5 by Ben Gamari at 2024-04-16T20:12:39-04:00 template-haskell: Declare TH.Lib.Internal as not-home Rather than `hide`. Closes #24659. - - - - - 5eaa46e7 by Matthew Pickering at 2024-04-19T02:14:55-04:00 testsuite: Rename isCross() predicate to needsTargetWrapper() isCross() was a misnamed because it assumed that all cross targets would provide a target wrapper, but the two most common cross targets (javascript, wasm) don't need a target wrapper. Therefore we rename this predicate to `needsTargetWrapper()` so situations in the testsuite where we can check whether running executables requires a target wrapper or not. - - - - - 55a9d699 by Simon Peyton Jones at 2024-04-19T02:15:32-04:00 Do not float HNFs out of lambdas This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001 - - - - - f0701585 by Alan Zimmerman at 2024-04-19T02:16:08-04:00 EPA: Fix comments in mkListSyntaxTy0 Also extend the test to confirm. Addresses #24669, 1 of 4 - - - - - b01c01d4 by Serge S. Gulin at 2024-04-19T02:16:51-04:00 JS: set image `x86_64-linux-deb11-emsdk-closure` for build - - - - - c90c6039 by Alan Zimmerman at 2024-04-19T02:17:27-04:00 EPA: Provide correct span for PatBind And remove unused parameter in checkPatBind Contributes to #24669 - - - - - bee54c24 by Krzysztof Gogolewski at 2024-04-19T11:13:00+02:00 Update quantification order following GHC haskell/haddock#23764 - - - - - 2814eb89 by Ben Gamari at 2024-04-19T18:57:05+02:00 hypsrc-test: Fix output of PositionPragmas.html - - - - - 26036f96 by Alan Zimmerman at 2024-04-19T13:11:08-04:00 EPA: Fix span for PatBuilderAppType Include the location of the prefix @ in the span for InVisPat. Also removes unnecessary annotations from HsTP. Contributes to #24669 - - - - - dba03aab by Matthew Craven at 2024-04-19T13:11:44-04:00 testsuite: Give the pre_cmd for mhu-perf more time - - - - - d31fbf6c by Krzysztof Gogolewski at 2024-04-19T21:04:09-04:00 Fix quantification order for a `op` b and a %m -> b Fixes #23764 Implements https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0640-tyop-quantification-order.rst Updates haddock submodule. - - - - - 385cd1c4 by Sebastian Graf at 2024-04-19T21:04:45-04:00 Make `seq#` a magic Id and inline it in CorePrep (#24124) We can save much code and explanation in Tag Inference and StgToCmm by making `seq#` a known-key Magic Id in `GHC.Internal.IO` and inline this definition in CorePrep. See the updated `Note [seq# magic]`. I also implemented a new `Note [Flatten case-bind]` to get better code for otherwise nested case scrutinees. I renamed the contructors of `ArgInfo` to use an `AI` prefix in order to resolve the clash between `type CpeApp = CoreExpr` and the data constructor of `ArgInfo`, as well as fixed typos in `Note [CorePrep invariants]`. Fixes #24252 and #24124. - - - - - 275e41a9 by Jade at 2024-04-20T11:10:40-04:00 Put the newline after errors instead of before them This mainly has consequences for GHCi but also slightly alters how the output of GHC on the commandline looks. Fixes: #22499 - - - - - dd339c7a by Teo Camarasu at 2024-04-20T11:11:16-04:00 Remove unecessary stage0 packages Historically quite a few packages had to be stage0 as they depended on `template-haskell` and that was stage0. In #23536 we made it so that was no longer the case. This allows us to remove a bunch of packages from this list. A few still remain. A new version of `Win32` is required by `semaphore-compat`. Including `Win32` in the stage0 set requires also including `filepath` because otherwise Hadrian's dependency logic gets confused. Once our boot compiler has a newer version of `Win32` all of these will be able to be dropped. Resolves #24652 - - - - - 2f8e3a25 by Alan Zimmerman at 2024-04-20T11:11:52-04:00 EPA: Avoid duplicated comments in splice decls Contributes to #24669 - - - - - c70b9ddb by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fix typos and namings (fixes #24602) You may noted that I've also changed term of ``` , global "h$vt_double" ||= toJExpr IntV ``` See "IntV" and ``` WaitReadOp -> \[] [fd] -> pure $ PRPrimCall $ returnS (app "h$waidRead" [fd]) ``` See "h$waidRead" - - - - - 3db54f9b by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: trivial checks for variable presence (fixes #24602) - - - - - 777f108f by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: fs module imported twice (by emscripten and by ghc-internal). ghc-internal import wrapped in a closure to prevent conflict with emscripten (fixes #24602) Better solution is to use some JavaScript module system like AMD, CommonJS or even UMD. It will be investigated at other issues. At first glance we should try UMD (See https://github.com/umdjs/umd) - - - - - a45a5712 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: thread.js requires h$fds and h$fdReady to be declared for static code analysis, minimal code copied from GHCJS (fixes #24602) I've just copied some old pieces of GHCJS from publicly available sources (See https://github.com/Taneb/shims/blob/a6dd0202dcdb86ad63201495b8b5d9763483eb35/src/io.js#L607). Also I didn't put details to h$fds. I took minimal and left only its object initialization: `var h$fds = {};` - - - - - ad90bf12 by Serge S. Gulin at 2024-04-21T16:33:43+03:00 JS: heap and stack overflows reporting defined as js hard failure (fixes #24602) These errors were treated as a hard failure for browser application. The fix is trivial: just throw error. - - - - - 5962fa52 by Serge S. Gulin at 2024-04-21T16:33:44+03:00 JS: Stubs for code without actual implementation detected by Google Closure Compiler (fixes #24602) These errors were fixed just by introducing stubbed functions with throw for further implementation. - - - - - a0694298 by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add externs to linker (fixes #24602) After enabling jsdoc and built-in google closure compiler types I was needed to deal with the following: 1. Define NodeJS-environment types. I've just copied minimal set of externs from semi-official repo (see https://github.com/externs/nodejs/blob/6c6882c73efcdceecf42e7ba11f1e3e5c9c041f0/v8/nodejs.js#L8). 2. Define Emscripten-environment types: `HEAP8`. Emscripten already provides some externs in our code but it supposed to be run in some module system. And its definitions do not work well in plain bundle. 3. We have some functions which purpose is to add to functions some contextual information via function properties. These functions should be marked as `modifies` to let google closure compiler remove calls if these functions are not used actually by call graph. Such functions are: `h$o`, `h$sti`, `h$init_closure`, `h$setObjInfo`. 4. STG primitives such as registries and stuff from `GHC.StgToJS`. `dXX` properties were already present at externs generator function but they are started from `7`, not from `1`. This message is related: `// fixme does closure compiler bite us here?` - - - - - e58bb29f by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: added both tests: for size and for correctness (fixes #24602) By some reason MacOS builds add to stderr messages like: Ignoring unexpected archive entry: __.SYMDEF ... However I left stderr to `/dev/null` for compatibility with linux CI builds. - - - - - 909f3a9c by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Disable js linker warning for empty symbol table to make js tests running consistent across environments - - - - - 83eb10da by Serge S. Gulin at 2024-04-21T16:34:07+03:00 JS: Add special preprocessor for js files due of needing to keep jsdoc comments (fixes #24602) Our js files have defined google closure compiler types at jsdoc entries but these jsdoc entries are removed by cpp preprocessor. I considered that reusing them in javascript-backend would be a nice thing. Right now haskell processor uses `-traditional` option to deal with comments and `//` operators. But now there are following compiler options: `-C` and `-CC`. You can read about them at GCC (see https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-CC) and CLang (see https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-CC). It seems that `-CC` works better for javascript jsdoc than `-traditional`. At least it leaves `/* ... */` comments w/o changes. - - - - - e1cf8dc2 by brandon s allbery kf8nh at 2024-04-22T03:48:26-04:00 fix link in CODEOWNERS It seems that our local Gitlab no longer has documentation for the `CODEOWNERS` file, but the master documentation still does. Use that instead. - - - - - a27c6a49 by Fendor at 2024-04-22T10:13:03+02:00 Adapt to UserData split - - - - - 1efc5a7a by Fendor at 2024-04-22T10:13:03+02:00 Adapt to BinHandle split - - - - - 593f4e04 by Fendor at 2024-04-23T10:19:14-04:00 Add performance regression test for '-fwrite-simplified-core' - - - - - 1ba39b05 by Fendor at 2024-04-23T10:19:14-04:00 Typecheck corebindings lazily during bytecode generation This delays typechecking the corebindings until the bytecode generation happens. We also avoid allocating a thunk that is retained by `unsafeInterleaveIO`. In general, we shouldn't retain values of the hydrated `Type`, as not evaluating the bytecode object keeps it alive. It is better if we retain the unhydrated `IfaceType`. See Note [Hydrating Modules] - - - - - e916fc92 by Alan Zimmerman at 2024-04-23T10:19:50-04:00 EPA: Keep comments in a CaseAlt match The comments now live in the surrounding location, not inside the Match. Make sure we keep them. Closes #24707 - - - - - d2b17f32 by Cheng Shao at 2024-04-23T15:01:22-04:00 driver: force merge objects when building dynamic objects This patch forces the driver to always merge objects when building dynamic objects even when ar -L is supported. It is an oversight of !8887: original rationale of that patch is favoring the relatively cheap ar -L operation over object merging when ar -L is supported, which makes sense but only if we are building static objects! Omitting check for whether we are building dynamic objects will result in broken .so files with undefined reference errors at executable link time when building GHC with llvm-ar. Fixes #22210. - - - - - 209d09f5 by Julian Ospald at 2024-04-23T15:02:03-04:00 Allow non-absolute values for bootstrap GHC variable Fixes #24682 - - - - - 3fff0977 by Matthew Pickering at 2024-04-23T15:02:38-04:00 Don't depend on registerPackage function in Cabal More recent versions of Cabal modify the behaviour of libAbiHash which breaks our usage of registerPackage. It is simpler to inline the part of registerPackage that we need and avoid any additional dependency and complication using the higher-level function introduces. - - - - - c62dc317 by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: remove obsolete ln script This commit removes an obsolete ln script in ghc-bignum/gmp. See 060251c24ad160264ae8553efecbb8bed2f06360 for its original intention, but it's been obsolete for a long time, especially since the removal of the make build system. Hence the house cleaning. - - - - - 6399d52b by Cheng Shao at 2024-04-25T01:32:02-04:00 ghc-bignum: update gmp to 6.3.0 This patch bumps the gmp-tarballs submodule and updates gmp to 6.3.0. The tarball format is now xz, and gmpsrc.patch has been patched into the tarball so hadrian no longer needs to deal with patching logic when building in-tree GMP. - - - - - 65b4b92f by Cheng Shao at 2024-04-25T01:32:02-04:00 hadrian: remove obsolete Patch logic This commit removes obsolete Patch logic from hadrian, given we no longer need to patch the gmp tarball when building in-tree GMP. - - - - - 71f28958 by Cheng Shao at 2024-04-25T01:32:02-04:00 autoconf: remove obsolete patch detection This commit removes obsolete deletection logic of the patch command from autoconf scripts, given we no longer need to patch anything in the GHC build process. - - - - - daeda834 by Sylvain Henry at 2024-04-25T01:32:43-04:00 JS: correctly handle RUBBISH literals (#24664) - - - - - 8a06ddf6 by Matthew Pickering at 2024-04-25T11:16:16-04:00 Linearise ghc-internal and base build This is achieved by requesting the final package database for ghc-internal, which mandates it is fully built as a dependency of configuring the `base` package. This is at the expense of cross-package parrallelism between ghc-internal and the base package. Fixes #24436 - - - - - 94da9365 by Andrei Borzenkov at 2024-04-25T11:16:54-04:00 Fix tuple puns renaming (24702) Move tuple renaming short cutter from `isBuiltInOcc_maybe` to `isPunOcc_maybe`, so we consider incoming module. I also fixed some hidden bugs that raised after the change was done. - - - - - fa03b1fb by Fendor at 2024-04-26T18:03:13-04:00 Refactor the Binary serialisation interface The goal is simplifiy adding deduplication tables to `ModIface` interface serialisation. We identify two main points of interest that make this difficult: 1. UserData hardcodes what `Binary` instances can have deduplication tables. Moreover, it heavily uses partial functions. 2. GHC.Iface.Binary hardcodes the deduplication tables for 'Name' and 'FastString', making it difficult to add more deduplication. Instead of having a single `UserData` record with fields for all the types that can have deduplication tables, we allow to provide custom serialisers for any `Typeable`. These are wrapped in existentials and stored in a `Map` indexed by their respective `TypeRep`. The `Binary` instance of the type to deduplicate still needs to explicitly look up the decoder via `findUserDataReader` and `findUserDataWriter`, which is no worse than the status-quo. `Map` was chosen as microbenchmarks indicate it is the fastest for a small number of keys (< 10). To generalise the deduplication table serialisation mechanism, we introduce the types `ReaderTable` and `WriterTable` which provide a simple interface that is sufficient to implement a general purpose deduplication mechanism for `writeBinIface` and `readBinIface`. This allows us to provide a list of deduplication tables for serialisation that can be extended more easily, for example for `IfaceTyCon`, see the issue https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for more motivation. In addition to this refactoring, we split `UserData` into `ReaderUserData` and `WriterUserData`, to avoid partial functions and reduce overall memory usage, as we need fewer mutable variables. Bump haddock submodule to accomodate for `UserData` split. ------------------------- Metric Increase: MultiLayerModulesTH_Make MultiLayerModulesRecomp T21839c ------------------------- - - - - - bac57298 by Fendor at 2024-04-26T18:03:13-04:00 Split `BinHandle` into `ReadBinHandle` and `WriteBinHandle` A `BinHandle` contains too much information for reading data. For example, it needs to keep a `FastMutInt` and a `IORef BinData`, when the non-mutable variants would suffice. Additionally, this change has the benefit that anyone can immediately tell whether the `BinHandle` is used for reading or writing. Bump haddock submodule BinHandle split. - - - - - 4d6394dd by Simon Peyton Jones at 2024-04-26T18:03:49-04:00 Fix missing escaping-kind check in tcPatSynSig Note [Escaping kind in type signatures] explains how we deal with escaping kinds in type signatures, e.g. f :: forall r (a :: TYPE r). a where the kind of the body is (TYPE r), but `r` is not in scope outside the forall-type. I had missed this subtlety in tcPatSynSig, leading to #24686. This MR fixes it; and a similar bug in tc_top_lhs_type. (The latter is tested by T24686a.) - - - - - 981c2c2c by Alan Zimmerman at 2024-04-26T18:04:25-04:00 EPA: check-exact: check that the roundtrip reproduces the source Closes #24670 - - - - - a8616747 by Andrew Lelechenko at 2024-04-26T18:05:01-04:00 Document that setEnv is not thread-safe - - - - - 1e41de83 by Bryan Richter at 2024-04-26T18:05:37-04:00 CI: Work around frequent Signal 9 errors - - - - - a6d5f9da by Naïm Favier at 2024-04-27T17:52:40-04:00 ghc-internal: add MonadFix instance for (,) Closes https://gitlab.haskell.org/ghc/ghc/-/issues/24288, implements CLC proposal https://github.com/haskell/core-libraries-committee/issues/238. Adds a MonadFix instance for tuples, permitting value recursion in the "native" writer monad and bringing consistency with the existing instance for transformers's WriterT (and, to a lesser extent, for Solo). - - - - - 64feadcd by Rodrigo Mesquita at 2024-04-27T17:53:16-04:00 bindist: Fix xattr cleaning The original fix (725343aa) was incorrect because it used the shell bracket syntax which is the quoting syntax in autoconf, making the test for existence be incorrect and therefore `xattr` was never run. Fixes #24554 - - - - - e2094df3 by damhiya at 2024-04-28T23:52:00+09:00 Make read accepts binary integer formats CLC proposal : https://github.com/haskell/core-libraries-committee/issues/177 - - - - - c62239b7 by Sylvain Henry at 2024-04-29T10:35:00+02:00 Fix tests for T22229 - - - - - 1c2fd963 by Alan Zimmerman at 2024-04-29T23:17:00-04:00 EPA: Preserve comments in Match Pats Closes #24708 Closes #24715 Closes #24734 - - - - - 4189d17e by Sylvain Henry at 2024-04-29T23:17:42-04:00 LLVM: better unreachable default destination in Switch (#24717) See added note. Co-authored-by: Siddharth Bhat <siddu.druid at gmail.com> - - - - - a3725c88 by Cheng Shao at 2024-04-29T23:18:20-04:00 ci: enable wasm jobs for MRs with wasm label This patch enables wasm jobs for MRs with wasm label. Previously the wasm label didn't actually have any effect on the CI pipeline, and full-ci needed to be applied to run wasm jobs which was a waste of runners when working on the wasm backend, hence the fix here. - - - - - 702f7964 by Matthew Pickering at 2024-04-29T23:18:56-04:00 Make interface files and object files depend on inplace .conf file A potential fix for #24737 - - - - - 728af21e by Cheng Shao at 2024-04-30T05:30:23-04:00 utils: remove obsolete vagrant scripts Vagrantfile has long been removed in !5288. This commit further removes the obsolete vagrant scripts in the tree. - - - - - 36f2c342 by Cheng Shao at 2024-04-30T05:31:00-04:00 Update autoconf scripts Scripts taken from autoconf 948ae97ca5703224bd3eada06b7a69f40dd15a02 - - - - - ecbf22a6 by Ben Gamari at 2024-04-30T05:31:36-04:00 ghcup-metadata: Drop output_name field This is entirely redundant to the filename of the URL. There is no compelling reason to name the downloaded file differently from its source. - - - - - c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00 testsuite: Handle exceptions in framework_fail when testdir is not initialised When `framework_fail` is called before initialising testdir, it would fail with an exception reporting the testdir not being initialised instead of the actual failure. Ensure we report the actual reason for the failure instead of failing in this way. One way this can manifest is when trying to run a test that doesn't exist using `--only` - - - - - d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00 EPA: Fix range for GADT decl with sig only Closes #24714 - - - - - 4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00 Fix TH dependencies (#22229) Add a dependency between Syntax and Internal (via module reexport). - - - - - 37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00 Bump haddock submodule - - - - - ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00 JS: cleanup to prepare for #24743 - - - - - 40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00 EPA: Preserve comments for PrefixCon Preserve comments in fun (Con {- c1 -} a b) = undefined Closes #24736 - - - - - 92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00 Correct `@since` metadata in HpcFlags It was introduced in base-4.20, not 4.22. Fix #24721 - - - - - a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00 testsuite: fix req_target_smp predicate - - - - - ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Remove (unused)coarse grained locking. The STM code had a coarse grained locking mode guarded by #defines that was unused. This commit removes the code. - - - - - 917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00 STM: Be more optimistic when validating in-flight transactions. * Don't lock tvars when performing non-committal validation. * If we encounter a locked tvar don't consider it a failure. This means in-flight validation will only fail if committing at the moment of validation is *guaranteed* to fail. This prevents in-flight validation from failing spuriously if it happens in parallel on multiple threads or parallel to thread comitting. - - - - - 167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00 EPA: fix span for empty \case(s) In instance SDecide Nat where SZero %~ (SSucc _) = Disproved (\case) Ensure the span for the HsLam covers the full construct. Closes #24748 - - - - - 9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00 testsuite: expand size testing infrastructure - closes #24191 - adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so - path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite - adds on_windows and req_dynamic_ghc predicate to testsuite The design is to not make the testsuite too smart and simply offload to ghc-pkg for locations of object files and directories. - - - - - b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00 GHCi: support inlining breakpoints (#24712) When a breakpoint is inlined, its context may change (e.g. tyvars in scope). We must take this into account and not used the breakpoint tick index as its sole identifier. Each instance of a breakpoint (even with the same tick index) now gets a different "info" index. We also need to distinguish modules: - tick module: module with the break array (tick counters, status, etc.) - info module: module having the CgBreakInfo (info at occurrence site) - - - - - 649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00 Expose constructors of SNat, SChar and SSymbol in ghc-internal - - - - - d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00 Add DCoVarSet to PluginProv (!12037) - - - - - ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00 JS: Enable more efficient packing of string data (fixes #24706) - - - - - be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Track in-scope variables in ruleCheckProgram This small patch fixes #24726, by tracking in-scope variables properly in -drule-check. Not hard to do! - - - - - 58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add a couple more HasCallStack constraints in SimpleOpt Just for debugging, no effect on normal code - - - - - 70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Add comments to Prep.hs This documentation patch fixes a TODO left over from !12364 - - - - - e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00 Use HasDebugCallStack, rather than HasCallStack - - - - - 631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00 driver: always merge objects when possible This patch makes the driver always merge objects with `ld -r` when possible, and only fall back to calling `ar -L` when merge objects command is unavailable. This completely reverts !8887 and !12313, given more fixes in Cabal seems to be needed to avoid breaking certain configurations and the maintainence cost is exceeding the behefits in this case :/ - - - - - 1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump time submodule to 1.14 As requested in #24528. ------------------------- Metric Decrease: ghc_bignum_so rts_so Metric Increase: cabal_syntax_dir rts_so time_dir time_so ------------------------- - - - - - 4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00 Bump terminfo submodule to current master - - - - - 43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00 wasm: use scheduler.postTask() for context switch when available This patch makes use of scheduler.postTask() for JSFFI context switch when it's available. It's a more principled approach than our MessageChannel based setImmediate() implementation, and it's available in latest version of Chromium based browsers. - - - - - 08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00 testsuite: give pre_cmd for mhu-perf 5x time - - - - - bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00 EPA: Preserve comments for pattern synonym sig Closes #24749 - - - - - c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00 tests: Widen acceptance window for dir and so size tests These are testing things which are sometimes out the control of a GHC developer. Therefore we shouldn't fail CI if something about these dependencies change because we can't do anything about it. It is still useful to have these statistics for visualisation in grafana though. Ticket #24759 - - - - - 9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00 Disable rts_so test It has already manifested large fluctuations and destabilising CI Fixes #24762 - - - - - fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00 unboxedSum{Type,Data}Name: Use GHC.Types as the module Unboxed sum constructors are now defined in the `GHC.Types` module, so if you manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like: ```hs GHC.Types.Sum2# ``` The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly believes that unboxed sum constructors are defined in `GHC.Prim`, so `unboxedSumTypeName 2` would return an entirely different `Name`: ```hs GHC.Prim.(#|#) ``` This is a problem for Template Haskell users, as it means that they can't be sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.) This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use `GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the `unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums (`Sum<N>#`) as the `OccName`. Fixes #24750. - - - - - 7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00 EPA: Widen stmtslist to include last semicolon Closes #24754 - - - - - 06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00 doc: Fix type error in hs_try_putmvar example - - - - - af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00 Fix parsing of module names in CLI arguments closes issue #24732 - - - - - da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00 ghc-platform: Add Setup.hs The Hadrian bootstrapping script relies upon `Setup.hs` to drive its build. Addresses #24761. - - - - - 35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00 EPA: preserve comments in class and data decls Fix checkTyClHdr which was discarding comments. Closes #24755 - - - - - 03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00 Fix a float-out error Ticket #24768 showed that the Simplifier was accidentally destroying a join point. It turned out to be that we were sending a bottoming join point to the top, accidentally abstracting over /other/ join points. Easily fixed. - - - - - adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00 Substitute bindist files with Hadrian not configure The `ghc-toolchain` overhaul will eventually replace all this stuff with something much more cleaned up, but I think it is still worth making this sort of cleanup in the meantime so other untanglings and dead code cleaning can procede. I was able to delete a fair amount of dead code doing this too. `LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it wasn't actually turned into a valid CPP identifier. (Original to 1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.) Progress on #23966 Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com> - - - - - 18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00 EPA: fix mkHsOpTyPV duplicating comments Closes #24753 - - - - - a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00 Add test cases for #24664 ...since none are present in the original MR !12463 fixing this issue. - - - - - 46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00 EPA: preserve comments in data decls Closes #24771 - - - - - 3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00 Rename Solo# data constructor to MkSolo# (#24673) - data Solo# a = (# a #) + data Solo# a = MkSolo# a And `(# foo #)` syntax now becomes just a syntactic sugar for `MkSolo# a`. - - - - - 4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Add the cmm_cpp_is_gcc predicate to the testsuite A future C-- test called T24474-cmm-override-g0 relies on the GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it emitting #defines past the preprocessing stage. Clang, at least, does not do this, so the test would fail if ran on Clang. As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of the workaround we apply as a fix for bug #24474, and the workaround was for GCC-specific behaviour, the test needs to be marked as fragile on other compilers. - - - - - 25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00 Split out the C-- preprocessor, and make it pass -g0 Previously, C-- was processed with the C preprocessor program. This means that it inherited flags passed via -optc. A flag that is somewhat often passed through -optc is -g. At certain -g levels (>=2), GCC starts emitting defines *after* preprocessing, for the purposes of debug info generation. This is not useful for the C-- compiler, and, in fact, causes lexer errors. We can suppress this effect (safely, if supported) via -g0. As a workaround, in older versions of GCC (<=10), GCC only emitted defines if a certain set of -g*3 flags was passed. Newer versions check the debug level. For the former, we filter out those -g*3 flags and, for the latter, we specify -g0 on top of that. As a compatible and effective solution, this change adds a C-- preprocessor distinct from the C compiler and preprocessor, but that keeps its flags. The command line produced for C-- preprocessing now looks like: $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474 - - - - - 9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00 -fprof-late: Only insert cost centres on functions/non-workfree cafs. They are usually useless and doing so for data values comes with a large compile time/code size overhead. Fixes #24103 - - - - - 259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00 Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770) See the adjusted `Note [DataAlt occ info]`. This change also has a positive repercussion on `Note [Combine case alts: awkward corner]`. Fixes #24770. We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675. Metric Decrease: T9675 - - - - - 31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00 Kill seqRule, discard dead seq# in Prep (#24334) Discarding seq#s in Core land via `seqRule` was problematic; see #24334. So instead we discard certain dead, discardable seq#s in Prep now. See the updated `Note [seq# magic]`. This fixes the symptoms of #24334. - - - - - b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00 Document NcgImpl methods Fixes #19914 - - - - - 4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00 Make renamer to be more flexible with parens in the LHS of the rules We used to reject LHS like `(f a) b` in RULES and requires it to be written as `f a b`. It will be handy to allow both as the expression may be more readable with extra parens in some cases when infix operator is involved. Espceially when TemplateHaskell is used, extra parens may be added out of user's control and result in "valid" rules being rejected and there are not always ways to workaround it. Fixes #24621 - - - - - ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00 IPE: Eliminate dependency on Read Instead of encoding the closure type as decimal string we now simply represent it as an integer, eliminating the need for `Read` in `GHC.Internal.InfoProv.Types.peekInfoProv`. Closes #24504. ------------------------- Metric Decrease: T24602_perf_size size_hello_artifact ------------------------- - - - - - a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00 testsuite: fix testwsdeque with recent clang This patch fixes compilation of testwsdeque.c with recent versions of clang, which will fail with the error below: ``` testwsdeque.c:95:33: error: warning: format specifies type 'long' but the argument has type 'void *' [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~~ ^ testwsdeque.c:95:39: error: warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat] 95 | barf("FAIL: %ld %d %d", p, n, val); | ~~ ^~~ | %lu testwsdeque.c:133:42: error: error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types] 133 | createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n); | ^~~~~ /workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error: note: passing argument to parameter 'startProc' here 193 | OSThreadProc *startProc, void *param); | ^ 2 warnings and 1 error generated. ``` - - - - - c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00 Rename pre-processor invocation args Small clean up. Uses proper names for the various groups of arguments that make up the pre-processor invocation. - - - - - 2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00 ghc-heap: fix typo in ghc-heap cbits - - - - - fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00 Improve performance of Data.List.sort(By) This patch improves the algorithm to sort lists in base. It does so using two strategies: 1) Use a four-way-merge instead of the 'default' two-way-merge. This is able to save comparisons and allocations. 2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization. This mainly benefits types with a fast (>). Note that this *may* break instances with a *malformed* Ord instance where `a > b` is *not* equal to `compare a b == GT`. CLC proposal: https://github.com/haskell/core-libraries-committee/issues/236 Fixes #24280 ------------------------- Metric Decrease: MultiLayerModulesTH_Make T10421 T13719 T15164 T18698a T18698b T1969 T9872a T9961 T18730 WWRec T12425 T15703 ------------------------- - - - - - 1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00 Revert "ghcup-metadata: Drop output_name field" This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f. This breaks the ghcup metadata generation on the nightly jobs. - - - - - daff1e30 by Jannis at 2024-05-12T13:38:35-04:00 Division by constants optimization - - - - - 413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00 Tidy: Add flag to expose unfoldings if they take dictionary arguments. Add the flag `-fexpose-overloaded-unfoldings` to be able to control this behaviour. For ghc's boot libraries file size grew by less than 1% when it was enabled. However I refrained from enabling it by default for now. I've also added a section on specialization more broadly to the users guide. ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot Metric Increase: T12425 T13386 hard_hole_fits ------------------------- - - - - - c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00 Don't store a GlobalRdrEnv in `mi_globals` for GHCi. GHCi only needs the `mi_globals` field for modules imported with :module +*SomeModule. It uses this field to make the top level environment in `SomeModule` available to the repl. By default, only the first target in the command line parameters is "star" loaded into GHCi. Other modules have to be manually "star" loaded into the repl. Storing the top level GlobalRdrEnv for each module is very wasteful, especially given that we will most likely never need most of these environments. Instead we store only the information needed to reconstruct the top level environment in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements as well as all top level symbols defined in the module (not taking export lists into account) When a particular module is "star-loaded" into GHCi (as the first commandline target, or via an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using the `IfaceTopEnv`. - - - - - d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00 Add perf regression test for `-fwrite-if-simplified-core` - - - - - 2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00 Improve pattern to type pattern transformation (23739) `pat_to_type_pat` function now can handle more patterns: - TuplePat - ListPat - LitPat - NPat - ConPat Allowing these new constructors in type patterns significantly increases possible shapes of type patterns without `type` keyword. This patch also changes how lookups in `lookupOccRnConstr` are performed, because we need to fall back into types when we didn't find a constructor on data level to perform `ConPat` to type transformation properly. - - - - - be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00 hadrian: fix hadrian building with ghc-9.10.1 - - - - - ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00 linters: fix lint-whitespace compilation with ghc-9.10.1 - - - - - a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00 Expand the `inline` rule to look through casts/ticks. Fixes #24808 - - - - - b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00 testsuite: bump PartialDownSweep timeout to 5x on wasm32 - - - - - b2227487 by Fendor at 2024-05-15T17:14:06-04:00 Add Eq and Ord instance to `IfaceType` We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes - - - - - d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00 Move out LiteralMap to avoid cyclic module dependencies - - - - - 2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00 Add deduplication table for `IfaceType` The type `IfaceType` is a highly redundant, tree-like data structure. While benchmarking, we realised that the high redundancy of `IfaceType` causes high memory consumption in GHCi sessions when byte code is embedded into the `.hi` file via `-fwrite-if-simplified-core` or `-fbyte-code-and-object-code`. Loading such `.hi` files from disk introduces many duplicates of memory expensive values in `IfaceType`, such as `IfaceTyCon`, `IfaceTyConApp`, `IA_Arg` and many more. We improve the memory behaviour of GHCi by adding an additional deduplication table for `IfaceType` to the serialisation of `ModIface`, similar to how we deduplicate `Name`s and `FastString`s. When reading the interface file back, the table allows us to automatically share identical values of `IfaceType`. To provide some numbers, we evaluated this patch on the agda code base. We loaded the full library from the `.hi` files, which contained the embedded core expressions (`-fwrite-if-simplified-core`). Before this patch: * Load time: 11.7 s, 2.5 GB maximum residency. After this patch: * Load time: 7.3 s, 1.7 GB maximum residency. This deduplication has the beneficial side effect to additionally reduce the size of the on-disk interface files tremendously. For example, on agda, we reduce the size of `.hi` files (with `-fwrite-if-simplified-core`): * Before: 101 MB on disk * Now: 24 MB on disk This has even a beneficial side effect on the cabal store. We reduce the size of the store on disk: * Before: 341 MB on disk * Now: 310 MB on disk Note, none of the dependencies have been compiled with `-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple locations in a `ModIface`. We also add IfaceType deduplication table to .hie serialisation and refactor .hie file serialisation to use the same infrastrucutre as `putWithTables`. Bump haddock submodule to accomodate for changes to the deduplication table layout and binary interface. - - - - - 36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00 Add run-time configurability of `.hi` file compression Introduce the flag `-fwrite-if-compression=<n>` which allows to configure the compression level of writing .hi files. The motivation is that some deduplication operations are too expensive for the average use case. Hence, we introduce multiple compression levels with variable impact on performance, but still reduce the memory residency and `.hi` file size on disk considerably. We introduce three compression levels: * `1`: `Normal` mode. This is the least amount of compression. It deduplicates only `Name` and `FastString`s, and is naturally the fastest compression mode. * `2`: `Safe` mode. It has a noticeable impact on .hi file size and is marginally slower than `Normal` mode. In general, it should be safe to always use `Safe` mode. * `3`: `Full` deduplication mode. Deduplicate as much as we can, resulting in minimal .hi files, but at the cost of additional compilation time. Reading .hi files doesn't need to know the initial compression level, and can always deserialise a `ModIface`, as we write out a byte that indicates the next value has been deduplicated. This allows users to experiment with different compression levels for packages, without recompilation of dependencies. Note, the deduplication also has an additional side effect of reduced memory consumption to implicit sharing of deduplicated elements. See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where that matters. ------------------------- Metric Decrease: MultiLayerModulesDefsGhciWithCore T16875 T21839c T24471 hard_hole_fits libdir ------------------------- - - - - - 1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00 Introduce regression tests for `.hi` file sizes Add regression tests to track how `-fwrite-if-compression` levels affect the size of `.hi` files. - - - - - 639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00 TTG: ApplicativeStatement exist only in Rn and Tc Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com> - - - - - aa7b336b by Jade at 2024-05-15T23:06:17-04:00 Documentation: Improve documentation for symbols exported from System.IO - - - - - c561de8f by Jade at 2024-05-15T23:06:54-04:00 Improve suggestions for language extensions - When suggesting Language extensions, also suggest Extensions which imply them - Suggest ExplicitForAll and GADTSyntax instead of more specific extensions - Rephrase suggestion to include the term 'Extension' - Also moves some flag specific definitions out of Session.hs into Flags.hs (#24478) Fixes: #24477 Fixes: #24448 Fixes: #10893 - - - - - 4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00 Testsuite: Check if llvm assembler is available for have_llvm - - - - - bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00 refactor quadratic search in warnMissingHomeModules - - - - - 7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00 add test that runs MakeDepend on thousands of modules - - - - - b84b91f5 by Adam Gundry at 2024-05-16T15:32:06-04:00 Representation-polymorphic HasField (fixes #22156) This generalises the HasField class to support representation polymorphism, so that instead of type HasField :: forall {k} . k -> Type -> Type -> Constraint we have type HasField :: forall {k} {r_rep} {a_rep} . k -> TYPE r_rep -> TYPE a_rep -> Constraint - - - - - 05285090 by Matthew Pickering at 2024-05-16T15:32:43-04:00 Bump os-string submodule to 2.0.2.2 Closes #24786 - - - - - 886ab43a by Cheng Shao at 2024-05-17T01:34:50-04:00 rts: do not prefetch mark_closure bdescr in non-moving gc when ASSERTS_ENABLED This commit fixes a small an oversight in !12148: the prefetch logic in non-moving GC may trap in debug RTS because it calls Bdescr() for mark_closure which may be a static one. It's fine in non-debug RTS because even invalid bdescr addresses are prefetched, they will not cause segfaults, so this commit implements the most straightforward fix: don't prefetch mark_closure bdescr when assertions are enabled. - - - - - b38dcf39 by Teo Camarasu at 2024-05-17T01:34:50-04:00 rts: Allocate non-moving segments with megablocks Non-moving segments are 8 blocks long and need to be aligned. Previously we serviced allocations by grabbing 15 blocks, finding an aligned 8 block group in it and returning the rest. This proved to lead to high levels of fragmentation as a de-allocating a segment caused an 8 block gap to form, and this could not be reused for allocation. This patch introduces a segment allocator based around using entire megablocks to service segment allocations in bulk. When there are no free segments, we grab an entire megablock and fill it with aligned segments. As the megablock is free, we can easily guarantee alignment. Any unused segments are placed on a free list. It only makes sense to free segments in bulk when all of the segments in a megablock are freeable. After sweeping, we grab the free list, sort it, and find all groups of segments where they cover the megablock and free them. This introduces a period of time when free segments are not available to the mutator, but the risk that this would lead to excessive allocation is low. Right after sweep, we should have an abundance of partially full segments, and this pruning step is relatively quick. In implementing this we drop the logic that kept NONMOVING_MAX_FREE segments on the free list. We also introduce an eventlog event to log the amount of pruned/retained free segments. See Note [Segment allocation strategy] Resolves #24150 ------------------------- Metric Decrease: T13253 T19695 ------------------------- - - - - - 710665bd by Cheng Shao at 2024-05-17T01:35:30-04:00 rts: fix I/O manager compilation errors for win32 target This patch fixes I/O manager compilation errors for win32 target discovered when cross-compiling to win32 using recent clang: ``` rts/win32/ThrIOManager.c:117:7: error: error: call to undeclared function 'is_io_mng_native_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 117 | if (is_io_mng_native_p ()) { | ^ | 117 | if (is_io_mng_native_p ()) { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/fs.c:143:28: error: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] 143 | int setErrNoFromWin32Error () { | ^ | void | 143 | int setErrNoFromWin32Error () { | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:227:9: error: error: call to undeclared function 'interruptIOManagerEvent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 227 | interruptIOManagerEvent (); | ^ | 227 | interruptIOManagerEvent (); | ^ rts/win32/ConsoleHandler.c:227:9: error: note: did you mean 'getIOManagerEvent'? | 227 | interruptIOManagerEvent (); | ^ rts/include/rts/IOInterface.h:27:10: error: note: 'getIOManagerEvent' declared here 27 | void * getIOManagerEvent (void); | ^ | 27 | void * getIOManagerEvent (void); | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) rts/win32/ConsoleHandler.c:196:9: error: error: call to undeclared function 'setThreadLabel'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/win32/ConsoleHandler.c:196:9: error: note: did you mean 'postThreadLabel'? | 196 | setThreadLabel(cap, t, "signal handler thread"); | ^ rts/eventlog/EventLog.h:118:6: error: note: 'postThreadLabel' declared here 118 | void postThreadLabel(Capability *cap, | ^ | 118 | void postThreadLabel(Capability *cap, | ^ 1 error generated. `x86_64-w64-mingw32-clang' failed in phase `C Compiler'. (Exit code: 1) ``` - - - - - 28b9cee0 by Rodrigo Mesquita at 2024-05-17T01:36:05-04:00 configure: Check C99-compat for Cmm preprocessor Fixes #24815 - - - - - 8927e0c3 by Andreas Klebinger at 2024-05-17T01:36:41-04:00 Ensure `tcHasFixedRuntimeRep (# #)` returns True. - - - - - 04179044 by doyougnu at 2024-05-17T09:00:32-04:00 testsuite: make find_so regex less general Closes #24759 Background. In MR !12372 we began tracking shared object files and directories sizes for dependencies. However, this broke release builds because release builds alter the filenames swapping "in-place" for a hash. This was not considered in the MR and thus broke release pipelines. Furthermore, the rts_so test was found to be wildly varying and was therefore disabled in !12561. This commit fixes both of these issues: - fix the rts_so test by making the regex less general, now the rts_so test and all other foo.so tests must match "libHS<some-lib>-<version>-<hash|'in-place>-<ghc>". This prevents the rts_so test from accidentally matching different rts variants such as rts_threaded, which was the cause of the wild swings after !12372. - add logic to match either a hash or the string in-place. This should make the find_so function build agnostic. - - - - - 0962b50d by Andreas Klebinger at 2024-05-17T09:01:08-04:00 TagAnalysis: Treat all bottom ids as tagged during analysis. Ticket #24806 showed that we also need to treat dead end thunks as tagged during the analysis. - - - - - 7eb9f184 by Ben Gamari at 2024-05-17T11:23:37-04:00 Remove haddock submodule In preparation for merge into the GHC, as proposed in #23178. - - - - - 47b14dcc by Fendor at 2024-05-17T11:28:17-04:00 Adapt to `IfLclName` newtype changes (cherry picked from commit a711607e29b925f3d69e27c5fde4ba655c711ff1) - - - - - 6cc6681d by Fendor at 2024-05-17T11:28:17-04:00 Add IfaceType deduplication table to interface file serialisation Although we do not really need it in the interface file serialisation, as the deserialisation uses `getWithUserData`, we need to mirror the structure `getWithUserData` expects. Thus, we write essentially an empty `IfaceType` table at the end of the file, as the interface file doesn't reference `IfaceType`. (cherry picked from commit c9bc29c6a708483d2abc3d8ec9262510ce87ca61) - - - - - b9721206 by Ben Gamari at 2024-05-17T11:30:22-04:00 ghc-tags.yaml: Initial commit - - - - - 074e7d8f by Ben Gamari at 2024-05-17T11:31:29-04:00 fourmolu: Add configuration - - - - - 151b1736 by Ben Gamari at 2024-05-17T11:32:52-04:00 Makefile: Rework for use by haddock developers Previously the Makefile was present only for GHC's old make-based build system. Now since the make-based build system is gone we can use it for more useful ends. - - - - - a7dcf13b by Ben Gamari at 2024-05-17T11:36:14-04:00 Reformat with fourmolu Using previously-added configuration and `fourmolu -i .` Note that we exclude the test-cases (`./{hoogle,html-hypsrc,latex}-test`) as they are sensitive to formatting. - - - - - 0ea6017b by Ben Gamari at 2024-05-17T11:40:04-04:00 Add 'utils/haddock/' from commit 'a7dcf13bfbb97b20e75cc8ce650e2bb628db4660' git-subtree-dir: utils/haddock git-subtree-mainline: 7eb9f1849b1c72a1c61dee88462b4244550406f3 git-subtree-split: a7dcf13bfbb97b20e75cc8ce650e2bb628db4660 - - - - - aba1d304 by Hécate Moonlight at 2024-05-17T11:40:48-04:00 Add exceptions to the dangling notes list - - - - - 527bfbfb by Hécate Moonlight at 2024-05-17T11:40:52-04:00 Add haddock to the whitespace lint ignore list - - - - - 43274677 by Ben Gamari at 2024-05-17T11:41:20-04:00 git-blame-ignore-revs: Ignore haddock reformatting - - - - - 0e679e37 by Fendor at 2024-05-18T00:27:24-04:00 Pass cpp options to the CC builder in hadrian - - - - - bb40244e by Sylvain Henry at 2024-05-18T00:28:06-04:00 JS: fix allocation constant (fix #24746) - - - - - 646d30ab by Jade at 2024-05-18T19:23:31+02:00 Add highlighting for inline-code snippets in haddock - - - - - 64459a3e by Hécate Moonlight at 2024-05-19T08:42:27-04:00 haddock: Add a .readthedocs.yml file for online documentation - - - - - 7d3d9bbf by Serge S. Gulin at 2024-05-19T18:47:05+00:00 Unicode: General Category size test (related #24789) Added trivial size performance test which involves unicode general category usage via `read`. The `read` itself uses general category to detect spaces. The purpose for this test is to measure outcome of applying improvements at General Category representation in code discussed at #24789. - - - - - 8e04efcf by Alan Zimmerman at 2024-05-19T21:29:34-04:00 EPA: Remove redundant code Remove unused epAnnAnns function various cases for showAstData that no longer exist - - - - - 071d7a1e by Rodrigo Mesquita at 2024-05-20T10:55:16-04:00 Improve docs on closed type families in hs-boots Fixes #24776 - - - - - d9e2c119 by Torsten Schmits at 2024-05-20T10:55:52-04:00 Use default deviation for large-project test This new performance test has the purpose of detecting regressions in complexity in relation to the number of modules in a project, so 1% deviation is way too small to avoid false positives. - - - - - 20b0136a by Ben Gamari at 2024-05-22T00:31:39-04:00 ghcup-metadata: Various fixes from 9.10.1 Use Debian 12/x86-64, Debian 10/aarch64, and Debian 11/aarch64 bindists where possible. - - - - - 6838a7c3 by Sylvain Henry at 2024-05-22T00:32:23-04:00 Reverse arguments to stgCallocBytes (fix #24828) - - - - - f50f46c3 by Fendor at 2024-05-22T00:32:59-04:00 Add log messages for Iface serialisation compression level Fix the label of the number of 'IfaceType' entries in the log message. Add log message for the compression level that is used to serialise a an interface file. Adds `Outputable` instance for 'CompressionIFace'. - - - - - 3bad5d55 by Hécate Moonlight at 2024-05-22T00:33:40-04:00 base: Update doctests outputs ghc-internal: Update doctests outputs - - - - - 9317c6fb by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix the testsuites of the haddock-library - Apply all the metadata revisions from Hackage to the cabal file. - Fix the `ParserSpec.hs` file in the `spec` testsuite of haddock-library. - Make `CHANGES.md` an extra-doc-file instead of an extra-source-file. - - - - - 54073b02 by David Binder at 2024-05-22T00:34:21-04:00 haddock: Fix parser of @since pragma The testsuite contained tests for annotations of the form `@since foo-bar-0.5.0`, but the parser was written incorrectly. - - - - - ede6ede3 by Matthew Pickering at 2024-05-22T00:34:57-04:00 Fix nightly pages job It seems likely broken by 9f99126a which moved `index.html` from the root folder into `docs/` folder. Fixes #24840 - - - - - b7bcf729 by Cheng Shao at 2024-05-22T00:35:32-04:00 autoconf: remove unused context diff check This patch removes redundant autoconf check for the context diff program given it isn't actually been used anywhere, especially since make removal. - - - - - ea2fe66e by Hécate Moonlight at 2024-05-22T00:36:13-04:00 haddock: Rework the contributing guide - - - - - 0f302a94 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 haddock: Add module relationships diagrams of haddock-api and haddock-library - - - - - d1a9f34f by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add instructions - - - - - b880ee80 by Hécate Moonlight at 2024-05-22T00:36:52-04:00 Add SVG outputs - - - - - 6d7e6ad8 by Ben Gamari at 2024-05-22T13:40:05-04:00 rts: Fix size of StgOrigThunkInfo frames Previously the entry code of the `stg_orig_thunk` frame failed to account for the size of the profiling header as it hard-coded the frame size. Fix this. Fixes #24809. - - - - - c645fe40 by Fendor at 2024-05-22T13:40:05-04:00 Add regression test T24809 for stg_orig_thunk_info_frame size - - - - - 4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00 bindists: Check for existence of share folder before trying to copy it. This folder isn't distributed in windows bindists A lack of doing so resulted us copying loads of files twice. - - - - - d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00 Remove ad-hoc installation of mingw toolchain in relocatable bindists This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951 The choice about whether to install mingw is taken in the installation makefile. This is also broken on non-windows systems. The actual issue was the EnableDistroToolchain variable wasn't declared in mk/config.mk and therefore the check to install mingw was failing. - - - - - 7b4c1998 by Cheng Shao at 2024-05-22T21:52:52-04:00 testsuite: fix T17920 for wasm backend T17920 was marked as fragile on wasm before; it can be trivially fixed by avoiding calling variadic printf() in cmm. - - - - - c739383b by Cheng Shao at 2024-05-22T21:53:29-04:00 testsuite: bump T22744 timeout to 5x - - - - - c4c6d714 by Cheng Shao at 2024-05-22T21:54:06-04:00 testsuite: don't attempt to detect host cpu features when testing cross ghc The testsuite driver CPU feature detection logic only detects host CPU and only makes sense when we are not testing a cross GHC. - - - - - 3d9e4ce6 by Simon Peyton Jones at 2024-05-22T21:54:43-04:00 Better skolemisation As #24810 showed, it is (a little) better to skolemise en-bloc, so that Note [Let-bound skolems] fires more often. See Note [Skolemisation en bloc] in GHC.Tc.Utils.Instantiate. - - - - - a3cd3a1d by Ryan Scott at 2024-05-22T21:55:19-04:00 Add missing parenthesizePat in cvtp We need to ensure that the output of `cvtp` is parenthesized (at precedence `sigPrec`) so that any pattern signatures with a surrounding pattern signature can parse correctly. Fixes #24837. - - - - - 4bb2a7cc by Hécate Moonlight at 2024-05-22T21:55:59-04:00 [base] Document the memory overhead of ByteArray Add a diagram that shows the constituent parts of a ByteArray and their memory overhead. - - - - - 8b2a016a by Hécate Moonlight at 2024-05-22T21:56:38-04:00 Haddock: Add MR template for Haddock - - - - - ead75532 by Peter Trommler at 2024-05-23T02:28:05-04:00 PPC: Support ELF v2 on powerpc64 big-endian Detect ELF v2 on PowerPC 64-bit systems. Check for `_CALL_ELF` preprocessor macro. Fixes #21191 - - - - - 9d4c10f2 by Hécate Kleidukos at 2024-05-23T02:28:44-04:00 gitlab: Add @Kleidukos to CODEOWNERS for utils/haddock - - - - - 28e64170 by Preetham Gujjula at 2024-05-23T07:20:48-04:00 haddock: Add cabal-fmt to tools for `make style` - - - - - 00126a89 by Andrei Borzenkov at 2024-05-23T07:21:24-04:00 haddock: fix verbosity option parsing - - - - - a3e0b68b by Ryan Hendrickson at 2024-05-23T15:52:03-04:00 base: specify tie-breaking behavior of min, max, and related list/Foldable functions - - - - - bdcc0f37 by doyougnu at 2024-05-24T07:51:18-04:00 cmm: add word <-> double/float bitcast - closes: #25331 This is the last step in the project plan described in #25331. This commit: - adds bitcast operands for x86_64, LLVM, aarch64 - For PPC and i386 we resort to using the cmm implementations - renames conversion MachOps from Conv to Round|Truncate - - - - - f0d257f7 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor Some functions in StgToByteCode were filtering out void arguments. However, StgToByteCode is called after unarisation: the void arguments should have been removed earlier. Instead of filtering out, we assert that the args are non-void. - - - - - 03137fd2 by Krzysztof Gogolewski at 2024-05-24T07:51:55-04:00 StgToByteCode: minor refactor `layoutNativeCall` was always called with a `primRepCmmType platform` callback. Hence we can put it inside of `layoutNativeCall` rather than repeat it. - - - - - 27c430f3 by David Binder at 2024-05-24T07:52:38-04:00 haddock: Remove compatibility shims for GHC < 8.4 from haddock-library - - - - - 8dd8a076 by Cheng Shao at 2024-05-24T07:53:14-04:00 compiler: avoid saving foreign call target to local when there are no caller-save GlobalRegs This patch makes the STG->Cmm backend avoid saving foreign call target to local when there are no caller-save GlobalRegs. Since 321941a8ebe25192cdeece723e1058f2f47809ea, when we lower a foreign call, we unconditionally save the foreign call target to a temporary local first, then rely on cmmSink to clean it up later, which only happens with -fcmm-sink (implied by -O) and not in unoptimized code. And this is troublesome for the wasm backend NCG, which needs to infer a foreign call target symbol's type signature from the Cmm call site. Previously, the NCG has been emitting incorrect type signatures for unoptimized code, which happens to work with `wasm-ld` most of the time, but this is never future-proof against upstream toolchain updates, and it causes horrible breakages when LTO objects are included in linker input. Hence this patch. - - - - - 986df1ab by Cheng Shao at 2024-05-24T07:53:14-04:00 testsuite: add callee-no-local regression test - - - - - 52d62e2a by Sylvain Henry at 2024-05-24T07:53:57-04:00 Fix HasCallStack leftovers from !12514 / #24726 - - - - - c5e00c35 by crumbtoo at 2024-05-24T07:54:38-04:00 user_guide: Fix typo in MultiWayIf chapter Close #24829 - - - - - bd323b0e by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Ensure that CHANGELOG is included in extra-source-files This was missed in the `ghc-internal` split. Closes #24831. - - - - - 1bfd32e8 by Ben Gamari at 2024-05-24T07:55:15-04:00 base: Fix changelog reference to setBacktraceMechanismState (cherry picked from commit b63f7ba01fdfd98a01d2f0dec8d9262b3e595c5d) - - - - - 43e8e4f3 by Sylvain Henry at 2024-05-24T12:16:43-04:00 Float/double unboxed literal support for HexFloatLiterals (fix #22155) - - - - - 4a7f4713 by Fendor at 2024-05-24T12:17:19-04:00 Improve test labels for binary interface file size tests Test labels for binary interface file sizes are hard to read and overly verbose at the same time. Extend the name for the metric title, but shorten it in the actual comparison table. - - - - - 14e554cf by Zubin Duggal at 2024-05-24T12:17:55-04:00 Revert "Fix haskell/haddock#783 Don't show button if --quickjump not present" This reverts commit 7776566531e72c415f66dd3b13da9041c52076aa. - - - - - f56838c3 by Ben Gamari at 2024-05-24T12:17:55-04:00 Fix default hyperlinked sources pattern Previously this didn't include the `%M` token which manifested as broken links to the hyperlinked sources of reexports of declarations defined in other packages. Fixes haddock#1628. (cherry picked from commit 1432bcc943d41736eca491ecec4eb9a6304dab36) - - - - - 42efa62c by Ben Gamari at 2024-05-24T12:17:55-04:00 Make DocPaths a proper data type (cherry picked from commit 7f3a5c4da0023ae47b4c376c9b1ea2d706c94d8c) - - - - - 53d9ceb3 by Ben Gamari at 2024-05-24T12:17:55-04:00 haddock: Bump version to 2.30 (cherry picked from commit 994989ed3d535177e57b778629726aeabe8c7602) - - - - - e4db1112 by Zubin Duggal at 2024-05-24T12:17:55-04:00 haddock-api: allow base 4.20 and ghc 9.11 - - - - - e294f7a2 by PHO at 2024-05-24T12:17:55-04:00 Add a flag "threaded" for building haddock with the threaded RTS GHC isn't guaranteed to have a threaded RTS. There should be a way to build it with the vanilla one. (cherry picked from commit 75a94e010fb5b0236c670d22b04f5472397dc15d) - - - - - 51165bc9 by Andreas Klebinger at 2024-05-25T10:58:03-04:00 Update ticky counter event docs. Add the info about the info table address and json fields. Fixes #23200 - - - - - 98597ad5 by Sylvain Henry at 2024-05-25T10:58:45-04:00 Export extractPromotedList (#24866) This can be useful in plugins. - - - - - 228dcae6 by Teo Camarasu at 2024-05-28T13:12:24+00:00 template-haskell: Move wired-ins to ghc-internal Thus we make `template-haskell` reinstallable and keep it as the public API for Template Haskell. All of the wired-in identifiers are moved to `ghc-internal`. This necessitates also moving much of `ghc-boot-th` into `ghc-internal`. These modules are then re-exported from `ghc-boot-th` and `template-haskell`. To avoid a dependency on `template-haskell` from `lib:ghc`, we instead depend on the TH ASTs via `ghc-boot-th`. As `template-haskell` no longer has special status, we can drop the logic adding an implicit dependency on `template-haskell` when using TH. We can also drop the `template-haskell-next` package, which was previously used when bootstrapping. When bootstrapping, we need to vendor the TH AST modules from `ghc-internal` into `ghc-boot-th`. This is controlled by the `bootstrap` cabal flag as before. See Note [Bootstrapping Template Haskell]. We split out a GHC.Internal.TH.Lift module resolving #24752. This module is only built when not bootstrapping. Resolves #24703 ------------------------- Metric Increase: ghc_boot_th_dir ghc_boot_th_so ------------------------- - - - - - 62dded28 by Teo Camarasu at 2024-05-28T13:12:24+00:00 testsuite: mark tests broken by #24886 Now that `template-haskell` is no longer wired-in. These tests are triggering #24886, and so need to be marked broken. - - - - - 3ca72ad9 by Cheng Shao at 2024-05-30T02:57:06-04:00 rts: fix missing function prototypes in ClosureMacros.h - - - - - e0029e3d by Andreas Klebinger at 2024-05-30T02:57:43-04:00 UnliftedFFITypes: Allow `(# #)` as argument when it's the only argument. This allows representing functions like: int foo(void); to be imported like this: foreign import ccall "a_number_c" c_number :: (# #) -> Int64# Which can be useful when the imported function isn't implicitly stateful. - - - - - d0401335 by Matthew Pickering at 2024-05-30T02:58:19-04:00 ci: Update ci-images commit for fedora38 image The fedora38 nightly job has been failing for quite a while because `diff` was no longer installed. The ci-images bump explicitly installs `diffutils` into these images so hopefully they now pass again. - - - - - 3c97c74a by Jan Hrček at 2024-05-30T02:58:58-04:00 Update exactprint docs - - - - - 77760cd7 by Jan Hrček at 2024-05-30T02:58:58-04:00 Incorporate review feedback - - - - - 87591368 by Jan Hrček at 2024-05-30T02:58:58-04:00 Remove no longer relevant reference to comments - - - - - 05f4f142 by Jan Hrček at 2024-05-30T02:58:59-04:00 Replace outdated code example - - - - - 45a4a5f3 by Andreas Klebinger at 2024-05-30T02:59:34-04:00 Reword error resulting from missing -XBangPatterns. It can be the result of either a bang pattern or strict binding, so now we say so instead of claiming it must be a bang pattern. Fixes #21032 - - - - - e17f2df9 by Cheng Shao at 2024-05-30T03:00:10-04:00 testsuite: bump MultiLayerModulesDefsGhciReload timeout to 10x - - - - - 7a660042 by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: ensure gc_thread/gen_workspace is allocated with proper alignment gc_thread/gen_workspace are required to be aligned by 64 bytes. However, this property has not been properly enforced before, and numerous alignment violations at runtime has been caught by UndefinedBehaviorSanitizer that look like: ``` rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment 0x0000027a3390: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8 rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment 0x0000027a3450: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13 ``` This patch fixes the gc_thread/gen_workspace misalignment issue by explicitly allocating them with alignment constraint. - - - - - c77a48af by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: fix an unaligned load in nonmoving gc This patch fixes an unaligned load in nonmoving gc by ensuring the closure address is properly untagged first before attempting to prefetch its header. The unaligned load is reported by UndefinedBehaviorSanitizer: ``` rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment 0x0042005f3a71: note: pointer points here 00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9 ``` This issue had previously gone unnoticed since it didn't really harm runtime correctness, the invalid header address directly loaded from a tagged pointer is only used as prefetch address and will not cause segfaults. However, it still should be corrected because the prefetch would be rendered useless by this issue, and untagging only involves a single bitwise operation without memory access so it's cheap enough to add. - - - - - 05c4fafb by Cheng Shao at 2024-05-30T14:42:29-04:00 rts: use __builtin_offsetof to implement STG_FIELD_OFFSET This patch fixes the STG_FIELD_OFFSET macro definition by using __builtin_offsetof, which is what gcc/clang uses to implement offsetof in standard C. The previous definition that uses NULL pointer involves subtle undefined behavior in C and thus reported by UndefinedBehaviorSanitizer as well: ``` rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58 ``` - - - - - 5ff83bfc by Sylvain Henry at 2024-05-30T14:43:10-04:00 JS: remove useless h$CLOCK_REALTIME (#23202) - - - - - 95ef2d58 by Matthew Pickering at 2024-05-30T14:43:47-04:00 ghcup-metadata: Fix metadata generation There were some syntax errors in the generation script which were preventing it from running. I have tested this with: ``` nix shell --extra-experimental-features nix-command -f .gitlab/rel_eng -c ghcup-metadata --metadata ghcup-0.0.7.yaml --date="2024-05-27" --pipeline-id=95534 --version=9.11.20240525 ``` which completed successfully. - - - - - 1bc66ee4 by Jakob Bruenker at 2024-05-30T14:44:22-04:00 Add diagrams to Arrows documentation This adds diagrams to the documentation of Arrows, similar to the ones found on https://www.haskell.org/arrows/. It does not add diagrams for ArrowChoice for the time being, mainly because it's not clear to me how to visually distinguish them from the ones for Arrow. Ideally, you might want to do something like highlight the arrows belonging to the same tuple or same Either in common colors, but that's not really possible with unicode. - - - - - d10a1c65 by Matthew Craven at 2024-05-30T23:35:48-04:00 Make UnsafeSNat et al. into pattern synonyms ...so that they do not cause coerce to bypass the nominal role on the corresponding singleton types when they are imported. See Note [Preventing unsafe coercions for singleton types] and the discussion at #23478. This also introduces unsafeWithSNatCo (and analogues for Char and Symbol) so that users can still access the dangerous coercions that importing the real constructors would allow, but only in a very localized way. - - - - - 0958937e by Cheng Shao at 2024-05-30T23:36:25-04:00 hadrian: build C/C++ with split sections when enabled When split sections is enabled, ensure -fsplit-sections is passed to GHC as well when invoking GHC to compile C/C++; and pass -ffunction-sections -fdata-sections to gcc/clang when compiling C/C++ with the hadrian Cc builder. Fixes #23381. - - - - - 02b1f91e by Cheng Shao at 2024-05-30T23:36:25-04:00 driver: build C/C++ with -ffunction-sections -fdata-sections when split sections is enabled When -fsplit-sections is passed to GHC, pass -ffunction-sections -fdata-sections to gcc/clang when building C/C++. Previously, -fsplit-sections was only respected by the NCG/LLVM backends, but not the unregisterised backend; the GHC driver did not pass -fdata-sections and -ffunction-sections to the C compiler, which resulted in excessive executable sizes. Fixes #23381. ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - fd47e2e3 by Cheng Shao at 2024-05-30T23:37:00-04:00 testsuite: mark process005 as fragile on JS - - - - - 34a04ea1 by Matthew Pickering at 2024-05-31T06:08:36-04:00 Add -Wderiving-typeable to -Wall Deriving `Typeable` does nothing, and it hasn't done for a long while. There has also been a warning for a long while which warns you about uselessly deriving it but it wasn't enabled in -Wall. Fixes #24784 - - - - - 75fa7b0b by Matthew Pickering at 2024-05-31T06:08:36-04:00 docs: Fix formatting of changelog entries - - - - - 303c4b33 by Preetham Gujjula at 2024-05-31T06:09:21-04:00 docs: Fix link to injective type families paper Closes #24863 - - - - - df97e9a6 by Ben Gamari at 2024-05-31T06:09:57-04:00 ghc-internal: Fix package description The previous description was inherited from `base` and was inappropriate for `ghc-internal`. Also fix the maintainer and bug reporting fields. Closes #24906. - - - - - bf0737c0 by Cheng Shao at 2024-05-31T06:10:33-04:00 compiler: remove ArchWasm32 special case in cmmDoCmmSwitchPlans This patch removes special consideration for ArchWasm32 in cmmDoCmmSwitchPlans, which means the compiler will now disable cmmImplementSwitchPlans for wasm unreg backend, just like unreg backend of other targets. We enabled it in the past to workaround some compile-time panic in older versions of LLVM, but those panics are no longer present, hence no need to keep this workaround. - - - - - 7eda4bd2 by Cheng Shao at 2024-05-31T15:52:04-04:00 utils: add hie.yaml config file for ghc-config Add hie.yaml to ghc-config project directory so it can be edited using HLS. - - - - - 1e5752f6 by Cheng Shao at 2024-05-31T15:52:05-04:00 hadrian: handle findExecutable "" gracefully hadrian may invoke findExecutable "" at run-time due to a certain program is not found by configure script. Which is fine and findExecutable is supposed to return Nothing in this case. However, on Windows there's a directory bug that throws an exception (see https://github.com/haskell/directory/issues/180), so we might as well use a wrapper for findExecutable and handle exceptions gracefully. - - - - - 4eb5ad09 by Cheng Shao at 2024-05-31T15:52:05-04:00 configure: do not set LLC/OPT/LLVMAS fallback values when FIND_LLVM_PROG fails When configure fails to find LLC/OPT/LLVMAS within supported version range, it used to set "llc"/"opt"/"clang" as fallback values. This behavior is particularly troublesome when the user has llc/opt/clang with other versions in their PATH and run the testsuite, since hadrian will incorrectly assume have_llvm=True and pass that to the testsuite driver, resulting in annoying optllvm test failures (#23186). If configure determines llc/opt/clang wouldn't work, then we shouldn't pretend it'll work at all, and the bindist configure will invoke FIND_LLVM_PROG check again at install time anyway. - - - - - 5f1afdf7 by Sylvain Henry at 2024-05-31T15:52:52-04:00 Introduce UniqueSet and use it to replace 'UniqSet Unique' 'UniqSet Unique' represents a set of uniques as a 'Map Unique Unique', which is wasting space (associated key/value are always the same). Fix #23572 and #23605 - - - - - e0aa42b9 by crumbtoo at 2024-05-31T15:53:33-04:00 Improve template-haskell haddocks Closes #15822 - - - - - ae170155 by Olivier Benz at 2024-06-01T09:35:17-04:00 Bump max LLVM version to 19 (not inclusive) - - - - - 92aa65ea by Matthew Pickering at 2024-06-01T09:35:17-04:00 ci: Update CI images to test LLVM 18 The debian12 image in this commit has llvm 18 installed. - - - - - adb1fe42 by Serge S. Gulin at 2024-06-01T09:35:53-04:00 Unicode: make ucd2haskell build-able again ucd2haskell tool used streamly library which version in cabal was out of date. It is updated to the latest version at hackage with deprecated parts rewritten. Also following fixes were applied to existing code in suppose that from its last run the code structure was changed and now it was required to be up to date with actual folder structures: 1. Ghc module path environment got a suffix with `src`. 2. Generated code got 2.1 `GHC.Internal` prefix for `Data.*`. 2.2 `GHC.Unicode.Internal` swapped on `GHC.Internal.Unicode` according to actual structure. - - - - - ad56fd84 by Jade at 2024-06-01T09:36:29-04:00 Replace 'NB' with 'Note' in error messages - - - - - 6346c669 by Cheng Shao at 2024-06-01T09:37:04-04:00 compiler: fix -ddump-cmm-raw when compiling .cmm This patch fixes missing -ddump-cmm-raw output when compiling .cmm, which is useful for debugging cmm related codegen issues. - - - - - 1c834ad4 by Ryan Scott at 2024-06-01T09:37:40-04:00 Print namespace specifiers in FixitySig's Outputable instance For whatever reason, the `Outputable` instance for `FixitySig` simply did not print out namespace specifiers, leading to the confusing `-ddump-splices` output seen in #24911. This patch corrects this oversight. Fixes #24911. - - - - - cf49fb5f by Sylvain Henry at 2024-06-01T09:38:19-04:00 Configure: display C++ compiler path - - - - - f9c1ae12 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable PIC for in-tree GMP on wasm32 This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC unconditionally adds undesired code size and runtime overhead for wasm32. - - - - - 1a32f828 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: disable in-tree gmp fft code path for wasm32 This patch disables in-tree GMP FFT code paths for wasm32 target in order to give up some performance of multiplying very large operands in exchange for reduced code size. - - - - - 06277d56 by Cheng Shao at 2024-06-02T14:01:55-04:00 hadrian: build in-tree GMP with malloc-notreentrant on wasm32 This patch makes hadrian build in-tree GMP with the --enable-alloca=malloc-notreentrant configure option. We will only need malloc-reentrant when we have threaded RTS and SMP support on wasm32, which will take some time to happen, before which we should use malloc-notreentrant to avoid undesired runtime overhead. - - - - - 9f614270 by ARATA Mizuki at 2024-06-02T14:02:35-04:00 Set package include paths when assembling .S files Fixes #24839. Co-authored-by: Sylvain Henry <hsyl20 at gmail.com> - - - - - 4998a6ed by Alex Mason at 2024-06-03T02:09:29-04:00 Improve performance of genericWordQuotRem2Op (#22966) Implements the algorithm from compiler-rt's udiv128by64to64default. This rewrite results in a roughly 24x improvement in runtime on AArch64 (and likely any other arch that uses it). - - - - - ae50a8eb by Cheng Shao at 2024-06-03T02:10:05-04:00 testsuite: mark T7773 as fragile on wasm - - - - - c8ece0df by Fendor at 2024-06-03T19:43:22-04:00 Migrate `Finder` component to `OsPath`, fixed #24616 For each module in a GHCi session, we keep alive one `ModLocation`. A `ModLocation` is fairly inefficiently packed, as `String`s are expensive in memory usage. While benchmarking the agda codebase, we concluded that we keep alive around 11MB of `FilePath`'s, solely retained by `ModLocation`. We provide a more densely packed encoding of `ModLocation`, by moving from `FilePath` to `OsPath`. Further, we migrate the full `Finder` component to `OsPath` to avoid unnecessary transformations. As the `Finder` component is well-encapsulated, this requires only a minimal amount of changes in other modules. We introduce pattern synonym for 'ModLocation' which maintains backwards compatibility and avoids breaking consumers of 'ModLocation'. - - - - - 0cff083a by Cheng Shao at 2024-06-03T19:43:58-04:00 compiler: emit NaturallyAligned when element type & index type are the same width This commit fixes a subtle mistake in alignmentFromTypes that used to generate Unaligned when element type & index type are the same width. Fixes #24930. - - - - - 18f63970 by Sebastian Graf at 2024-06-04T05:05:27-04:00 Parser: Remove unused `apats` rule - - - - - 38757c30 by David Knothe at 2024-06-04T05:05:27-04:00 Implement Or Patterns (#22596) This commit introduces a new language extension, `-XOrPatterns`, as described in GHC Proposal 522. An or-pattern `pat1; ...; patk` succeeds iff one of the patterns `pat1`, ..., `patk` succeed, in this order. See also the summary `Note [Implmentation of OrPatterns]`. Co-Authored-By: Sebastian Graf <sgraf1337 at gmail.com> - - - - - 395412e8 by Cheng Shao at 2024-06-04T05:06:04-04:00 compiler/ghci/rts: remove stdcall support completely We have formally dropped i386 windows support (#18487) a long time ago. The stdcall foreign call convention is only used by i386 windows, and the legacy logic around it is a significant maintenance burden for future work that adds arm64 windows support (#24603). Therefore, this patch removes stdcall support completely from the compiler as well as the RTS (#24883): - stdcall is still recognized as a FFI calling convention in Haskell syntax. GHC will now unconditionally emit a warning (-Wunsupported-calling-conventions) and treat it as ccall. - Apart from minimum logic to support the parsing and warning logic, all other code paths related to stdcall has been completely stripped from the compiler. - ghci only supports FFI_DEFAULT_ABI and ccall convention from now on. - FFI foreign export adjustor code on all platforms no longer handles the stdcall case and only handles ccall from now on. - The Win32 specific parts of RTS no longer has special code paths for stdcall. This commit is the final nail on the coffin for i386 windows support. Further commits will perform more housecleaning to strip the legacy code paths and pave way for future arm64 windows support. - - - - - d1fe9ab6 by Cheng Shao at 2024-06-04T05:06:04-04:00 rts: remove legacy i386 windows code paths This commit removes some legacy i386 windows related code paths in the RTS, given this target is no longer supported. - - - - - a605e4b2 by Cheng Shao at 2024-06-04T05:06:04-04:00 autoconf: remove i386 windows related logic This commit removes legacy i386 windows logic in autoconf scripts. - - - - - 91e5ac5e by Cheng Shao at 2024-06-04T05:06:04-04:00 llvm-targets: remove i386 windows support This commit removes i386 windows from llvm-targets and the script to generate it. - - - - - 65fe75a4 by Cheng Shao at 2024-06-04T05:06:04-04:00 libraries/utils: remove stdcall related legacy logic This commit removes stdcall related legacy logic in libraries and utils. ccall should be used uniformly for all supported windows hosts from now on. - - - - - d2a83302 by Cheng Shao at 2024-06-04T05:06:04-04:00 testsuite: adapt the testsuite for stdcall removal This patch adjusts test cases to handle the stdcall removal: - Some stdcall usages are replaced with ccall since stdcall doesn't make sense anymore. - We also preserve some stdcall usages, and check in the expected warning messages to ensure GHC always warn about stdcall usages (-Wunsupported-calling-conventions) as expected. - Error code testsuite coverage is slightly improved, -Wunsupported-calling-conventions is now tested. - Obsolete code paths related to i386 windows are also removed. - - - - - cef8f47a by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: minor adjustments for stdcall removal This commit include minor adjustments of documentation related to stdcall removal. - - - - - 54332437 by Cheng Shao at 2024-06-04T05:06:04-04:00 docs: mention i386 Windows removal in 9.12 changelog This commit mentions removal of i386 Windows support and stdcall related change in the 9.12 changelog. - - - - - 2aaea8a1 by Cheng Shao at 2024-06-04T05:06:40-04:00 hadrian: improve user settings documentation This patch adds minor improvements to hadrian user settings documentation: - Add missing `ghc.cpp.opts` case - Remove non-existent `cxx` case - Clarify `cc.c.opts` also works for C++, while `cc.deps.opts` doesn't - Add example of passing configure argument to autoconf packages - - - - - 71010381 by Alex Mason at 2024-06-04T12:09:07-04:00 Add AArch64 CLZ, CTZ, RBIT primop implementations. Adds support for emitting the clz and rbit instructions, which are used by GHC.Prim.clz*#, GHC.Prim.ctz*# and GHC.Prim.bitReverse*#. - - - - - 44e2abfb by Cheng Shao at 2024-06-04T12:09:43-04:00 hadrian: add +text_simdutf flavour transformer to allow building text with simdutf This patch adds a +text_simdutf flavour transformer to hadrian to allow downstream packagers and users that build from source to opt-in simdutf support for text, in order to benefit from SIMD speedup at run-time. It's still disabled by default for the time being. - - - - - 077cb2e1 by Cheng Shao at 2024-06-04T12:09:43-04:00 ci: enable +text_simdutf flavour transformer for wasm jobs This commit enables +text_simdutf flavour transformer for wasm jobs, so text is now built with simdutf support for wasm. - - - - - b23746ad by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Use TemplateHaskellQuotes in instance Lift ByteArray Resolves #24852 - - - - - 3fd25743 by Teo Camarasu at 2024-06-04T22:50:50-04:00 base: Mark addrToByteArray as NOINLINE This function should never be inlined in order to keep code size small. - - - - - 98ad1ea5 by Cheng Shao at 2024-06-04T22:51:26-04:00 compiler: remove unused CompilerInfo/LinkerInfo types This patch removes CompilerInfo/LinkerInfo types from the compiler since they aren't actually used anywhere. - - - - - 11795244 by Cheng Shao at 2024-06-05T06:33:17-04:00 rts: remove unused PowerPC/IA64 native adjustor code This commit removes unused PowerPC/IA64 native adjustor code which is never actually enabled by autoconf/hadrian. Fixes #24920. - - - - - 5132754b by Sylvain Henry at 2024-06-05T06:33:57-04:00 RTS: fix warnings with doing*Profiling (#24918) - - - - - accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00 hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows - - - - - 6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00 autoconf: normalize paths of some build-time dependencies on Windows This commit applies path normalization via cygpath -m to some build-time dependencies on Windows. Without this logic, the /clang64/bin prefixed msys2-style paths cause the build to fail with --enable-distro-toolchain. - - - - - 075dc6d4 by Cheng Shao at 2024-06-05T11:36:12-04:00 hadrian: remove OSDarwin mention from speedHack This commit removes mentioning of OSDarwin from speedHack, since speedHack is purely for i386 and we no longer support i386 darwin (#24921). - - - - - 83235c4c by Cheng Shao at 2024-06-05T11:36:12-04:00 compiler: remove 32-bit darwin logic This commit removes all 32-bit darwin logic from the compiler, given we no longer support 32-bit apple systems (#24921). Also contains a bit more cleanup of obsolete i386 windows logic. - - - - - 1eb99bc3 by Cheng Shao at 2024-06-05T11:36:12-04:00 rts: remove 32-bit darwin/ios logic This commit removes 32-bit darwin/ios related logic from the rts, given we no longer support them (#24921). - - - - - 24f65892 by Cheng Shao at 2024-06-05T11:36:12-04:00 llvm-targets: remove 32-bit darwin/ios targets This commit removes 32-bit darwin/ios targets from llvm-targets given we no longer support them (#24921). - - - - - ccdbd689 by Cheng Shao at 2024-06-05T11:36:12-04:00 testsuite: remove 32-bit darwin logic This commit removes 32-bit darwin logic from the testsuite given it's no longer supported (#24921). Also contains more cleanup of obsolete i386 windows logic. - - - - - 11d661c4 by Cheng Shao at 2024-06-05T11:36:13-04:00 docs: mention 32-bit darwin/ios removal in 9.12 changelog This commit mentions removal of 32-bit darwin/ios support (#24921) in the 9.12 changelog. - - - - - 7c173310 by Georgi Lyubenov at 2024-06-05T15:17:22-04:00 Add firstA and secondA to Data.Bitraversable Please see https://github.com/haskell/core-libraries-committee/issues/172 for related discussion - - - - - 3b6f9fd1 by Ben Gamari at 2024-06-05T15:17:59-04:00 base: Fix name of changelog Fixes #24899. Also place it under `extra-doc-files` to better reflect its nature and avoid triggering unnecessary recompilation if it changes. - - - - - 1f4d2ef7 by Sebastian Graf at 2024-06-05T15:18:34-04:00 Announce Or-patterns in the release notes for GHC 9.12 (#22596) Leftover from !9229. - - - - - 8650338d by Jan Hrček at 2024-06-06T10:39:24-04:00 Improve haddocks of Language.Haskell.Syntax.Pat.Pat - - - - - 2eee65e1 by Cheng Shao at 2024-06-06T10:40:00-04:00 testsuite: bump T7653 timeout for wasm - - - - - 990fed60 by Sylvain Henry at 2024-06-07T14:45:23-04:00 StgToCmm: refactor opTranslate and friends - Change arguments order to avoid `\args -> ...` lambdas - Fix documentation - Rename StgToCmm options ("big" doesn't mean anything) - - - - - 1afad514 by Sylvain Henry at 2024-06-07T14:45:23-04:00 NCG x86: remove dead code (#5444) Since 6755d833af8c21bbad6585144b10e20ac4a0a1ab this code is dead. - - - - - 595c0894 by Cheng Shao at 2024-06-07T14:45:58-04:00 testsuite: skip objc-hi/objcxx-hi when cross compiling objc-hi/objcxx-hi should be skipped when cross compiling. The existing opsys('darwin') predicate only asserts the host system is darwin but tells us nothing about the target, hence the oversight. - - - - - edfe6140 by qqwy at 2024-06-08T11:23:54-04:00 Replace '?callStack' implicit param with HasCallStack in GHC.Internal.Exception.throw - - - - - 35a64220 by Cheng Shao at 2024-06-08T11:24:30-04:00 rts: cleanup inlining logic This patch removes pre-C11 legacy code paths related to INLINE_HEADER/STATIC_INLINE/EXTERN_INLINE macros, ensure EXTERN_INLINE is treated as static inline in most cases (fixes #24945), and also corrects the comments accordingly. - - - - - 9ea90ed2 by Andrew Lelechenko at 2024-06-08T11:25:06-04:00 CODEOWNERS: add @core-libraries to track base interface changes A low-tech tactical solution for #24919 - - - - - 580fef7b by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update CHANGELOG to reflect current version - - - - - 391ecff5 by Ben Gamari at 2024-06-09T01:27:21-04:00 ghc-internal: Update prologue.txt to reflect package description - - - - - 3dca3b7d by Ben Gamari at 2024-06-09T01:27:57-04:00 compiler: Clarify comment regarding need for MOVABS The comment wasn't clear in stating that it was only applicable to immediate source and memory target operands. - - - - - 6bd850e8 by doyougnu at 2024-06-09T21:02:14-04:00 JS: establish single source of truth for symbols In pursuit of: #22736. This MR moves ad-hoc symbols used throughout the js backend into a single symbols file. Why? First, this cleans up the code by removing ad-hoc strings created on the fly and therefore makes the code more maintainable. Second, it makes it much easier to eventually type these identifiers. - - - - - f3017dd3 by Cheng Shao at 2024-06-09T21:02:49-04:00 rts: replace ad-hoc MYTASK_USE_TLV with proper CC_SUPPORTS_TLS This patch replaces the ad-hoc `MYTASK_USE_TLV` with the `CC_SUPPORTS_TLS` macro. If TLS support is detected by autoconf, then we should use that for managing `myTask` in the threaded RTS. - - - - - e17d7e8c by Ben Gamari at 2024-06-11T05:25:21-04:00 users-guide: Fix stylistic issues in 9.12 release notes - - - - - 8a8a982a by Hugo Peters at 2024-06-11T05:25:57-04:00 fix typo in the simplifier debug output: baling -> bailing - - - - - 16475bb8 by Hécate Moonlight at 2024-06-12T03:07:55-04:00 haddock: Correct the Makefile to take into account Darwin systems - - - - - a2f60da5 by Hécate Kleidukos at 2024-06-12T03:08:35-04:00 haddock: Remove obsolete links to github.com/haskell/haddock in the docs - - - - - de4395cd by qqwy at 2024-06-12T03:09:12-04:00 Add `__GLASGOW_HASKELL_ASSERTS_IGNORED__` as CPP macro name if `-fasserts-ignored is set. This allows users to create their own Control.Exception.assert-like functionality that does something other than raising an `AssertFailed` exception. Fixes #24967 - - - - - 0e9c4dee by Ryan Hendrickson at 2024-06-12T03:09:53-04:00 compiler: add hint to TcRnBadlyStaged message - - - - - 2747cd34 by Simon Peyton Jones at 2024-06-12T12:51:37-04:00 Fix a QuickLook bug This MR fixes the bug exposed by #24676. The problem was that quickLookArg was trying to avoid calling tcInstFun unnecessarily; but it was in fact necessary. But that in turn forced me into a significant refactoring, putting more fields into EValArgQL. Highlights: see Note [Quick Look overview] in GHC.Tc.Gen.App * Instantiation variables are now distinguishable from ordinary unification variables, by level number = QLInstVar. This is treated like "level infinity". See Note [The QLInstVar TcLevel] in GHC.Tc.Utils.TcType. * In `tcApp`, we don't track the instantiation variables in a set Delta any more; instead, we just tell them apart by their level number. * EValArgQL now much more clearly captures the "half-done" state of typechecking an argument, ready for later resumption. See Note [Quick Look at value arguments] in GHC.Tc.Gen.App * Elminated a bogus (never used) fast-path in GHC.Tc.Utils.Instantiate.instCallConstraints See Note [Possible fast path for equality constraints] Many other small refactorings. - - - - - 1b1523b1 by George Thomas at 2024-06-12T12:52:18-04:00 Fix non-compiling extensible record `HasField` example - - - - - 97b141a3 by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Fix hyperlinker source urls (#24907) This fixes a bug introduced by f56838c36235febb224107fa62334ebfe9941aba Links to external modules in the hyperlinker are uniformly generated using splicing the template given to us instead of attempting to construct the url in an ad-hoc manner. - - - - - 954f864c by Zubin Duggal at 2024-06-12T12:52:55-04:00 haddock: Add name anchor to external source urls from documentation page URLs for external source links from documentation pages were missing a splice location for the name. Fixes #24912 - - - - - b0b64177 by Simon Peyton Jones at 2024-06-12T12:53:31-04:00 Prioritise nominal equalities The main payload of this patch is * Prioritise nominal equalities in the constraint solver. This ameliorates the incompleteness of solving for representational constraints over newtypes: see #24887. See (EX2) in Note [Decomposing newtype equalities] in GHC.Tc.Solver.Equality In doing this patch I tripped over some other things that I refactored: * Move `isCoVarType` from `GHC.Core.Type` to `GHC.Core.Predicate` where it seems more at home. * Clarify the "rewrite role" of a constraint. I was very puzzled about what the role of, say `(Eq a)` might be, but see the new Note [The rewrite-role of a constraint]. In doing so I made predTypeEqRel crash when given a non-equality. Usually it expects an equality; but it was being mis-used for the above rewrite-role stuff. - - - - - cb7c1b83 by Liam Goodacre at 2024-06-12T12:54:09-04:00 compiler: missing-deriving-strategies suggested fix Extends the missing-deriving-strategies warning with a suggested fix that includes which deriving strategies were assumed. For info about the warning, see comments for `TcRnNoDerivStratSpecified`, `TcRnNoDerivingClauseStrategySpecified`, & `TcRnNoStandaloneDerivingStrategySpecified`. For info about the suggested fix, see `SuggestExplicitDerivingClauseStrategies` & `SuggestExplicitStandalanoDerivingStrategy`. docs: Rewords missing-deriving-strategies to mention the suggested fix. Resolves #24955 - - - - - 4e36d3a3 by Jan Hrček at 2024-06-12T12:54:48-04:00 Further haddocks improvements in Language.Haskell.Syntax.Pat.Pat - - - - - 558353f4 by Cheng Shao at 2024-06-12T12:55:24-04:00 rts: use page sized mblocks on wasm This patch changes mblock size to page size on wasm. It allows us to simplify our wasi-libc fork, makes it much easier to test third party libc allocators like emmalloc/mimalloc, as well as experimenting with threaded RTS in wasm. - - - - - b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00 compiler: Make ghc-experimental not wired in If you need to wire in definitions, then place them in ghc-internal and reexport them from ghc-experimental. Ticket #24903 - - - - - 700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00 base: Use a more appropriate unicode arrow for the ByteArray diagram This commit rectifies the usage of a unicode arrow in favour of one that doesn't provoke mis-alignment. - - - - - cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00 ghcup-metadata: Fix debian version ranges This was caught by `ghcup-ci` failing and attempting to install a deb12 bindist on deb11. ``` configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got in ArSupportsDashL_STAGE0. Defaulting to False. bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so) ``` Fixes #24974 - - - - - 7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00 ucd2haskell: remove Streamly dependency + misc - Remove dead code. - Remove `streamly` dependency. - Process files with `bytestring`. - Replace Unicode files parsers with the corresponding ones from the package `unicode-data-parser`. - Simplify cabal file and rename module - Regenerate `ghc-internal` Unicode files with new header - - - - - 4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00 Document how to run haddocks tests (#24976) Also remove ghc 9.7 requirement - - - - - fb629e24 by amesgen at 2024-06-14T00:28:20-04:00 compiler: refactor lower_CmmExpr_Ptr - - - - - def46c8c by amesgen at 2024-06-14T00:28:20-04:00 compiler: handle CmmRegOff in lower_CmmExpr_Ptr - - - - - ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00 Small documentation update in Quick Look - - - - - 19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Add hack for #24623 ..Th bug in #24623 is randomly triggered by this MR!.. - - - - - 7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Various fixes to type-tidying This MR was triggered by #24868, but I found a number of bugs and infelicities in type-tidying as I went along. Highlights: * Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid using the OccNames of /bound/ variables when tidying /free/ variables; see the call to `tidyAvoiding`. That avoid the gratuitous renaming which was the cause of #24868. See Note [tidyAvoiding] in GHC.Core.TyCo.Tidy * Refactor and document the tidying of open types. See GHC.Core.TyCo.Tidy Note [Tidying open types] Note [Tidying is idempotent] * Tidy the coercion variable in HoleCo. That's important so that tidied types have tidied kinds. * Some small renaming to make things consistent. In particular the "X" forms return a new TidyEnv. E.g. tidyOpenType :: TidyEnv -> Type -> Type tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type) - - - - - 2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00 Wibble - - - - - e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00 Wibbles - - - - - 246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00 Localise a case-binder in SpecConstr.mkSeqs This small change fixes #24944 See (SCF1) in Note [SpecConstr and strict fields] - - - - - a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00 PPC: display foreign label in panic message (cf #23969) - - - - - bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00 cmm: Parse MO_BSwap primitive operation Parsing this operation allows it to be tested using `test-primops` in a subsequent MR. - - - - - e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00 Make flip representation polymorphic, similar to ($) and (&) CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245 - - - - - 118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00 EPA: Add location to Match Pats list So we can freely modify the pats and the following item spacing will still be valid when exact printing. Closes #24862 - - - - - db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00 compiler: Rejects RULES whose LHS immediately fails to type-check Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This happens when we have a RULE that does not type check, and enable `-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an immediately LHS type error. Fixes #24026 - - - - - e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00 Add hscTypecheckRenameWithDiagnostics, for HLS (#24996) Use runHsc' in runHsc so that both functions can't fall out of sync We're currently copying parts of GHC code to get structured warnings in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics` locally. Once we get this function into GHC we can drop the copied code in future versions of HLS. - - - - - d70abb49 by sheaf at 2024-06-18T18:47:20-04:00 Clarify -XGADTs enables existential quantification Even though -XGADTs does not turn on -XExistentialQuantification, it does allow the user of existential quantification syntax, without needing to use GADT-style syntax. Fixes #20865 - - - - - 13fdf788 by David Binder at 2024-06-18T18:48:02-04:00 Add RTS flag --read-tix-file (GHC Proposal 612) This commit introduces the RTS flag `--read-tix-file=<yes|no>` which controls whether a preexisting .tix file is read in at the beginning of a program run. The default is currently `--read-tix-file=yes` but will change to `--read-tix-file=no` in a future release of GHC. For this reason, whenever a .tix file is read in a warning is emitted to stderr. This warning can be silenced by explicitly passing the `--read-tix-file=yes` option. Details can be found in the GHC proposal cited below. Users can query whether this flag has been used with the help of the module `GHC.RTS.Flags`. A new field `readTixFile` was added to the record `HpcFlags`. These changes have been discussed and approved in - GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612 - CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276 - - - - - f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00 Improve sharing of duplicated values in `ModIface`, fixes #24723 As a `ModIface` often contains duplicated values that are not necessarily shared, we improve sharing by serialising the `ModIface` to an in-memory byte array. Serialisation uses deduplication tables, and deserialisation implicitly shares duplicated values. This helps reducing the peak memory usage while compiling in `--make` mode. The peak memory usage is especially smaller when generating interface files with core expressions (`-fwrite-if-simplified-core`). On agda, this reduces the peak memory usage: * `2.2 GB` to `1.9 GB` for a ghci session. On `lib:Cabal`, we report: * `570 MB` to `500 MB` for a ghci session * `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc There is a small impact on execution time, around 2% on the agda code base. - - - - - 1bab7dde by Fendor at 2024-06-18T18:48:38-04:00 Avoid unneccessarily re-serialising the `ModIface` To reduce memory usage of `ModIface`, we serialise `ModIface` to an in-memory byte array, which implicitly shares duplicated values. This serialised byte array can be reused to avoid work when we actually write the `ModIface` to disk. We introduce a new field to `ModIface` which allows us to save the byte array, and write it direclty to disk if the `ModIface` wasn't changed after the initial serialisation. This requires us to change absolute offsets, for example to jump to the deduplication table for `Name` or `FastString` with relative offsets, as the deduplication byte array doesn't contain header information, such as fingerprints. To allow us to dump the binary blob to disk, we need to replace all absolute offsets with relative ones. We introduce additional helpers for `ModIface` binary serialisation, which construct relocatable binary blobs. We say the binary blob is relocatable, if the binary representation can be moved and does not contain any absolute offsets. Further, we introduce new primitives for `Binary` that allow to create relocatable binaries, such as `forwardGetRel` and `forwardPutRel`. ------------------------- Metric Decrease: MultiLayerModulesDefsGhcWithCore Metric Increase: MultiComponentModules MultiLayerModules T10421 T12150 T12234 T12425 T13035 T13253-spj T13701 T13719 T14697 T15703 T16875 T18698b T18140 T18304 T18698a T18730 T18923 T20049 T24582 T5837 T6048 T9198 T9961 mhu-perf ------------------------- These metric increases may look bad, but they are all completely benign, we simply allocate 1 MB per module for `shareIface`. As this allocation is quite quick, it has a negligible impact on run-time performance. In fact, the performance difference wasn't measurable on my local machine. Reducing the size of the pre-allocated 1 MB buffer avoids these test failures, but also requires us to reallocate the buffer if the interface file is too big. These reallocations *did* have an impact on performance, which is why I have opted to accept all these metric increases, as the number of allocated bytes is merely a guidance. This 1MB allocation increase causes a lot of tests to fail that generally have a low allocation number. E.g., increasing from 40MB to 41MB is a 2.5% increase. In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a, T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin job, where the number of allocated bytes seems to be lower than in other jobs. The tests T16875 and T18698b fail on i386-linux for the same reason. - - - - - 099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00 Improve documentation of @Any@ type. In particular mention possible uses for non-lifted types. Fixes #23100. - - - - - 5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00 Update user guide to indicate support for 64-tuples - - - - - 4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00 lint notes: Add more info to notes.stdout When fixing a note reference CI fails with a somewhat confusing diff. See #21123. This commit adds a line to the output file being compared which hopefully makes it clear this is the list of broken refs, not all refs. Fixes #21123 - - - - - 1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00 docs: Update mention of ($) type in user guide Fixes #24909 - - - - - 1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00 Remove duplicate Anno instances - - - - - 8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00 AArch64: Delete unused RegNos This has the additional benefit of getting rid of the -1 encoding (real registers start at 0.) - - - - - 325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00 Bump stm submodule to current master - - - - - 64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00 testsuite: bump T17572 timeout on wasm32 - - - - - eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00 AArch64: Simplify BL instruction The BL constructor carried unused data in its third argument. - - - - - b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00 TTG: Move SourceText from `Fixity` to `FixitySig` It is only used there, simplifies the use of `Fixity` in the rest of the code, and is moved into a TTG extension point. Precedes !12842, to simplify it - - - - - 842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00 base: Deprecate some .Internal modules Deprecates the following modules according to clc-proposal #217: https://github.com/haskell/core-libraries-committee/issues/217 * GHC.TypeNats.Internal * GHC.TypeLits.Internal * GHC.ExecutionStack.Internal Closes #24998 - - - - - 24e89c40 by Jacco Krijnen at 2024-06-20T07:21:27-04:00 ttg: Use List instead of Bag in AST for LHsBindsLR Considering that the parser used to create a Bag of binds using a cons-based approach, it can be also done using lists. The operations in the compiler don't really require Bag. By using lists, there is no dependency on GHC.Data.Bag anymore from the AST. Progress towards #21592 - - - - - 04f5bb85 by Simon Peyton Jones at 2024-06-20T07:22:03-04:00 Fix untouchability test This MR fixes #24938. The underlying problem was tha the test for "does this implication bring in scope any equalities" was plain wrong. See Note [Tracking Given equalities] and Note [Let-bound skolems] both in GHC.Tc.Solver.InertSet. Then * Test LocalGivenEqs succeeds for a different reason than before; see (LBS2) in Note [Let-bound skolems] * New test T24938a succeeds because of (LBS2), whereas it failed before. * Test LocalGivenEqs2 now fails, as it should. * Test T224938, the repro from the ticket, fails, as it should. - - - - - 9a757a27 by Simon Peyton Jones at 2024-06-20T07:22:40-04:00 Fix demand signatures for join points This MR tackles #24623 and #23113 The main change is to give a clearer notion of "worker/wrapper arity", esp for join points. See GHC.Core.Opt.DmdAnal Note [Worker/wrapper arity and join points] This Note is a good summary of what this MR does: (1) The "worker/wrapper arity" of an Id is * For non-join-points: idArity * The join points: the join arity (Id part only of course) This is the number of args we will use in worker/wrapper. See `ww_arity` in `dmdAnalRhsSig`, and the function `workWrapArity`. (2) A join point's demand-signature arity may exceed the Id's worker/wrapper arity. See the `arity_ok` assertion in `mkWwBodies`. (3) In `finaliseArgBoxities`, do trimBoxity on any argument demands beyond the worker/wrapper arity. (4) In WorkWrap.splitFun, make sure we split based on the worker/wrapper arity (re)-computed by workWrapArity. - - - - - 5e8faaf1 by Jan Hrček at 2024-06-20T07:23:20-04:00 Update haddocks of Import/Export AST types - - - - - cd512234 by Hécate Kleidukos at 2024-06-20T07:24:02-04:00 haddock: Update bounds in cabal files and remove allow-newer stanza in cabal.project - - - - - 8a8ff8f2 by Rodrigo Mesquita at 2024-06-20T07:24:38-04:00 cmm: Don't parse MO_BSwap for W8 Don't support parsing bswap8, since bswap8 is not really an operation and would have to be implemented as a no-op (and currently is not implemented at all). Fixes #25002 - - - - - 5cc472f5 by sheaf at 2024-06-20T07:25:14-04:00 Delete unused testsuite files These files were committed by mistake in !11902. This commit simply removes them. - - - - - 7b079378 by Matthew Pickering at 2024-06-20T07:25:50-04:00 Remove left over debugging pragma from 2016 This pragma was accidentally introduced in 648fd73a7b8fbb7955edc83330e2910428e76147 The top-level cost centres lead to a lack of optimisation when compiling with profiling. - - - - - c872e09b by Hécate Kleidukos at 2024-06-20T19:28:36-04:00 haddock: Remove unused pragmata, qualify usages of Data.List functions, add more sanity checking flags by default This commit enables some extensions and GHC flags in the cabal file in a way that allows us to reduce the amount of prologuing on top of each file. We also prefix the usage of some List functions that removes ambiguity when they are also exported from the Prelude, like foldl'. In general, this has the effect of pointing out more explicitly that a linked list is used. Metric Increase: haddock.Cabal haddock.base haddock.compiler - - - - - 8c87d4e1 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 Add test case for #23586 - - - - - 568de8a5 by Arnaud Spiwack at 2024-06-20T19:29:12-04:00 When matching functions in rewrite rules: ignore multiplicity When matching a template variable to an expression, we check that it has the same type as the matched expression. But if the variable `f` has type `A -> B` while the expression `e` has type `A %1 -> B`, the match was previously rejected. A principled solution would have `f` substituted by `\(%Many x) -> e x` or some other appropriate coercion. But since linearity is not properly checked in Core, we can be cheeky and simply ignore multiplicity while matching. Much easier. This has forced a change in the linter which, when `-dlinear-core-lint` is off, must consider that `a -> b` and `a %1 -> b` are equal. This is achieved by adding an argument to configure the behaviour of `nonDetCmpTypeX` and modify `ensureEqTys` to call to the new behaviour which ignores multiplicities when comparing two `FunTy`. Fixes #24725. - - - - - c8a8727e by Simon Peyton Jones at 2024-06-20T19:29:12-04:00 Faster type equality This MR speeds up type equality, triggered by perf regressions that showed up when fixing #24725 by parameterising type equality over whether to ignore multiplicity. The changes are: * Do not use `nonDetCmpType` for type /equality/. Instead use a specialised type-equality function, which we have always had! `nonDetCmpType` remains, but I did not invest effort in refactoring or optimising it. * Type equality is parameterised by - whether to expand synonyms - whether to respect multiplicities - whether it has a RnEnv2 environment In this MR I systematically specialise it for static values of these parameters. Much more direct and predictable than before. See Note [Specialising type equality] * We want to avoid comparing kinds if possible. I refactored how this happens, at least for `eqType`. See Note [Casts and coercions in type comparison] * To make Lint fast, we want to avoid allocating a thunk for <msg> in ensureEqTypes ty1 ty2 <msg> because the test almost always succeeds, and <msg> isn't needed. See Note [INLINE ensureEqTys] Metric Decrease: T13386 T5030 - - - - - 21fc180b by Ryan Hendrickson at 2024-06-22T10:40:55-04:00 base: Add inits1 and tails1 to Data.List - - - - - d640a3b6 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Derive previously hand-written `Lift` instances (#14030) This is possible now that #22229 is fixed. - - - - - 33fee6a2 by Sebastian Graf at 2024-06-22T10:41:32-04:00 Implement the "Derive Lift instances for data types in template-haskell" proposal (#14030) After #22229 had been fixed, we can finally derive the `Lift` instance for the TH AST, as proposed by Ryan Scott in https://mail.haskell.org/pipermail/libraries/2015-September/026117.html. Fixes #14030, #14296, #21759 and #24560. The residency of T24471 increases by 13% because we now load `AnnLookup` from its interface file, which transitively loads the whole TH AST. Unavoidable and not terrible, I think. Metric Increase: T24471 - - - - - 383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00 bindist: Use complete relative paths when cding to directories If a user has configured CDPATH on their system then `cd lib` may change into an unexpected directory during the installation process. If you write `cd ./lib` then it will not consult `CDPATH` to determine what you mean. I have added a check on ghcup-ci to verify that the bindist installation works in this situation. Fixes #24951 - - - - - 5759133f by Hécate Kleidukos at 2024-06-22T10:42:49-04:00 haddock: Use the more precise SDocContext instead of DynFlags The pervasive usage of DynFlags (the parsed command-line options passed to ghc) blurs the border between different components of Haddock, and especially those that focus solely on printing text on the screen. In order to improve the understanding of the real dependencies of a function, the pretty-printer options are made concrete earlier in the pipeline instead of late when pretty-printing happens. This also has the advantage of clarifying which functions actually require DynFlags for purposes other than pretty-printing, thus making the interactions between Haddock and GHC more understandable when exploring the code base. See Henry, Ericson, Young. "Modularizing GHC". https://hsyl20.fr/home/files/papers/2022-ghc-modularity.pdf. 2022 - - - - - 749e089b by Alexander McKenna at 2024-06-22T10:43:24-04:00 Add INLINE [1] pragma to compareInt / compareWord To allow rules to be written on the concrete implementation of `compare` for `Int` and `Word`, we need to have an `INLINE [1]` pragma on these functions, following the `matching_overloaded_methods_in_rules` note in `GHC.Classes`. CLC proposal https://github.com/haskell/core-libraries-committee/issues/179 Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22643 - - - - - db033639 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ci: Enable strict ghc-toolchain setting for bindists - - - - - 14308a8f by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Improve parse failure error Improves the error message for when `ghc-toolchain` fails to read a valid `Target` value from a file (in doFormat mode). - - - - - 6e7cfff1 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: ghc-toolchain related options in configure - - - - - 958d6931 by Matthew Pickering at 2024-06-24T17:21:15-04:00 ci: Fail when bindist configure fails when installing bindist It is better to fail earlier if the configure step fails rather than carrying on for a more obscure error message. - - - - - f48d157d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 ghc-toolchain: Fix error logging indentation - - - - - f1397104 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 bindist: Correct default.target substitution The substitution on `default.target.in` must be done after `PREP_TARGET_FILE` is called -- that macro is responsible for setting the variables that will be effectively substituted in the target file. Otherwise, the target file is invalid. Fixes #24792 #24574 - - - - - 665e653e by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 configure: Prefer tool name over tool path It is non-obvious whether the toolchain configuration should use full-paths to tools or simply their names. In addressing #24574, we've decided to prefer executable names over paths, ultimately, because the bindist configure script already does this, thus is the default in ghcs out there. Updates the in-tree configure script to prefer tool names (`AC_CHECK_TOOL` rather than `AC_PATH_TOOL`) and `ghc-toolchain` to ignore the full-path-result of `findExecutable`, which it previously used over the program name. This change doesn't undo the fix in bd92182cd56140ffb2f68ec01492e5aa6333a8fc because `AC_CHECK_TOOL` still takes into account the target triples, unlike `AC_CHECK_PROG/AC_PATH_PROG`. - - - - - 463716c2 by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 dist: Don't forget to configure JavascriptCPP We introduced a configuration step for the javascript preprocessor, but only did so for the in-tree configure script. This commit makes it so that we also configure the javascript preprocessor in the configure shipped in the compiler bindist. - - - - - e99cd73d by Rodrigo Mesquita at 2024-06-24T17:21:15-04:00 distrib: LlvmTarget in distrib/configure LlvmTarget was being set and substituted in the in-tree configure, but not in the configure shipped in the bindist. We want to set the LlvmTarget to the canonical LLVM name of the platform that GHC is targetting. Currently, that is going to be the boostrapped llvm target (hence the code which sets LlvmTarget=bootstrap_llvm_target). - - - - - 4199aafe by Matthew Pickering at 2024-06-24T17:21:51-04:00 Update bootstrap plans for recent GHC versions (9.6.5, 9.8.2, 9.10.10) - - - - - f599d816 by Matthew Pickering at 2024-06-24T17:21:51-04:00 ci: Add 9_10 bootstrap testing job - - - - - 8f4b799d by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Move the usage of mkParserOpts directly to ppHyperlinkedModuleSource in order to avoid passing a whole DynFlags Follow up to !12931 - - - - - 210cf1cd by Hécate Kleidukos at 2024-06-24T17:22:30-04:00 haddock: Remove cabal file linting rule This will be reintroduced with a properly ignored commit when the cabal files are themselves formatted for good. - - - - - 7fe85b13 by Peter Trommler at 2024-06-24T22:03:41-04:00 PPC NCG: Fix sign hints in C calls Sign hints for parameters are in the second component of the pair. Fixes #23034 - - - - - 949a0e0b by Andrew Lelechenko at 2024-06-24T22:04:17-04:00 base: fix missing changelog entries - - - - - 1bfa9111 by Andreas Klebinger at 2024-06-26T21:49:53-04:00 GHCi interpreter: Tag constructor closures when possible. When evaluating PUSH_G try to tag the reference we are pushing if it's a constructor. This is potentially helpful for performance and required to fix #24870. - - - - - caf44a2d by Andrew Lelechenko at 2024-06-26T21:50:30-04:00 Implement Data.List.compareLength and Data.List.NonEmpty.compareLength `compareLength xs n` is a safer and faster alternative to `compare (length xs) n`. The latter would force and traverse the entire spine (potentially diverging), while the former traverses as few elements as possible. The implementation is carefully designed to maintain as much laziness as possible. As per https://github.com/haskell/core-libraries-committee/issues/257 - - - - - f4606ae0 by Serge S. Gulin at 2024-06-26T21:51:05-04:00 Unicode: adding compact version of GeneralCategory (resolves #24789) The following features are applied: 1. Lookup code like Cmm-switches (draft implementation proposed by Sylvain Henry @hsyl20) 2. Nested ifs (logarithmic search vs linear search) (the idea proposed by Sylvain Henry @hsyl20) ------------------------- Metric Decrease: size_hello_artifact size_hello_unicode ------------------------- - - - - - 0e424304 by Hécate Kleidukos at 2024-06-26T21:51:44-04:00 haddock: Restructure import statements This commit removes idiosyncrasies that have accumulated with the years in how import statements were laid out, and defines clear but simple guidelines in the CONTRIBUTING.md file. - - - - - 9b8ddaaf by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Rename test for #24725 I must have fumbled my tabs when I copy/pasted the issue number in 8c87d4e1136ae6d28e92b8af31d78ed66224ee16. - - - - - b0944623 by Arnaud Spiwack at 2024-06-26T21:52:23-04:00 Add original reproducer for #24725 - - - - - 77ce65a5 by Matthew Pickering at 2024-06-27T07:57:14-04:00 Expand LLVM version matching regex for compability with bsd systems sed on BSD systems (such as darwin) does not support the + operation. Therefore we take the simple minded approach of manually expanding group+ to groupgroup*. Fixes #24999 - - - - - bdfe4a9e by Matthew Pickering at 2024-06-27T07:57:14-04:00 ci: On darwin configure LLVMAS linker to match LLC and OPT toolchain The version check was previously broken so the toolchain was not detected at all. - - - - - 07e03a69 by Matthew Pickering at 2024-06-27T07:57:15-04:00 Update nixpkgs commit for darwin toolchain One dependency (c-ares) changed where it hosted the releases which breaks the build with the old nixpkgs commit. - - - - - 144afed7 by Rodrigo Mesquita at 2024-06-27T07:57:50-04:00 base: Add changelog entry for #24998 - - - - - eebe1658 by Sylvain Henry at 2024-06-28T07:13:26-04:00 X86/DWARF: support no tables-next-to-code and asm-shortcutting (#22792) - Without TNTC (tables-next-to-code), we must be careful to not duplicate labels in pprNatCmmDecl. Especially, as a CmmProc is identified by the label of its entry block (and not of its info table), we can't reuse the same label to delimit the block end and the proc end. - We generate debug infos from Cmm blocks. However, when asm-shortcutting is enabled, some blocks are dropped at the asm codegen stage and some labels in the DebugBlocks become missing. We fix this by filtering the generated debug-info after the asm codegen to only keep valid infos. Also add some related documentation. - - - - - 6e86d82b by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: handle JMP to ForeignLabels (#23969) - - - - - 9e4b4b0a by Sylvain Henry at 2024-06-28T07:14:06-04:00 PPC NCG: support loading 64-bit value on 32-bit arch (#23969) - - - - - 50caef3e by Sylvain Henry at 2024-06-28T07:14:46-04:00 Fix warnings in genapply - - - - - 37139b17 by Matthew Pickering at 2024-06-28T07:15:21-04:00 libraries: Update os-string to 2.0.4 This updates the os-string submodule to 2.0.4 which removes the usage of `TemplateHaskell` pragma. - - - - - 0f3d3bd6 by Sylvain Henry at 2024-06-30T00:47:40-04:00 Bump array submodule - - - - - 354c350c by Sylvain Henry at 2024-06-30T00:47:40-04:00 GHCi: Don't use deprecated sizeofMutableByteArray# - - - - - 35d65098 by Ben Gamari at 2024-06-30T00:47:40-04:00 primops: Undeprecate addr2Int# and int2Addr# addr2Int# and int2Addr# were marked as deprecated with the introduction of the OCaml code generator (1dfaee318171836b32f6b33a14231c69adfdef2f) due to its use of tagged integers. However, this backend has long vanished and `base` has all along been using `addr2Int#` in the Show instance for Ptr. While it's unlikely that we will have another backend which has tagged integers, we may indeed support platforms which have tagged pointers. Consequently we undeprecate the operations but warn the user that the operations may not be portable. - - - - - 3157d817 by Sylvain Henry at 2024-06-30T00:47:41-04:00 primops: Undeprecate par# par# is still used in base and it's not clear how to replace it with spark# (see #24825) - - - - - c8d5b959 by Ben Gamari at 2024-06-30T00:47:41-04:00 Primops: Make documentation generation more efficient Previously we would do a linear search through all primop names, doing a String comparison on the name of each when preparing the HsDocStringMap. Fix this. - - - - - 65165fe4 by Ben Gamari at 2024-06-30T00:47:41-04:00 primops: Ensure that deprecations are properly tracked We previously failed to insert DEPRECATION pragmas into GHC.Prim's ModIface, meaning that they would appear in the Haddock documentation but not issue warnings. Fix this. See #19629. Haddock also needs to be fixed: https://github.com/haskell/haddock/issues/223 Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - bc1d435e by Mario Blažević at 2024-06-30T00:48:20-04:00 Improved pretty-printing of unboxed TH sums and tuples, fixes #24997 - - - - - 0d170eaf by Zubin Duggal at 2024-07-04T11:08:41-04:00 compiler: Turn `FinderCache` into a record of operations so that GHC API clients can have full control over how its state is managed by overriding `hsc_FC`. Also removes the `uncacheModule` function as this wasn't being used by anything since 1893ba12fe1fa2ade35a62c336594afcd569736e Fixes #23604 - - - - - 4664997d by Teo Camarasu at 2024-07-04T11:09:18-04:00 Add HasCallStack to T23221 This makes the test a bit easier to debug - - - - - 66919dcc by Teo Camarasu at 2024-07-04T11:09:18-04:00 rts: use live words to estimate heap size We use live words rather than live blocks to determine the size of the heap for determining memory retention. Most of the time these two metrics align, but they can come apart in normal usage when using the nonmoving collector. The nonmoving collector leads to a lot of partially occupied blocks. So, using live words is more accurate. They can also come apart when the heap is suffering from high levels fragmentation caused by small pinned objects, but in this case, the block size is the more accurate metric. Since this case is best avoided anyway. It is ok to accept the trade-off that we might try (and probably) fail to return more memory in this case. See also the Note [Statistics for retaining memory] Resolves #23397 - - - - - 8dfca66a by Oleg Grenrus at 2024-07-04T11:09:55-04:00 Add reflections of GHC.TypeLits/Nats type families ------------------------- Metric Increase: ghc_experimental_dir ghc_experimental_so ------------------------- - - - - - 6c469bd2 by Adam Gundry at 2024-07-04T11:10:33-04:00 Correct -Wpartial-fields warning to say "Definition" rather than "Use" Fixes #24710. The message and documentation for `-Wpartial-fields` were misleading as (a) the warning occurs at definition sites rather than use sites, and (b) the warning relates to the definition of a field independently of the selector function (e.g. because record updates are also partial). - - - - - 977b6b64 by Max Ulidtko at 2024-07-04T11:11:11-04:00 GHCi: Support local Prelude Fixes #10920, an issue where GHCi bails out when started alongside a file named Prelude.hs or Prelude.lhs (even empty file suffices). The in-source Note [GHCi and local Preludes] documents core reasoning. Supplementary changes: * add debug traces for module lookups under -ddump-if-trace; * drop stale comment in GHC.Iface.Load; * reduce noise in -v3 traces from GHC.Utils.TmpFs; * new test, which also exercizes HomeModError. - - - - - 87cf4111 by Ryan Scott at 2024-07-04T11:11:47-04:00 Add missing gParPat in cvtp's ViewP case When converting a `ViewP` using `cvtp`, we need to ensure that the view pattern is parenthesized so that the resulting code will parse correctly when roundtripped back through GHC's parser. Fixes #24894. - - - - - b05613c5 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation for module cycle errors (see #18516) This removes the re-export of cyclicModuleErr from the top-level GHC module. - - - - - 70389749 by Adam Gundry at 2024-07-04T11:12:23-04:00 Use structured error representation when reloading a nonexistent module - - - - - 680ade3d by sheaf at 2024-07-04T11:12:23-04:00 Use structured errors for a Backpack instantiation error - - - - - 97c6d6de by sheaf at 2024-07-04T11:12:23-04:00 Move mkFileSrcSpan to GHC.Unit.Module.Location - - - - - f9e7bd9b by Adriaan Leijnse at 2024-07-04T11:12:59-04:00 ttg: Remove SourceText from OverloadedLabel Progress towards #21592 - - - - - 00d63245 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: GHC.Prelude -> Prelude Refactor occurrences to GHC.Prelude with Prelude within Language/Haskell. Progress towards #21592 - - - - - cc846ea5 by Alexander Foremny at 2024-07-04T11:12:59-04:00 AST: remove occurrences of GHC.Unit.Module.ModuleName `GHC.Unit.Module` re-exports `ModuleName` from `Language.Haskell.Syntax.Module.Name`. Progress towards #21592 - - - - - 24c7d287 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move Data instance definition for ModuleName to GHC.Unit.Types To remove the dependency on GHC.Utils.Misc inside Language.Haskell.Syntax.Module.Name, the instance definition is moved from there into GHC.Unit.Types. Progress towards #21592 - - - - - 6cbba381 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move negateOverLitVal into GHC.Hs.Lit The function negateOverLitVal is not used within Language.Haskell and therefore can be moved to the respective module inside GHC.Hs. Progress towards #21592 - - - - - 611aa7c6 by Fabian Kirchner at 2024-07-04T11:12:59-04:00 AST: move conDetailsArity into GHC.Rename.Module The function conDetailsArity is only used inside GHC.Rename.Module. We therefore move it there from Language.Haskell.Syntax.Lit. Progress towards #21592 - - - - - 1b968d16 by Mauricio at 2024-07-04T11:12:59-04:00 AST: Remove GHC.Utils.Assert from GHC Simple cleanup. Progress towards #21592 - - - - - 3d192e5d by Fabian Kirchner at 2024-07-04T11:12:59-04:00 ttg: extract Specificity, ForAllTyFlag and helper functions from GHC.Types.Var Progress towards #21592 Specificity, ForAllTyFlag and its' helper functions are extracted from GHC.Types.Var and moved into a new module Language.Haskell.Syntax.Specificity. Note: Eventually (i.e. after Language.Haskell.Syntax.Decls does not depend on GHC.* anymore) these should be moved into Language.Haskell.Syntax.Decls. At this point, this would cause cyclic dependencies. - - - - - 257d1adc by Adowrath at 2024-07-04T11:12:59-04:00 ttg: Split HsSrcBang, remove ref to DataCon from Syntax.Type Progress towards #21592 This splits HsSrcBang up, creating the new HsBang within `Language.Haskell.Syntax.Basic`. `HsBang` holds the unpackedness and strictness information, while `HsSrcBang` only adds the SourceText for usage within the compiler directly. Inside the AST, to preserve the SourceText, it is hidden behind the pre-existing extension point `XBindTy`. All other occurrences of `HsSrcBang` were adapted to deconstruct the inner `HsBang`, and when interacting with the `BindTy` constructor, the hidden `SourceText` is extracted/inserted into the `XBindTy` extension point. `GHC.Core.DataCon` exports both `HsSrcBang` and `HsBang` for convenience. A constructor function `mkHsSrcBang` that takes all individual components has been added. Two exceptions has been made though: - The `Outputable HsSrcBang` instance is replaced by `Outputable HsBang`. While being only GHC-internal, the only place it's used is in outputting `HsBangTy` constructors -- which already have `HsBang`. It wouldn't make sense to reconstruct a `HsSrcBang` just to ignore the `SourceText` anyway. - The error `TcRnUnexpectedAnnotation` did not use the `SourceText`, so it too now only holds a `HsBang`. - - - - - 24757fec by Mauricio at 2024-07-04T11:12:59-04:00 AST: Moved definitions that use GHC.Utils.Panic to GHC namespace Progress towards #21592 - - - - - 9be49379 by Mike Pilgrem at 2024-07-04T11:13:41-04:00 Fix #25032 Refer to Cabal's `includes` field, not `include-files` - - - - - 9e2ecf14 by Andrew Lelechenko at 2024-07-04T11:14:17-04:00 base: fix more missing changelog entries - - - - - a82121b3 by Peter Trommler at 2024-07-04T11:14:53-04:00 X86 NCG: Fix argument promotion in foreign C calls Promote 8 bit and 16 bit signed arguments by sign extension. Fixes #25018 - - - - - fab13100 by Bryan Richter at 2024-07-04T11:15:29-04:00 Add .gitlab/README.md with creds instructions - - - - - 564981bd by Matthew Pickering at 2024-07-05T07:35:29-04:00 configure: Set LD_STAGE0 appropiately when 9.10.1 is used as a boot compiler In 9.10.1 the "ld command" has been removed, so we fall back to using the more precise "merge objects command" when it's available as LD_STAGE0 is only used to set the object merging command in hadrian. Fixes #24949 - - - - - a949c792 by Matthew Pickering at 2024-07-05T07:35:29-04:00 hadrian: Don't build ghci object files for ./hadrian/ghci target There is some convoluted logic which determines whether we build ghci object files are not. In any case, if you set `ghcDynPrograms = pure False` then it forces them to be built. Given we aren't ever building executables with this flavour it's fine to leave `ghcDynPrograms` as the default and it should be a bit faster to build less. Also fixes #24949 - - - - - 48bd8f8e by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Remove STG dump from ticky_ghc flavour transformer This adds 10-15 minutes to build time, it is a better strategy to precisely enable dumps for the modules which show up prominently in a ticky profile. Given I am one of the only people regularly building ticky compilers I think it's worthwhile to remove these. Fixes #23635 - - - - - 5b1aefb7 by Matthew Pickering at 2024-07-05T07:36:06-04:00 hadrian: Add dump_stg flavour transformer This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you really want STG for all modules. - - - - - ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - c5afeae8 by Ben Gamari at 2024-07-30T17:02:11+01:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.12. - - - - - 20 changed files: - .ghcid - + .git-blame-ignore-revs - .gitignore - .gitlab-ci.yml - + .gitlab/README.md - .gitlab/ci.sh - .gitlab/darwin/nix/sources.json - .gitlab/darwin/toolchain.nix - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + .gitlab/merge_request_templates/Haddock.md - .gitlab/rel_eng/default.nix - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/README.mkd - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + .gitlab/rel_eng/recompress-all - .gitlab/rel_eng/upload.sh - .gitlab/rel_eng/upload_ghc_libs.py - .gitmodules - CODEOWNERS The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/34a1b75e1540620b8e1b71c2c300a2b98f1da7cc...c5afeae89df0d22d24e7f24dcd3445d972036ea4 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/34a1b75e1540620b8e1b71c2c300a2b98f1da7cc...c5afeae89df0d22d24e7f24dcd3445d972036ea4 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 16:04:13 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 12:04:13 -0400 Subject: [Git][ghc/ghc][wip/clc216] base: Deprecate GHC.Desugar Message-ID: <66a90efd4929c_246ab1988bf4673cf@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 93e96f5a by Ben Gamari at 2024-07-30T17:04:03+01:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.12. - - - - - 3 changed files: - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Desugar.hs Changes: ===================================== libraries/base/base.cabal ===================================== @@ -55,6 +55,7 @@ Library , Data.Ratio , Data.STRef.Lazy , Data.Semigroup + , GHC.Desugar , Prelude , Text.Printf , System.CPUTime @@ -156,7 +157,6 @@ Library , GHC.Conc.Sync , GHC.ConsoleHandler , GHC.Constants - , GHC.Desugar , GHC.Encoding.UTF8 , GHC.Enum , GHC.Environment ===================================== libraries/base/changelog.md ===================================== @@ -1,6 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) ## 4.21.0.0 *TBA* + * `GHC.Desugar` has been deprecated and should be removed in GHC 9.12. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) @@ -51,6 +52,7 @@ * Implement `many` and `some` methods of `instance Alternative (Compose f g)` explicitly. ([CLC proposal #181](https://github.com/haskell/core-libraries-committee/issues/181)) * Change the types of the `GHC.Stack.StackEntry.closureType` and `GHC.InfoProv.InfoProv.ipDesc` record fields to use `GHC.Exts.Heap.ClosureType` rather than an `Int`. To recover the old value use `fromEnum`. ([CLC proposal #210](https://github.com/haskell/core-libraries-committee/issues/210)) + * The functions `GHC.Exts.dataToTag#` and `GHC.Base.getTag` have had their types changed to the following: ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -1,6 +1,8 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} +----------------------------------------------------------------------------- -- | -- -- Module : GHC.Desugar @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs at haskell.org --- Stability : internal +-- Stability : deprecated () -- Portability : non-portable (GHC extensions) -- -- Support code for desugaring in GHC @@ -18,11 +20,14 @@ -- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can -- change rapidly without much warning. -- +----------------------------------------------------------------------------- + +#if __GLASGOW_HASKELL >= 912 +#error "GHC.Desugar should be removed in GHC 9.12" +#endif module GHC.Desugar - ((>>>), - AnnotationWrapper(..), - toAnnotationWrapper - ) where + {-# DEPRECATED ["GHC.Desugar is deprecated and should be removed in GHC 9.12.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} + ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import GHC.Internal.Desugar View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93e96f5a2d76db29a89374734823b8ba05e58879 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93e96f5a2d76db29a89374734823b8ba05e58879 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 16:04:50 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Tue, 30 Jul 2024 12:04:50 -0400 Subject: [Git][ghc/ghc][wip/clc216] base: Deprecate GHC.Desugar Message-ID: <66a90f22a6042_246ab1ba114871495@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 3d3e56c0 by Ben Gamari at 2024-07-30T17:04:42+01:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.12. - - - - - 3 changed files: - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Desugar.hs Changes: ===================================== libraries/base/base.cabal ===================================== @@ -55,6 +55,7 @@ Library , Data.Ratio , Data.STRef.Lazy , Data.Semigroup + , GHC.Desugar , Prelude , Text.Printf , System.CPUTime @@ -156,7 +157,6 @@ Library , GHC.Conc.Sync , GHC.ConsoleHandler , GHC.Constants - , GHC.Desugar , GHC.Encoding.UTF8 , GHC.Enum , GHC.Environment ===================================== libraries/base/changelog.md ===================================== @@ -1,6 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) ## 4.21.0.0 *TBA* + * `GHC.Desugar` has been deprecated and should be removed in GHC 9.12. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -1,6 +1,8 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} +----------------------------------------------------------------------------- -- | -- -- Module : GHC.Desugar @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs at haskell.org --- Stability : internal +-- Stability : deprecated () -- Portability : non-portable (GHC extensions) -- -- Support code for desugaring in GHC @@ -18,11 +20,14 @@ -- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can -- change rapidly without much warning. -- +----------------------------------------------------------------------------- + +#if __GLASGOW_HASKELL >= 912 +#error "GHC.Desugar should be removed in GHC 9.12" +#endif module GHC.Desugar - ((>>>), - AnnotationWrapper(..), - toAnnotationWrapper - ) where + {-# DEPRECATED ["GHC.Desugar is deprecated and should be removed in GHC 9.12.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} + ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import GHC.Internal.Desugar View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3d3e56c0e4f44e1e6a427aaf8911087146d33a94 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3d3e56c0e4f44e1e6a427aaf8911087146d33a94 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 16:44:28 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 30 Jul 2024 12:44:28 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: TTG HsCmdArrForm: use Fixity via extension point Message-ID: <66a9186cb0fc5_246ab111b83c410543e@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 14ccb98d by Rodrigo Mesquita at 2024-07-30T12:44:09-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - 2404743c by Matthew Pickering at 2024-07-30T12:44:10-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - 30 changed files: - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Driver/Make.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/Types/Fixity.hs - compiler/GHC/Types/Fixity/Env.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/ghc.cabal.in - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs - testsuite/tests/driver/multipleHomeUnits/all.T - + testsuite/tests/driver/multipleHomeUnits/unitSame1 - + testsuite/tests/driver/multipleHomeUnits/unitSame2 - utils/check-exact/ExactPrint.hs Changes: ===================================== .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py ===================================== @@ -234,7 +234,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): , "Linux_UnknownLinux" : { "unknown_versioning": rocky8 } , "Darwin" : { "unknown_versioning" : darwin_x86 } , "Windows" : { "unknown_versioning" : windows } - , "Linux_Alpine" : { "( >= 3.12 && < 3.18 )": alpine3_12 + , "Linux_Alpine" : { "( >= 3.12 && < 3.20 )": alpine3_12 , ">= 3.20": alpine3_20 , "unknown_versioning": alpine3_12 } @@ -242,7 +242,7 @@ def mk_new_yaml(release_mode, version, date, pipeline_type, job_map): a32 = { "Linux_Debian": { "( >= 10 && < 12 )": deb10_i386 , ">= 12": deb12_i386 - , "unknown versioning": deb10_i386 } + , "unknown_versioning": deb10_i386 } , "Linux_Ubuntu": { "unknown_versioning": deb10_i386 } , "Linux_Mint" : { "unknown_versioning": deb10_i386 } , "Linux_UnknownLinux" : { "unknown_versioning": deb10_i386 } ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -329,10 +329,12 @@ warnMissingHomeModules dflags targets mod_graph = -- Note also that we can't always infer the associated module name -- directly from the filename argument. See #13727. is_known_module mod = - (Map.lookup (moduleName (ms_mod mod)) mod_targets == Just (ms_unitid mod)) + is_module_target mod || maybe False is_file_target (ml_hs_file (ms_location mod)) + is_module_target mod = (moduleName (ms_mod mod), ms_unitid mod) `Set.member` mod_targets + is_file_target file = Set.member (withoutExt file) file_targets file_targets = Set.fromList (mapMaybe file_target targets) @@ -343,7 +345,7 @@ warnMissingHomeModules dflags targets mod_graph = TargetFile file _ -> Just (withoutExt (augmentByWorkingDirectory dflags file)) - mod_targets = Map.fromList (mod_target <$> targets) + mod_targets = Set.fromList (mod_target <$> targets) mod_target Target {targetUnitId, targetId} = case targetId of ===================================== compiler/GHC/Hs/Basic.hs ===================================== @@ -0,0 +1,56 @@ +{-# OPTIONS_GHC -Wno-orphans #-} -- Outputable, Binary +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DeriveDataTypeable #-} + +-- | Fixity +module GHC.Hs.Basic + ( module Language.Haskell.Syntax.Basic + ) where + +import GHC.Prelude + +import GHC.Utils.Outputable +import GHC.Utils.Binary + +import Data.Data () + +import Language.Haskell.Syntax.Basic + +instance Outputable LexicalFixity where + ppr Prefix = text "Prefix" + ppr Infix = text "Infix" + +instance Outputable FixityDirection where + ppr InfixL = text "infixl" + ppr InfixR = text "infixr" + ppr InfixN = text "infix" + +instance Outputable Fixity where + ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] + + +instance Binary Fixity where + put_ bh (Fixity aa ab) = do + put_ bh aa + put_ bh ab + get bh = do + aa <- get bh + ab <- get bh + return (Fixity aa ab) + +------------------------ + +instance Binary FixityDirection where + put_ bh InfixL = + putByte bh 0 + put_ bh InfixR = + putByte bh 1 + put_ bh InfixN = + putByte bh 2 + get bh = do + h <- getByte bh + case h of + 0 -> return InfixL + 1 -> return InfixR + _ -> return InfixN ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -32,6 +32,7 @@ import Language.Haskell.Syntax.Expr -- friends: import GHC.Prelude +import GHC.Hs.Basic() -- import instances import GHC.Hs.Decls() -- import instances import GHC.Hs.Pat import GHC.Hs.Lit @@ -1250,8 +1251,10 @@ type instance XCmdArrApp GhcRn = NoExtField type instance XCmdArrApp GhcTc = Type type instance XCmdArrForm GhcPs = AnnList -type instance XCmdArrForm GhcRn = NoExtField -type instance XCmdArrForm GhcTc = NoExtField +-- | fixity (filled in by the renamer), for forms that were converted from +-- OpApp's by the renamer +type instance XCmdArrForm GhcRn = Maybe Fixity +type instance XCmdArrForm GhcTc = Maybe Fixity type instance XCmdApp (GhcPass _) = NoExtField type instance XCmdLam (GhcPass _) = NoExtField @@ -1412,7 +1415,7 @@ ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp True) ppr_cmd (HsCmdArrApp _ arrow arg HsHigherOrderApp False) = hsep [ppr_lexpr arg, arrowtt, ppr_lexpr arrow] -ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) +ppr_cmd (HsCmdArrForm rn_fix (L _ op) ps_fix args) | HsVar _ (L _ v) <- op = ppr_cmd_infix v | GhcTc <- ghcPass @p @@ -1427,7 +1430,10 @@ ppr_cmd (HsCmdArrForm _ (L _ op) ps_fix rn_fix args) ppr_cmd_infix :: OutputableBndr v => v -> SDoc ppr_cmd_infix v | [arg1, arg2] <- args - , isJust rn_fix || ps_fix == Infix + , case ghcPass @p of + GhcPs -> ps_fix == Infix + GhcRn -> isJust rn_fix || ps_fix == Infix + GhcTc -> isJust rn_fix || ps_fix == Infix = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc v, pprCmdArg (unLoc arg2)]) | otherwise ===================================== compiler/GHC/Hs/Instances.hs ===================================== @@ -570,6 +570,9 @@ deriving instance Eq (IE GhcTc) deriving instance Data HsThingRn deriving instance Data XXExprGhcRn + +-- --------------------------------------------------------------------- + deriving instance Data XXExprGhcTc deriving instance Data XXPatGhcTc ===================================== compiler/GHC/HsToCore/Arrows.hs ===================================== @@ -634,7 +634,7 @@ dsCmd ids local_vars stack_ty res_ty (HsCmdDo _ (L _ stmts)) env_ids = do -- ----------------------------------- -- D; xs |-a (|e c1 ... cn|) :: stk --> t ---> e [t_xs] c1 ... cn -dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ _ args) env_ids = do +dsCmd _ local_vars _stack_ty _res_ty (HsCmdArrForm _ op _ args) env_ids = do let env_ty = mkBigCoreVarTupTy env_ids core_op <- dsLExpr op (core_args, fv_sets) <- mapAndUnzipM (dsTrimCmdArg local_vars env_ids) args ===================================== compiler/GHC/HsToCore/Ticks.hs ===================================== @@ -882,11 +882,10 @@ addTickHsCmd (HsCmdArrApp arr_ty e1 e2 ty1 lr) = (addTickLHsExpr e2) (return ty1) (return lr) -addTickHsCmd (HsCmdArrForm x e f fix cmdtop) = - liftM4 (HsCmdArrForm x) +addTickHsCmd (HsCmdArrForm x e f cmdtop) = + liftM3 (HsCmdArrForm x) (addTickLHsExpr e) (return f) - (return fix) (mapM (traverse (addTickHsCmdTop)) cmdtop) addTickHsCmd (XCmd (HsWrap w cmd)) = ===================================== compiler/GHC/Iface/Ext/Ast.hs ===================================== @@ -1510,7 +1510,7 @@ instance HiePass p => ToHie (LocatedA (HsCmd (GhcPass p))) where [ toHie a , toHie b ] - HsCmdArrForm _ a _ _ cmdtops -> + HsCmdArrForm _ a _ cmdtops -> [ toHie a , toHie cmdtops ] ===================================== compiler/GHC/Parser.y ===================================== @@ -3081,7 +3081,7 @@ aexp2 :: { ECP } | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 -> fmap ecpFromCmd $ amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (Just $ mu AnnOpenB $1) (Just $ mu AnnCloseB $4) [] []) $2 Prefix - Nothing (reverse $3)) } + (reverse $3)) } projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) } projection ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -1765,7 +1765,7 @@ instance DisambECP (HsCmd GhcPs) where mkHsOpAppPV l c1 op c2 = do let cmdArg c = L (l2l $ getLoc c) $ HsCmdTop noExtField c !cs <- getCommentsFor l - return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix Nothing [cmdArg c1, cmdArg c2] + return $ L (EpAnn (spanAsAnchor l) noAnn cs) $ HsCmdArrForm (AnnList Nothing Nothing Nothing [] []) (reLoc op) Infix [cmdArg c1, cmdArg c2] mkHsCasePV l c (L lm m) anns = do !cs <- getCommentsFor l ===================================== compiler/GHC/Rename/Expr.hs ===================================== @@ -905,21 +905,10 @@ rnCmd (HsCmdArrApp _ arrow arg ho rtl) -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. --- infix form -rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) - = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) - ; let L _ (HsVar _ (L _ op_name)) = op' - ; (arg1',fv_arg1) <- rnCmdTop arg1 - ; (arg2',fv_arg2) <- rnCmdTop arg2 - -- Deal with fixity - ; fixity <- lookupFixityRn op_name - ; final_e <- mkOpFormRn arg1' op' fixity arg2' - ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } - -rnCmd (HsCmdArrForm _ op f fixity cmds) +rnCmd (HsCmdArrForm _ op f cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds - ; return ( HsCmdArrForm noExtField op' f fixity cmds' + ; return ( HsCmdArrForm Nothing op' f cmds' , fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) ===================================== compiler/GHC/Rename/HsType.hs ===================================== @@ -25,7 +25,7 @@ module GHC.Rename.HsType ( -- Precence related stuff NegationHandling(..), - mkOpAppRn, mkNegAppRn, mkOpFormRn, mkConOpPatRn, + mkOpAppRn, mkNegAppRn, mkConOpPatRn, checkPrecMatch, checkSectionPrec, -- Binding related stuff @@ -1455,35 +1455,6 @@ not_op_app :: HsExpr id -> Bool not_op_app (OpApp {}) = False not_op_app _ = True ---------------------------- -mkOpFormRn :: LHsCmdTop GhcRn -- Left operand; already rearranged - -> LHsExpr GhcRn -> Fixity -- Operator and fixity - -> LHsCmdTop GhcRn -- Right operand (not an infix) - -> RnM (HsCmd GhcRn) - --- (e1a `op1` e1b) `op2` e2 -mkOpFormRn e1@(L loc - (HsCmdTop _ - (L _ (HsCmdArrForm x op1 f (Just fix1) - [e1a,e1b])))) - op2 fix2 e2 - | nofix_error - = do precParseErr (get_op op1,fix1) (get_op op2,fix2) - return (HsCmdArrForm x op2 f (Just fix2) [e1, e2]) - - | associate_right - = do new_c <- mkOpFormRn e1a op2 fix2 e2 - return (HsCmdArrForm noExtField op1 f (Just fix1) - [e1b, L loc (HsCmdTop [] (L (l2l loc) new_c))]) - -- TODO: locs are wrong - where - (nofix_error, associate_right) = compareFixity fix1 fix2 - --- Default case -mkOpFormRn arg1 op fix arg2 -- Default case, no rearrangement - = return (HsCmdArrForm noExtField op Infix (Just fix) [arg1, arg2]) - - -------------------------------------- mkConOpPatRn :: LocatedN Name -> Fixity -> LPat GhcRn -> LPat GhcRn -> RnM (Pat GhcRn) ===================================== compiler/GHC/Tc/Gen/Arrow.hs ===================================== @@ -290,7 +290,7 @@ tc_cmd env (HsCmdDo _ (L l stmts) ) (cmd_stk, res_ty) -- ---------------------------------------------- -- D; G |-a (| e c1 ... cn |) : stk --> t -tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) +tc_cmd env cmd@(HsCmdArrForm fixity expr f cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) do { (cmd_args', cmd_tys) <- mapAndUnzipM tc_cmd_arg cmd_args -- We use alphaTyVar for 'w' @@ -298,7 +298,7 @@ tc_cmd env cmd@(HsCmdArrForm x expr f fixity cmd_args) (cmd_stk, res_ty) mkVisFunTysMany cmd_tys $ mkCmdArrTy env (mkPairTy alphaTy cmd_stk) res_ty ; expr' <- tcCheckPolyExpr expr e_ty - ; return (HsCmdArrForm x expr' f fixity cmd_args') } + ; return (HsCmdArrForm fixity expr' f cmd_args') } where tc_cmd_arg :: LHsCmdTop GhcRn -> TcM (LHsCmdTop GhcTc, TcType) ===================================== compiler/GHC/Tc/Zonk/Type.hs ===================================== @@ -1152,10 +1152,10 @@ zonkCmd (HsCmdArrApp ty e1 e2 ho rl) new_ty <- zonkTcTypeToTypeX ty return (HsCmdArrApp new_ty new_e1 new_e2 ho rl) -zonkCmd (HsCmdArrForm x op f fixity args) +zonkCmd (HsCmdArrForm x op fixity args) = do new_op <- zonkLExpr op new_args <- mapM zonkCmdTop args - return (HsCmdArrForm x new_op f fixity new_args) + return (HsCmdArrForm x new_op fixity new_args) zonkCmd (HsCmdApp x c e) = do new_c <- zonkLCmd c ===================================== compiler/GHC/Types/Fixity.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# OPTIONS_GHC -Wno-dodgy-exports #-} -- For re-export of GHC.Hs.Basic instances -- | Fixity module GHC.Types.Fixity @@ -11,61 +12,17 @@ module GHC.Types.Fixity , negateFixity , funTyFixity , compareFixity + , module GHC.Hs.Basic ) where import GHC.Prelude -import GHC.Utils.Outputable -import GHC.Utils.Binary - -import Data.Data hiding (Fixity, Prefix, Infix) - -data Fixity = Fixity Int FixityDirection - deriving Data - -instance Outputable Fixity where - ppr (Fixity prec dir) = hcat [ppr dir, space, int prec] - -instance Eq Fixity where -- Used to determine if two fixities conflict - (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2 - -instance Binary Fixity where - put_ bh (Fixity aa ab) = do - put_ bh aa - put_ bh ab - get bh = do - aa <- get bh - ab <- get bh - return (Fixity aa ab) +import Language.Haskell.Syntax.Basic (LexicalFixity(..), FixityDirection(..), Fixity(..) ) +import GHC.Hs.Basic () -- For instances only ------------------------ -data FixityDirection - = InfixL - | InfixR - | InfixN - deriving (Eq, Data) -instance Outputable FixityDirection where - ppr InfixL = text "infixl" - ppr InfixR = text "infixr" - ppr InfixN = text "infix" - -instance Binary FixityDirection where - put_ bh InfixL = - putByte bh 0 - put_ bh InfixR = - putByte bh 1 - put_ bh InfixN = - putByte bh 2 - get bh = do - h <- getByte bh - case h of - 0 -> return InfixL - 1 -> return InfixR - _ -> return InfixN - ------------------------- maxPrecedence, minPrecedence :: Int maxPrecedence = 9 minPrecedence = 0 @@ -103,12 +60,3 @@ compareFixity (Fixity prec1 dir1) (Fixity prec2 dir2) right = (False, True) left = (False, False) error_please = (True, False) - --- |Captures the fixity of declarations as they are parsed. This is not --- necessarily the same as the fixity declaration, as the normal fixity may be --- overridden using parens or backticks. -data LexicalFixity = Prefix | Infix deriving (Data,Eq) - -instance Outputable LexicalFixity where - ppr Prefix = text "Prefix" - ppr Infix = text "Infix" ===================================== compiler/GHC/Types/Fixity/Env.hs ===================================== @@ -43,4 +43,3 @@ mkIfaceFixCache pairs emptyIfaceFixCache :: OccName -> Maybe Fixity emptyIfaceFixCache _ = Nothing - ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) ===================================== compiler/Language/Haskell/Syntax/Basic.hs ===================================== @@ -114,3 +114,25 @@ data SrcUnpackedness = SrcUnpack -- ^ {-# UNPACK #-} specified | SrcNoUnpack -- ^ {-# NOUNPACK #-} specified | NoSrcUnpack -- ^ no unpack pragma deriving (Eq, Data) + +{- +************************************************************************ +* * +Fixity +* * +************************************************************************ +-} + +-- | Captures the fixity of declarations as they are parsed. This is not +-- necessarily the same as the fixity declaration, as the normal fixity may be +-- overridden using parens or backticks. +data LexicalFixity = Prefix | Infix deriving (Eq, Data) + +data FixityDirection + = InfixL + | InfixR + | InfixN + deriving (Eq, Data) + +data Fixity = Fixity Int FixityDirection + deriving (Eq, Data) ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -31,7 +31,6 @@ import Language.Haskell.Syntax.Type import Language.Haskell.Syntax.Binds -- others: -import GHC.Types.Fixity (LexicalFixity(Infix), Fixity) import GHC.Types.SourceText (StringLiteral) import GHC.Data.FastString (FastString) @@ -831,8 +830,6 @@ data HsCmd id -- applied to the type of the local environment tuple LexicalFixity -- Whether the operator appeared prefix or infix when -- parsed. - (Maybe Fixity) -- fixity (filled in by the renamer), for forms that - -- were converted from OpApp's by the renamer [LHsCmdTop id] -- argument commands | HsCmdApp (XCmdApp id) ===================================== compiler/ghc.cabal.in ===================================== @@ -523,6 +523,7 @@ Library GHC.Driver.Ppr GHC.Driver.Session GHC.Hs + GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -91,6 +91,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc @@ -217,6 +218,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -94,6 +94,7 @@ GHC.Driver.Phases GHC.Driver.Pipeline.Monad GHC.Driver.Plugins.External GHC.Hs +GHC.Hs.Basic GHC.Hs.Binds GHC.Hs.Decls GHC.Hs.Doc @@ -239,6 +240,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs ===================================== @@ -0,0 +1 @@ +module T25122 where ===================================== testsuite/tests/driver/multipleHomeUnits/all.T ===================================== @@ -71,6 +71,11 @@ test('multipleHomeUnits_shared', [extra_files([ 'A.hs', 'unitShared1', 'unitShar test('multipleHomeUnits_shared_ghci', [extra_files([ 'shared.script', 'A.hs', 'unitShared1', 'unitShared2']), extra_run_opts('-unit @unitShared1 -unit @unitShared2')], ghci_script, ['shared.script']) +test('T25122', + [ extra_files( + [ 'T25122', 'unitSame1', 'unitSame2']) + ], multiunit_compile, [['unitSame1', 'unitSame2'], '-v0 -fhide-source-paths -Werror -Wmissing-home-modules']) + ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame1 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=s1 ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame2 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=u2 ===================================== utils/check-exact/ExactPrint.hs ===================================== @@ -3470,7 +3470,7 @@ instance ExactPrint (HsCmd GhcPs) where arr' <- markAnnotated arr return (HsCmdArrApp an0 arr' arg' o isRightToLeft) - exact (HsCmdArrForm an e fixity mf cs) = do + exact (HsCmdArrForm an e fixity cs) = do an0 <- markLensMAA' an lal_open (e',cs') <- case (fixity, cs) of (Infix, (arg1:argrest)) -> do @@ -3484,7 +3484,7 @@ instance ExactPrint (HsCmd GhcPs) where return (e', cs') (Infix, []) -> error "Not possible" an1 <- markLensMAA' an0 lal_close - return (HsCmdArrForm an1 e' fixity mf cs') + return (HsCmdArrForm an1 e' fixity cs') exact (HsCmdApp an e1 e2) = do e1' <- markAnnotated e1 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3bfef4909ba1af142ad41d4533595d0f4e9466ff...2404743c2e6ecd00165cb22a09aa619cd3ea0c6f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3bfef4909ba1af142ad41d4533595d0f4e9466ff...2404743c2e6ecd00165cb22a09aa619cd3ea0c6f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 17:43:10 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 13:43:10 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a9262e38d67_2627bb4f8288608ae@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: b6f26d58 by sheaf at 2024-07-30T19:42:47+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 28 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -535,13 +535,20 @@ pprMachOpApp' platform mop args -- ternary args@[_,_,_] -> - pprMachOp_for_C platform mop <> parens (pprWithCommas pprArg args) + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprWithCommas pprArg args) -- dyadic - [x,y] -> pprArg x <+> pprMachOp_for_C platform mop <+> pprArg y + args@[x,y] -> + let (fixity, op) = pprMachOp_for_C platform mop + in case fixity of + Infix -> pprArg x <+> op <+> pprArg y + Prefix -> op <> parens (pprWithCommas pprArg args) -- unary - [x] -> pprMachOp_for_C platform mop <> parens (pprArg x) + [x] -> + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprArg x) _ -> panic "PprC.pprMachOp : machop with wrong number of args" @@ -701,36 +708,41 @@ pprBlockId b = char '_' <> ppr (getUnique b) -- Print a MachOp in a way suitable for emitting via C. -- -pprMachOp_for_C :: Platform -> MachOp -> SDoc +data Fixity = Prefix | Infix + deriving ( Eq, Show ) + +pprMachOp_for_C :: Platform -> MachOp -> (Fixity, SDoc) pprMachOp_for_C platform mop = case mop of -- Integer operations - MO_Add _ -> char '+' - MO_Sub _ -> char '-' - MO_Eq _ -> text "==" - MO_Ne _ -> text "!=" - MO_Mul _ -> char '*' + MO_Add _ -> (Infix, char '+') + MO_Sub _ -> (Infix, char '-') + MO_Eq _ -> (Infix, text "==") + MO_Ne _ -> (Infix, text "!=") + MO_Mul _ -> (Infix, char '*') - MO_S_Quot _ -> char '/' - MO_S_Rem _ -> char '%' - MO_S_Neg _ -> char '-' + MO_S_Quot _ -> (Infix, char '/') + MO_S_Rem _ -> (Infix, char '%') + MO_S_Neg _ -> (Infix, char '-') - MO_U_Quot _ -> char '/' - MO_U_Rem _ -> char '%' + MO_U_Quot _ -> (Infix, char '/') + MO_U_Rem _ -> (Infix, char '%') -- Floating-point operations - MO_F_Add _ -> char '+' - MO_F_Sub _ -> char '-' - MO_F_Neg _ -> char '-' - MO_F_Mul _ -> char '*' - MO_F_Quot _ -> char '/' + MO_F_Add _ -> (Infix, char '+') + MO_F_Sub _ -> (Infix, char '-') + MO_F_Neg _ -> (Infix, char '-') + MO_F_Mul _ -> (Infix, char '*') + MO_F_Quot _ -> (Infix, char '/') + MO_F_Min _ -> (Prefix, text "fmin") + MO_F_Max _ -> (Prefix, text "fmax") -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> case w of - W32 -> text "fmaf" - W64 -> text "fma" + W32 -> (Prefix, text "fmaf") + W64 -> (Prefix, text "fma") _ -> pprTrace "offending mop:" (text "FMAdd") @@ -747,34 +759,34 @@ pprMachOp_for_C platform mop = case mop of (panic $ "PprC.pprMachOp_for_C: unsupported vector operation") -- Signed comparisons - MO_S_Ge _ -> text ">=" - MO_S_Le _ -> text "<=" - MO_S_Gt _ -> char '>' - MO_S_Lt _ -> char '<' + MO_S_Ge _ -> (Infix, text ">=") + MO_S_Le _ -> (Infix, text "<=") + MO_S_Gt _ -> (Infix, char '>') + MO_S_Lt _ -> (Infix, char '<') -- & Unsigned comparisons - MO_U_Ge _ -> text ">=" - MO_U_Le _ -> text "<=" - MO_U_Gt _ -> char '>' - MO_U_Lt _ -> char '<' + MO_U_Ge _ -> (Infix, text ">=") + MO_U_Le _ -> (Infix, text "<=") + MO_U_Gt _ -> (Infix, char '>') + MO_U_Lt _ -> (Infix, char '<') -- & Floating-point comparisons - MO_F_Eq _ -> text "==" - MO_F_Ne _ -> text "!=" - MO_F_Ge _ -> text ">=" - MO_F_Le _ -> text "<=" - MO_F_Gt _ -> char '>' - MO_F_Lt _ -> char '<' + MO_F_Eq _ -> (Infix, text "==") + MO_F_Ne _ -> (Infix, text "!=") + MO_F_Ge _ -> (Infix, text ">=") + MO_F_Le _ -> (Infix, text "<=") + MO_F_Gt _ -> (Infix, char '>') + MO_F_Lt _ -> (Infix, char '<') -- Bitwise operations. Not all of these may be supported at all -- sizes, and only integral MachReps are valid. - MO_And _ -> char '&' - MO_Or _ -> char '|' - MO_Xor _ -> char '^' - MO_Not _ -> char '~' - MO_Shl _ -> text "<<" - MO_U_Shr _ -> text ">>" -- unsigned shift right - MO_S_Shr _ -> text ">>" -- signed shift right + MO_And _ -> (Infix, char '&') + MO_Or _ -> (Infix, char '|') + MO_Xor _ -> (Infix, char '^') + MO_Not _ -> (Infix, char '~') + MO_Shl _ -> (Infix, text "<<") + MO_U_Shr _ -> (Infix, text ">>") -- unsigned shift right + MO_S_Shr _ -> (Infix, text ">>") -- signed shift right -- Conversions. Some of these will be NOPs, but never those that convert -- between ints and floats. @@ -785,11 +797,11 @@ pprMachOp_for_C platform mop = case mop of -- bitcasts, in the C backend these are performed with __builtin_memcpy. -- See rts/include/stg/Prim.h - MO_FW_Bitcast W32 -> text "hs_bitcastfloat2word" - MO_FW_Bitcast W64 -> text "hs_bitcastdouble2word64" + MO_FW_Bitcast W32 -> (Prefix, text "hs_bitcastfloat2word") + MO_FW_Bitcast W64 -> (Prefix, text "hs_bitcastdouble2word64") - MO_WF_Bitcast W32 -> text "hs_bitcastword2float" - MO_WF_Bitcast W64 -> text "hs_bitcastword642double" + MO_WF_Bitcast W32 -> (Prefix, text "hs_bitcastword2float") + MO_WF_Bitcast W64 -> (Prefix, text "hs_bitcastword642double") MO_FW_Bitcast w -> pprTrace "offending mop:" (text "MO_FW_Bitcast") @@ -805,20 +817,20 @@ pprMachOp_for_C platform mop = case mop of -- noop casts - MO_UU_Conv from to | from == to -> empty - MO_UU_Conv _from to -> parens (machRep_U_CType platform to) + MO_UU_Conv from to | from == to -> (Prefix, empty) + MO_UU_Conv _from to -> (Prefix, parens (machRep_U_CType platform to)) - MO_SS_Conv from to | from == to -> empty - MO_SS_Conv _from to -> parens (machRep_S_CType platform to) + MO_SS_Conv from to | from == to -> (Prefix, empty) + MO_SS_Conv _from to -> (Prefix, parens (machRep_S_CType platform to)) - MO_XX_Conv from to | from == to -> empty - MO_XX_Conv _from to -> parens (machRep_U_CType platform to) + MO_XX_Conv from to | from == to -> (Prefix, empty) + MO_XX_Conv _from to -> (Prefix,parens (machRep_U_CType platform to)) - MO_FF_Conv from to | from == to -> empty - MO_FF_Conv _from to -> parens (machRep_F_CType to) + MO_FF_Conv from to | from == to -> (Prefix, empty) + MO_FF_Conv _from to -> (Prefix,parens (machRep_F_CType to)) - MO_SF_Round _from to -> parens (machRep_F_CType to) - MO_FS_Truncate _from to -> parens (machRep_S_CType platform to) + MO_SF_Round _from to -> (Prefix,parens (machRep_F_CType to)) + MO_FS_Truncate _from to -> (Prefix,parens (machRep_S_CType platform to)) MO_RelaxedRead _ -> pprTrace "offending mop:" (text "MO_RelaxedRead") @@ -917,6 +929,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Max n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Max n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are scalar + integer values (e.g. `Word16#`, `Int32#` etc) and both scalar and vector + floating point values (e.g. `Float`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -203,6 +203,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -176,6 +176,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6f26d58f30bd2828fbcbe93251136e36ccc3a6f -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6f26d58f30bd2828fbcbe93251136e36ccc3a6f You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 17:44:38 2024 From: gitlab at gitlab.haskell.org (sheaf (@sheaf)) Date: Tue, 30 Jul 2024 13:44:38 -0400 Subject: [Git][ghc/ghc][wip/ncg-simd] Add min/max primops Message-ID: <66a9268653b4f_2627bb6251106157d@gitlab.mail> sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC Commits: a57beb9d by sheaf at 2024-07-30T19:44:16+02:00 Add min/max primops This commit adds min/max primops, such as minDouble# :: Double# -> Double# -> Double# minFloatX4# :: FloatX4# -> FloatX4# -> FloatX4# minWord16X8# :: Word16X8# -> Word16X8# -> Word16X8# These are supported in: - the X86, AArch64 and PowerPC NCGs, - the LLVM backend, - the WebAssembly and JavaScript backends. Fixes #25120 - - - - - 28 changed files: - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/Cmm/MachOp.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/Wasm/Asm.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/Wasm/Types.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/JS/Make.hs - compiler/GHC/Llvm/Types.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - docs/users_guide/9.12.1-notes.rst - libraries/base/src/GHC/Base.hs - libraries/base/src/GHC/Exts.hs - testsuite/tests/simd/should_run/all.T - testsuite/tests/simd/should_run/simd006.hs - + testsuite/tests/simd/should_run/simd012.hs - + testsuite/tests/simd/should_run/simd012.stdout Changes: ===================================== compiler/GHC/Builtin/primops.txt.pp ===================================== @@ -1093,6 +1093,14 @@ primop DoubleLtOp "<##" Compare Double# -> Double# -> Int# primop DoubleLeOp "<=##" Compare Double# -> Double# -> Int# with fixity = infix 4 +primop DoubleMinOp "minDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + +primop DoubleMaxOp "maxDouble#" GenPrimOp + Double# -> Double# -> Double# + with commutable = True + primop DoubleAddOp "+##" GenPrimOp Double# -> Double# -> Double# with commutable = True @@ -1259,6 +1267,14 @@ primop FloatNeOp "neFloat#" Compare primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Int# primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Int# +primop FloatMinOp "minFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + +primop FloatMaxOp "maxFloat#" GenPrimOp + Float# -> Float# -> Float# + with commutable = True + primop FloatAddOp "plusFloat#" GenPrimOp Float# -> Float# -> Float# with commutable = True @@ -4202,6 +4218,18 @@ primop VecShuffleOp "shuffle#" GenPrimOp into the result vector.} with vector = ALL_VECTOR_TYPES +primop VecMinOp "min#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise minimum of two vectors.} + with + vector = ALL_VECTOR_TYPES + +primop VecMaxOp "max#" GenPrimOp + VECTOR -> VECTOR -> VECTOR + {Component-wise maximum of two vectors.} + with + vector = ALL_VECTOR_TYPES + ------------------------------------------------------------------------ section "Prefetch" ===================================== compiler/GHC/Cmm/MachOp.hs ===================================== @@ -126,6 +126,9 @@ data MachOp | MO_F_Gt Width | MO_F_Lt Width + | MO_F_Min Width + | MO_F_Max Width + -- Bitwise operations. Not all of these may be supported -- at all sizes, and only integral Widths are valid. | MO_And Width @@ -192,6 +195,14 @@ data MachOp | MO_VF_Mul Length Width | MO_VF_Quot Length Width + -- Min/max operations + | MO_VS_Min Length Width + | MO_VS_Max Length Width + | MO_VU_Min Length Width + | MO_VU_Max Length Width + | MO_VF_Min Length Width + | MO_VF_Max Length Width + -- | An atomic read with no memory ordering. Address msut -- be naturally aligned. | MO_RelaxedRead Width @@ -322,6 +333,8 @@ isCommutableMachOp mop = MO_Xor _ -> True MO_F_Add _ -> True MO_F_Mul _ -> True + MO_F_Min {} -> True + MO_F_Max {} -> True _other -> False -- ---------------------------------------------------------------------------- @@ -464,6 +477,8 @@ machOpResultType platform mop tys = MO_F_Mul r -> cmmFloat r MO_F_Quot r -> cmmFloat r MO_F_Neg r -> cmmFloat r + MO_F_Min r -> cmmFloat r + MO_F_Max r -> cmmFloat r MO_FMA _ l r -> if l == 1 then cmmFloat r else cmmVec l (cmmFloat r) @@ -502,9 +517,13 @@ machOpResultType platform mop tys = MO_VS_Quot l w -> cmmVec l (cmmBits w) MO_VS_Rem l w -> cmmVec l (cmmBits w) MO_VS_Neg l w -> cmmVec l (cmmBits w) + MO_VS_Min l w -> cmmVec l (cmmBits w) + MO_VS_Max l w -> cmmVec l (cmmBits w) MO_VU_Quot l w -> cmmVec l (cmmBits w) MO_VU_Rem l w -> cmmVec l (cmmBits w) + MO_VU_Min l w -> cmmVec l (cmmBits w) + MO_VU_Max l w -> cmmVec l (cmmBits w) MO_V_Shuffle l w _ -> cmmVec l (cmmBits w) MO_VF_Shuffle l w _ -> cmmVec l (cmmFloat w) @@ -518,6 +537,8 @@ machOpResultType platform mop tys = MO_VF_Mul l w -> cmmVec l (cmmFloat w) MO_VF_Quot l w -> cmmVec l (cmmFloat w) MO_VF_Neg l w -> cmmVec l (cmmFloat w) + MO_VF_Min l w -> cmmVec l (cmmFloat w) + MO_VF_Max l w -> cmmVec l (cmmFloat w) MO_RelaxedRead r -> cmmBits r MO_AlignmentCheck _ _ -> ty1 @@ -566,6 +587,8 @@ machOpArgReps platform op = MO_F_Mul r -> [r,r] MO_F_Quot r -> [r,r] MO_F_Neg r -> [r] + MO_F_Min r -> [r,r] + MO_F_Max r -> [r,r] MO_FMA _ l r -> [vecwidth l r, vecwidth l r, vecwidth l r] @@ -611,9 +634,13 @@ machOpArgReps platform op = MO_VS_Quot l w -> [vecwidth l w, vecwidth l w] MO_VS_Rem l w -> [vecwidth l w, vecwidth l w] MO_VS_Neg l w -> [vecwidth l w] + MO_VS_Min l w -> [vecwidth l w, vecwidth l w] + MO_VS_Max l w -> [vecwidth l w, vecwidth l w] MO_VU_Quot l w -> [vecwidth l w, vecwidth l w] MO_VU_Rem l w -> [vecwidth l w, vecwidth l w] + MO_VU_Min l w -> [vecwidth l w, vecwidth l w] + MO_VU_Max l w -> [vecwidth l w, vecwidth l w] -- NOTE: The below is owing to the fact that floats use the SSE registers MO_VF_Add l w -> [vecwidth l w, vecwidth l w] @@ -621,6 +648,8 @@ machOpArgReps platform op = MO_VF_Mul l w -> [vecwidth l w, vecwidth l w] MO_VF_Quot l w -> [vecwidth l w, vecwidth l w] MO_VF_Neg l w -> [vecwidth l w] + MO_VF_Min l w -> [vecwidth l w, vecwidth l w] + MO_VF_Max l w -> [vecwidth l w, vecwidth l w] MO_RelaxedRead _ -> [wordWidth platform] MO_AlignmentCheck _ r -> [r] ===================================== compiler/GHC/Cmm/Parser.y ===================================== @@ -1050,6 +1050,8 @@ machOps = listToUFM $ ( "fneg", MO_F_Neg ), ( "fmul", MO_F_Mul ), ( "fquot", MO_F_Quot ), + ( "fmin", MO_F_Min ), + ( "fmax", MO_F_Max ), ( "fmadd" , MO_FMA FMAdd 1 ), ( "fmsub" , MO_FMA FMSub 1 ), ===================================== compiler/GHC/CmmToAsm/AArch64/CodeGen.hs ===================================== @@ -812,6 +812,15 @@ getRegister' config plat expr MO_Add {} -> notUnary MO_Sub {} -> notUnary + MO_F_Min {} -> notUnary + MO_F_Max {} -> notUnary + MO_VU_Min {} -> notUnary + MO_VU_Max {} -> notUnary + MO_VS_Min {} -> notUnary + MO_VS_Max {} -> notUnary + MO_VF_Min {} -> notUnary + MO_VF_Max {} -> notUnary + MO_AlignmentCheck {} -> pprPanic "getRegister' (monadic CmmMachOp):" (pdoc plat expr) @@ -1126,6 +1135,8 @@ getRegister' config plat expr MO_F_Sub w -> floatOp w (\d x y -> unitOL $ SUB d x y) MO_F_Mul w -> floatOp w (\d x y -> unitOL $ MUL d x y) MO_F_Quot w -> floatOp w (\d x y -> unitOL $ SDIV d x y) + MO_F_Min w -> floatOp w (\d x y -> unitOL $ FMIN d x y) + MO_F_Max w -> floatOp w (\d x y -> unitOL $ FMAX d x y) -- Floating point comparison MO_F_Eq w -> floatCond w (\d x y -> toOL [ CMP x y, CSET d EQ ]) @@ -1187,6 +1198,12 @@ getRegister' config plat expr MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm where notDyadic = pprPanic "getRegister' (non-dyadic CmmMachOp with 2 arguments): " $ ===================================== compiler/GHC/CmmToAsm/AArch64/Instr.hs ===================================== @@ -145,6 +145,8 @@ regUsageOfInstr platform instr = case instr of FCVTZS dst src -> usage (regOp src, regOp dst) FABS dst src -> usage (regOp src, regOp dst) FSQRT dst src -> usage (regOp src, regOp dst) + FMIN dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) + FMAX dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst) FMA _ dst src1 src2 src3 -> usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst) @@ -295,6 +297,8 @@ patchRegsOfInstr instr env = case instr of FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2) FABS o1 o2 -> FABS (patchOp o1) (patchOp o2) FSQRT o1 o2 -> FSQRT (patchOp o1) (patchOp o2) + FMIN o1 o2 o3 -> FMIN (patchOp o1) (patchOp o2) (patchOp o3) + FMAX o1 o2 o3 -> FMAX (patchOp o1) (patchOp o2) (patchOp o3) FMA s o1 o2 o3 o4 -> FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4) @@ -667,6 +671,10 @@ data Instr | FCVTZS Operand Operand -- Float ABSolute value | FABS Operand Operand + -- Float minimum + | FMIN Operand Operand Operand + -- Float maximum + | FMAX Operand Operand Operand -- Float SQuare RooT | FSQRT Operand Operand @@ -743,6 +751,8 @@ instrCon i = FCVTZS{} -> "FCVTZS" FABS{} -> "FABS" FSQRT{} -> "FSQRT" + FMIN {} -> "FMIN" + FMAX {} -> "FMAX" FMA variant _ _ _ _ -> case variant of FMAdd -> "FMADD" ===================================== compiler/GHC/CmmToAsm/AArch64/Ppr.hs ===================================== @@ -534,6 +534,8 @@ pprInstr platform instr = case instr of FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2 FABS o1 o2 -> op2 (text "\tfabs") o1 o2 FSQRT o1 o2 -> op2 (text "\tfsqrt") o1 o2 + FMIN o1 o2 o3 -> op3 (text "\tfmin") o1 o2 o3 + FMAX o1 o2 o3 -> op3 (text "\tfmax") o1 o2 o3 FMA variant d r1 r2 r3 -> let fma = case variant of FMAdd -> text "\tfmadd" ===================================== compiler/GHC/CmmToAsm/PPC/CodeGen.hs ===================================== @@ -589,6 +589,8 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_F_Sub w -> triv_float w FSUB MO_F_Mul w -> triv_float w FMUL MO_F_Quot w -> triv_float w FDIV + MO_F_Min w -> triv_float w FMIN + MO_F_Max w -> triv_float w FMAX -- optimize addition with 32-bit immediate -- (needed for PIC) @@ -671,6 +673,12 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps MO_VF_Quot {} -> vectorsNeedLlvm MO_V_Shuffle {} -> vectorsNeedLlvm MO_VF_Shuffle {} -> vectorsNeedLlvm + MO_VU_Min {} -> vectorsNeedLlvm + MO_VU_Max {} -> vectorsNeedLlvm + MO_VS_Min {} -> vectorsNeedLlvm + MO_VS_Max {} -> vectorsNeedLlvm + MO_VF_Min {} -> vectorsNeedLlvm + MO_VF_Max {} -> vectorsNeedLlvm _ -> panic "PPC.CodeGen.getRegister: no match" ===================================== compiler/GHC/CmmToAsm/PPC/Instr.hs ===================================== @@ -279,6 +279,8 @@ data Instr | FDIV Format Reg Reg Reg | FABS Reg Reg -- abs is the same for single and double | FNEG Reg Reg -- negate is the same for single and double prec. + | FMIN Format Reg Reg Reg + | FMAX Format Reg Reg Reg -- | Fused multiply-add instructions. -- ===================================== compiler/GHC/CmmToAsm/PPC/Ppr.hs ===================================== @@ -941,6 +941,12 @@ pprInstr platform instr = case instr of FNEG reg1 reg2 -> pprUnary (text "fneg") reg1 reg2 + FMIN fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmin") fmt reg1 reg2 reg3 + + FMAX fmt reg1 reg2 reg3 + -> pprBinaryF (text "fmax") fmt reg1 reg2 reg3 + FMADD signs fmt dst ra rc rb -> pprTernaryF (pprFMASign signs) fmt dst ra rc rb ===================================== compiler/GHC/CmmToAsm/Wasm/Asm.hs ===================================== @@ -362,6 +362,8 @@ asmTellWasmInstr ty_word instr = case instr of WasmF64PromoteF32 -> asmTellLine "f64.promote_f32" WasmAbs ty -> asmTellLine $ asmFromWasmType ty <> ".abs" WasmNeg ty -> asmTellLine $ asmFromWasmType ty <> ".neg" + WasmMin ty -> asmTellLine $ asmFromWasmType ty <> ".min" + WasmMax ty -> asmTellLine $ asmFromWasmType ty <> ".max" WasmCond t -> do asmTellLine "if" asmWithTab $ asmTellWasmInstr ty_word t ===================================== compiler/GHC/CmmToAsm/Wasm/FromCmm.hs ===================================== @@ -821,6 +821,18 @@ lower_CmmMachOp lbl (MO_F_Lt w0) xs = lbl (cmmFloat w0) xs +lower_CmmMachOp lbl (MO_F_Min w0) xs = + lower_MO_Bin_Homo + WasmMin + lbl + (cmmFloat w0) + xs +lower_CmmMachOp lbl (MO_F_Max w0) xs = + lower_MO_Bin_Homo + WasmMax + lbl + (cmmFloat w0) + xs lower_CmmMachOp lbl (MO_And w0) xs = lower_MO_Bin_Homo WasmAnd ===================================== compiler/GHC/CmmToAsm/Wasm/Types.hs ===================================== @@ -306,6 +306,8 @@ data WasmInstr :: WasmType -> [WasmType] -> [WasmType] -> Type where WasmF64PromoteF32 :: WasmInstr w ('F32 : pre) ('F64 : pre) WasmAbs :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) WasmNeg :: WasmTypeTag t -> WasmInstr w (t : pre) (t : pre) + WasmMin :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) + WasmMax :: WasmTypeTag t -> WasmInstr w (t : t : pre) (t : pre) WasmCond :: WasmInstr w pre pre -> WasmInstr w (w : pre) pre newtype WasmExpr w t = WasmExpr (forall pre. WasmInstr w pre (t : pre)) ===================================== compiler/GHC/CmmToAsm/X86/CodeGen.hs ===================================== @@ -842,7 +842,7 @@ iselExpr64ParallelBin op e1 e2 = do -- This is a helper data type which helps reduce the code duplication for -- the code generation of arithmetic operations. This is not specifically -- targetted for any particular type like Int8, Int32 etc -data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div +data VectorArithInstns = VA_Add | VA_Sub | VA_Mul | VA_Div | VA_Min | VA_Max getRegister :: CmmExpr -> NatM Register getRegister e = do platform <- getPlatform @@ -1124,6 +1124,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_F_Le {} -> incorrectOperands MO_F_Gt {} -> incorrectOperands MO_F_Lt {} -> incorrectOperands + MO_F_Min {} -> incorrectOperands + MO_F_Max {} -> incorrectOperands MO_And {} -> incorrectOperands MO_Or {} -> incorrectOperands MO_Xor {} -> incorrectOperands @@ -1141,6 +1143,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x]) = do -- unary MachOps MO_VU_Rem {} -> incorrectOperands MO_V_Shuffle {} -> incorrectOperands MO_VF_Shuffle {} -> incorrectOperands + MO_VU_Min {} -> incorrectOperands + MO_VU_Max {} -> incorrectOperands + MO_VS_Min {} -> incorrectOperands + MO_VS_Max {} -> incorrectOperands + MO_VF_Min {} -> incorrectOperands + MO_VF_Max {} -> incorrectOperands MO_VF_Extract {} -> incorrectOperands MO_VF_Add {} -> incorrectOperands @@ -1338,6 +1346,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_F_Sub w -> trivialFCode_sse2 w SUB x y MO_F_Quot w -> trivialFCode_sse2 w FDIV x y MO_F_Mul w -> trivialFCode_sse2 w MUL x y + MO_F_Min w -> trivialFCode_sse2 w (MINMAX Min FloatMinMax) x y + MO_F_Max w -> trivialFCode_sse2 w (MINMAX Max FloatMinMax) x y MO_Add rep -> add_code rep x y MO_Sub rep -> sub_code rep x y @@ -1394,6 +1404,12 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VF_Quot l w | avx -> vector_float_op_avx VA_Div l w x y | otherwise -> vector_float_op_sse VA_Div l w x y + MO_VF_Min l w | avx -> vector_float_op_avx VA_Min l w x y + | otherwise -> vector_float_op_sse VA_Min l w x y + + MO_VF_Max l w | avx -> vector_float_op_avx VA_Max l w x y + | otherwise -> vector_float_op_sse VA_Max l w x y + -- SIMD NCG TODO: integer vector operations MO_V_Shuffle {} -> needLlvm mop MO_V_Add {} -> needLlvm mop @@ -1404,6 +1420,11 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps MO_VU_Quot {} -> needLlvm mop MO_VU_Rem {} -> needLlvm mop + MO_VU_Min {} -> needLlvm mop + MO_VU_Max {} -> needLlvm mop + MO_VS_Min {} -> needLlvm mop + MO_VS_Max {} -> needLlvm mop + -- Unary MachOps MO_S_Neg {} -> incorrectOperands MO_F_Neg {} -> incorrectOperands @@ -1633,6 +1654,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr VSUB VA_Mul -> arithInstr VMUL VA_Div -> arithInstr VDIV + VA_Min -> arithInstr (VMINMAX Min FloatMinMax) + VA_Max -> arithInstr (VMINMAX Max FloatMinMax) where -- opcode src2 src1 dst <==> dst = src1 `opcode` src2 arithInstr instr = exp1 `appOL` exp2 `snocOL` @@ -1658,6 +1681,8 @@ getRegister' platform is32Bit (CmmMachOp mop [x, y]) = do -- dyadic MachOps VA_Sub -> arithInstr SUB VA_Mul -> arithInstr MUL VA_Div -> arithInstr FDIV + VA_Min -> arithInstr (MINMAX Min FloatMinMax) + VA_Max -> arithInstr (MINMAX Max FloatMinMax) where -- opcode src2 src1 <==> src1 = src1 `opcode` src2 arithInstr instr ===================================== compiler/GHC/CmmToAsm/X86/Instr.hs ===================================== @@ -40,6 +40,7 @@ module GHC.CmmToAsm.X86.Instr , isMetaInstr , isJumpishInstr , movdOutFormat + , MinOrMax(..), MinMaxType(..) ) where @@ -330,8 +331,20 @@ data Instr | PSLLDQ Format Operand Reg | PSRLDQ Format Operand Reg + -- min/max + | MINMAX MinOrMax MinMaxType Format Operand Operand + | VMINMAX MinOrMax MinMaxType Format Operand Reg Reg + data PrefetchVariant = NTA | Lvl0 | Lvl1 | Lvl2 +-- | 'MIN' or 'MAX' +data MinOrMax = Min | Max + deriving ( Eq, Show ) +-- | What kind of min/max operation: signed or unsigned vector integer min/max, +-- or (scalar or vector) floating point min/max? +data MinMaxType = + IntVecMinMax { minMaxSigned :: Bool } | FloatMinMax + deriving ( Eq, Show ) data Operand = OpReg Reg -- register @@ -508,6 +521,10 @@ regUsageOfInstr platform instr PUNPCKLQDQ fmt src dst -> mkRU (use_R fmt src [mk fmt dst]) [mk fmt dst] + MINMAX _ _ fmt src dst + -> mkRU (use_R fmt src $ use_R fmt dst []) (use_R fmt dst []) + VMINMAX _ _ fmt src1 src2 dst + -> mkRU (use_R fmt src1 [mk fmt src2]) [mk fmt dst] _other -> panic "regUsage: unrecognised instr" where -- # Definitions @@ -748,6 +765,11 @@ patchRegsOfInstr platform instr env PUNPCKLQDQ fmt src dst -> PUNPCKLQDQ fmt (patchOp src) (env dst) + MINMAX minMax ty fmt src dst + -> MINMAX minMax ty fmt (patchOp src) (patchOp dst) + VMINMAX minMax ty fmt src1 src2 dst + -> VMINMAX minMax ty fmt (patchOp src1) (env src2) (env dst) + where patch1 :: (Operand -> a) -> Operand -> a patch1 insn op = insn $! patchOp op ===================================== compiler/GHC/CmmToAsm/X86/Ppr.hs ===================================== @@ -43,6 +43,7 @@ import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Utils.Outputable import GHC.Utils.Panic +import Data.List ( intersperse ) import Data.Word -- Note [Subsections Via Symbols] @@ -1034,6 +1035,11 @@ pprInstr platform i = case i of PUNPCKLQDQ format from to -> pprOpReg (text "punpcklqdq") format from to + MINMAX minMax ty fmt src dst + -> pprMinMax False minMax ty fmt [src, dst] + VMINMAX minMax ty fmt src1 src2 dst + -> pprMinMax True minMax ty fmt [src1, OpReg src2, OpReg dst] + where gtab :: Line doc gtab = char '\t' @@ -1365,3 +1371,14 @@ pprInstr platform i = case i of comma, pprReg platform format reg ] + + pprMinMax :: Bool -> MinOrMax -> MinMaxType -> Format -> [Operand] -> doc + pprMinMax wantV minOrMax mmTy fmt regs + = line $ hcat ( instr : intersperse comma ( map ( pprOperand platform fmt ) regs ) ) + where + instr = (if wantV then text "v" else empty) + <> (case mmTy of { IntVecMinMax {} -> text "p"; FloatMinMax -> empty }) + <> (case minOrMax of { Min -> text "min"; Max -> text "max" }) + <> (case mmTy of { IntVecMinMax wantSigned -> if wantSigned then text "s" else text "u"; FloatMinMax -> empty }) + <> pprFormat fmt + <> space ===================================== compiler/GHC/CmmToC.hs ===================================== @@ -535,13 +535,20 @@ pprMachOpApp' platform mop args -- ternary args@[_,_,_] -> - pprMachOp_for_C platform mop <> parens (pprWithCommas pprArg args) + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprWithCommas pprArg args) -- dyadic - [x,y] -> pprArg x <+> pprMachOp_for_C platform mop <+> pprArg y + args@[x,y] -> + let (fixity, op) = pprMachOp_for_C platform mop + in case fixity of + Infix -> pprArg x <+> op <+> pprArg y + Prefix -> op <> parens (pprWithCommas pprArg args) -- unary - [x] -> pprMachOp_for_C platform mop <> parens (pprArg x) + [x] -> + let (_fixity, op) = pprMachOp_for_C platform mop + in op <> parens (pprArg x) _ -> panic "PprC.pprMachOp : machop with wrong number of args" @@ -701,36 +708,41 @@ pprBlockId b = char '_' <> ppr (getUnique b) -- Print a MachOp in a way suitable for emitting via C. -- -pprMachOp_for_C :: Platform -> MachOp -> SDoc +data Fixity = Prefix | Infix + deriving ( Eq, Show ) + +pprMachOp_for_C :: Platform -> MachOp -> (Fixity, SDoc) pprMachOp_for_C platform mop = case mop of -- Integer operations - MO_Add _ -> char '+' - MO_Sub _ -> char '-' - MO_Eq _ -> text "==" - MO_Ne _ -> text "!=" - MO_Mul _ -> char '*' + MO_Add _ -> (Infix, char '+') + MO_Sub _ -> (Infix, char '-') + MO_Eq _ -> (Infix, text "==") + MO_Ne _ -> (Infix, text "!=") + MO_Mul _ -> (Infix, char '*') - MO_S_Quot _ -> char '/' - MO_S_Rem _ -> char '%' - MO_S_Neg _ -> char '-' + MO_S_Quot _ -> (Infix, char '/') + MO_S_Rem _ -> (Infix, char '%') + MO_S_Neg _ -> (Infix, char '-') - MO_U_Quot _ -> char '/' - MO_U_Rem _ -> char '%' + MO_U_Quot _ -> (Infix, char '/') + MO_U_Rem _ -> (Infix, char '%') -- Floating-point operations - MO_F_Add _ -> char '+' - MO_F_Sub _ -> char '-' - MO_F_Neg _ -> char '-' - MO_F_Mul _ -> char '*' - MO_F_Quot _ -> char '/' + MO_F_Add _ -> (Infix, char '+') + MO_F_Sub _ -> (Infix, char '-') + MO_F_Neg _ -> (Infix, char '-') + MO_F_Mul _ -> (Infix, char '*') + MO_F_Quot _ -> (Infix, char '/') + MO_F_Min _ -> (Prefix, text "fmin") + MO_F_Max _ -> (Prefix, text "fmax") -- Floating-point fused multiply-add operations MO_FMA FMAdd 1 w -> case w of - W32 -> text "fmaf" - W64 -> text "fma" + W32 -> (Prefix, text "fmaf") + W64 -> (Prefix, text "fma") _ -> pprTrace "offending mop:" (text "FMAdd") @@ -747,34 +759,34 @@ pprMachOp_for_C platform mop = case mop of (panic $ "PprC.pprMachOp_for_C: unsupported vector operation") -- Signed comparisons - MO_S_Ge _ -> text ">=" - MO_S_Le _ -> text "<=" - MO_S_Gt _ -> char '>' - MO_S_Lt _ -> char '<' + MO_S_Ge _ -> (Infix, text ">=") + MO_S_Le _ -> (Infix, text "<=") + MO_S_Gt _ -> (Infix, char '>') + MO_S_Lt _ -> (Infix, char '<') -- & Unsigned comparisons - MO_U_Ge _ -> text ">=" - MO_U_Le _ -> text "<=" - MO_U_Gt _ -> char '>' - MO_U_Lt _ -> char '<' + MO_U_Ge _ -> (Infix, text ">=") + MO_U_Le _ -> (Infix, text "<=") + MO_U_Gt _ -> (Infix, char '>') + MO_U_Lt _ -> (Infix, char '<') -- & Floating-point comparisons - MO_F_Eq _ -> text "==" - MO_F_Ne _ -> text "!=" - MO_F_Ge _ -> text ">=" - MO_F_Le _ -> text "<=" - MO_F_Gt _ -> char '>' - MO_F_Lt _ -> char '<' + MO_F_Eq _ -> (Infix, text "==") + MO_F_Ne _ -> (Infix, text "!=") + MO_F_Ge _ -> (Infix, text ">=") + MO_F_Le _ -> (Infix, text "<=") + MO_F_Gt _ -> (Infix, char '>') + MO_F_Lt _ -> (Infix, char '<') -- Bitwise operations. Not all of these may be supported at all -- sizes, and only integral MachReps are valid. - MO_And _ -> char '&' - MO_Or _ -> char '|' - MO_Xor _ -> char '^' - MO_Not _ -> char '~' - MO_Shl _ -> text "<<" - MO_U_Shr _ -> text ">>" -- unsigned shift right - MO_S_Shr _ -> text ">>" -- signed shift right + MO_And _ -> (Infix, char '&') + MO_Or _ -> (Infix, char '|') + MO_Xor _ -> (Infix, char '^') + MO_Not _ -> (Infix, char '~') + MO_Shl _ -> (Infix, text "<<") + MO_U_Shr _ -> (Infix, text ">>") -- unsigned shift right + MO_S_Shr _ -> (Infix, text ">>") -- signed shift right -- Conversions. Some of these will be NOPs, but never those that convert -- between ints and floats. @@ -785,11 +797,11 @@ pprMachOp_for_C platform mop = case mop of -- bitcasts, in the C backend these are performed with __builtin_memcpy. -- See rts/include/stg/Prim.h - MO_FW_Bitcast W32 -> text "hs_bitcastfloat2word" - MO_FW_Bitcast W64 -> text "hs_bitcastdouble2word64" + MO_FW_Bitcast W32 -> (Prefix, text "hs_bitcastfloat2word") + MO_FW_Bitcast W64 -> (Prefix, text "hs_bitcastdouble2word64") - MO_WF_Bitcast W32 -> text "hs_bitcastword2float" - MO_WF_Bitcast W64 -> text "hs_bitcastword642double" + MO_WF_Bitcast W32 -> (Prefix, text "hs_bitcastword2float") + MO_WF_Bitcast W64 -> (Prefix, text "hs_bitcastword642double") MO_FW_Bitcast w -> pprTrace "offending mop:" (text "MO_FW_Bitcast") @@ -805,20 +817,20 @@ pprMachOp_for_C platform mop = case mop of -- noop casts - MO_UU_Conv from to | from == to -> empty - MO_UU_Conv _from to -> parens (machRep_U_CType platform to) + MO_UU_Conv from to | from == to -> (Prefix, empty) + MO_UU_Conv _from to -> (Prefix, parens (machRep_U_CType platform to)) - MO_SS_Conv from to | from == to -> empty - MO_SS_Conv _from to -> parens (machRep_S_CType platform to) + MO_SS_Conv from to | from == to -> (Prefix, empty) + MO_SS_Conv _from to -> (Prefix, parens (machRep_S_CType platform to)) - MO_XX_Conv from to | from == to -> empty - MO_XX_Conv _from to -> parens (machRep_U_CType platform to) + MO_XX_Conv from to | from == to -> (Prefix, empty) + MO_XX_Conv _from to -> (Prefix,parens (machRep_U_CType platform to)) - MO_FF_Conv from to | from == to -> empty - MO_FF_Conv _from to -> parens (machRep_F_CType to) + MO_FF_Conv from to | from == to -> (Prefix, empty) + MO_FF_Conv _from to -> (Prefix,parens (machRep_F_CType to)) - MO_SF_Round _from to -> parens (machRep_F_CType to) - MO_FS_Truncate _from to -> parens (machRep_S_CType platform to) + MO_SF_Round _from to -> (Prefix,parens (machRep_F_CType to)) + MO_FS_Truncate _from to -> (Prefix,parens (machRep_S_CType platform to)) MO_RelaxedRead _ -> pprTrace "offending mop:" (text "MO_RelaxedRead") @@ -917,6 +929,30 @@ pprMachOp_for_C platform mop = case mop of (text "MO_VF_Quot") (panic $ "PprC.pprMachOp_for_C: MO_VF_Quot" ++ "unsupported by the unregisterised backend") + MO_VU_Min {} -> pprTrace "offending mop:" + (text "MO_VU_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VU_Max {} -> pprTrace "offending mop:" + (text "MO_VU_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") + MO_VS_Min {} -> pprTrace "offending mop:" + (text "MO_VS_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Min" + ++ "unsupported by the unregisterised backend") + MO_VS_Max {} -> pprTrace "offending mop:" + (text "MO_VS_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VS_Max" + ++ "unsupported by the unregisterised backend") + MO_VF_Min {} -> pprTrace "offending mop:" + (text "MO_VF_Min") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Min" + ++ "unsupported by the unregisterised backend") + MO_VF_Max {} -> pprTrace "offending mop:" + (text "MO_VF_Max") + (panic $ "PprC.pprMachOp_for_C: MO_VU_Max" + ++ "unsupported by the unregisterised backend") signedOp :: MachOp -> Bool -- Argument type(s) are signed ints signedOp (MO_S_Quot _) = True ===================================== compiler/GHC/CmmToLlvm/CodeGen.hs ===================================== @@ -1493,6 +1493,8 @@ genMachOp _ op [x] = case op of MO_F_Sub _ -> panicOp MO_F_Mul _ -> panicOp MO_F_Quot _ -> panicOp + MO_F_Min _ -> panicOp + MO_F_Max _ -> panicOp MO_FMA _ _ _ -> panicOp @@ -1519,9 +1521,13 @@ genMachOp _ op [x] = case op of MO_VS_Quot _ _ -> panicOp MO_VS_Rem _ _ -> panicOp + MO_VS_Min _ _ -> panicOp + MO_VS_Max _ _ -> panicOp MO_VU_Quot _ _ -> panicOp MO_VU_Rem _ _ -> panicOp + MO_VU_Min _ _ -> panicOp + MO_VU_Max _ _ -> panicOp MO_VF_Insert _ _ -> panicOp MO_VF_Extract _ _ -> panicOp @@ -1533,6 +1539,8 @@ genMachOp _ op [x] = case op of MO_VF_Sub _ _ -> panicOp MO_VF_Mul _ _ -> panicOp MO_VF_Quot _ _ -> panicOp + MO_VF_Min _ _ -> panicOp + MO_VF_Max _ _ -> panicOp where negate ty v2 negOp = do @@ -1732,6 +1740,16 @@ genMachOp_slow opt op [x, y] = case op of MO_VF_Neg {} -> panicOp + -- Min/max + MO_F_Min {} -> genMinMaxOp "minnum" x y + MO_F_Max {} -> genMinMaxOp "maxnum" x y + MO_VF_Min {} -> genMinMaxOp "minnum" x y + MO_VF_Max {} -> genMinMaxOp "maxnum" x y + MO_VU_Min {} -> genMinMaxOp "umin" x y + MO_VU_Max {} -> genMinMaxOp "umax" x y + MO_VS_Min {} -> genMinMaxOp "smin" x y + MO_VS_Max {} -> genMinMaxOp "smax" x y + MO_RelaxedRead {} -> panicOp MO_AlignmentCheck {} -> panicOp @@ -1786,6 +1804,19 @@ genMachOp_slow opt op [x, y] = case op of genCastBinMach ty op = binCastLlvmOp ty (LlvmOp op) + genMinMaxOp intrin x y = runExprData $ do + vx <- exprToVarW x + vy <- exprToVarW y + let tx = getVarType vx + ty = getVarType vy + fname = "llvm." ++ intrin ++ "." ++ ppLlvmTypeShort ty + Panic.massertPpr + (tx == ty) + (vcat [ text (fname ++ ": mismatched arg types") + , ppLlvmType tx, ppLlvmType ty ]) + fptr <- liftExprData $ getInstrinct (fsLit fname) ty [tx, ty] + doExprW tx $ Call StdCall fptr [vx, vy] [ReadNone, NoUnwind] + -- Detect if overflow will occur in signed multiply of the two -- CmmExpr's. This is the LLVM assembly equivalent of the NCG -- implementation. Its much longer due to type information/safety. ===================================== compiler/GHC/JS/Make.hs ===================================== @@ -130,7 +130,8 @@ module GHC.JS.Make -- $math , math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, - math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround + math_cosh, math_sinh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max -- * Statement helpers , Solo(..) , decl @@ -672,7 +673,8 @@ math_ op args = ApplExpr (math .^ op) args math_log, math_sin, math_cos, math_tan, math_exp, math_acos, math_asin, math_atan, math_abs, math_pow, math_sqrt, math_asinh, math_acosh, math_atanh, math_sign, - math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround + math_sinh, math_cosh, math_tanh, math_expm1, math_log1p, math_fround, + math_min, math_max :: [JStgExpr] -> JStgExpr math_log = math_ "log" math_sin = math_ "sin" @@ -695,6 +697,8 @@ math_tanh = math_ "tanh" math_expm1 = math_ "expm1" math_log1p = math_ "log1p" math_fround = math_ "fround" +math_min = math_ "min" +math_max = math_ "max" instance Num JStgExpr where x + y = InfixExpr AddOp x y ===================================== compiler/GHC/Llvm/Types.hs ===================================== @@ -91,6 +91,15 @@ ppLlvmType t = case t of {-# SPECIALIZE ppLlvmType :: LlvmType -> SDoc #-} {-# SPECIALIZE ppLlvmType :: LlvmType -> HLine #-} -- see Note [SPECIALIZE to HDoc] in GHC.Utils.Outputable +-- | Pretty-print a short name for a scalar or vector type, e.g. @"i16"@ or @"v4f32"@. +ppLlvmTypeShort :: LlvmType -> String +ppLlvmTypeShort t = case t of + LMInt w -> 'i' : show w + LMFloat -> "f32" + LMDouble -> "f64" + LMVector l t -> "v" ++ show l ++ ppLlvmTypeShort t + _ -> pprPanic "ppLlvmTypeShort" (ppLlvmType t) + ppParams :: IsLine doc => LlvmParameterListType -> [LlvmParameter] -> doc ppParams varg p = let varg' = case varg of ===================================== compiler/GHC/StgToCmm/Prim.hs ===================================== @@ -1481,6 +1481,9 @@ emitPrimOp cfg primop = DoubleGtOp -> opTranslate (MO_F_Gt W64) DoubleLtOp -> opTranslate (MO_F_Lt W64) + DoubleMinOp -> opTranslate (MO_F_Min W64) + DoubleMaxOp -> opTranslate (MO_F_Max W64) + DoubleAddOp -> opTranslate (MO_F_Add W64) DoubleSubOp -> opTranslate (MO_F_Sub W64) DoubleMulOp -> opTranslate (MO_F_Mul W64) @@ -1512,6 +1515,9 @@ emitPrimOp cfg primop = FloatFNMAdd -> fmaOp FNMAdd 1 W32 FloatFNMSub -> fmaOp FNMSub 1 W32 + FloatMinOp -> opTranslate (MO_F_Min W32) + FloatMaxOp -> opTranslate (MO_F_Max W32) + -- Vector ops (VecAddOp FloatVec n w) -> opTranslate (MO_VF_Add n w) @@ -1521,6 +1527,8 @@ emitPrimOp cfg primop = (VecQuotOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecRemOp FloatVec _ _) -> \_ -> panic "unsupported primop" (VecNegOp FloatVec n w) -> opTranslate (MO_VF_Neg n w) + (VecMinOp FloatVec n w) -> opTranslate (MO_VF_Min n w) + (VecMaxOp FloatVec n w) -> opTranslate (MO_VF_Max n w) (VecAddOp IntVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp IntVec n w) -> opTranslate (MO_V_Sub n w) @@ -1529,6 +1537,8 @@ emitPrimOp cfg primop = (VecQuotOp IntVec n w) -> opTranslate (MO_VS_Quot n w) (VecRemOp IntVec n w) -> opTranslate (MO_VS_Rem n w) (VecNegOp IntVec n w) -> opTranslate (MO_VS_Neg n w) + (VecMinOp IntVec n w) -> opTranslate (MO_VS_Min n w) + (VecMaxOp IntVec n w) -> opTranslate (MO_VS_Max n w) (VecAddOp WordVec n w) -> opTranslate (MO_V_Add n w) (VecSubOp WordVec n w) -> opTranslate (MO_V_Sub n w) @@ -1537,6 +1547,8 @@ emitPrimOp cfg primop = (VecQuotOp WordVec n w) -> opTranslate (MO_VU_Quot n w) (VecRemOp WordVec n w) -> opTranslate (MO_VU_Rem n w) (VecNegOp WordVec _ _) -> \_ -> panic "unsupported primop" + (VecMinOp WordVec n w) -> opTranslate (MO_VU_Min n w) + (VecMaxOp WordVec n w) -> opTranslate (MO_VU_Max n w) -- Vector FMA instructions VecFMAdd _ n w -> fmaOp FMAdd n w ===================================== compiler/GHC/StgToJS/Prim.hs ===================================== @@ -477,6 +477,8 @@ genPrim prof bound ty op = case op of DoubleDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= Div x y DoubleNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x DoubleFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] + DoubleMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + DoubleMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] DoubleToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x DoubleToFloatOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [x] DoubleExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_exp [x] @@ -520,6 +522,8 @@ genPrim prof bound ty op = case op of FloatMulOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Mul x y] FloatDivOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_fround [Div x y] FloatNegOp -> \[r] [x] -> pure $ PrimInline $ r |= Negate x + FloatMinOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_min [x,y] + FloatMaxOp -> \[r] [x,y] -> pure $ PrimInline $ r |= math_max [x,y] FloatFabsOp -> \[r] [x] -> pure $ PrimInline $ r |= math_abs [x] FloatToIntOp -> \[r] [x] -> pure $ PrimInline $ r |= toI32 x FloatExpOp -> \[r] [x] -> pure $ PrimInline $ r |= math_fround [math_exp [x]] @@ -1204,6 +1208,8 @@ genPrim prof bound ty op = case op of VecReadScalarOffAddrOp _ _ _ -> unhandledPrimop op VecWriteScalarOffAddrOp _ _ _ -> unhandledPrimop op VecShuffleOp _ _ _ -> unhandledPrimop op + VecMinOp {} -> unhandledPrimop op + VecMaxOp {} -> unhandledPrimop op PrefetchByteArrayOp3 -> noOp PrefetchMutableByteArrayOp3 -> noOp ===================================== docs/users_guide/9.12.1-notes.rst ===================================== @@ -136,6 +136,12 @@ Runtime system and indices ``(# 4#, 3#, 6#, 1# #)``, will return a vector with components ``(# 44.1#, 33.1#, 66.1#, 11.1# #)``. +- New instructions for minimum/maximum, such as `minDouble#` and + `minFloatX4#`. These instructions compute the minimum/maximum of their inputs, + working component-wise for SIMD vectors. Supported argument types are vector + integer values (e.g. `Word16X8#`, `Int32X4#` etc) and both scalar and vector + floating point values (e.g. `Float#`, `DoubleX2#`, `FloatX8#` etc). + ``ghc`` library ~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/Base.hs ===================================== @@ -203,6 +203,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== libraries/base/src/GHC/Exts.hs ===================================== @@ -176,6 +176,71 @@ import GHC.Prim hiding , shuffleWord8X16# , shuffleWord8X32# , shuffleWord8X64# + -- Don't re-export min/max primops + , maxDouble# + , maxDoubleX2# + , maxDoubleX4# + , maxDoubleX8# + , maxFloat# + , maxFloatX16# + , maxFloatX4# + , maxFloatX8# + , maxInt16X16# + , maxInt16X32# + , maxInt16X8# + , maxInt32X16# + , maxInt32X4# + , maxInt32X8# + , maxInt64X2# + , maxInt64X4# + , maxInt64X8# + , maxInt8X16# + , maxInt8X32# + , maxInt8X64# + , maxWord16X16# + , maxWord16X32# + , maxWord16X8# + , maxWord32X16# + , maxWord32X4# + , maxWord32X8# + , maxWord64X2# + , maxWord64X4# + , maxWord64X8# + , maxWord8X16# + , maxWord8X32# + , maxWord8X64# + , minDouble# + , minDoubleX2# + , minDoubleX4# + , minDoubleX8# + , minFloat# + , minFloatX16# + , minFloatX4# + , minFloatX8# + , minInt16X16# + , minInt16X32# + , minInt16X8# + , minInt32X16# + , minInt32X4# + , minInt32X8# + , minInt64X2# + , minInt64X4# + , minInt64X8# + , minInt8X16# + , minInt8X32# + , minInt8X64# + , minWord16X16# + , minWord16X32# + , minWord16X8# + , minWord32X16# + , minWord32X4# + , minWord32X8# + , minWord64X2# + , minWord64X4# + , minWord64X8# + , minWord8X16# + , minWord8X32# + , minWord8X64# ) import GHC.Prim.Ext ===================================== testsuite/tests/simd/should_run/all.T ===================================== @@ -39,6 +39,7 @@ test('simd010', [], compile_and_run, ['']) test('simd011', [ unless(have_cpu_feature('fma'), skip) , extra_hc_opts('-mfma') ], compile_and_run, ['']) +test('simd012', [], compile_and_run, ['']) test('T25062_V16', [], compile_and_run, ['']) test('T25062_V32', [ unless(have_cpu_feature('avx2'), skip) ===================================== testsuite/tests/simd/should_run/simd006.hs ===================================== @@ -120,6 +120,15 @@ instance Arbitrary Word64 where instance Arbitrary Word32 where arbitrary = wordDownsize <$> arbitraryWord64 +class HasMinMax a where + mini, maxi :: a -> a -> a +instance HasMinMax FloatNT where + mini (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (minFloat# f1 f2)) + maxi (FloatNT (F# f1)) (FloatNT (F# f2)) = FloatNT (F# (maxFloat# f1 f2)) +instance HasMinMax DoubleNT where + mini (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (minDouble# d1 d2)) + maxi (DoubleNT (D# d1)) (DoubleNT (D# d2)) = DoubleNT (D# (maxDouble# d1 d2)) + newtype FloatNT = FloatNT Float deriving newtype (Show, Num) instance Eq FloatNT where @@ -167,6 +176,9 @@ instance Num FloatX4 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax FloatX4 where + mini (FX4# a) (FX4# b) = FX4# (minFloatX4# a b) + maxi (FX4# a) (FX4# b) = FX4# (maxFloatX4# a b) data DoubleX2 = DX2# DoubleX2# instance Show DoubleX2 where @@ -195,6 +207,9 @@ instance Num DoubleX2 where abs = error "no" signum = error "no" fromInteger = error "no" +instance HasMinMax DoubleX2 where + mini (DX2# a) (DX2# b) = DX2# (minDoubleX2# a b) + maxi (DX2# a) (DX2# b) = DX2# (maxDoubleX2# a b) data Expr a where Lit :: a -> Expr a @@ -202,6 +217,8 @@ data Expr a where Sub :: Expr a -> Expr a -> Expr a Neg :: Expr a -> Expr a Mul :: Expr a -> Expr a -> Expr a + Min :: Expr a -> Expr a -> Expr a + Max :: Expr a -> Expr a -> Expr a deriving (Show, Eq) fmapExpr :: (a -> b) -> Expr a -> Expr b fmapExpr f (Lit a) = Lit (f a) @@ -209,6 +226,8 @@ fmapExpr f (Add a b) = Add (fmapExpr f a) (fmapExpr f b) fmapExpr f (Sub a b) = Sub (fmapExpr f a) (fmapExpr f b) fmapExpr f (Neg a) = Neg (fmapExpr f a) fmapExpr f (Mul a b) = Mul (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Min a b) = Min (fmapExpr f a) (fmapExpr f b) +fmapExpr f (Max a b) = Max (fmapExpr f a) (fmapExpr f b) instance Arbitrary a => Arbitrary (Expr a) where arbitrary = do @@ -218,15 +237,18 @@ instance Arbitrary a => Arbitrary (Expr a) where 2 -> Sub <$> arbitrary <*> arbitrary 3 -> Neg <$> arbitrary 4 -> Mul <$> arbitrary <*> arbitrary + 5 -> Min <$> arbitrary <*> arbitrary + 6 -> Max <$> arbitrary <*> arbitrary _ -> Lit <$> arbitrary -eval :: Num a => Expr a -> a +eval :: (Num a, HasMinMax a) => Expr a -> a eval (Lit a) = a eval (Add a b) = eval a + eval b eval (Sub a b) = eval a - eval b eval (Neg a) = negate (eval a) eval (Mul a b) = eval a * eval b - +eval (Min a b) = mini (eval a) (eval b) +eval (Max a b) = maxi (eval a) (eval b) int64ToInt :: Int64 -> Int #if WORD_SIZE_IN_BITS == 64 ===================================== testsuite/tests/simd/should_run/simd012.hs ===================================== @@ -0,0 +1,30 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE UnboxedTuples #-} +-- simple test for vector min/max instructions + +import GHC.Exts +import GHC.Prim + + +main :: IO () +main = do + + -- FloatX4# + let + !f1 = packFloatX4# (# 1.1#, 20.1#, 3.1#, 40.1# #) + !f2 = packFloatX4# (# 10.2#, 2.2#, 30.2#, 4.2# #) + + case unpackFloatX4# (minFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + case unpackFloatX4# (maxFloatX4# f1 f2) of + (# a, b, c, d #) -> print (F# a, F# b, F# c, F# d) + + -- DoubleX2# + let + !d1 = packDoubleX2# (# 1.1##, 20.1## #) + !d2 = packDoubleX2# (# 10.2##, 2.2## #) + + case unpackDoubleX2# (minDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) + case unpackDoubleX2# (maxDoubleX2# d1 d2) of + (# a, b #) -> print (D# a, D# b) ===================================== testsuite/tests/simd/should_run/simd012.stdout ===================================== @@ -0,0 +1,4 @@ +(1.1,2.2,3.1,4.2) +(10.2,20.1,30.2,40.1) +(1.1,2.2) +(10.2,20.1) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a57beb9ddd1adaa667adc2708b3244f864d40e0c -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a57beb9ddd1adaa667adc2708b3244f864d40e0c You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 18:26:57 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 14:26:57 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66a93071b367c_84d0aa546090e4@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 815b39fa by Cheng Shao at 2024-07-30T20:26:47+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - 11 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -991,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWholeCoreBindingsWith :: + IO (HscEnv, IORef TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1007,22 +1015,51 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } - -- The bytecode generation itself is lazy because otherwise even when doing - -- recompilation checking the bytecode will be generated (which slows things down a lot) - -- the laziness is OK because generateByteCode just depends on things already loaded - -- in the interface file. - LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] - trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) - generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) + -- The bytecode generation itself is lazy because otherwise even when doing + -- recompilation checking the bytecode will be generated (which slows things down a lot) + -- the laziness is OK because generateByteCode just depends on things already loaded + -- in the interface file. + LoadedBCOs <$> (unsafeInterleaveIO $ do + (tc_hsc_env, type_env) <- mk_tc_env + core_binds <- initIfaceCheck (text "l") tc_hsc_env $ + typecheckWholeCoreBindings type_env fi + tycons <- typeEnvTyCons <$> readIORef type_env + let cgi_guts = CgInteractiveGuts this_mod core_binds tycons NoStubs Nothing [] + trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> ppr this_mod) + generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details linkable at LM {linkableModule} = + initWholeCoreBindingsWith mk_tc_env hsc_env mod_iface linkable + where + mk_tc_env = do + types_var <- newIORef (md_types details) + let + kv = knotVarsFromModuleEnv (mkModuleEnv [(linkableModule, types_var)]) + hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } + pure (hsc_env', types_var) + where + act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env iface = + initWholeCoreBindingsWith mk_tc_env hsc_env iface + where + mk_tc_env = do + type_env <- newIORef emptyUFM + let + hsc_env' = hsc_env { + hsc_type_env_vars = + knotVarsFromModuleEnv (mkModuleEnv [(mi_module iface, type_env)]) + } + pure (hsc_env', type_env) + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "load core bindings") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/815b39faf35a17a9892ffe0d10ab2a1ad9ec0b85 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/815b39faf35a17a9892ffe0d10ab2a1ad9ec0b85 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 18:35:21 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 14:35:21 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66a93269f2966_84d0a21f23c1001b@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 5fe0cfc6 by Cheng Shao at 2024-07-30T20:35:03+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - 11 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -991,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWcbWithTcEnv :: + (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWcbWithTcEnv tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1007,22 +1015,44 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } - -- The bytecode generation itself is lazy because otherwise even when doing - -- recompilation checking the bytecode will be generated (which slows things down a lot) - -- the laziness is OK because generateByteCode just depends on things already loaded - -- in the interface file. - LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] - trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) - generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) + -- The bytecode generation itself is lazy because otherwise even when doing + -- recompilation checking the bytecode will be generated (which slows things down a lot) + -- the laziness is OK because generateByteCode just depends on things already loaded + -- in the interface file. + LoadedBCOs <$> (unsafeInterleaveIO $ do + let (tc_hsc_env, initial_types) = tc_env + type_env <- newIORef initial_types + let + tc_hsc_env_with_kv = tc_hsc_env { + hsc_type_env_vars = + knotVarsFromModuleEnv (mkModuleEnv [(this_mod, type_env)]) + } + core_binds <- initIfaceCheck (text "l") tc_hsc_env_with_kv $ + typecheckWholeCoreBindings type_env fi + tycons <- typeEnvTyCons <$> readIORef type_env + let cgi_guts = CgInteractiveGuts this_mod core_binds tycons NoStubs Nothing [] + trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> ppr this_mod) + generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details = + initWcbWithTcEnv tc_env hsc_env mod_iface + where + tc_env = (hscUpdateHPT add_hmi hsc_env, md_types details) + + add_hmi hpt = + addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env = + initWcbWithTcEnv (hsc_env, emptyUFM) hsc_env + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "load core bindings") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fe0cfc6f5ece3a3bddea7282845601a92512adb -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fe0cfc6f5ece3a3bddea7282845601a92512adb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 19:37:07 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 15:37:07 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] add test Message-ID: <66a940e3c7062_84d0a5b81001471d@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 077064b8 by Torsten Schmits at 2024-07-30T21:37:01+02:00 add test - - - - - 8 changed files: - + testsuite/tests/bytecode/T25090/A.hs - + testsuite/tests/bytecode/T25090/B.hs - + testsuite/tests/bytecode/T25090/C.hs - + testsuite/tests/bytecode/T25090/C.hs-boot - + testsuite/tests/bytecode/T25090/D.hs - + testsuite/tests/bytecode/T25090/Makefile - + testsuite/tests/bytecode/T25090/T25090.stdout - + testsuite/tests/bytecode/T25090/all.T Changes: ===================================== testsuite/tests/bytecode/T25090/A.hs ===================================== @@ -0,0 +1,7 @@ +{-# language TemplateHaskell #-} +module Main where + +import D + +main :: IO () +main = putStrLn (show ($splc :: Int)) ===================================== testsuite/tests/bytecode/T25090/B.hs ===================================== @@ -0,0 +1,5 @@ +module B where + +import {-# source #-} C (C) + +data B = B C ===================================== testsuite/tests/bytecode/T25090/C.hs ===================================== @@ -0,0 +1,8 @@ +module C where + +import B + +data C = C Int + +b :: B +b = B (C 2024) ===================================== testsuite/tests/bytecode/T25090/C.hs-boot ===================================== @@ -0,0 +1,3 @@ +module C where + +data C ===================================== testsuite/tests/bytecode/T25090/D.hs ===================================== @@ -0,0 +1,12 @@ +module D where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +import B +import C + +splc :: ExpQ +splc = + lift @_ @Int num + where + B (C num) = b ===================================== testsuite/tests/bytecode/T25090/Makefile ===================================== @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T25090: + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs-boot + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic B.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic D.hs + $(TEST_HC) -c -fbyte-code-and-object-code -fprefer-byte-code -dynamic C.o B.o A.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code D.o A.o -o exe + ./exe ===================================== testsuite/tests/bytecode/T25090/T25090.stdout ===================================== @@ -0,0 +1 @@ +2024 ===================================== testsuite/tests/bytecode/T25090/all.T ===================================== @@ -0,0 +1,7 @@ +test('T25090', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + ignore_stderr, + ], + makefile_test, + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/077064b8d8e727496538e07f526bc9394e74f4bd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/077064b8d8e727496538e07f526bc9394e74f4bd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 19:51:53 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 15:51:53 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] add test Message-ID: <66a944594eda0_84d0a71cc94153e0@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: b3a28c30 by Torsten Schmits at 2024-07-30T21:51:47+02:00 add test - - - - - 8 changed files: - + testsuite/tests/bytecode/T25090/A.hs - + testsuite/tests/bytecode/T25090/B.hs - + testsuite/tests/bytecode/T25090/C.hs - + testsuite/tests/bytecode/T25090/C.hs-boot - + testsuite/tests/bytecode/T25090/D.hs - + testsuite/tests/bytecode/T25090/Makefile - + testsuite/tests/bytecode/T25090/T25090.stdout - + testsuite/tests/bytecode/T25090/all.T Changes: ===================================== testsuite/tests/bytecode/T25090/A.hs ===================================== @@ -0,0 +1,7 @@ +{-# language TemplateHaskell #-} +module Main where + +import D + +main :: IO () +main = putStrLn (show ($splc :: Int)) ===================================== testsuite/tests/bytecode/T25090/B.hs ===================================== @@ -0,0 +1,5 @@ +module B where + +import {-# source #-} C (C) + +data B = B C ===================================== testsuite/tests/bytecode/T25090/C.hs ===================================== @@ -0,0 +1,8 @@ +module C where + +import B + +data C = C Int + +b :: B +b = B (C 2024) ===================================== testsuite/tests/bytecode/T25090/C.hs-boot ===================================== @@ -0,0 +1,3 @@ +module C where + +data C ===================================== testsuite/tests/bytecode/T25090/D.hs ===================================== @@ -0,0 +1,12 @@ +module D where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +import B +import C + +splc :: ExpQ +splc = + lift @_ @Int num + where + B (C num) = b ===================================== testsuite/tests/bytecode/T25090/Makefile ===================================== @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T25090: + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs-boot + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic B.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic D.hs + $(TEST_HC) -c -fbyte-code-and-object-code -fprefer-byte-code -dynamic A.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code D.o A.o -o exe + ./exe ===================================== testsuite/tests/bytecode/T25090/T25090.stdout ===================================== @@ -0,0 +1 @@ +2024 ===================================== testsuite/tests/bytecode/T25090/all.T ===================================== @@ -0,0 +1,7 @@ +test('T25090', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + ignore_stderr, + ], + makefile_test, + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3a28c30c4825c86eea7a5e37f2e227959c86d87 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3a28c30c4825c86eea7a5e37f2e227959c86d87 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 19:53:27 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 15:53:27 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 2 commits: Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66a944b743735_84d0a75279015990@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: b3a34b0f by Cheng Shao at 2024-07-30T21:53:19+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - e7fdd33f by Torsten Schmits at 2024-07-30T21:53:19+02:00 add test - - - - - 19 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h - + testsuite/tests/bytecode/T25090/A.hs - + testsuite/tests/bytecode/T25090/B.hs - + testsuite/tests/bytecode/T25090/C.hs - + testsuite/tests/bytecode/T25090/C.hs-boot - + testsuite/tests/bytecode/T25090/D.hs - + testsuite/tests/bytecode/T25090/Makefile - + testsuite/tests/bytecode/T25090/T25090.stdout - + testsuite/tests/bytecode/T25090/all.T Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -991,9 +993,15 @@ initModDetails hsc_env iface = -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWcbWithTcEnv :: + (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + Linkable -> + IO Linkable +initWcbWithTcEnv tc_env hsc_env mod_iface (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1007,22 +1015,45 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } - -- The bytecode generation itself is lazy because otherwise even when doing - -- recompilation checking the bytecode will be generated (which slows things down a lot) - -- the laziness is OK because generateByteCode just depends on things already loaded - -- in the interface file. - LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] - trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) - generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) + -- The bytecode generation itself is lazy because otherwise even when doing + -- recompilation checking the bytecode will be generated (which slows things down a lot) + -- the laziness is OK because generateByteCode just depends on things already loaded + -- in the interface file. + LoadedBCOs <$> (unsafeInterleaveIO $ do + let (tc_hsc_env, initial_types) = tc_env + type_env <- newIORef initial_types + let + tc_hsc_env_with_kv = tc_hsc_env { + hsc_type_env_vars = + knotVarsFromModuleEnv (mkModuleEnv [(this_mod, type_env)]) + } + core_binds <- initIfaceCheck (text "l") tc_hsc_env_with_kv $ + typecheckWholeCoreBindings type_env fi + tycons <- typeEnvTyCons <$> readIORef type_env + let cgi_guts = CgInteractiveGuts this_mod core_binds tycons NoStubs Nothing [] + trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> ppr this_mod) + generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env mod_iface details = + initWcbWithTcEnv tc_env hsc_env mod_iface + where + tc_env = (hscUpdateHPT add_hmi hsc_env, md_types details) + + add_hmi hpt = + addToHpt hpt (moduleName $ mi_module mod_iface) + (HomeModInfo mod_iface details emptyHomeModInfoLinkable) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env iface lnk = do + details <- genModDetails hsc_env iface + initWcbWithTcEnv (hsc_env, md_types details) hsc_env iface lnk + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "load core bindings") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== ===================================== testsuite/tests/bytecode/T25090/A.hs ===================================== @@ -0,0 +1,7 @@ +{-# language TemplateHaskell #-} +module Main where + +import D + +main :: IO () +main = putStrLn (show ($splc :: Int)) ===================================== testsuite/tests/bytecode/T25090/B.hs ===================================== @@ -0,0 +1,5 @@ +module B where + +import {-# source #-} C (C) + +data B = B C ===================================== testsuite/tests/bytecode/T25090/C.hs ===================================== @@ -0,0 +1,8 @@ +module C where + +import B + +data C = C Int + +b :: B +b = B (C 2024) ===================================== testsuite/tests/bytecode/T25090/C.hs-boot ===================================== @@ -0,0 +1,3 @@ +module C where + +data C ===================================== testsuite/tests/bytecode/T25090/D.hs ===================================== @@ -0,0 +1,12 @@ +module D where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +import B +import C + +splc :: ExpQ +splc = + lift @_ @Int num + where + B (C num) = b ===================================== testsuite/tests/bytecode/T25090/Makefile ===================================== @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T25090: + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs-boot + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic B.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic D.hs + $(TEST_HC) -c -fbyte-code-and-object-code -fprefer-byte-code -dynamic A.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code D.o A.o -o exe + ./exe ===================================== testsuite/tests/bytecode/T25090/T25090.stdout ===================================== @@ -0,0 +1 @@ +2024 ===================================== testsuite/tests/bytecode/T25090/all.T ===================================== @@ -0,0 +1,7 @@ +test('T25090', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + ignore_stderr, + ], + makefile_test, + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b3a28c30c4825c86eea7a5e37f2e227959c86d87...e7fdd33f6b7359e149509e0b16fb076800c5fecd -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b3a28c30c4825c86eea7a5e37f2e227959c86d87...e7fdd33f6b7359e149509e0b16fb076800c5fecd You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 20:51:01 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Tue, 30 Jul 2024 16:51:01 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 2 commits: Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66a95235e7fb0_38baa2113eb0821f4@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: 1478aa2e by Cheng Shao at 2024-07-30T22:50:47+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - 96ec9368 by Torsten Schmits at 2024-07-30T22:50:47+02:00 add test - - - - - 20 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h - + testsuite/tests/bytecode/T25090/A.hs - + testsuite/tests/bytecode/T25090/B.hs - + testsuite/tests/bytecode/T25090/C.hs - + testsuite/tests/bytecode/T25090/C.hs-boot - + testsuite/tests/bytecode/T25090/D.hs - + testsuite/tests/bytecode/T25090/Makefile - + testsuite/tests/bytecode/T25090/T25090.stdout - + testsuite/tests/bytecode/T25090/all.T Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -976,24 +978,34 @@ loadByteCode iface mod_sum = do -- Compilers -------------------------------------------------------------- +add_iface_to_hpt :: ModIface -> ModDetails -> HscEnv -> HscEnv +add_iface_to_hpt iface details = + hscUpdateHPT $ \ hpt -> + addToHpt hpt (moduleName (mi_module iface)) + (HomeModInfo iface details emptyHomeModInfoLinkable) -- Knot tying! See Note [Knot-tying typecheckIface] -- See Note [ModDetails and --make mode] initModDetails :: HscEnv -> ModIface -> IO ModDetails initModDetails hsc_env iface = fixIO $ \details' -> do - let act hpt = addToHpt hpt (moduleName $ mi_module iface) - (HomeModInfo iface details' emptyHomeModInfoLinkable) - let !hsc_env' = hscUpdateHPT act hsc_env + let !hsc_env' = add_iface_to_hpt iface details' hsc_env -- NB: This result is actually not that useful -- in one-shot mode, since we're not going to do -- any further typechecking. It's much more useful -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWcbWithTcEnv :: + (HscEnv, TypeEnv) -> + HscEnv -> + ModIface -> + ModDetails -> + Linkable -> + IO Linkable +initWcbWithTcEnv tc_env hsc_env mod_iface details (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1006,23 +1018,41 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do bytecode_uls <- for uls go pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where - go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } - -- The bytecode generation itself is lazy because otherwise even when doing - -- recompilation checking the bytecode will be generated (which slows things down a lot) - -- the laziness is OK because generateByteCode just depends on things already loaded - -- in the interface file. - LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] - trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) - generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) + go (CoreBindings fi) = + -- The bytecode generation itself is lazy because otherwise even when doing + -- recompilation checking the bytecode will be generated (which slows things down a lot) + -- the laziness is OK because generateByteCode just depends on things already loaded + -- in the interface file. + LoadedBCOs <$> (unsafeInterleaveIO $ do + let (tc_hsc_env, iface_types) = tc_env + type_env <- newIORef iface_types + let + tc_hsc_env_with_kv = tc_hsc_env { + hsc_type_env_vars = + knotVarsFromModuleEnv (mkModuleEnv [(this_mod, type_env)]) + } + core_binds <- initIfaceCheck (text "l") tc_hsc_env_with_kv $ + typecheckWholeCoreBindings type_env fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> ppr this_mod) + generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env iface details = + initWcbWithTcEnv tc_env hsc_env iface details + where + tc_env = (add_iface_to_hpt iface details hsc_env, md_types details) + +-- | Hydrate core bindings for a module in the external package state. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env iface lnk = do + details <- genModDetails hsc_env iface + initWcbWithTcEnv (hsc_env, md_types details) hsc_env iface details lnk + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/IfaceToCore.hs ===================================== @@ -897,7 +897,7 @@ tcTopIfaceBindings ty_var ver_decls let all_ids :: [Id] = concatMap toList int liftIO $ modifyIORef ty_var (flip extendTypeEnvList (map AnId all_ids)) - extendIfaceIdEnv all_ids $ mapM (tc_iface_bindings) int + extendIfaceIdEnv all_ids $ mapM tc_iface_bindings int tcTopBinders :: IfaceBindingX a IfaceTopBndrInfo -> IfL (IfaceBindingX a Id) tcTopBinders = traverse mk_top_id ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "load core bindings") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== ===================================== testsuite/tests/bytecode/T25090/A.hs ===================================== @@ -0,0 +1,7 @@ +{-# language TemplateHaskell #-} +module Main where + +import D + +main :: IO () +main = putStrLn (show ($splc :: Int)) ===================================== testsuite/tests/bytecode/T25090/B.hs ===================================== @@ -0,0 +1,5 @@ +module B where + +import {-# source #-} C (C) + +data B = B C ===================================== testsuite/tests/bytecode/T25090/C.hs ===================================== @@ -0,0 +1,8 @@ +module C where + +import B + +data C = C Int + +b :: B +b = B (C 2024) ===================================== testsuite/tests/bytecode/T25090/C.hs-boot ===================================== @@ -0,0 +1,3 @@ +module C where + +data C ===================================== testsuite/tests/bytecode/T25090/D.hs ===================================== @@ -0,0 +1,12 @@ +module D where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +import B +import C + +splc :: ExpQ +splc = + lift @_ @Int num + where + B (C num) = b ===================================== testsuite/tests/bytecode/T25090/Makefile ===================================== @@ -0,0 +1,16 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T25090a: + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs-boot + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic B.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic D.hs + $(TEST_HC) -c -fbyte-code-and-object-code -fprefer-byte-code -dynamic A.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code D.o A.o -o exe + ./exe + +T25090b: + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code A -o exe -v0 + ./exe ===================================== testsuite/tests/bytecode/T25090/T25090.stdout ===================================== @@ -0,0 +1 @@ +2024 ===================================== testsuite/tests/bytecode/T25090/all.T ===================================== @@ -0,0 +1,15 @@ +test('T25090a', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + use_specs({'stdout': 'T25090.stdout'}), + ], + makefile_test, + []) + +test('T25090b', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + use_specs({'stdout': 'T25090.stdout'}), + ], + makefile_test, + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e7fdd33f6b7359e149509e0b16fb076800c5fecd...96ec9368ad7852ed1b190c0bde91fcc1d2fc6dbb -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e7fdd33f6b7359e149509e0b16fb076800c5fecd...96ec9368ad7852ed1b190c0bde91fcc1d2fc6dbb You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Tue Jul 30 23:25:07 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Tue, 30 Jul 2024 19:25:07 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Deriving-via one-shot strict state Monad instances Message-ID: <66a976535262a_38baa290430488615@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 0deab854 by Rodrigo Mesquita at 2024-07-30T19:24:59-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - ee5cfbf1 by Matthew Pickering at 2024-07-30T19:24:59-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - 11 changed files: - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs - testsuite/tests/driver/multipleHomeUnits/all.T - + testsuite/tests/driver/multipleHomeUnits/unitSame1 - + testsuite/tests/driver/multipleHomeUnits/unitSame2 Changes: ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -329,10 +329,12 @@ warnMissingHomeModules dflags targets mod_graph = -- Note also that we can't always infer the associated module name -- directly from the filename argument. See #13727. is_known_module mod = - (Map.lookup (moduleName (ms_mod mod)) mod_targets == Just (ms_unitid mod)) + is_module_target mod || maybe False is_file_target (ml_hs_file (ms_location mod)) + is_module_target mod = (moduleName (ms_mod mod), ms_unitid mod) `Set.member` mod_targets + is_file_target file = Set.member (withoutExt file) file_targets file_targets = Set.fromList (mapMaybe file_target targets) @@ -343,7 +345,7 @@ warnMissingHomeModules dflags targets mod_graph = TargetFile file _ -> Just (withoutExt (augmentByWorkingDirectory dflags file)) - mod_targets = Map.fromList (mod_target <$> targets) + mod_targets = Set.fromList (mod_target <$> targets) mod_target Target {targetUnitId, targetId} = case targetId of ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -218,6 +218,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -240,6 +240,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs ===================================== @@ -0,0 +1 @@ +module T25122 where ===================================== testsuite/tests/driver/multipleHomeUnits/all.T ===================================== @@ -71,6 +71,11 @@ test('multipleHomeUnits_shared', [extra_files([ 'A.hs', 'unitShared1', 'unitShar test('multipleHomeUnits_shared_ghci', [extra_files([ 'shared.script', 'A.hs', 'unitShared1', 'unitShared2']), extra_run_opts('-unit @unitShared1 -unit @unitShared2')], ghci_script, ['shared.script']) +test('T25122', + [ extra_files( + [ 'T25122', 'unitSame1', 'unitSame2']) + ], multiunit_compile, [['unitSame1', 'unitSame2'], '-v0 -fhide-source-paths -Werror -Wmissing-home-modules']) + ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame1 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=s1 ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame2 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=u2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2404743c2e6ecd00165cb22a09aa619cd3ea0c6f...ee5cfbf15522a5b5ed71468afbdc9e2387a5f850 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2404743c2e6ecd00165cb22a09aa619cd3ea0c6f...ee5cfbf15522a5b5ed71468afbdc9e2387a5f850 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 00:26:49 2024 From: gitlab at gitlab.haskell.org (Brandon Chinn (@brandonchinn178)) Date: Tue, 30 Jul 2024 20:26:49 -0400 Subject: [Git][ghc/ghc][wip/multiline-strings] Implement MultilineStrings (#24390) Message-ID: <66a984c9d8338_38baa2d9f300941bf@gitlab.mail> Brandon Chinn pushed to branch wip/multiline-strings at Glasgow Haskell Compiler / GHC Commits: b04c81ad by Brandon Chinn at 2024-07-30T17:17:44-07:00 Implement MultilineStrings (#24390) This commit adds support for multiline strings, proposed at https://github.com/ghc-proposals/ghc-proposals/pull/569. Multiline strings can now be written as: myString = """ this is a multiline string """ The multiline string will have leading indentation stripped away. Full details of this post-processing may be found at the new GHC.Parser.String module. In order to cleanly implement this and maximize reusability, I broke out the lexing logic for strings out of Lexer.x into a new GHC.Parser.String module, which lexes strings with any provided "get next character" function. This also gave us the opportunity to clean up this logic, and even optimize it a bit. With this change, parsing string literals now takes 25% less time and 25% less space. - - - - - 30 changed files: - compiler/GHC/Driver/Flags.hs - compiler/GHC/Hs/Lit.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/CharClass.hs - compiler/GHC/Parser/Lexer.x - + compiler/GHC/Parser/String.hs - compiler/GHC/Rename/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs - compiler/Language/Haskell/Syntax/Lit.hs - compiler/ghc.cabal.in - docs/users_guide/9.12.1-notes.rst - docs/users_guide/exts/literals.rst - + docs/users_guide/exts/multiline_strings.rst - libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/driver/T4437.hs - testsuite/tests/interface-stability/template-haskell-exports.stdout - + testsuite/tests/parser/should_fail/MultilineStringsError.hs - + testsuite/tests/parser/should_fail/MultilineStringsError.stderr - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.hs - + testsuite/tests/parser/should_fail/MultilineStringsInnerTab.stderr - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.hs - + testsuite/tests/parser/should_fail/MultilineStringsSmartQuotes.stderr - testsuite/tests/parser/should_fail/all.T - + testsuite/tests/parser/should_run/MultilineStrings.hs - + testsuite/tests/parser/should_run/MultilineStrings.stdout - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.hs - + testsuite/tests/parser/should_run/MultilineStringsOverloaded.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b04c81adf063041984838fbdd41bb0ee0699f2de -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b04c81adf063041984838fbdd41bb0ee0699f2de You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 07:11:07 2024 From: gitlab at gitlab.haskell.org (Zubin (@wz1000)) Date: Wed, 31 Jul 2024 03:11:07 -0400 Subject: [Git][ghc/ghc][wip/hadddock-libraries] 27 commits: Improve docs for NondecreasingIndentation Message-ID: <66a9e38be8346_d690a9b94c38957@gitlab.mail> Zubin pushed to branch wip/hadddock-libraries at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 0d3c6e6d by Zubin Duggal at 2024-07-31T12:41:00+05:30 haddock: Build haddock-api and haddock-library using hadrian We build these two packages as regular boot library dependencies rather than using the `in-ghc-tree` flag to include the source files into the haddock executable. The `in-ghc-tree` flag is moved into haddock-api to ensure that haddock built from hackage can still find the location of the GHC bindist using `ghc-paths`. Addresses #24834 This causes a metric decrease under non-release flavours because under these flavours libraries are compiled with optimisation but executables are not. Since we move the bulk of the code from the haddock executable to the haddock-api library, we see a metric decrease on the validate flavours. Metric Decrease: haddock.Cabal haddock.base haddock.compiler - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/HsToCore/Utils.hs - compiler/GHC/Iface/Make.hs - compiler/GHC/Iface/Recomp/Flags.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/IfaceToCore.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/079e159a85faebceaa793ecfe19d0056eb539b27...0d3c6e6df999450568f89c6ed76493e639bdcee2 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/079e159a85faebceaa793ecfe19d0056eb539b27...0d3c6e6df999450568f89c6ed76493e639bdcee2 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 08:22:12 2024 From: gitlab at gitlab.haskell.org (Serge S. Gulin (@gulin.serge)) Date: Wed, 31 Jul 2024 04:22:12 -0400 Subject: [Git][ghc/ghc][wip/T25046_impl] 39 commits: Improve docs for NondecreasingIndentation Message-ID: <66a9f4344a4a_17293f8aa70749fd@gitlab.mail> Serge S. Gulin pushed to branch wip/T25046_impl at Glasgow Haskell Compiler / GHC Commits: 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 9c783f18 by Serge S. Gulin at 2024-07-31T11:21:25+03:00 testsuite: extend size performance tests with gzip (fixes #25046) The main purpose is to create tests for minimal app (hello world and its variations, i.e. unicode used) distribution size metric. Many platforms support distribution in compressed form via gzip. It would be nice to collect information on how much size is taken by the executional bundle for each platform at minimal edge case. 2 groups of tests are added: 1. We extend javascript backend size tests with gzip-enabled versions for all cases where an optimizing compiler is used (for now it is google closure compiler). 2. We add trivial hello world tests with gzip-enabled versions for all other platforms at CI pipeline where no external optimizing compiler is used. - - - - - 30 changed files: - .gitlab-ci.yml - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unify.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Env.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/Session.hs - + compiler/GHC/Hs/Basic.hs - compiler/GHC/Hs/Dump.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f504ffc45e9565ec872b4bf17286208a858aca8e...9c783f18272fc89970e82b8b3cc8b3e1e28ad8a1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f504ffc45e9565ec872b4bf17286208a858aca8e...9c783f18272fc89970e82b8b3cc8b3e1e28ad8a1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 08:56:12 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 31 Jul 2024 04:56:12 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: Deriving-via one-shot strict state Monad instances Message-ID: <66a9fc2cdfc39_17293f3ed1408672a@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 34432558 by Rodrigo Mesquita at 2024-07-31T04:55:50-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - 17d4c72f by Sylvain Henry at 2024-07-31T04:56:02-04:00 Only lookup ghcversion.h file in the RTS include-dirs by default. The code was introduced in 3549c952b535803270872adaf87262f2df0295a4. It used `getPackageIncludePath` which name doesn't convey that it looks into all include paths of the preload units too. So this behavior is probably unintentional and it should be ok to change it. Fix #25106 - - - - - 847e8052 by Matthew Pickering at 2024-07-31T04:56:03-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - 12 changed files: - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/SysTools/Cpp.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs - testsuite/tests/driver/multipleHomeUnits/all.T - + testsuite/tests/driver/multipleHomeUnits/unitSame1 - + testsuite/tests/driver/multipleHomeUnits/unitSame2 Changes: ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -329,10 +329,12 @@ warnMissingHomeModules dflags targets mod_graph = -- Note also that we can't always infer the associated module name -- directly from the filename argument. See #13727. is_known_module mod = - (Map.lookup (moduleName (ms_mod mod)) mod_targets == Just (ms_unitid mod)) + is_module_target mod || maybe False is_file_target (ml_hs_file (ms_location mod)) + is_module_target mod = (moduleName (ms_mod mod), ms_unitid mod) `Set.member` mod_targets + is_file_target file = Set.member (withoutExt file) file_targets file_targets = Set.fromList (mapMaybe file_target targets) @@ -343,7 +345,7 @@ warnMissingHomeModules dflags targets mod_graph = TargetFile file _ -> Just (withoutExt (augmentByWorkingDirectory dflags file)) - mod_targets = Map.fromList (mod_target <$> targets) + mod_targets = Set.fromList (mod_target <$> targets) mod_target Target {targetUnitId, targetId} = case targetId of ===================================== compiler/GHC/SysTools/Cpp.hs ===================================== @@ -263,11 +263,17 @@ generateMacros prefix name version = -- | Find out path to @ghcversion.h@ file getGhcVersionPathName :: DynFlags -> UnitEnv -> IO FilePath getGhcVersionPathName dflags unit_env = do - candidates <- case ghcVersionFile dflags of - Just path -> return [path] - Nothing -> do - ps <- mayThrowUnitErr (preloadUnitsInfo' unit_env [rtsUnitId]) - return (( "ghcversion.h") <$> collectIncludeDirs ps) + let candidates = case ghcVersionFile dflags of + -- the user has provided an explicit `ghcversion.h` file to use. + Just path -> [path] + -- otherwise, try to find it in the rts' include-dirs. + -- Note: only in the RTS include-dirs! not all preload units less we may + -- use a wrong file. See #25106 where a globally installed + -- /usr/include/ghcversion.h file was used instead of the one provided + -- by the rts. + Nothing -> case lookupUnitId (ue_units unit_env) rtsUnitId of + Nothing -> [] + Just info -> ( "ghcversion.h") <$> collectIncludeDirs [info] found <- filterM doesFileExist candidates case found of ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -218,6 +218,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -240,6 +240,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs ===================================== @@ -0,0 +1 @@ +module T25122 where ===================================== testsuite/tests/driver/multipleHomeUnits/all.T ===================================== @@ -71,6 +71,11 @@ test('multipleHomeUnits_shared', [extra_files([ 'A.hs', 'unitShared1', 'unitShar test('multipleHomeUnits_shared_ghci', [extra_files([ 'shared.script', 'A.hs', 'unitShared1', 'unitShared2']), extra_run_opts('-unit @unitShared1 -unit @unitShared2')], ghci_script, ['shared.script']) +test('T25122', + [ extra_files( + [ 'T25122', 'unitSame1', 'unitSame2']) + ], multiunit_compile, [['unitSame1', 'unitSame2'], '-v0 -fhide-source-paths -Werror -Wmissing-home-modules']) + ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame1 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=s1 ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame2 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=u2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ee5cfbf15522a5b5ed71468afbdc9e2387a5f850...847e805265f2fe06c1fb68abf1b009b5bb2e74d1 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ee5cfbf15522a5b5ed71468afbdc9e2387a5f850...847e805265f2fe06c1fb68abf1b009b5bb2e74d1 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 09:18:36 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 05:18:36 -0400 Subject: [Git][ghc/ghc][wip/kill-ioport] Kill IOPort# Message-ID: <66aa016c8317a_1d208a93a9436330@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kill-ioport at Glasgow Haskell Compiler / GHC Commits: 11956afe by Ben Gamari at 2024-07-31T10:18:24+01:00 Kill IOPort# This type is unnecessary, having been superceded by `MVar` and a rework of WinIO's blocking logic. See #20947. See https://github.com/haskell/core-libraries-committee/issues/213. - - - - - 30 changed files: - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Exts.hs - − libraries/base/src/GHC/IOPort.hs - libraries/ghc-heap/GHC/Exts/Heap/Closures.hs - libraries/ghc-internal/ghc-internal.cabal - libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc - libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Exts.hs - libraries/ghc-internal/src/GHC/Internal/IO/Buffer.hs - libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc - − libraries/ghc-internal/src/GHC/Internal/IOPort.hs - libraries/ghc-prim/GHC/Prim/PtrEq.hs - libraries/ghc-prim/changelog.md - rts/Prelude.h - rts/PrimOps.cmm - rts/RtsSymbols.c - rts/external-symbols.list.in - rts/include/stg/MiscClosures.h - rts/include/stg/SMP.h - rts/win32/AsyncWinIO.c - rts/win32/libHSghc-internal.def - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/11956afe83e3ea7f4569651fdba5a080703ed896 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/11956afe83e3ea7f4569651fdba5a080703ed896 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 09:22:43 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 05:22:43 -0400 Subject: [Git][ghc/ghc][wip/clc216] base: Deprecate GHC.Desugar Message-ID: <66aa0263524ab_1d208a9ead437137@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: e5e8a162 by Ben Gamari at 2024-07-31T10:22:28+01:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.14. - - - - - 5 changed files: - compiler/GHC/Tc/Gen/Splice.hs - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Desugar.hs - libraries/ghci/GHCi/TH.hs Changes: ===================================== compiler/GHC/Tc/Gen/Splice.hs ===================================== @@ -136,8 +136,8 @@ import qualified GHC.Internal.TH.Syntax as TH import qualified GHC.Internal.TH.Ppr as TH #if defined(HAVE_INTERNAL_INTERPRETER) --- Because GHC.Desugar might not be in the base library of the bootstrapping compiler -import GHC.Desugar ( AnnotationWrapper(..) ) +-- Because GHC.Internal.Desugar might not be in the base library of the bootstrapping compiler +import GHC.Internal.Desugar ( AnnotationWrapper(..) ) import Unsafe.Coerce ( unsafeCoerce ) #endif ===================================== libraries/base/base.cabal ===================================== @@ -55,6 +55,7 @@ Library , Data.Ratio , Data.STRef.Lazy , Data.Semigroup + , GHC.Desugar , Prelude , Text.Printf , System.CPUTime @@ -156,7 +157,6 @@ Library , GHC.Conc.Sync , GHC.ConsoleHandler , GHC.Constants - , GHC.Desugar , GHC.Encoding.UTF8 , GHC.Enum , GHC.Environment ===================================== libraries/base/changelog.md ===================================== @@ -1,6 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) ## 4.21.0.0 *TBA* + * `GHC.Desugar` has been deprecated and should be removed in GHC 9.14. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -1,6 +1,8 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} +----------------------------------------------------------------------------- -- | -- -- Module : GHC.Desugar @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs at haskell.org --- Stability : internal +-- Stability : deprecated () -- Portability : non-portable (GHC extensions) -- -- Support code for desugaring in GHC @@ -18,11 +20,14 @@ -- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can -- change rapidly without much warning. -- +----------------------------------------------------------------------------- + +#if __GLASGOW_HASKELL >= 912 +#error "GHC.Desugar should be removed in GHC 9.12" +#endif module GHC.Desugar - ((>>>), - AnnotationWrapper(..), - toAnnotationWrapper - ) where + {-# DEPRECATED ["GHC.Desugar is deprecated and should be removed in GHC 9.12.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} + ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import GHC.Internal.Desugar ===================================== libraries/ghci/GHCi/TH.hs ===================================== @@ -109,7 +109,7 @@ import Data.IORef import Data.Map (Map) import qualified Data.Map as M import Data.Maybe -import GHC.Desugar +import GHC.Internal.Desugar import qualified GHC.Internal.TH.Syntax as TH import Unsafe.Coerce View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e5e8a16295e6c75e7a50c40fd97c47faac4b35d7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e5e8a16295e6c75e7a50c40fd97c47faac4b35d7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 12:17:59 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 31 Jul 2024 08:17:59 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/libffi-dep-hadrian Message-ID: <66aa2b7737e77_e0ba629097867117@gitlab.mail> Matthew Pickering pushed new branch wip/libffi-dep-hadrian at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/libffi-dep-hadrian You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 12:18:52 2024 From: gitlab at gitlab.haskell.org (Andrei Borzenkov (@sand-witch)) Date: Wed, 31 Jul 2024 08:18:52 -0400 Subject: [Git][ghc/ghc][wip/sand-witch/types-in-terms] Type syntax in expressions (24159, 24572, 24226) Message-ID: <66aa2bac64220_e0ba62c24dc692dd@gitlab.mail> Andrei Borzenkov pushed to branch wip/sand-witch/types-in-terms at Glasgow Haskell Compiler / GHC Commits: 568c8bfc by Andrei Borzenkov at 2024-07-31T16:16:44+04:00 Type syntax in expressions (24159, 24572, 24226) This patch extends the grammar of expressions with syntax that is typically found only in types: * function types (a -> b), (a ->. b), (a %m -> b) * constrained types (ctx => t) * forall-quantification (forall tvs. t) The new forms are guarded behind the RequiredTypeArguments extension, as specified in GHC Proposal #281. Examples: {-# LANGUAGE RequiredTypeArguments #-} e1 = f (Int -> String) -- function type e2 = f (Int %1 -> String) -- linear function type e3 = f (forall a. Bounded a => a) -- forall type, constraint The GHC AST and the TH AST have been extended as follows: syntax | HsExpr | TH.Exp ---------------+----------+-------------- a -> b | HsFunArr | ConE (->) a %m -> b | HsFunArr | ConE FUN ctx => t | HsQual | ConstrainedE forall a. t | HsForAll | ForallE forall a -> t | HsForAll | ForallVisE Additionally, a new warning flag -Wview-pattern-signatures has been introduced to aid with migration to the new precedence of (e -> p :: t). Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com> - - - - - 30 changed files: - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Pat.hs - compiler/GHC/Hs/Syn/Type.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/HsType.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Hint.hs - compiler/GHC/Types/Hint/Ppr.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/568c8bfc2e48b2c80ee4b15c7cc698e1b27145a7 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/568c8bfc2e48b2c80ee4b15c7cc698e1b27145a7 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 12:18:55 2024 From: gitlab at gitlab.haskell.org (Matthew Pickering (@mpickering)) Date: Wed, 31 Jul 2024 08:18:55 -0400 Subject: [Git][ghc/ghc][wip/libffi-dep-hadrian] hadrian: Make sure ffi headers are built before using a compiler Message-ID: <66aa2baf27700_e0ba62c8f0869487@gitlab.mail> Matthew Pickering pushed to branch wip/libffi-dep-hadrian at Glasgow Haskell Compiler / GHC Commits: 84c97b40 by Matthew Pickering at 2024-07-31T13:18:27+01:00 hadrian: Make sure ffi headers are built before using a compiler When we are using ffi adjustors then we rely on `ffi.h` and `ffitarget.h` files during code generation when compiling stubs. Therefore we need to add this dependency to the build system (which this patch does). Reproducer, configure with `--enable-libffi-adjustors` and then build "_build/stage1/libraries/ghc-prim/build/GHC/Types.p_o". Observe that this fails before this patch and works afterwards. Fixes #24864 - - - - - 1 changed file: - hadrian/src/Builder.hs Changes: ===================================== hadrian/src/Builder.hs ===================================== @@ -237,16 +237,24 @@ instance H.Builder Builder where -- changes (#18001). _bootGhcVersion <- setting GhcVersion pure [] - Ghc {} -> do + Ghc _ st -> do root <- buildRoot unlitPath <- builderPath Unlit distro_mingw <- settingsFileSetting ToolchainSetting_DistroMinGW + libffi_adjustors <- useLibffiForAdjustors return $ [ unlitPath ] ++ [ root -/- mingwStamp | windowsHost, distro_mingw == "NO" ] -- proxy for the entire mingw toolchain that -- we have in inplace/mingw initially, and then at -- root -/- mingw. + -- ffi.h needed by the compiler when using libffi_adjustors (#24864) + -- It would be nicer to not duplicate this logic between here + -- and needRtsLibffiTargets and libffiHeaderFiles but this doesn't change + -- very often. + ++ [ root -/- buildDir (rtsContext st) -/- "include" -/- header + | header <- ["ffi.h", "ffitarget.h"] + , libffi_adjustors ] Hsc2Hs stage -> (\p -> [p]) <$> templateHscPath stage Make dir -> return [dir -/- "Makefile"] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84c97b40fc8af6db28116d3547d5eb9b5856eec0 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84c97b40fc8af6db28116d3547d5eb9b5856eec0 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 12:40:38 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Wed, 31 Jul 2024 08:40:38 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] 2 commits: Link bytecode from interface-stored core bindings in oneshot mode Message-ID: <66aa30c665b1d_e0ba65d2230725cc@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: bed5faae by Cheng Shao at 2024-07-31T14:40:11+02:00 Link bytecode from interface-stored core bindings in oneshot mode If the flag `-fprefer-byte-code` is given when compiling a module containing TH, GHC will use core bindings stored in interfaces to compile and link bytecode for splices. This was only implemented for `--make` mode initially, so this commit adds the same mechanism to oneshot mode (`-c`). - - - - - 313cd392 by Torsten Schmits at 2024-07-31T14:40:11+02:00 add test - - - - - 20 changed files: - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main.hs-boot - compiler/GHC/Iface/Load.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - testsuite/tests/bytecode/T24634/Hello.hs - testsuite/tests/bytecode/T24634/Makefile - testsuite/tests/bytecode/T24634/T24634.stdout - testsuite/tests/bytecode/T24634/all.T - testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c - testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h - + testsuite/tests/bytecode/T25090/A.hs - + testsuite/tests/bytecode/T25090/B.hs - + testsuite/tests/bytecode/T25090/C.hs - + testsuite/tests/bytecode/T25090/C.hs-boot - + testsuite/tests/bytecode/T25090/D.hs - + testsuite/tests/bytecode/T25090/Makefile - + testsuite/tests/bytecode/T25090/T25090.stdout - + testsuite/tests/bytecode/T25090/all.T Changes: ===================================== compiler/GHC/Driver/Main.hs ===================================== @@ -50,6 +50,7 @@ module GHC.Driver.Main , HscBackendAction (..), HscRecompStatus (..) , initModDetails , initWholeCoreBindings + , initWholeCoreBindingsEps , hscMaybeWriteIface , hscCompileCmmFile @@ -106,6 +107,7 @@ module GHC.Driver.Main , showModuleIndex , hscAddSptEntries , writeInterfaceOnlyMode + , loadByteCode ) where import GHC.Prelude @@ -976,24 +978,34 @@ loadByteCode iface mod_sum = do -- Compilers -------------------------------------------------------------- +add_iface_to_hpt :: ModIface -> ModDetails -> HscEnv -> HscEnv +add_iface_to_hpt iface details = + hscUpdateHPT $ \ hpt -> + addToHpt hpt (moduleName (mi_module iface)) + (HomeModInfo iface details emptyHomeModInfoLinkable) -- Knot tying! See Note [Knot-tying typecheckIface] -- See Note [ModDetails and --make mode] initModDetails :: HscEnv -> ModIface -> IO ModDetails initModDetails hsc_env iface = fixIO $ \details' -> do - let act hpt = addToHpt hpt (moduleName $ mi_module iface) - (HomeModInfo iface details' emptyHomeModInfoLinkable) - let !hsc_env' = hscUpdateHPT act hsc_env + let !hsc_env' = add_iface_to_hpt iface details' hsc_env -- NB: This result is actually not that useful -- in one-shot mode, since we're not going to do -- any further typechecking. It's much more useful -- in make mode, since this HMI will go into the HPT. genModDetails hsc_env' iface --- Hydrate any WholeCoreBindings linkables into BCOs -initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable -initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do +-- | Hydrate any WholeCoreBindings linkables into BCOs, using the supplied +-- action to initialize the appropriate environment for type checking. +initWcbWithTcEnv :: + HscEnv -> + HscEnv -> + ModIface -> + ModDetails -> + Linkable -> + IO Linkable +initWcbWithTcEnv tc_env hsc_env mod_iface details (LM utc_time this_mod uls) = do -- If a module is compiled with -fbyte-code-and-object-code and it -- makes use of foreign stubs, then the interface file will also -- contain serialized stub dynamic objects, and we can simply write @@ -1006,23 +1018,40 @@ initWholeCoreBindings hsc_env mod_iface details (LM utc_time this_mod uls) = do bytecode_uls <- for uls go pure $ LM utc_time this_mod $ stub_uls ++ bytecode_uls where - go (CoreBindings fi) = do - let act hpt = addToHpt hpt (moduleName $ mi_module mod_iface) - (HomeModInfo mod_iface details emptyHomeModInfoLinkable) - types_var <- newIORef (md_types details) - let kv = knotVarsFromModuleEnv (mkModuleEnv [(this_mod, types_var)]) - let hsc_env' = hscUpdateHPT act hsc_env { hsc_type_env_vars = kv } - -- The bytecode generation itself is lazy because otherwise even when doing - -- recompilation checking the bytecode will be generated (which slows things down a lot) - -- the laziness is OK because generateByteCode just depends on things already loaded - -- in the interface file. - LoadedBCOs <$> (unsafeInterleaveIO $ do - core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckWholeCoreBindings types_var fi - let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] - trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> (ppr this_mod)) - generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) + go (CoreBindings fi) = + -- The bytecode generation itself is lazy because otherwise even when doing + -- recompilation checking the bytecode will be generated (which slows things down a lot) + -- the laziness is OK because generateByteCode just depends on things already loaded + -- in the interface file. + LoadedBCOs <$> (unsafeInterleaveIO $ do + type_env <- newIORef (md_types details) + let + tc_hsc_env_with_kv = tc_env { + hsc_type_env_vars = + knotVarsFromModuleEnv (mkModuleEnv [(this_mod, type_env)]) + } + core_binds <- initIfaceCheck (text "l") tc_hsc_env_with_kv $ + typecheckWholeCoreBindings type_env fi + let cgi_guts = CgInteractiveGuts this_mod core_binds (typeEnvTyCons (md_types details)) NoStubs Nothing [] + trace_if (hsc_logger hsc_env) (text "Generating ByteCode for" <+> ppr this_mod) + generateByteCode hsc_env cgi_guts (wcb_mod_location fi)) go ul = return ul +-- | Hydrate core bindings for a module in the home package table, for which we +-- can obtain a 'ModDetails'. +initWholeCoreBindings :: HscEnv -> ModIface -> ModDetails -> Linkable -> IO Linkable +initWholeCoreBindings hsc_env iface details = + initWcbWithTcEnv (add_iface_to_hpt iface details hsc_env) hsc_env iface details + +-- | Hydrate core bindings for a module in the external package state. +-- This is used for home modules as well when compiling in oneshot mode. +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable +initWholeCoreBindingsEps hsc_env iface lnk = do + -- details <- genModDetails hsc_env iface + details <- initIfaceLoadModule hsc_env (mi_module iface) (typecheckIface iface) + initWcbWithTcEnv hsc_env hsc_env iface details lnk + + {- Note [ModDetails and --make mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================== compiler/GHC/Driver/Main.hs-boot ===================================== @@ -0,0 +1,8 @@ +module GHC.Driver.Main where + +import GHC.Driver.Env +import GHC.Linker.Types +import GHC.Prelude +import GHC.Unit.Module.ModIface + +initWholeCoreBindingsEps :: HscEnv -> ModIface -> Linkable -> IO Linkable ===================================== compiler/GHC/Iface/Load.hs ===================================== @@ -513,11 +513,6 @@ loadInterface doc_str mod from ; new_eps_complete_matches <- tcIfaceCompleteMatches (mi_complete_matches iface) ; let final_iface = iface - & set_mi_decls (panic "No mi_decls in PIT") - & set_mi_insts (panic "No mi_insts in PIT") - & set_mi_fam_insts (panic "No mi_fam_insts in PIT") - & set_mi_rules (panic "No mi_rules in PIT") - & set_mi_anns (panic "No mi_anns in PIT") ; let bad_boot = mi_boot iface == IsBoot && isJust (lookupKnotVars (if_rec_types gbl_env) mod) ===================================== compiler/GHC/IfaceToCore.hs ===================================== @@ -897,7 +897,7 @@ tcTopIfaceBindings ty_var ver_decls let all_ids :: [Id] = concatMap toList int liftIO $ modifyIORef ty_var (flip extendTypeEnvList (map AnId all_ids)) - extendIfaceIdEnv all_ids $ mapM (tc_iface_bindings) int + extendIfaceIdEnv all_ids $ mapM tc_iface_bindings int tcTopBinders :: IfaceBindingX a IfaceTopBndrInfo -> IfL (IfaceBindingX a Id) tcTopBinders = traverse mk_top_id ===================================== compiler/GHC/Linker/Deps.hs ===================================== @@ -55,6 +55,11 @@ import qualified Data.Map as M import System.FilePath import System.Directory +import GHC.Driver.Env +import {-# SOURCE #-} GHC.Driver.Main +import Data.Time.Clock +import GHC.Driver.Flags +import GHC.Driver.Session data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files @@ -69,6 +74,7 @@ data LinkDepsOpts = LinkDepsOpts , ldWays :: !Ways -- ^ Enabled ways , ldLoadIface :: SDoc -> Module -> IO (MaybeErr MissingInterfaceError ModIface) -- ^ Interface loader function + , ldHscEnv :: !HscEnv } data LinkDeps = LinkDeps @@ -282,13 +288,27 @@ get_link_deps opts pls maybe_normal_osuf span mods = do Found loc mod -> found loc mod _ -> no_obj (moduleName mod) where - found loc mod = do { - -- ...and then find the linkable for it - mb_lnk <- findObjectLinkableMaybe mod loc ; - case mb_lnk of { - Nothing -> no_obj mod ; - Just lnk -> adjust_linkable lnk - }} + found loc mod + | prefer_bytecode = do + Succeeded iface <- ldLoadIface opts (text "load core bindings") mod + case mi_extra_decls iface of + Just extra_decls -> do + t <- getCurrentTime + initWholeCoreBindingsEps hsc_env iface $ LM t mod [CoreBindings $ WholeCoreBindings extra_decls mod undefined] + _ -> fallback_no_bytecode loc mod + | otherwise = fallback_no_bytecode loc mod + + fallback_no_bytecode loc mod = do + mb_lnk <- findObjectLinkableMaybe mod loc + case mb_lnk of + Nothing -> no_obj mod + Just lnk -> adjust_linkable lnk + + prefer_bytecode = gopt Opt_UseBytecodeRatherThanObjects dflags + + dflags = hsc_dflags hsc_env + + hsc_env = ldHscEnv opts adjust_linkable lnk | Just new_osuf <- maybe_normal_osuf = do ===================================== compiler/GHC/Linker/Loader.hs ===================================== @@ -648,6 +648,7 @@ initLinkDepsOpts hsc_env = opts , ldUseByteCode = gopt Opt_UseBytecodeRatherThanObjects dflags , ldMsgOpts = initIfaceMessageOpts dflags , ldWays = ways dflags + , ldHscEnv = hsc_env } dflags = hsc_dflags hsc_env load_iface msg mod = initIfaceCheck (text "loader") hsc_env ===================================== testsuite/tests/bytecode/T24634/Hello.hs ===================================== @@ -7,7 +7,7 @@ module Hello where import Language.Haskell.TH import Language.Haskell.TH.Syntax -foreign import capi "hello.h say_hello" say_hello :: IO Int +foreign import capi "hello_c.h say_hello" say_hello :: IO Int mkHello :: DecsQ mkHello = do ===================================== testsuite/tests/bytecode/T24634/Makefile ===================================== @@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T24634: - $(TEST_HC) -c -dynamic hello.c -o hello.o + $(TEST_HC) -c -dynamic hello_c.c -o hello_c.o $(TEST_HC) -c -fbyte-code-and-object-code Hello.hs - $(TEST_HC) -fprefer-byte-code hello.o Main.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code hello_c.o Main.hs ./Main ===================================== testsuite/tests/bytecode/T24634/T24634.stdout ===================================== @@ -1,3 +1,3 @@ -[2 of 3] Compiling Main ( Main.hs, Main.o ) +[2 of 3] Compiling Main ( Main.hs, Main.o, interpreted ) [3 of 3] Linking Main 42 ===================================== testsuite/tests/bytecode/T24634/all.T ===================================== @@ -1,8 +1,17 @@ +# Skipping this on debug compilers because of a pipeline failure in `x86_64-linux-deb12-numa-slow-validate`: +# +# WARNING: +# CorePrep: silly extra arguments: +# say_hello +# Call stack: +# CallStack (from HasCallStack): +# warnPprTrace, called at compiler/GHC/CoreToStg/Prep.hs:: in :GHC.CoreToStg.Prep + test('T24634', - [extra_files(['hello.h', 'hello.c', 'Hello.hs', 'Main.hs']), + [extra_files(['hello_c.h', 'hello_c.c', 'Hello.hs', 'Main.hs']), req_c, req_th, - ignore_stderr + when(compiler_debugged(), skip), ], makefile_test, []) ===================================== testsuite/tests/bytecode/T24634/hello.c → testsuite/tests/bytecode/T24634/hello_c.c ===================================== @@ -1,4 +1,4 @@ -#include "hello.h" +#include "hello_c.h" int say_hello() { return 42; ===================================== testsuite/tests/bytecode/T24634/hello.h → testsuite/tests/bytecode/T24634/hello_c.h ===================================== ===================================== testsuite/tests/bytecode/T25090/A.hs ===================================== @@ -0,0 +1,7 @@ +{-# language TemplateHaskell #-} +module Main where + +import D + +main :: IO () +main = putStrLn (show ($splc :: Int)) ===================================== testsuite/tests/bytecode/T25090/B.hs ===================================== @@ -0,0 +1,5 @@ +module B where + +import {-# source #-} C (C) + +data B = B C ===================================== testsuite/tests/bytecode/T25090/C.hs ===================================== @@ -0,0 +1,8 @@ +module C where + +import B + +data C = C Int + +b :: B +b = B (C 2024) ===================================== testsuite/tests/bytecode/T25090/C.hs-boot ===================================== @@ -0,0 +1,3 @@ +module C where + +data C ===================================== testsuite/tests/bytecode/T25090/D.hs ===================================== @@ -0,0 +1,12 @@ +module D where + +import Language.Haskell.TH (ExpQ) +import Language.Haskell.TH.Syntax (lift) +import B +import C + +splc :: ExpQ +splc = + lift @_ @Int num + where + B (C num) = b ===================================== testsuite/tests/bytecode/T25090/Makefile ===================================== @@ -0,0 +1,16 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T25090a: + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs-boot + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic B.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic C.hs + $(TEST_HC) -c -fbyte-code-and-object-code -dynamic D.hs + $(TEST_HC) -c -fbyte-code-and-object-code -fprefer-byte-code -dynamic A.hs + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code D.o C.o B.o A.o -o exe + ./exe + +T25090b: + $(TEST_HC) -fbyte-code-and-object-code -fprefer-byte-code A -o exe -v0 + ./exe ===================================== testsuite/tests/bytecode/T25090/T25090.stdout ===================================== @@ -0,0 +1 @@ +2024 ===================================== testsuite/tests/bytecode/T25090/all.T ===================================== @@ -0,0 +1,15 @@ +test('T25090a', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + use_specs({'stdout': 'T25090.stdout'}), + ], + makefile_test, + []) + +test('T25090b', + [extra_files(['A.hs', 'B.hs', 'C.hs-boot', 'C.hs', 'D.hs']), + req_th, + use_specs({'stdout': 'T25090.stdout'}), + ], + makefile_test, + []) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96ec9368ad7852ed1b190c0bde91fcc1d2fc6dbb...313cd392b03cb5ec51d7378867b0a8e990134335 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/96ec9368ad7852ed1b190c0bde91fcc1d2fc6dbb...313cd392b03cb5ec51d7378867b0a8e990134335 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 13:51:00 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 09:51:00 -0400 Subject: [Git][ghc/ghc][wip/clc216] base: Deprecate GHC.Desugar Message-ID: <66aa4144334ac_17fa233e8f28608a4@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 5fcad2f9 by Ben Gamari at 2024-07-31T14:50:48+01:00 base: Deprecate GHC.Desugar See https://github.com/haskell/core-libraries-committee/issues/216. This will be removed in GHC 9.14. - - - - - 6 changed files: - compiler/GHC/Tc/Gen/Splice.hs - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Desugar.hs - libraries/ghci/GHCi/TH.hs - libraries/ghci/ghci.cabal.in Changes: ===================================== compiler/GHC/Tc/Gen/Splice.hs ===================================== @@ -136,8 +136,8 @@ import qualified GHC.Internal.TH.Syntax as TH import qualified GHC.Internal.TH.Ppr as TH #if defined(HAVE_INTERNAL_INTERPRETER) --- Because GHC.Desugar might not be in the base library of the bootstrapping compiler -import GHC.Desugar ( AnnotationWrapper(..) ) +-- Because GHC.Internal.Desugar might not be in the base library of the bootstrapping compiler +import GHC.Internal.Desugar ( AnnotationWrapper(..) ) import Unsafe.Coerce ( unsafeCoerce ) #endif ===================================== libraries/base/base.cabal ===================================== @@ -55,6 +55,7 @@ Library , Data.Ratio , Data.STRef.Lazy , Data.Semigroup + , GHC.Desugar , Prelude , Text.Printf , System.CPUTime @@ -156,7 +157,6 @@ Library , GHC.Conc.Sync , GHC.ConsoleHandler , GHC.Constants - , GHC.Desugar , GHC.Encoding.UTF8 , GHC.Enum , GHC.Environment ===================================== libraries/base/changelog.md ===================================== @@ -1,6 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) ## 4.21.0.0 *TBA* + * `GHC.Desugar` has been deprecated and should be removed in GHC 9.14. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -1,6 +1,8 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} {-# OPTIONS_HADDOCK not-home #-} +----------------------------------------------------------------------------- -- | -- -- Module : GHC.Desugar @@ -8,7 +10,7 @@ -- License : see libraries/base/LICENSE -- -- Maintainer : ghc-devs at haskell.org --- Stability : internal +-- Stability : deprecated () -- Portability : non-portable (GHC extensions) -- -- Support code for desugaring in GHC @@ -18,11 +20,14 @@ -- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can -- change rapidly without much warning. -- +----------------------------------------------------------------------------- + +#if __GLASGOW_HASKELL >= 912 +#error "GHC.Desugar should be removed in GHC 9.12" +#endif module GHC.Desugar - ((>>>), - AnnotationWrapper(..), - toAnnotationWrapper - ) where + {-# DEPRECATED ["GHC.Desugar is deprecated and should be removed in GHC 9.12.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} + ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import GHC.Internal.Desugar ===================================== libraries/ghci/GHCi/TH.hs ===================================== @@ -109,7 +109,7 @@ import Data.IORef import Data.Map (Map) import qualified Data.Map as M import Data.Maybe -import GHC.Desugar +import GHC.Internal.Desugar (AnnotationWrapper(..)) import qualified GHC.Internal.TH.Syntax as TH import Unsafe.Coerce ===================================== libraries/ghci/ghci.cabal.in ===================================== @@ -85,6 +85,7 @@ library rts, array == 0.5.*, base >= 4.8 && < 4.21, + ghc-internal == @ProjectVersionMunged@, ghc-prim >= 0.5.0 && < 0.12, binary == 0.8.*, bytestring >= 0.10 && < 0.13, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fcad2f9e868322fa4ab93de150116b1caa83450 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fcad2f9e868322fa4ab93de150116b1caa83450 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 15:00:23 2024 From: gitlab at gitlab.haskell.org (Torsten Schmits (@torsten.schmits)) Date: Wed, 31 Jul 2024 11:00:23 -0400 Subject: [Git][ghc/ghc][wip/T24634-oneshot-bytecode] try without forced dynamic Message-ID: <66aa518768437_1c8dbb3c6b947164b@gitlab.mail> Torsten Schmits pushed to branch wip/T24634-oneshot-bytecode at Glasgow Haskell Compiler / GHC Commits: c26c2ed7 by Torsten Schmits at 2024-07-31T16:59:26+02:00 try without forced dynamic - - - - - 1 changed file: - compiler/GHC/Driver/Pipeline/Execute.hs Changes: ===================================== compiler/GHC/Driver/Pipeline/Execute.hs ===================================== @@ -587,12 +587,9 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do -- When compiling with -fprefer-byte-code, always -- compile foreign stubs as shared objects to ensure -- they can be properly loaded. - let hsc_env_stub - | gopt Opt_WriteIfSimplifiedCore dflags = hscUpdateFlags setDynamicNow hsc_env - | otherwise = hsc_env - stub_o <- mapM (compileStub hsc_env_stub) mStub + stub_o <- mapM (compileStub hsc_env) mStub foreign_os <- - mapM (uncurry (compileForeign hsc_env_stub)) foreign_files + mapM (uncurry (compileForeign hsc_env)) foreign_files let fos = maybe [] return stub_o ++ foreign_os iface_fos | gopt Opt_WriteIfSimplifiedCore dflags = fos View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c26c2ed7428e815d43ce21c414cdb77779cb413d -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c26c2ed7428e815d43ce21c414cdb77779cb413d You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:19:55 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:19:55 -0400 Subject: [Git][ghc/ghc][wip/kill-ioport] Kill IOPort# Message-ID: <66aa642b822e3_1c8dbbb8bfdc9593b@gitlab.mail> Rodrigo Mesquita pushed to branch wip/kill-ioport at Glasgow Haskell Compiler / GHC Commits: cc74e171 by Ben Gamari at 2024-07-31T17:19:43+01:00 Kill IOPort# This type is unnecessary, having been superceded by `MVar` and a rework of WinIO's blocking logic. See #20947. See https://github.com/haskell/core-libraries-committee/issues/213. - - - - - 30 changed files: - compiler/GHC/Builtin/Names.hs - compiler/GHC/Builtin/Types/Prim.hs - compiler/GHC/Builtin/primops.txt.pp - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Prim.hs - libraries/base/base.cabal - libraries/base/changelog.md - libraries/base/src/GHC/Exts.hs - − libraries/base/src/GHC/IOPort.hs - libraries/ghc-heap/GHC/Exts/Heap/Closures.hs - libraries/ghc-internal/ghc-internal.cabal - libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc - libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Exts.hs - libraries/ghc-internal/src/GHC/Internal/IO/Buffer.hs - libraries/ghc-internal/src/GHC/Internal/IO/Windows/Handle.hsc - − libraries/ghc-internal/src/GHC/Internal/IOPort.hs - libraries/ghc-prim/GHC/Prim/PtrEq.hs - libraries/ghc-prim/changelog.md - rts/Prelude.h - rts/PrimOps.cmm - rts/RtsSymbols.c - rts/external-symbols.list.in - rts/include/stg/MiscClosures.h - rts/include/stg/SMP.h - rts/win32/AsyncWinIO.c - rts/win32/libHSghc-internal.def - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc74e171def4a9daabccdafa8fe16e68a3e7f51e -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cc74e171def4a9daabccdafa8fe16e68a3e7f51e You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:42:54 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:42:54 -0400 Subject: [Git][ghc/ghc] Pushed new branch wip/romes/25104 Message-ID: <66aa698ecf08a_1c8dbbf25684989ce@gitlab.mail> Rodrigo Mesquita pushed new branch wip/romes/25104 at Glasgow Haskell Compiler / GHC -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/romes/25104 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:46:54 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:46:54 -0400 Subject: [Git][ghc/ghc][wip/romes/25052] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66aa6a7e86706_1c8dbb106de24108916@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25052 at Glasgow Haskell Compiler / GHC Commits: 51b2ed87 by Rodrigo Mesquita at 2024-07-31T16:46:40+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs Changes: ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -204,11 +204,9 @@ instance Exception SomeException where dc -> displayException e ++ "\n" ++ dc displayContext :: ExceptionContext -> String -displayContext (ExceptionContext anns0) = go anns0 +displayContext (ExceptionContext anns0) = unlines $ map go anns0 where - go [SomeExceptionAnnotation ann] = displayExceptionAnnotation ann - go (SomeExceptionAnnotation ann : anns) = displayExceptionAnnotation ann ++ "\n" ++ go anns - go [] = "" + go (SomeExceptionAnnotation ann) = displayExceptionAnnotation ann newtype NoBacktrace e = NoBacktrace e deriving (Show) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51b2ed87dc7e9334e579d7966a2b727a93ea385a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/51b2ed87dc7e9334e579d7966a2b727a93ea385a You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:48:02 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:48:02 -0400 Subject: [Git][ghc/ghc][wip/clc216] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66aa6ac2b794f_1c8dbb10265ec110497@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 498b8a6d by Rodrigo Mesquita at 2024-07-31T16:48:00+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/base/src/GHC/Desugar.hs Changes: ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -22,8 +22,8 @@ -- ----------------------------------------------------------------------------- -#if __GLASGOW_HASKELL >= 912 -#error "GHC.Desugar should be removed in GHC 9.12" +#if __GLASGOW_HASKELL >= 914 +#error "GHC.Desugar should be removed in GHC 9.14" #endif module GHC.Desugar View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/498b8a6d67abccdf3afe377ee8bbd1baefdc0430 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/498b8a6d67abccdf3afe377ee8bbd1baefdc0430 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:48:13 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:48:13 -0400 Subject: [Git][ghc/ghc][wip/clc216] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66aa6acd34f0_1c8dbb113ce4011114@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 9eaa204b by Rodrigo Mesquita at 2024-07-31T16:48:09+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/base/src/GHC/Desugar.hs Changes: ===================================== libraries/base/src/GHC/Desugar.hs ===================================== @@ -27,7 +27,7 @@ #endif module GHC.Desugar - {-# DEPRECATED ["GHC.Desugar is deprecated and should be removed in GHC 9.12.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} + {-# DEPRECATED ["GHC.Desugar is deprecated and will be removed in GHC 9.14.", "(>>>) should be imported from Control.Arrow.", "AnnotationWrapper is internal to GHC and should not be used externally."] #-} ((>>>), AnnotationWrapper(..), toAnnotationWrapper) where import GHC.Internal.Desugar View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9eaa204beae9a9748e5aff892a25629cfbceedc3 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9eaa204beae9a9748e5aff892a25629cfbceedc3 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 16:48:18 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 12:48:18 -0400 Subject: [Git][ghc/ghc][wip/clc216] Apply 1 suggestion(s) to 1 file(s) Message-ID: <66aa6ad29c8ba_1c8dbb10d7720111862@gitlab.mail> Rodrigo Mesquita pushed to branch wip/clc216 at Glasgow Haskell Compiler / GHC Commits: 95c3cf3f by Rodrigo Mesquita at 2024-07-31T16:48:15+00:00 Apply 1 suggestion(s) to 1 file(s) Co-authored-by: sheaf <sam.derbyshire at gmail.com> - - - - - 1 changed file: - libraries/base/changelog.md Changes: ===================================== libraries/base/changelog.md ===================================== @@ -1,7 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) ## 4.21.0.0 *TBA* - * `GHC.Desugar` has been deprecated and should be removed in GHC 9.14. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) + * `GHC.Desugar` has been deprecated and will be removed in GHC 9.14. ([CLC proposal #216](https://github.com/haskell/core-libraries-committee/issues/216)) * Add a `readTixFile` field to the `HpcFlags` record in `GHC.RTS.Flags` ([CLC proposal #276](https://github.com/haskell/core-libraries-committee/issues/276)) * Add `compareLength` to `Data.List` and `Data.List.NonEmpty` ([CLC proposal #257](https://github.com/haskell/core-libraries-committee/issues/257)) * Add `INLINE[1]` to `compareInt` / `compareWord` ([CLC proposal #179](https://github.com/haskell/core-libraries-committee/issues/179)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/95c3cf3f2d2f3e3318220a13c8098f89855affe8 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/95c3cf3f2d2f3e3318220a13c8098f89855affe8 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 20:53:22 2024 From: gitlab at gitlab.haskell.org (Rodrigo Mesquita (@alt-romes)) Date: Wed, 31 Jul 2024 16:53:22 -0400 Subject: [Git][ghc/ghc][wip/romes/25052] 49 commits: AArch64: Simplify stmtToInstrs type Message-ID: <66aaa4424398_b64667c1b681068e0@gitlab.mail> Rodrigo Mesquita pushed to branch wip/romes/25052 at Glasgow Haskell Compiler / GHC Commits: ab2b60b6 by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtToInstrs type There's no need to hand `Nothing`s around... (there was no case with a `BlockId`.) - - - - - 71a7fa8c by Sven Tennie at 2024-07-08T15:03:41-04:00 AArch64: Simplify stmtsToInstrs type The `BlockId` parameter (`bid`) is never used, only handed around. Deleting it simplifies the surrounding code. - - - - - 8bf6fd68 by Simon Peyton Jones at 2024-07-08T15:04:17-04:00 Fix eta-expansion in Prep As #25033 showed, we were eta-expanding in a way that broke a join point, which messed up Note [CorePrep invariants]. The fix is rather easy. See Wrinkle (EA1) of Note [Eta expansion of arguments in CorePrep] - - - - - 96acf823 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 One-shot Haddock - - - - - 74ec4c06 by Sjoerd Visscher at 2024-07-09T06:16:14-04:00 Remove haddock-stdout test option Superseded by output handling of Hadrian - - - - - ed8a8f0b by Rodrigo Mesquita at 2024-07-09T06:16:51-04:00 ghc-boot: Relax Cabal bound Fixes #25013 - - - - - 3f9548fe by Matthew Pickering at 2024-07-09T06:17:36-04:00 ci: Unset ALEX/HAPPY variables when testing bootstrap jobs Ticket #24826 reports a regression in 9.10.1 when building from a source distribution. This patch is an attempt to reproduce the issue on CI by more aggressively removing `alex` and `happy` from the environment. - - - - - aba2c9d4 by Andrea Bedini at 2024-07-09T06:17:36-04:00 hadrian: Ignore build-tool-depends fields in cabal files hadrian does not utilise the build-tool-depends fields in cabal files and their presence can cause issues when building source distribution (see #24826) Ideally Cabal would support building "full" source distributions which would remove the need for workarounds in hadrian but for now we can patch the build-tool-depends out of the cabal files. Fixes #24826 - - - - - 12bb9e7b by Matthew Pickering at 2024-07-09T06:18:12-04:00 testsuite: Don't attempt to link when checking whether a way is supported It is sufficient to check that the simple test file compiles as it will fail if there are not the relevant library files for the requested way. If you break a way so badly that even a simple executable fails to link (as I did for profiled dynamic way), it will just mean the tests for that way are skipped on CI rather than displayed. - - - - - 46ec0a8e by Torsten Schmits at 2024-07-09T13:37:02+02:00 Improve docs for NondecreasingIndentation The text stated that this affects indentation of layouts nested in do expressions, while it actually affects that of do layouts nested in any other. - - - - - dddc9dff by Zubin Duggal at 2024-07-12T11:41:24-04:00 compiler: Fingerprint -fwrite-if-simplified-core We need to recompile if this flag is changed because later modules might depend on the simplified core for this module if -fprefer-bytecode is enabled. Fixes #24656 - - - - - 145a6477 by Matthew Pickering at 2024-07-12T11:42:00-04:00 Add support for building profiled dynamic way The main payload of this change is to hadrian. * Default settings will produced dynamic profiled objects * `-fexternal-interpreter` is turned on in some situations when there is an incompatibility between host GHC and the way attempting to be built. * Very few changes actually needed to GHC There are also necessary changes to the bootstrap plans to work with the vendored Cabal dependency. These changes should ideally be reverted by the next GHC release. In hadrian support is added for building profiled dynamic libraries (nothing too exciting to see there) Updates hadrian to use a vendored Cabal submodule, it is important that we replace this usage with a released version of Cabal library before the 9.12 release. Fixes #21594 ------------------------- Metric Increase: libdir ------------------------- - - - - - 414a6950 by Matthew Pickering at 2024-07-12T11:42:00-04:00 testsuite: Make find_so regex more precise The hash contains lowercase [a-z0-9] and crucially not _p which meant we sometimes matched on `libHS.._p` profiled shared libraries rather than the normal shared library. - - - - - dee035bf by Alex Mason at 2024-07-12T11:42:41-04:00 ncg(aarch64): Add fsqrt instruction, byteSwap primitives [#24956] Implements the FSQRT machop using native assembly rather than a C call. Implements MO_BSwap by producing assembly to do the byte swapping instead of producing a foreign call a C function. In `tar`, the hot loop for `deserialise` got almost 4x faster by avoiding the foreign call which caused spilling live variables to the stack -- this means the loop did 4x more memory read/writing than necessary in that particular case! - - - - - 5104ee61 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: use m32 allocator for sections when NEED_PLT (#24432) Use M32 allocator to avoid fragmentation when allocating ELF sections. We already did this when NEED_PLT was undefined. Failing to do this led to relocations impossible to fulfil (#24432). - - - - - 52d66984 by Sylvain Henry at 2024-07-12T11:43:23-04:00 RTS: allow M32 allocation outside of 4GB range when assuming -fPIC - - - - - c34fef56 by Sylvain Henry at 2024-07-12T11:43:23-04:00 Linker: fix stub offset Remove unjustified +8 offset that leads to memory corruption (cf discussion in #24432). - - - - - 280e4bf5 by Simon Peyton Jones at 2024-07-12T11:43:59-04:00 Make type-equality on synonyms a bit faster This MR make equality fast for (S tys1 `eqType` S tys2), where S is a non-forgetful type synonym. It doesn't affect compile-time allocation much, but then comparison doesn't allocate anyway. But it seems like a Good Thing anyway. See Note [Comparing type synonyms] in GHC.Core.TyCo.Compare and Note [Forgetful type synonyms] in GHC.Core.TyCon Addresses #25009. - - - - - cb83c347 by Alan Zimmerman at 2024-07-12T11:44:35-04:00 EPA: Bring back SrcSpan in EpaDelta When processing files in ghc-exactprint, the usual workflow is to first normalise it with makeDeltaAst, and then operate on it. But we need the original locations to operate on it, in terms of finding things. So restore the original SrcSpan for reference in EpaDelta - - - - - 7bcda869 by Matthew Pickering at 2024-07-12T11:45:11-04:00 Update alpine release job to 3.20 alpine 3.20 was recently released and uses a new python and sphinx toolchain which could be useful to test. - - - - - 43aa99b8 by Matthew Pickering at 2024-07-12T11:45:11-04:00 testsuite: workaround bug in python-3.12 There is some unexplained change to binding behaviour in python-3.12 which requires moving this import from the top-level into the scope of the function. I didn't feel any particular desire to do a deep investigation as to why this changed as the code works when modified like this. No one in the python IRC channel seemed to know what the problem was. - - - - - e3914028 by Adam Sandberg Ericsson at 2024-07-12T11:45:47-04:00 initialise mmap_32bit_base during RTS startup #24847 - - - - - 86b8ecee by Hécate Kleidukos at 2024-07-12T11:46:27-04:00 haddock: Only fetch supported languages and extensions once per Interface list This reduces the number of operations done on each Interface, because supported languages and extensions are determined from architecture and operating system of the build host. This information remains stable across Interfaces, and as such doesn not need to be recovered for each Interface. - - - - - 4f85366f by sheaf at 2024-07-13T05:58:14-04:00 Testsuite: use py-cpuinfo to compute CPU features This replaces the rather hacky logic we had in place for checking CPU features. In particular, this means that feature availability now works properly on Windows. - - - - - 41f1354d by Matthew Pickering at 2024-07-13T05:58:51-04:00 testsuite: Replace $CC with $TEST_CC The TEST_CC variable should be set based on the test compiler, which may be different to the compiler which is set to CC on your system (for example when cross compiling). Fixes #24946 - - - - - 572fbc44 by sheaf at 2024-07-15T08:30:32-04:00 isIrrefutableHsPat: consider COMPLETE pragmas This patch ensures we taken into account COMPLETE pragmas when we compute whether a pattern is irrefutable. In particular, if a pattern synonym is the sole member of a COMPLETE pragma (without a result TyCon), then we consider a pattern match on that pattern synonym to be irrefutable. This affects the desugaring of do blocks, as it ensures we don't use a "fail" operation. Fixes #15681 #16618 #22004 - - - - - 84dadea9 by Zubin Duggal at 2024-07-15T08:31:09-04:00 haddock: Handle non-hs files, so that haddock can generate documentation for modules with foreign imports and template haskell. Fixes #24964 - - - - - 0b4ff9fa by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of warnings/deprecations from dependent packages in `InstalledInterface` and use this to propagate these on items re-exported from dependent packages. Fixes #25037 - - - - - b8b4b212 by Zubin Duggal at 2024-07-15T12:12:30-04:00 haddock: Keep track of instance source locations in `InstalledInterface` and use this to add source locations on out of package instances Fixes #24929 - - - - - 559a7a7c by Matthew Pickering at 2024-07-15T12:13:05-04:00 ci: Refactor job_groups definition, split up by platform The groups are now split up so it's easier to see which jobs are generated for each platform No change in behaviour, just refactoring. - - - - - 20383006 by Matthew Pickering at 2024-07-16T11:48:25+01:00 ci: Replace debian 10 with debian 12 on validation jobs Since debian 10 is now EOL we migrate onwards to debian 12 as the basis for most platform independent validation jobs. - - - - - 12d3b66c by Matthew Pickering at 2024-07-17T13:22:37-04:00 ghcup-metadata: Fix use of arch argument The arch argument was ignored when making the jobname, which lead to failures when generating metadata for the alpine_3_18-aarch64 bindist. Fixes #25089 - - - - - bace981e by Matthew Pickering at 2024-07-19T10:14:02-04:00 testsuite: Delay querying ghc-pkg to find .so dirs until test is run The tests which relied on find_so would fail when `test` was run before the tree was built. This was because `find_so` was evaluated too eagerly. We can fix this by waiting to query the location of the libraries until after the compiler has built them. - - - - - 478de1ab by Torsten Schmits at 2024-07-19T10:14:37-04:00 Add `complete` pragmas for backwards compat patsyns `ModLocation` and `ModIface` !12347 and !12582 introduced breaking changes to these two constructors and mitigated that with pattern synonyms. - - - - - b57792a8 by Matthew Pickering at 2024-07-19T10:15:13-04:00 ci: Fix ghcup-metadata generation (again) I made some mistakes in 203830065b81fe29003c1640a354f11661ffc604 * Syntax error * The aarch-deb11 bindist doesn't exist I tested against the latest nightly pipeline locally: ``` nix run .gitlab/generate-ci#generate-job-metadata nix shell -f .gitlab/rel_eng/ -c ghcup-metadata --pipeline-id 98286 --version 9.11.20240715 --fragment --date 2024-07-17 --metadata=/tmp/meta ``` - - - - - 1fa35b64 by Andreas Klebinger at 2024-07-19T17:35:20+02:00 Revert "Allow non-absolute values for bootstrap GHC variable" This broke configure in subtle ways resulting in #25076 where hadrian didn't end up the boot compiler it was configured to use. This reverts commit 209d09f52363b261b900cf042934ae1e81e2caa7. - - - - - 55117e13 by Simon Peyton Jones at 2024-07-24T02:41:12-04:00 Fix bad bug in mkSynonymTyCon, re forgetfulness As #25094 showed, the previous tests for forgetfulness was plain wrong, when there was a forgetful synonym in the RHS of a synonym. - - - - - a8362630 by Sergey Vinokurov at 2024-07-24T12:22:45-04:00 Define Eq1, Ord1, Show1 and Read1 instances for basic Generic representation types This way the Generically1 newtype could be used to derive Eq1 and Ord1 for user types with DerivingVia. The CLC proposal is https://github.com/haskell/core-libraries-committee/issues/273. The GHC issue is https://gitlab.haskell.org/ghc/ghc/-/issues/24312. - - - - - de5d9852 by Simon Peyton Jones at 2024-07-24T12:23:22-04:00 Address #25055, by disabling case-of-runRW# in Gentle phase See Note [Case-of-case and full laziness] in GHC.Driver.Config.Core.Opt.Simplify - - - - - 3f89ab92 by Andreas Klebinger at 2024-07-25T14:12:54+02:00 Fix -freg-graphs for FP and AARch64 NCG (#24941). It seems we reserve 8 registers instead of four for global regs based on the layout in Note [AArch64 Register assignments]. I'm not sure it's neccesary, but for now we just accept this state of affairs and simple update -fregs-graph to account for this. - - - - - f6b4c1c9 by Simon Peyton Jones at 2024-07-27T09:45:44-04:00 Fix nasty bug in occurrence analyser As #25096 showed, the occurrence analyser was getting one-shot info flat out wrong. This commit does two things: * It fixes the bug and actually makes the code a bit tidier too. The work is done in the new function GHC.Core.Opt.OccurAnal.mkRhsOccEnv, especially the bit that prepares the `occ_one_shots` for the RHS. See Note [The OccEnv for a right hand side] * When floating out a binding we must be conservative about one-shot info. But we were zapping the entire demand info, whereas we only really need zap the /top level/ cardinality. See Note [Floatifying demand info when floating] in GHC.Core.Opt.SetLevels For some reason there is a 2.2% improvement in compile-time allocation for CoOpt_Read. Otherwise nickels and dimes. Metric Decrease: CoOpt_Read - - - - - 646ee207 by Torsten Schmits at 2024-07-27T09:46:20-04:00 add missing cell in flavours table - - - - - ec2eafdb by Ben Gamari at 2024-07-28T20:51:12+02:00 users-guide: Drop mention of dead __PARALLEL_HASKELL__ macro This has not existed for over a decade. - - - - - e2f2a56e by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Add tests for 25081 - - - - - 23f50640 by Arnaud Spiwack at 2024-07-28T22:21:07-04:00 Scale multiplicity in list comprehension Fixes #25081 - - - - - d2648289 by romes at 2024-07-30T01:38:12-04:00 TTG HsCmdArrForm: use Fixity via extension point Also migrate Fixity from GHC.Hs to Language.Haskell.Syntax since it no longer uses any GHC-specific data types. Fixed arrow desugaring bug. (This was dead code before.) Remove mkOpFormRn, it is also dead code, only used in the arrow desugaring now removed. Co-authored-by: Fabian Kirchner <kirchner at posteo.de> Co-authored-by: Alan Zimmerman <alan.zimm at gmail.com> - - - - - e258ad54 by Matthew Pickering at 2024-07-30T01:38:48-04:00 ghcup-metadata: More metadata fixes * Incorrect version range on the alpine bindists * Missing underscore in "unknown_versioning" Fixes #25119 - - - - - 8f92d56f by Rodrigo Mesquita at 2024-07-31T21:53:11+01:00 ghc-internal: @since for backtraceDesired Fixes point 1 in #25052 - - - - - bdff20ff by Rodrigo Mesquita at 2024-07-31T21:53:11+01:00 ghc-internal: No trailing whitespace in exceptions Fixes #25052 - - - - - 24 changed files: - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - .gitmodules - compiler/GHC.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs - compiler/GHC/Core/ConLike.hs - compiler/GHC/Core/Map/Type.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/TyCo/Compare.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51b2ed87dc7e9334e579d7966a2b727a93ea385a...bdff20ffb06443804c2e7ce296abf3e6dc816aaf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/51b2ed87dc7e9334e579d7966a2b727a93ea385a...bdff20ffb06443804c2e7ce296abf3e6dc816aaf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 21:37:14 2024 From: gitlab at gitlab.haskell.org (Jade (@Jade)) Date: Wed, 31 Jul 2024 17:37:14 -0400 Subject: [Git][ghc/ghc][wip/structured-ghci-errors] 6 commits: Generalise GHC diagnostic code infrastructure Message-ID: <66aaae8ac687b_b6466a2fddc1096b5@gitlab.mail> Jade pushed to branch wip/structured-ghci-errors at Glasgow Haskell Compiler / GHC Commits: 8da8ca0d by sheaf at 2024-07-31T10:42:33+02:00 Generalise GHC diagnostic code infrastructure This commit generalises the infrastructure used for diagnostic codes, allowing it to be used for other namespaces than the GHC namespace. In particular, this enables GHCi to re-use the same infrastructure to emit error messages. - - - - - aaea28bf by Jade at 2024-07-31T12:21:56+02:00 WIP - - - - - 81dd90c0 by Jade at 2024-07-31T12:21:56+02:00 WIP (using own type family) - - - - - acdc8566 by Jade at 2024-07-31T12:21:56+02:00 WIP - - - - - 5607151d by Jade at 2024-07-31T22:06:17+02:00 WIP - - - - - 8c1acd06 by Jade at 2024-07-31T23:36:36+02:00 WIP - - - - - 20 changed files: - compiler/GHC/Driver/Errors.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Errors/Types.hs - compiler/GHC/Driver/Ppr.hs - compiler/GHC/HsToCore/Errors/Ppr.hs - compiler/GHC/Iface/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Types/Error.hs - compiler/GHC/Types/Error/Codes.hs - ghc/GHCi/UI.hs - ghc/GHCi/UI/Exception.hs - ghc/GHCi/UI/Info.hs - ghc/GHCi/UI/Monad.hs - + ghc/GHCi/UI/Print.hs - ghc/ghc-bin.cabal.in - linters/lint-codes/LintCodes/Static.hs - linters/lint-codes/Main.hs - testsuite/tests/ghci/scripts/T10508.stderr Changes: ===================================== compiler/GHC/Driver/Errors.hs ===================================== @@ -13,7 +13,7 @@ import GHC.Utils.Error import GHC.Utils.Outputable (hang, ppr, ($$), text, mkErrStyle, sdocStyle, updSDocContext ) import GHC.Utils.Logger -printMessages :: forall a . Diagnostic a => Logger -> DiagnosticOpts a -> DiagOpts -> Messages a -> IO () +printMessages :: forall a. (Diagnostic a) => Logger -> DiagnosticOpts a -> DiagOpts -> Messages a -> IO () printMessages logger msg_opts opts msgs = sequence_ [ let style = mkErrStyle name_ppr_ctx ctx = (diag_ppr_ctx opts) { sdocStyle = style } @@ -28,7 +28,7 @@ printMessages logger msg_opts opts msgs errMsgContext = name_ppr_ctx } <- sortMsgBag (Just opts) (getMessages msgs) ] where - messageWithHints :: Diagnostic a => a -> SDoc + messageWithHints :: a -> SDoc messageWithHints e = let main_msg = formatBulleted $ diagnosticMessage msg_opts e in case diagnosticHints e of ===================================== compiler/GHC/Driver/Errors/Ppr.hs ===================================== @@ -89,7 +89,7 @@ instance Diagnostic GhcMessage where GhcUnknownMessage m -> diagnosticHints m - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC instance HasDefaultDiagnosticOpts DriverMessageOpts where defaultOpts = DriverMessageOpts (defaultDiagnosticOpts @PsMessage) (defaultDiagnosticOpts @IfaceMessage) @@ -409,4 +409,4 @@ instance Diagnostic DriverMessage where DriverInstantiationNodeInDependencyGeneration {} -> noHints - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC ===================================== compiler/GHC/Driver/Errors/Types.hs ===================================== @@ -111,7 +111,7 @@ data GhcMessageOpts = GhcMessageOpts { psMessageOpts :: DiagnosticOpts PsMessage -- conversion can happen gradually. This function should not be needed within -- GHC, as it would typically be used by plugin or library authors (see -- comment for the 'GhcUnknownMessage' type constructor) -ghcUnknownMessage :: (DiagnosticOpts a ~ NoDiagnosticOpts, Diagnostic a, Typeable a) => a -> GhcMessage +ghcUnknownMessage :: (DiagnosticOpts a ~ NoDiagnosticOpts, DiagnosticHint a ~ GhcHint, Diagnostic a, Typeable a) => a -> GhcMessage ghcUnknownMessage = GhcUnknownMessage . mkSimpleUnknownDiagnostic -- | Abstracts away the frequent pattern where we are calling 'ioMsgMaybe' on ===================================== compiler/GHC/Driver/Ppr.hs ===================================== @@ -6,6 +6,7 @@ module GHC.Driver.Ppr , showPpr , showPprUnsafe , printForUser + , printForUserColoured ) where @@ -34,6 +35,13 @@ showSDocForUser dflags unit_state name_ppr_ctx doc = renderWithContext (initSDoc doc' = pprWithUnitState unit_state doc printForUser :: DynFlags -> Handle -> NamePprCtx -> Depth -> SDoc -> IO () -printForUser dflags handle name_ppr_ctx depth doc +printForUser = printForUser' False + +printForUserColoured :: DynFlags -> Handle -> NamePprCtx -> Depth -> SDoc -> IO () +printForUserColoured = printForUser' True + +printForUser' :: Bool -> DynFlags -> Handle -> NamePprCtx -> Depth -> SDoc -> IO () +printForUser' colour dflags handle name_ppr_ctx depth doc = printSDocLn ctx (PageMode False) handle doc - where ctx = initSDocContext dflags (mkUserStyle name_ppr_ctx depth) + where ctx = initSDocContext dflags (setStyleColoured colour $ mkUserStyle name_ppr_ctx depth) + ===================================== compiler/GHC/HsToCore/Errors/Ppr.hs ===================================== @@ -280,7 +280,7 @@ instance Diagnostic DsMessage where DsAnotherRuleMightFireFirst _ bad_rule _ -> [SuggestAddPhaseToCompetingRule bad_rule] DsIncompleteRecordSelector{} -> noHints - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC {- Note [Suggest NegativeLiterals] ===================================== compiler/GHC/Iface/Errors/Ppr.hs ===================================== @@ -59,7 +59,7 @@ instance Diagnostic IfaceMessage where diagnosticHints = interfaceErrorHints - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC interfaceErrorHints :: IfaceMessage -> [GhcHint] interfaceErrorHints = \ case ===================================== compiler/GHC/Parser/Errors/Ppr.hs ===================================== @@ -826,7 +826,7 @@ instance Diagnostic PsMessage where PsErrInvalidPun {} -> [suggestExtension LangExt.ListTuplePuns] PsErrIllegalOrPat{} -> [suggestExtension LangExt.OrPatterns] - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC psHeaderMessageDiagnostic :: PsHeaderMessage -> DecoratedSDoc psHeaderMessageDiagnostic = \case ===================================== compiler/GHC/Tc/Errors/Ppr.hs ===================================== @@ -3272,7 +3272,7 @@ instance Diagnostic TcRnMessage where TcRnMisplacedInvisPat{} -> noHints - diagnosticCode = constructorCode + diagnosticCode = constructorCode @GHC note :: SDoc -> SDoc ===================================== compiler/GHC/Tc/Errors/Types.hs ===================================== @@ -285,7 +285,7 @@ data TcRnMessageDetailed !TcRnMessage deriving Generic -mkTcRnUnknownMessage :: (Diagnostic a, Typeable a, DiagnosticOpts a ~ NoDiagnosticOpts) +mkTcRnUnknownMessage :: (Diagnostic a, Typeable a, DiagnosticOpts a ~ NoDiagnosticOpts, DiagnosticHint a ~ GhcHint) => a -> TcRnMessage mkTcRnUnknownMessage diag = TcRnUnknownMessage (mkSimpleUnknownDiagnostic diag) -- Please don't use this function inside the GHC codebase; ===================================== compiler/GHC/Types/Error.hs ===================================== @@ -9,6 +9,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE UndecidableInstances #-} module GHC.Types.Error ( -- * Messages @@ -36,7 +37,6 @@ module GHC.Types.Error , DiagnosticMessage (..) , DiagnosticReason (WarningWithFlag, ..) , ResolvedDiagnosticReason(..) - , DiagnosticHint (..) , mkPlainDiagnostic , mkPlainError , mkDecoratedDiagnostic @@ -167,7 +167,7 @@ instance Diagnostic e => Outputable (Messages e) where pprDiagnostic (errMsgDiagnostic envelope) ] -instance Diagnostic e => ToJson (Messages e) where +instance (Diagnostic e) => ToJson (Messages e) where json msgs = JSArray . toList $ json <$> getMessages msgs {- Note [Discarding Messages] @@ -247,11 +247,16 @@ defaultDiagnosticOpts = defaultOpts @(DiagnosticOpts opts) -- A 'Diagnostic' carries the /actual/ description of the message (which, in -- GHC's case, it can be an error or a warning) and the /reason/ why such -- message was generated in the first place. -class (HasDefaultDiagnosticOpts (DiagnosticOpts a)) => Diagnostic a where +class (Outputable (DiagnosticHint a), HasDefaultDiagnosticOpts (DiagnosticOpts a)) => Diagnostic a where -- | Type of configuration options for the diagnostic. type DiagnosticOpts a + -- | Type of hint this diagnostic can provide. + -- by default this is 'GhcHint' + type DiagnosticHint a + type DiagnosticHint a = GhcHint + -- | Extract the error message text from a 'Diagnostic'. diagnosticMessage :: DiagnosticOpts a -> a -> DecoratedSDoc @@ -261,7 +266,7 @@ class (HasDefaultDiagnosticOpts (DiagnosticOpts a)) => Diagnostic a where -- | Extract any hints a user might use to repair their -- code to avoid this diagnostic. - diagnosticHints :: a -> [GhcHint] + diagnosticHints :: a -> [DiagnosticHint a] -- | Get the 'DiagnosticCode' associated with this 'Diagnostic'. -- This can return 'Nothing' for at least two reasons: @@ -279,13 +284,13 @@ class (HasDefaultDiagnosticOpts (DiagnosticOpts a)) => Diagnostic a where -- | An existential wrapper around an unknown diagnostic. data UnknownDiagnostic opts where - UnknownDiagnostic :: (Diagnostic a, Typeable a) + UnknownDiagnostic :: (Diagnostic a, Typeable a, DiagnosticHint a ~ GhcHint) => (opts -> DiagnosticOpts a) -- Inject the options of the outer context -- into the options for the wrapped diagnostic. -> a -> UnknownDiagnostic opts -instance HasDefaultDiagnosticOpts opts => Diagnostic (UnknownDiagnostic opts) where +instance (HasDefaultDiagnosticOpts opts) => Diagnostic (UnknownDiagnostic opts) where type DiagnosticOpts (UnknownDiagnostic opts) = opts diagnosticMessage opts (UnknownDiagnostic f diag) = diagnosticMessage (f opts) diag diagnosticReason (UnknownDiagnostic _ diag) = diagnosticReason diag @@ -299,15 +304,15 @@ instance HasDefaultDiagnosticOpts NoDiagnosticOpts where defaultOpts = NoDiagnosticOpts -- | Make a "simple" unknown diagnostic which doesn't have any configuration options. -mkSimpleUnknownDiagnostic :: (Diagnostic a, Typeable a, DiagnosticOpts a ~ NoDiagnosticOpts) => a -> UnknownDiagnostic b +mkSimpleUnknownDiagnostic :: (Diagnostic a, Typeable a, DiagnosticOpts a ~ NoDiagnosticOpts, DiagnosticHint a ~ GhcHint) => a -> UnknownDiagnostic b mkSimpleUnknownDiagnostic = UnknownDiagnostic (const NoDiagnosticOpts) -- | Make an unknown diagnostic which uses the same options as the context it will be embedded into. -mkUnknownDiagnostic :: (Typeable a, Diagnostic a) => a -> UnknownDiagnostic (DiagnosticOpts a) +mkUnknownDiagnostic :: (Typeable a, Diagnostic a, DiagnosticHint a ~ GhcHint) => a -> UnknownDiagnostic (DiagnosticOpts a) mkUnknownDiagnostic = UnknownDiagnostic id -- | Embed a more complicated diagnostic which requires a potentially different options type. -embedUnknownDiagnostic :: (Diagnostic a, Typeable a) => (opts -> DiagnosticOpts a) -> a -> UnknownDiagnostic opts +embedUnknownDiagnostic :: (Diagnostic a, Typeable a, DiagnosticHint a ~ GhcHint) => (opts -> DiagnosticOpts a) -> a -> UnknownDiagnostic opts embedUnknownDiagnostic = UnknownDiagnostic -------------------------------------------------------------------------------- @@ -317,11 +322,6 @@ pprDiagnostic e = vcat [ ppr (diagnosticReason e) , nest 2 (vcat (unDecorated (diagnosticMessage opts e))) ] where opts = defaultDiagnosticOpts @e --- | A generic 'Hint' message, to be used with 'DiagnosticMessage'. -data DiagnosticHint = DiagnosticHint !SDoc - -instance Outputable DiagnosticHint where - ppr (DiagnosticHint msg) = msg -- | A generic 'Diagnostic' message, without any further classification or -- provenance: By looking at a 'DiagnosticMessage' we don't know neither @@ -578,7 +578,7 @@ https://json-schema.org schemaVersion :: String schemaVersion = "1.0" -- See Note [Diagnostic Message JSON Schema] before editing! -instance Diagnostic e => ToJson (MsgEnvelope e) where +instance (Diagnostic e) => ToJson (MsgEnvelope e) where json m = JSObject [ ("version", JSString schemaVersion), ("ghcVersion", JSString $ "ghc-" ++ cProjectVersion), ===================================== compiler/GHC/Types/Error/Codes.hs ===================================== @@ -16,22 +16,30 @@ -- A diagnostic code is a numeric unique identifier for a diagnostic. -- See Note [Diagnostic codes]. module GHC.Types.Error.Codes - ( GhcDiagnosticCode, constructorCode, constructorCodes ) + ( -- * General diagnostic code infrastructure + DiagnosticCodeNameSpace(NameSpaceTag, DiagnosticCodeFor, ConRecursIntoFor) + , Outdated + , constructorCode, constructorCodes + -- * GHC diagnostic codes + , GHC, GhcDiagnosticCode, ConRecursInto + ) where import GHC.Prelude -import GHC.Types.Error ( DiagnosticCode(..), UnknownDiagnostic (..), diagnosticCode, NoDiagnosticOpts ) -import GHC.Hs.Extension ( GhcRn ) +import GHC.Core.InstEnv ( LookupInstanceErrReason ) +import GHC.Hs.Extension ( GhcRn ) +import GHC.Types.Error ( DiagnosticCode(..), UnknownDiagnostic (..), NoDiagnosticOpts + , diagnosticCode ) +import GHC.Unit.Module.Warnings ( WarningTxt ) +import GHC.Utils.Panic.Plain -import GHC.Core.InstEnv (LookupInstanceErrReason) -import GHC.Iface.Errors.Types +-- Import all the structured error data types import GHC.Driver.Errors.Types ( DriverMessage, GhcMessageOpts, DriverMessageOpts ) -import GHC.Parser.Errors.Types ( PsMessage, PsHeaderMessage ) import GHC.HsToCore.Errors.Types ( DsMessage ) +import GHC.Iface.Errors.Types +import GHC.Parser.Errors.Types ( PsMessage, PsHeaderMessage ) import GHC.Tc.Errors.Types -import GHC.Unit.Module.Warnings ( WarningTxt ) -import GHC.Utils.Panic.Plain import Data.Kind ( Type, Constraint ) import GHC.Exts ( proxy# ) @@ -57,7 +65,11 @@ To ensure uniqueness across GHC versions, we proceed as follows: - a diagnostic code never gets deleted from the GhcDiagnosticCode type family in GHC.Types.Error.Codes, even if it is no longer used. Older versions of GHC might still display the code, and we don't want that - old code to get confused with the error code of a different, new, error message. + old code to get confused with the error code of a different, new, error message.* + +Note that this module also provides a 'DiagnosticCodeNameSpace' typeclass which +allows diagnostic codes to be emitted in different namespaces than the GHC +namespace; see Note [Diagnostic code namespaces]. [Instructions for adding a new diagnostic code] @@ -99,33 +111,94 @@ To ensure uniqueness across GHC versions, we proceed as follows: Never remove a return value from the 'GhcDiagnosticCode' type family! Outdated error messages must still be tracked to ensure uniqueness - of diagnostic codes across GHC versions. + of diagnostic codes across GHC versions. Instead, you should wrap the + return value in the 'Outdated' type synonym. The presence of this type synonym + is used by the 'codes' test to determine which diagnostic codes to check + for testsuite coverage. -} {- ********************************************************************* * * - The GhcDiagnosticCode type family + DiagnosticCode infrastructure * * ********************************************************************* -} --- | This function obtain a diagnostic code by looking up the constructor --- name using generics, and using the 'GhcDiagnosticCode' type family. -constructorCode :: (Generic diag, GDiagnosticCode (Rep diag)) +{- Note [Diagnostic code namespaces] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The machinery for GHC diagnostic codes described in Note [Diagnostic codes] +works for other namespaces than the GHC namespaces; one example is GHCi-specific +diagnostic codes. + +To achieve this, we parametrise all the machinery over a namespace type-level +argument, using the 'DiagnosticCodeNameSpace' class. +To provide diagnostic codes, one needs to supply an instance of this class, +which means supplying the following pieces of information: + + - a type that represents the namespace, e.g. `data GHC` can be used to + represent the GHC namespace, + - a type family equation for 'NameSpaceTag', e.g. 'NameSpaceTag GHC = "GHC"', + - a diagnostic code type family, e.g. 'DiagnosticCodeFor GHC con = GhcDiagnosticCode con', + - a type family that specifies how to recur into constructor arguments, + e.g. 'ConRecursIntoFor GHC con = ConRecursInto con'. + +This allows any tool that imports the GHC library to re-use the diagnostic +code machinery that GHC uses. +-} + +-- | A constraint for a namespace which has its own diagnostic codes. +-- +-- See Note [Diagnostic code namespaces]. +type DiagnosticCodeNameSpace :: Type -> Constraint +class DiagnosticCodeNameSpace namespace where + -- | The symbolic tag for a namespace. + type NameSpaceTag namespace = (r :: Symbol) | r -> namespace + -- NB: the injectivity annotation ensures uniqueness of namespaces, + -- e.g. it prevents two different namespaces from using the same symbolic tag. + -- | A diagnostic code in a given namespace. + type DiagnosticCodeFor namespace (c :: Symbol) :: Nat + -- | Specify that one should recur into an argument of a constructor + -- in order to obtain a diagnostic code. See Note [Diagnostic codes]. + type ConRecursIntoFor namespace (c :: Symbol) :: Maybe Type + +-- | Use this type synonym to mark a diagnostic code as outdated. +-- +-- The presence of this type synonym is used by the 'codes' test to determine +-- which diagnostic codes to check for testsuite coverage. +type Outdated a = a + +-- | This function obtains a diagnostic code by looking up the constructor +-- name using generics, and using the 'DiagnosticCode' type family. +constructorCode :: forall namespace diag + . (Generic diag, GDiagnosticCode namespace (Rep diag)) => diag -> Maybe DiagnosticCode -constructorCode diag = gdiagnosticCode (from diag) +constructorCode diag = gdiagnosticCode @namespace (from diag) -- | This function computes all diagnostic codes that occur inside a given --- type using generics and the 'GhcDiagnosticCode' type family. +-- type using generics and the 'DiagnosticCode' type family. -- -- For example, if @T = MkT1 | MkT2@, @GhcDiagnosticCode \"MkT1\" = 123@ and -- @GhcDiagnosticCode \"MkT2\" = 456@, then we will get --- > constructorCodes @T = fromList [ (123, \"MkT1\"), (456, \"MkT2\") ] -constructorCodes :: forall diag. (Generic diag, GDiagnosticCodes '[diag] (Rep diag)) +-- > constructorCodes @GHC @T = fromList [ (DiagnosticCode "GHC" 123, \"MkT1\"), (DiagnosticCode "GHC" 456, \"MkT2\") ] +constructorCodes :: forall namespace diag + . (Generic diag, GDiagnosticCodes namespace '[diag] (Rep diag)) => Map DiagnosticCode String -constructorCodes = gdiagnosticCodes @'[diag] @(Rep diag) +constructorCodes = gdiagnosticCodes @namespace @'[diag] @(Rep diag) -- See Note [diagnosticCodes: don't recur into already-seen types] -- for the @'[diag] type argument. +{- ********************************************************************* +* * + The GhcDiagnosticCode type family +* * +********************************************************************* -} + +-- | The GHC namespace for diagnostic codes. +data GHC +instance DiagnosticCodeNameSpace GHC where + type instance NameSpaceTag GHC = "GHC" + type instance DiagnosticCodeFor GHC con = GhcDiagnosticCode con + type instance ConRecursIntoFor GHC con = ConRecursInto con + -- | Type family computing the numeric diagnostic code for a given error message constructor. -- -- Its injectivity annotation ensures uniqueness of error codes. @@ -894,7 +967,9 @@ type family GhcDiagnosticCode c = n | n -> c where -- NB: never remove a return value from this type family! -- We need to ensure uniquess of diagnostic codes across GHC versions, -- and this includes outdated diagnostic codes for errors that GHC - -- no longer reports. These are collected below. + -- no longer reports. These are mostly collected below, but for ease + -- of rebasing it is often better to simply declare a constructor outdated + -- without moving it down here. GhcDiagnosticCode "TcRnIllegalInstanceHeadDecl" = Outdated 12222 GhcDiagnosticCode "TcRnNoClassInstHead" = Outdated 56538 @@ -915,12 +990,6 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "TcRnInterfaceLookupError" = Outdated 52243 GhcDiagnosticCode "TcRnForallIdentifier" = Outdated 64088 --- | Use this type synonym to mark a diagnostic code as outdated. --- --- The presence of this type synonym is used by the 'codes' test to determine --- which diagnostic codes to check for testsuite coverage. -type Outdated a = a - {- ********************************************************************* * * Recurring into an argument @@ -1088,7 +1157,7 @@ type family ConRecursInto con where {- Note [Diagnostic codes using generics] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Diagnostic codes are specified at the type-level using the injective +Diagnostic codes for GHC are specified at the type-level using the injective type family 'GhcDiagnosticCode'. This ensures uniqueness of diagnostic codes, giving quick feedback (in the form of a type error). @@ -1125,7 +1194,12 @@ To achieve this, we use a variant of the 'typed' lens from 'generic-lens' first, and decide whether to recur into it using the HasTypeQ type family. - The two different behaviours are controlled by two main instances (*) and (**). - - (*) recurses into a subtype, when we have a type family equation such as: + - (*) directly uses the constructor name, by using the 'DiagnosticCodeFor' + type family. The 'KnownConstructor' context (ERR2) on the instance provides + a custom error message in case of a missing diagnostic code, which points + GHC contributors to the documentation explaining how to add diagnostic codes + for their diagnostics. + - (**) recurses into a subtype, when we have a type family equation such as: ConRecursInto "TcRnCannotDeriveInstance" = 'Just DeriveInstanceErrReason @@ -1133,94 +1207,87 @@ To achieve this, we use a variant of the 'typed' lens from 'generic-lens' type 'DeriveInstanceErrReason'. The overlapping instance (ERR1) provides an error message in case a constructor does not have the type specified by the 'ConRecursInto' type family. - - (**) directly uses the constructor name, by using the 'GhcDiagnosticCode' - type family. The 'KnownConstructor' context (ERR2) on the instance provides - a custom error message in case of a missing diagnostic code, which points - GHC contributors to the documentation explaining how to add diagnostic codes - for their diagnostics. -} -- | Use the generic representation of a type to retrieve the --- diagnostic code, using the 'GhcDiagnosticCode' type family. +-- diagnostic code, using 'DiagnosticCodeFor namespace' type family. -- -- See Note [Diagnostic codes using generics] in GHC.Types.Error.Codes. -type GDiagnosticCode :: (Type -> Type) -> Constraint -class GDiagnosticCode f where +type GDiagnosticCode :: Type -> (Type -> Type) -> Constraint +class GDiagnosticCode namespace f where gdiagnosticCode :: f a -> Maybe DiagnosticCode -- | Use the generic representation of a type to retrieve the collection -- of all diagnostic codes it can give rise to. -type GDiagnosticCodes :: [Type] -> (Type -> Type) -> Constraint -class GDiagnosticCodes seen f where +type GDiagnosticCodes :: Type -> [Type] -> (Type -> Type) -> Constraint +class GDiagnosticCodes namespace seen f where gdiagnosticCodes :: Map DiagnosticCode String -type ConstructorCode :: Symbol -> (Type -> Type) -> Maybe Type -> Constraint -class ConstructorCode con f recur where +type ConstructorCode :: Type -> Symbol -> (Type -> Type) -> Maybe Type -> Constraint +class ConstructorCode namespace con f recur where gconstructorCode :: f a -> Maybe DiagnosticCode -type ConstructorCodes :: Symbol -> (Type -> Type) -> [Type] -> Maybe Type -> Constraint -class ConstructorCodes con f seen recur where +type ConstructorCodes :: Type -> Symbol -> (Type -> Type) -> [Type] -> Maybe Type -> Constraint +class ConstructorCodes namespace con f seen recur where gconstructorCodes :: Map DiagnosticCode String -instance (KnownConstructor con, KnownSymbol con) => ConstructorCode con f 'Nothing where - gconstructorCode _ = Just $ DiagnosticCode "GHC" $ natVal' @(GhcDiagnosticCode con) proxy# -instance (KnownConstructor con, KnownSymbol con) => ConstructorCodes con f seen 'Nothing where - gconstructorCodes = - Map.singleton - (DiagnosticCode "GHC" $ natVal' @(GhcDiagnosticCode con) proxy#) - (symbolVal' @con proxy#) - -- If we recur into the 'UnknownDiagnostic' existential datatype, -- unwrap the existential and obtain the error code. instance {-# OVERLAPPING #-} - ( ConRecursInto con ~ 'Just (UnknownDiagnostic opts) - , HasType (UnknownDiagnostic opts) con f ) - => ConstructorCode con f ('Just (UnknownDiagnostic opts)) where - gconstructorCode diag = case getType @(UnknownDiagnostic opts) @con @f diag of + ( ConRecursIntoFor namespace con ~ 'Just (UnknownDiagnostic opts) + , HasType namespace (UnknownDiagnostic opts) con f ) + => ConstructorCode namespace con f ('Just (UnknownDiagnostic opts)) where + gconstructorCode diag = case getType @namespace @(UnknownDiagnostic opts) @con @f diag of UnknownDiagnostic _ diag -> diagnosticCode diag instance {-# OVERLAPPING #-} - ( ConRecursInto con ~ 'Just (UnknownDiagnostic opts) ) - => ConstructorCodes con f seen ('Just (UnknownDiagnostic opts)) where + ( ConRecursIntoFor namespace con ~ 'Just (UnknownDiagnostic opts) ) + => ConstructorCodes namespace con f seen ('Just (UnknownDiagnostic opts)) where gconstructorCodes = Map.empty --- (*) Recursive instance: Recur into the given type. -instance ( ConRecursInto con ~ 'Just ty, HasType ty con f - , Generic ty, GDiagnosticCode (Rep ty) ) - => ConstructorCode con f ('Just ty) where - gconstructorCode diag = gdiagnosticCode (from $ getType @ty @con @f diag) -instance ( ConRecursInto con ~ 'Just ty, HasType ty con f - , Generic ty, GDiagnosticCodes (Insert ty seen) (Rep ty) +-- | (*) Base instance: use the diagnostic code for this constructor in this namespace. +instance (KnownNameSpace namespace, KnownConstructor namespace con, KnownSymbol con) + => ConstructorCode namespace con f 'Nothing where + gconstructorCode _ = Just $ DiagnosticCode (symbolVal' @(NameSpaceTag namespace) proxy#) $ natVal' @(DiagnosticCodeFor namespace con) proxy# +instance ( KnownNameSpace namespace, KnownConstructor namespace con, KnownSymbol con) => ConstructorCodes namespace con f seen 'Nothing where + gconstructorCodes = + Map.singleton + (DiagnosticCode (symbolVal' @(NameSpaceTag namespace) proxy#) $ natVal' @(DiagnosticCodeFor namespace con) proxy#) + (symbolVal' @con proxy#) + +-- | (**) Recursive instance: recur into the given type. +instance ( ConRecursIntoFor namespace con ~ 'Just ty, HasType namespace ty con f + , Generic ty, GDiagnosticCode namespace (Rep ty) ) + => ConstructorCode namespace con f ('Just ty) where + gconstructorCode diag = gdiagnosticCode @namespace (from $ getType @namespace @ty @con @f diag) +instance ( ConRecursIntoFor namespace con ~ 'Just ty, HasType namespace ty con f + , Generic ty, GDiagnosticCodes namespace (Insert ty seen) (Rep ty) , Seen seen ty ) - => ConstructorCodes con f seen ('Just ty) where + => ConstructorCodes namespace con f seen ('Just ty) where gconstructorCodes = -- See Note [diagnosticCodes: don't recur into already-seen types] if wasSeen @seen @ty then Map.empty - else gdiagnosticCodes @(Insert ty seen) @(Rep ty) + else gdiagnosticCodes @namespace @(Insert ty seen) @(Rep ty) --- (**) Constructor instance: handle constructors directly. --- --- Obtain the code from the 'GhcDiagnosticCode' --- type family, applied to the name of the constructor. -instance (ConstructorCode con f recur, recur ~ ConRecursInto con, KnownSymbol con) - => GDiagnosticCode (M1 i ('MetaCons con x y) f) where - gdiagnosticCode (M1 x) = gconstructorCode @con @f @recur x -instance (ConstructorCodes con f seen recur, recur ~ ConRecursInto con, KnownSymbol con) - => GDiagnosticCodes seen (M1 i ('MetaCons con x y) f) where - gdiagnosticCodes = gconstructorCodes @con @f @seen @recur +instance (ConstructorCode namespace con f recur, recur ~ ConRecursIntoFor namespace con, KnownSymbol con) + => GDiagnosticCode namespace (M1 i ('MetaCons con x y) f) where + gdiagnosticCode (M1 x) = gconstructorCode @namespace @con @f @recur x +instance (ConstructorCodes namespace con f seen recur, recur ~ ConRecursIntoFor namespace con, KnownSymbol con) + => GDiagnosticCodes namespace seen (M1 i ('MetaCons con x y) f) where + gdiagnosticCodes = gconstructorCodes @namespace @con @f @seen @recur -- Handle sum types (the diagnostic types are sums of constructors). -instance (GDiagnosticCode f, GDiagnosticCode g) => GDiagnosticCode (f :+: g) where - gdiagnosticCode (L1 x) = gdiagnosticCode @f x - gdiagnosticCode (R1 y) = gdiagnosticCode @g y -instance (GDiagnosticCodes seen f, GDiagnosticCodes seen g) => GDiagnosticCodes seen (f :+: g) where - gdiagnosticCodes = Map.union (gdiagnosticCodes @seen @f) (gdiagnosticCodes @seen @g) +instance (GDiagnosticCode namespace f, GDiagnosticCode namespace g) => GDiagnosticCode namespace (f :+: g) where + gdiagnosticCode (L1 x) = gdiagnosticCode @namespace @f x + gdiagnosticCode (R1 y) = gdiagnosticCode @namespace @g y +instance (GDiagnosticCodes namespace seen f, GDiagnosticCodes namespace seen g) => GDiagnosticCodes namespace seen (f :+: g) where + gdiagnosticCodes = Map.union (gdiagnosticCodes @namespace @seen @f) (gdiagnosticCodes @namespace @seen @g) -- Discard metadata we don't need. -instance GDiagnosticCode f - => GDiagnosticCode (M1 i ('MetaData nm mod pkg nt) f) where - gdiagnosticCode (M1 x) = gdiagnosticCode @f x -instance GDiagnosticCodes seen f - => GDiagnosticCodes seen (M1 i ('MetaData nm mod pkg nt) f) where - gdiagnosticCodes = gdiagnosticCodes @seen @f +instance GDiagnosticCode namespace f + => GDiagnosticCode namespace (M1 i ('MetaData nm mod pkg nt) f) where + gdiagnosticCode (M1 x) = gdiagnosticCode @namespace @f x +instance GDiagnosticCodes namespace seen f + => GDiagnosticCodes namespace seen (M1 i ('MetaData nm mod pkg nt) f) where + gdiagnosticCodes = gdiagnosticCodes @namespace @seen @f -- | Decide whether to pick the left or right branch -- when deciding how to recurse into a product. @@ -1247,30 +1314,30 @@ type family Alt (m1 :: Maybe a) (m2 :: Maybe a) :: Maybe a where Alt ('Just a) _ = 'Just a Alt _ b = b -type HasType :: Type -> Symbol -> (Type -> Type) -> Constraint -class HasType ty orig f where +type HasType :: Type -> Type -> Symbol -> (Type -> Type) -> Constraint +class HasType namespace ty orig f where getType :: f a -> ty -instance HasType ty orig (M1 i s (K1 x ty)) where +instance HasType namespace ty orig (M1 i s (K1 x ty)) where getType (M1 (K1 x)) = x -instance HasTypeProd ty (HasTypeQ ty f) orig f g => HasType ty orig (f :*: g) where - getType = getTypeProd @ty @(HasTypeQ ty f) @orig +instance HasTypeProd namespace ty (HasTypeQ ty f) orig f g => HasType namespace ty orig (f :*: g) where + getType = getTypeProd @namespace @ty @(HasTypeQ ty f) @orig -- The lr parameter tells us whether to pick the left or right -- branch in a product, and is computed using 'HasTypeQ'. -- -- If it's @Just l@, then we have found the type in the left branch, -- so use that. Otherwise, look in the right branch. -class HasTypeProd ty lr orig f g where +class HasTypeProd namespace ty lr orig f g where getTypeProd :: (f :*: g) a -> ty -- Pick the left branch. -instance HasType ty orig f => HasTypeProd ty ('Just l) orig f g where - getTypeProd (x :*: _) = getType @ty @orig @f x +instance HasType namespace ty orig f => HasTypeProd namespace ty ('Just l) orig f g where + getTypeProd (x :*: _) = getType @namespace @ty @orig @f x -- Pick the right branch. -instance HasType ty orig g => HasTypeProd ty 'Nothing orig f g where - getTypeProd (_ :*: y) = getType @ty @orig @g y +instance HasType namespace ty orig g => HasTypeProd namespace ty 'Nothing orig f g where + getTypeProd (_ :*: y) = getType @namespace @ty @orig @g y {- Note [diagnosticCodes: don't recur into already-seen types] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1294,7 +1361,7 @@ of the form This would cause an infinite loop. We thus keep track of a list of types we have already encountered, and when we recur into a type we have already -encountered, we simply skip taking that union (see (*)). +encountered, we simply skip taking that union (see (**)). Note that 'constructorCodes' starts by marking the initial type itself as "seen", which precisely avoids the loop above when calling 'constructorCodes @TcRnMessage'. @@ -1329,28 +1396,43 @@ instance {-# OVERLAPPABLE #-} ':$$: 'Text "does not have any argument of type '" ':<>: 'ShowType ty ':<>: 'Text "'." ':$$: 'Text "" ':$$: 'Text "This is likely due to an incorrect type family equation:" - ':$$: 'Text " ConRecursInto \"" ':<>: 'Text orig ':<>: 'Text "\" = " ':<>: 'ShowType ty ) - => HasType ty orig f where + ':$$: 'Text " ConRecursIntoFor " ':<>: 'ShowType namespace ':<>: Text " \"" ':<>: 'Text orig ':<>: 'Text "\" = " ':<>: 'ShowType ty ) + => HasType namespace ty orig f where getType = panic "getType: unreachable" -- (ERR2) Improve error messages for missing 'GhcDiagnosticCode' equations. -type KnownConstructor :: Symbol -> Constraint -type family KnownConstructor con where - KnownConstructor con = +type KnownConstructor :: Type -> Symbol -> Constraint +type family KnownConstructor namespace con where + KnownConstructor namespace con = KnownNatOrErr ( TypeError - ( 'Text "Missing diagnostic code for constructor " + ( 'Text "Missing " ':<>: 'ShowType namespace ':<>: Text " diagnostic code for constructor " ':<>: 'Text "'" ':<>: 'Text con ':<>: 'Text "'." ':$$: 'Text "" ':$$: 'Text "Note [Diagnostic codes] in GHC.Types.Error.Codes" ':$$: 'Text "contains instructions for adding a new diagnostic code." ) ) - (GhcDiagnosticCode con) + (DiagnosticCodeFor namespace con) type KnownNatOrErr :: Constraint -> Nat -> Constraint type KnownNatOrErr err n = (Assert err n, KnownNat n) +-- (ERR3) Improve error messages for invalid namespaces. +type KnownNameSpace :: Type -> Constraint +type family KnownNameSpace namespace where + KnownNameSpace namespace = + ValidNameSpaceOrErr + ( TypeError + ( 'Text "Please provide a 'DiagnosticCodeNameSpace' instance for " ':<>: 'ShowType namespace ':<>: Text "," + ':$$: 'Text "including an associated type family equation for 'NameSpaceTag'." + ) + ) + (NameSpaceTag namespace) + +type ValidNameSpaceOrErr :: Constraint -> Symbol -> Constraint +type ValidNameSpaceOrErr err s = (Assert err s, KnownSymbol s) + -- Detecting a stuck type family using a data family. -- See https://blog.csongor.co.uk/report-stuck-families/. type Assert :: Constraint -> k -> Constraint ===================================== ghc/GHCi/UI.hs ===================================== @@ -10,6 +10,7 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE DataKinds #-} {-# OPTIONS -fno-warn-name-shadowing #-} -- This module does a lot of it @@ -34,7 +35,10 @@ module GHCi.UI ( import qualified GHCi.UI.Monad as GhciMonad ( args, runStmt, runDecls' ) import GHCi.UI.Monad hiding ( args, runStmt ) import GHCi.UI.Info -import GHCi.UI.Exception +import GHCi.UI.Exception hiding (GHCi) +import GHCi.Leak +import GHCi.UI.Print + import GHC.Runtime.Debugger import GHC.Runtime.Eval (mkTopLevEnv) @@ -170,14 +174,12 @@ import GHC.IO.Exception ( IOErrorType(InvalidArgument) ) import GHC.IO.Handle ( hFlushAll ) import GHC.TopHandler ( topHandler ) -import GHCi.Leak import qualified GHC.Unit.Module.Graph as GHC ----------------------------------------------------------------------------- data GhciSettings = GhciSettings { availableCommands :: [Command], - shortHelpText :: String, fullHelpText :: String, defPrompt :: PromptFunction, defPromptCont :: PromptFunction @@ -187,7 +189,6 @@ defaultGhciSettings :: GhciSettings defaultGhciSettings = GhciSettings { availableCommands = ghciCommands, - shortHelpText = defShortHelpText, defPrompt = default_prompt, defPromptCont = default_prompt_cont, fullHelpText = defFullHelpText @@ -321,10 +322,8 @@ keepGoing' :: GhciMonad m => (a -> m ()) -> a -> m CmdExecOutcome keepGoing' a str = do in_multi <- inMultiMode if in_multi - then - liftIO $ hPutStrLn stderr "Command is not supported (yet) in multi-mode" - else - a str + then reportError GhciCommandNotSupportedInMultiMode + else a str return CmdSuccess -- For commands which are actually support in multi-mode, initially just :reload @@ -337,12 +336,9 @@ inMultiMode = multiMode <$> getGHCiState keepGoingPaths :: ([FilePath] -> InputT GHCi ()) -> (String -> InputT GHCi CmdExecOutcome) keepGoingPaths a str = do case toArgsNoLoc str of - Left err -> liftIO $ hPutStrLn stderr err >> return CmdSuccess + Left err -> reportError (GhciInvalidArgumentString err) >> return CmdSuccess Right args -> keepGoing' a args -defShortHelpText :: String -defShortHelpText = "use :? for help.\n" - defFullHelpText :: String defFullHelpText = " Commands available from the prompt:\n" ++ @@ -588,7 +584,6 @@ interactiveUI config srcs maybe_exprs = do extra_imports = [], prelude_imports = [prelude_import], ghc_e = isJust maybe_exprs, - short_help = shortHelpText config, long_help = fullHelpText config, lastErrorLocations = lastErrLocationsRef, mod_infos = M.empty, @@ -599,6 +594,11 @@ interactiveUI config srcs maybe_exprs = do return () +reportError :: GhciMonad m => GhciCommandMessage -> m () +reportError err = do + printError err + failIfExprEvalMode + {- Note [Changing language extensions for interactive evaluation] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1015,15 +1015,14 @@ generatePromptFunctionFromString promptS modules_names line = processString ('%':'c':'a':'l':'l':xs) = do -- Input has just been validated by parseCallEscape let (cmd NE.:| args, afterClosed) = fromJust $ parseCallEscape xs - respond <- liftIO $ do + respond <- do (code, out, err) <- - readProcessWithExitCode - cmd args "" + liftIO $ readProcessWithExitCode cmd args "" `catchIO` \e -> return (ExitFailure 1, "", show e) case code of ExitSuccess -> return out _ -> do - hPutStrLn stderr err + reportError (GhciPromptCallError err) return "" liftM ((text respond) <>) (processString afterClosed) processString ('%':'%':xs) = @@ -1448,16 +1447,14 @@ specialCommand ('!':str) = lift $ shellEscape (dropWhile isSpace str) specialCommand str = do let (cmd,rest) = break isSpace str maybe_cmd <- lookupCommand cmd - htxt <- short_help <$> getGHCiState case maybe_cmd of GotCommand cmd -> (cmdAction cmd) (dropWhile isSpace rest) BadCommand -> - do liftIO $ hPutStr stderr ("unknown command ':" ++ cmd ++ "'\n" - ++ htxt) + -- JADE_TODO + do reportError (GhciUnknownCommand cmd) return CmdFailure NoLastCommand -> - do liftIO $ hPutStr stderr ("there is no last command to perform\n" - ++ htxt) + do reportError GhciNoLastCommandAvailable return CmdFailure shellEscape :: MonadIO m => String -> m CmdExecOutcome @@ -1577,8 +1574,8 @@ help _ = do ----------------------------------------------------------------------------- -- :info -info :: GHC.GhcMonad m => Bool -> String -> m () -info _ "" = throwGhcException (CmdLineError "syntax: ':i '") +info :: GhciMonad m => Bool -> String -> m () +info _ "" = reportError (GhciCommandSyntaxError "info ") info allInfo s = handleSourceError printGhciException $ do forM_ (words s) $ \thing -> do sdoc <- infoThing allInfo thing @@ -1617,9 +1614,7 @@ pprInfo (thing, fixity, cls_insts, fam_insts, docs) -- :main runMain :: GhciMonad m => String -> m () -runMain s = case toArgsNoLoc s of - Left err -> liftIO (hPutStrLn stderr err) - Right args -> doWithMain (doWithArgs args) +runMain s = toArgsNoLocWithErrorHandler s (doWithMain . doWithArgs) where doWithMain fun = do dflags <- getDynFlags @@ -1676,6 +1671,11 @@ toArgsNoLoc str = map unLoc <$> toArgs fake_loc str fake_loc = mkRealSrcLoc (fsLit "") 1 1 -- this should never be seen, because it's discarded with the `map unLoc` +toArgsNoLocWithErrorHandler :: GhciMonad m => String -> ([String] -> m ()) -> m () +toArgsNoLocWithErrorHandler str f = case toArgsNoLoc str of + Left err -> reportError $ GhciInvalidArgumentString err + Right ok -> f ok + ----------------------------------------------------------------------------- -- :cd @@ -1776,59 +1776,54 @@ chooseEditFile = -- :def defineMacro :: GhciMonad m => Bool{-overwrite-} -> String -> m () -defineMacro _ (':':_) = (liftIO $ hPutStrLn stderr - "macro name cannot start with a colon") - >> failIfExprEvalMode -defineMacro _ ('!':_) = (liftIO $ hPutStrLn stderr - "macro name cannot start with an exclamation mark") - >> failIfExprEvalMode - -- little code duplication allows to grep error msg +defineMacro _ (':':_) = reportError (GhciMacroInvalidStart "a colon") +defineMacro _ ('!':_) = reportError (GhciMacroInvalidStart "an exclamation mark") defineMacro overwrite s = do let (macro_name, definition) = break isSpace s macros <- ghci_macros <$> getGHCiState let defined = map cmdName macros if null macro_name then if null defined + -- JADE_TODO then liftIO $ putStrLn "no macros defined" else liftIO $ putStr ("the following macros are defined:\n" ++ unlines defined) else do isCommand <- isJust <$> lookupCommand' macro_name + let check_newname - | macro_name `elem` defined = throwGhcException (CmdLineError - ("macro '" ++ macro_name ++ "' is already defined. " ++ hint)) - | isCommand = throwGhcException (CmdLineError - ("macro '" ++ macro_name ++ "' overwrites builtin command. " ++ hint)) - | otherwise = return () - hint = " Use ':def!' to overwrite." - - unless overwrite check_newname - -- compile the expression - handleSourceError printErrAndMaybeExit $ do - step <- getGhciStepIO - expr <- GHC.parseExpr definition - -- > ghciStepIO . definition :: String -> IO String - let stringTy :: LHsType GhcPs - stringTy = nlHsTyVar NotPromoted stringTyCon_RDR - ioM :: LHsType GhcPs -- AZ - ioM = nlHsTyVar NotPromoted (getRdrName ioTyConName) `nlHsAppTy` stringTy - body = nlHsVar compose_RDR `mkHsApp` (nlHsPar step) - `mkHsApp` (nlHsPar expr) - tySig = mkHsWildCardBndrs $ noLocA $ mkHsImplicitSigType $ - nlHsFunTy stringTy ioM - new_expr = L (getLoc expr) $ ExprWithTySig noAnn body tySig - hv <- GHC.compileParsedExprRemote new_expr - - let newCmd = Command { cmdName = macro_name - , cmdAction = lift . runMacro hv - , cmdHidden = False - , cmdCompletionFunc = noCompletion - } - - -- later defined macros have precedence - modifyGHCiState $ \s -> - let filtered = [ cmd | cmd <- macros, cmdName cmd /= macro_name ] - in s { ghci_macros = newCmd : filtered } + | macro_name `elem` defined = Just (GhciMacroAlreadyDefined macro_name) + | isCommand = Just (GhciMacroOverwritesBuiltin macro_name) + | otherwise = Nothing + + if | not overwrite, Just err <- check_newname -> reportError err + | otherwise -> do + -- compile the expression + handleSourceError printErrAndMaybeExit $ do + step <- getGhciStepIO + expr <- GHC.parseExpr definition + -- > ghciStepIO . definition :: String -> IO String + let stringTy :: LHsType GhcPs + stringTy = nlHsTyVar NotPromoted stringTyCon_RDR + ioM :: LHsType GhcPs -- AZ + ioM = nlHsTyVar NotPromoted (getRdrName ioTyConName) `nlHsAppTy` stringTy + body = nlHsVar compose_RDR `mkHsApp` (nlHsPar step) + `mkHsApp` (nlHsPar expr) + tySig = mkHsWildCardBndrs $ noLocA $ mkHsImplicitSigType $ + nlHsFunTy stringTy ioM + new_expr = L (getLoc expr) $ ExprWithTySig noAnn body tySig + hv <- GHC.compileParsedExprRemote new_expr + + let newCmd = Command { cmdName = macro_name + , cmdAction = lift . runMacro hv + , cmdHidden = False + , cmdCompletionFunc = noCompletion + } + + -- later defined macros have precedence + modifyGHCiState $ \s -> + let filtered = [ cmd | cmd <- macros, cmdName cmd /= macro_name ] + in s { ghci_macros = newCmd : filtered } runMacro :: GhciMonad m @@ -1850,8 +1845,7 @@ undefineMacro str = mapM_ undef (words str) where undef macro_name = do cmds <- ghci_macros <$> getGHCiState if (macro_name `notElem` map cmdName cmds) - then throwGhcException (CmdLineError - ("macro '" ++ macro_name ++ "' is not defined")) + then reportError (GhciMacroNotDefined macro_name) else do -- This is a tad racy but really, it's a shell modifyGHCiState $ \s -> @@ -1890,9 +1884,8 @@ getGhciStepIO = do ----------------------------------------------------------------------------- -- :doc -docCmd :: GHC.GhcMonad m => String -> m () -docCmd "" = - throwGhcException (CmdLineError "syntax: ':doc '") +docCmd :: GhciMonad m => String -> m () +docCmd "" = reportError (GhciCommandSyntaxError "doc ") docCmd s = do -- TODO: Maybe also get module headers for module names names <- GHC.parseName s @@ -1978,8 +1971,7 @@ handleGetDocsFailure no_docs = do -- :instances instancesCmd :: String -> InputT GHCi () -instancesCmd "" = - throwGhcException (CmdLineError "syntax: ':instances '") +instancesCmd "" = reportError (GhciCommandSyntaxError "instances ") instancesCmd s = do handleSourceError printGhciException $ do ty <- GHC.parseInstanceHead s @@ -2082,16 +2074,13 @@ addModule files = do Finder.findImportedModule hsc_env m (ThisPkg (homeUnitId home_unit)) case result of Found _ _ -> return True - _ -> do liftIO $ hPutStrLn stderr ("Module " ++ moduleNameString m ++ " not found") - failIfExprEvalMode + _ -> do reportError (GhciModuleNotFound (moduleNameString m)) return False checkTargetFile :: GhciMonad m => String -> m Bool checkTargetFile f = do exists <- liftIO (doesFileExist f) - unless exists $ do - liftIO $ hPutStrLn stderr $ "File " ++ f ++ " not found" - failIfExprEvalMode + unless exists $ reportError (GhciFileNotFound f) return exists -- | @:unadd@ command @@ -2164,7 +2153,8 @@ doLoad load_type howmuch = do hmis <- ifaceCache <$> getGHCiState -- If GHCi message gets its own configuration at some stage then this will need to be -- modified to 'embedUnknownDiagnostic'. - ok <- trySuccess $ GHC.loadWithCache (Just hmis) (mkUnknownDiagnostic . GHCiMessage) howmuch + -- JADE_TODO + ok <- trySuccess $ GHC.loadWithCache (Just hmis) (embedUnknownDiagnostic id) howmuch afterLoad ok load_type pure ok @@ -2335,15 +2325,10 @@ modulesLoadedMsg ok mods load_type = do -- | Run an 'ExceptT' wrapped 'GhcMonad' while handling source errors -- and printing 'throwE' strings to 'stderr'. If in expression -- evaluation mode - throw GhcException and exit. -runExceptGhciMonad :: GhciMonad m => ExceptT SDoc m () -> m () +runExceptGhciMonad :: GhciMonad m => ExceptT GhciCommandMessage m () -> m () runExceptGhciMonad act = handleSourceError printGhciException $ - either handleErr pure =<< + either reportError pure =<< runExceptT act - where - handleErr sdoc = do - rendered <- showSDocForUserQualify sdoc - liftIO $ hPutStrLn stderr rendered - failIfExprEvalMode -- | Inverse of 'runExceptT' for \"pure\" computations -- (c.f. 'except' for 'Except') @@ -2419,7 +2404,7 @@ allTypesCmd _ = runExceptGhciMonad $ do -- Helpers for locAtCmd/typeAtCmd/usesCmd -- | Parse a span: -parseSpanArg :: String -> Either SDoc (RealSrcSpan,String) +parseSpanArg :: String -> Either GhciCommandMessage (RealSrcSpan,String) parseSpanArg s = do (fp,s0) <- readAsString (skipWs s) s0' <- skipWs1 s0 @@ -2443,13 +2428,13 @@ parseSpanArg s = do return (span',trailer) where - readAsInt :: String -> Either SDoc (Int,String) - readAsInt "" = Left "Premature end of string while expecting Int" + readAsInt :: String -> Either GhciCommandMessage (Int,String) + readAsInt "" = failParse "Premature end of string while expecting Int" readAsInt s0 = case reads s0 of [s_rest] -> Right s_rest - _ -> Left ("Couldn't read" <+> text (show s0) <+> "as Int") + _ -> failParse $ "Couldn't read" <+> text (show s0) <+> "as Int" - readAsString :: String -> Either SDoc (String,String) + readAsString :: String -> Either GhciCommandMessage (String,String) readAsString s0 | '"':_ <- s0 = case reads s0 of [s_rest] -> Right s_rest @@ -2457,15 +2442,16 @@ parseSpanArg s = do | s_rest@(_:_,_) <- breakWs s0 = Right s_rest | otherwise = leftRes where - leftRes = Left ("Couldn't read" <+> text (show s0) <+> "as String") + leftRes = failParse $ "Couldn't read" <+> text (show s0) <+> "as String" - skipWs1 :: String -> Either SDoc String + skipWs1 :: String -> Either GhciCommandMessage String skipWs1 (c:cs) | isWs c = Right (skipWs cs) - skipWs1 s0 = Left ("Expected whitespace in" <+> text (show s0)) + skipWs1 s0 = failParse $ "Expected whitespace in" <+> text (show s0) isWs = (`elem` [' ','\t']) skipWs = dropWhile isWs breakWs = break isWs + failParse = Left . GhciArgumentParseError -- | Pretty-print \"real\" 'SrcSpan's as @@ -2514,7 +2500,7 @@ scriptCmd :: String -> InputT GHCi () scriptCmd ws = do case words' ws of [s] -> runScript s - _ -> throwGhcException (CmdLineError "syntax: :script ") + _ -> reportError (GhciCommandSyntaxError "script ") -- | A version of 'words' that treats sequences enclosed in double quotes as -- single words and that does not break on backslash-escaped spaces. @@ -2562,7 +2548,7 @@ runScript filename = do -- Displaying Safe Haskell properties of a module -isSafeCmd :: GHC.GhcMonad m => String -> m () +isSafeCmd :: GhciMonad m => String -> m () isSafeCmd m = case words m of [s] | looksLikeModuleName s -> do @@ -2570,7 +2556,7 @@ isSafeCmd m = isSafeModule md [] -> do md <- guessCurrentModule "issafe" isSafeModule md - _ -> throwGhcException (CmdLineError "syntax: :issafe ") + _ -> reportError (GhciCommandSyntaxError "issafe ") isSafeModule :: GHC.GhcMonad m => Module -> m () isSafeModule m = do @@ -2741,7 +2727,7 @@ browseModule bang modl exports_only = do moduleCmd :: GhciMonad m => String -> m () moduleCmd str | all sensible strs = cmd - | otherwise = throwGhcException (CmdLineError "syntax: :module [+/-] [*]M1 ... [*]Mn") + | otherwise = reportError (GhciCommandSyntaxError "module [+/-] [*]M1 ... [*]Mn") where (cmd, strs) = case str of @@ -2989,41 +2975,30 @@ setCmd "" = showOptions False setCmd "-a" = showOptions True setCmd str = case getCmd str of - Right ("args", rest) -> - case toArgsNoLoc rest of - Left err -> liftIO (hPutStrLn stderr err) - Right args -> setArgs args - Right ("prog", rest) -> - case toArgsNoLoc rest of - Right [prog] -> setProg prog - _ -> liftIO (hPutStrLn stderr "syntax: :set prog ") - + Right ("args", rest) -> toArgsNoLocWithErrorHandler rest setArgs + Right ("prog", rest) -> toArgsNoLocWithErrorHandler rest $ \case + [prog] -> setProg prog + _ -> reportError $ GhciCommandSyntaxError "set prog " Right ("prompt", rest) -> setPromptString setPrompt (dropWhile isSpace rest) - "syntax: set prompt " + (GhciCommandSyntaxError "set promp ") Right ("prompt-function", rest) -> setPromptFunc setPrompt $ dropWhile isSpace rest Right ("prompt-cont", rest) -> setPromptString setPromptCont (dropWhile isSpace rest) - "syntax: :set prompt-cont " + (GhciCommandSyntaxError "set prompt-cont ") Right ("prompt-cont-function", rest) -> setPromptFunc setPromptCont $ dropWhile isSpace rest - Right ("editor", rest) -> setEditor $ dropWhile isSpace rest Right ("stop", rest) -> setStop $ dropWhile isSpace rest Right ("local-config", rest) -> setLocalConfigBehaviour $ dropWhile isSpace rest - _ -> case toArgsNoLoc str of - Left err -> liftIO (hPutStrLn stderr err) - Right wds -> () <$ keepGoing' setOptions wds + _ -> toArgsNoLocWithErrorHandler str $ \wds -> () <$ keepGoing' setOptions wds setiCmd :: GhciMonad m => String -> m () setiCmd "" = GHC.getInteractiveDynFlags >>= liftIO . showDynFlags False setiCmd "-a" = GHC.getInteractiveDynFlags >>= liftIO . showDynFlags True -setiCmd str = - case toArgsNoLoc str of - Left err -> liftIO (hPutStrLn stderr err) - Right wds -> newDynFlags True wds +setiCmd str = toArgsNoLocWithErrorHandler str (newDynFlags True) showOptions :: GhciMonad m => Bool -> m () showOptions show_all @@ -3096,8 +3071,7 @@ setLocalConfigBehaviour s modifyGHCiState (\st -> st { localConfig = SourceLocalConfig }) | s == "ignore" = modifyGHCiState (\st -> st { localConfig = IgnoreLocalConfig }) - | otherwise = throwGhcException - (CmdLineError "syntax: :set local-config { source | ignore }") + | otherwise = reportError (GhciCommandSyntaxError "set local-config { source | ignore }") setStop str@(c:_) | isDigit c = do let (nm_str,rest) = break (not.isDigit) str @@ -3134,18 +3108,17 @@ setPromptFunc fSetPrompt s = do convertToPromptFunction func = (\mods line -> liftIO $ liftM text (func mods line)) -setPromptString :: MonadIO m - => (PromptFunction -> m ()) -> String -> String -> m () +setPromptString :: GhciMonad m + => (PromptFunction -> m ()) -> String -> GhciCommandMessage -> m () setPromptString fSetPrompt value err = do if null value - then liftIO $ hPutStrLn stderr $ err + then reportError err else case value of ('\"':_) -> case reads value of [(value', xs)] | all isSpace xs -> setParsedPromptString fSetPrompt value' - _ -> liftIO $ hPutStrLn stderr - "Can't parse prompt string. Use Haskell syntax." + _ -> reportError GhciInvalidPromptString _ -> setParsedPromptString fSetPrompt value @@ -3228,15 +3201,11 @@ newDynFlags interactive_only minus_opts = do return () -unknownFlagsErr :: [String] -> a -unknownFlagsErr fs = throwGhcException $ CmdLineError $ concatMap oneError fs + +unknownFlagsErr :: GhciMonad m => [String] -> m () +unknownFlagsErr fs = mapM_ (\f -> reportError (GhciUnknownFlag f (suggestions f))) fs where - oneError f = - "unrecognised flag: " ++ f ++ "\n" ++ - (case flagSuggestions ghciFlags f of - [] -> "" - suggs -> "did you mean one of:\n" ++ unlines (map (" " ++) suggs)) - ghciFlags = nubSort $ flagsForCompletion True + suggestions f = flagSuggestions (nubSort $ flagsForCompletion True) f unsetOptions :: GhciMonad m => String -> m () unsetOptions str @@ -3357,13 +3326,13 @@ showCmd str = do $ hang (text ":show") 6 $ brackets (fsep $ punctuate (text " |") helpCmds) -showiCmd :: GHC.GhcMonad m => String -> m () +showiCmd :: GhciMonad m => String -> m () showiCmd str = do case words str of ["languages"] -> showiLanguages -- backwards compat ["language"] -> showiLanguages ["lang"] -> showiLanguages -- useful abbreviation - _ -> throwGhcException (CmdLineError ("syntax: :showi language")) + _ -> reportError (GhciCommandSyntaxError "showi language") showImports :: GhciMonad m => m () showImports = do @@ -3550,7 +3519,8 @@ completeCmd argLine0 = case parseLine argLine0 of liftIO . putStrLn $ unwords [ show (length compls'), show (length compls), show (reverse unusedLine) ] forM_ (takeRange resultRange compls) $ \(Completion r _ _) -> do liftIO $ print r - _ -> throwGhcException (CmdLineError "Syntax: :complete repl [] ") + -- JADE_TODO + _ -> reportError (GhciCommandSyntaxError "complete repl [] ") where parseLine [] = Nothing parseLine argLine = case breakSpace argLine of @@ -4587,7 +4557,7 @@ failIfExprEvalMode = do -- | When in expression evaluation mode (ghc -e), we want to exit immediately. -- Otherwis, just print out the message. printErrAndMaybeExit :: (GhciMonad m, MonadIO m, HasLogger m) => SourceError -> m () -printErrAndMaybeExit = (>> failIfExprEvalMode) . printGhciException +printErrAndMaybeExit err = printGhciException err >> failIfExprEvalMode ----------------------------------------------------------------------------- -- recursive exception handlers ===================================== ghc/GHCi/UI/Exception.hs ===================================== @@ -1,15 +1,19 @@ {-# LANGUAGE TypeApplications #-} -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE LambdaCase #-} -module GHCi.UI.Exception(printGhciException, GHCiMessage(..)) where +module GHCi.UI.Exception + ( GhciMessage(..) + , GhciMessageOpts(..) + , GhciCommandMessage(..) + , GHCi + ) where import GHC.Prelude -import GHC.Driver.Config.Diagnostic -import GHC.Driver.Errors import GHC.Driver.Errors.Types -import GHC.Driver.Session import GHC.Iface.Errors.Ppr import GHC.Iface.Errors.Types @@ -19,40 +23,60 @@ import qualified GHC.LanguageExtensions as LangExt import GHC.Tc.Errors.Ppr import GHC.Tc.Errors.Types -import GHC.Types.Error -import GHC.Types.SourceError +import GHC.Types.Error.Codes +import GHC.TypeLits import GHC.Unit.State -import GHC.Utils.Logger import GHC.Utils.Outputable -import Control.Monad.IO.Class +import GHC.Generics +import GHC.Types.Error +import qualified GHC + + +data GhciMessageOpts = GhciMessageOpts + { ghcMessageOpts :: DiagnosticOpts GhcMessage + , ghciCommandMessageOpts :: DiagnosticOpts GhciCommandMessage + } +data GhciMessage where + GhciCommandMessage :: GhciCommandMessage -> GhciMessage + GhciGhcMessage :: GhcMessage -> GhciMessage --- | Print the all diagnostics in a 'SourceError'. Specialised for GHCi error reporting --- for some error messages. -printGhciException :: (HasLogger m, MonadIO m, HasDynFlags m) => SourceError -> m () -printGhciException err = do - dflags <- getDynFlags - logger <- getLogger - let !diag_opts = initDiagOpts dflags - !print_config = initPrintConfig dflags - liftIO $ printMessages logger print_config diag_opts (GHCiMessage <$> (srcErrorMessages err)) +data GhciHint where + GhciCommandHint :: GhciCommandHint -> GhciHint + GhciGhcHint :: GhcHint -> GhciHint +instance Outputable GhciHint where + ppr = \case + GhciCommandHint hint -> ppr hint + GhciGhcHint hint -> ppr hint -newtype GHCiMessage = GHCiMessage { _getGhciMessage :: GhcMessage } +instance HasDefaultDiagnosticOpts GhciMessageOpts where + defaultOpts = GhciMessageOpts + (defaultDiagnosticOpts @GhcMessage) + (defaultDiagnosticOpts @GhciCommandMessage) -instance Diagnostic GHCiMessage where - type DiagnosticOpts GHCiMessage = DiagnosticOpts GhcMessage +instance Diagnostic GhciMessage where + type DiagnosticOpts GhciMessage = GhciMessageOpts + type DiagnosticHint GhciMessage = GhciHint - diagnosticMessage opts (GHCiMessage msg) = ghciDiagnosticMessage opts msg + diagnosticMessage opts = \case + GhciGhcMessage m -> ghciDiagnosticMessage (ghcMessageOpts opts) m + GhciCommandMessage m -> diagnosticMessage (ghciCommandMessageOpts opts) m - diagnosticReason (GHCiMessage msg) = diagnosticReason msg + diagnosticReason = \case + GhciGhcMessage m -> diagnosticReason m + GhciCommandMessage m -> diagnosticReason m - diagnosticHints (GHCiMessage msg) = ghciDiagnosticHints msg + diagnosticHints = \case + GhciGhcMessage m -> map GhciGhcHint (ghciDiagnosticHints m) + GhciCommandMessage m -> map GhciCommandHint (diagnosticHints m) - diagnosticCode (GHCiMessage msg) = diagnosticCode msg + diagnosticCode = \case + GhciGhcMessage m -> diagnosticCode m + GhciCommandMessage m -> diagnosticCode m -- | Modifications to hint messages which we want to display in GHCi. @@ -139,3 +163,157 @@ ghciDiagnosticMessage ghc_opts msg = quotes (text ":set -package " <> ppr (unitPackageName pkg)) <+> text "to expose it." $$ text "(Note: this unloads all the modules in the current scope.)" + +data GhciCommandMessage + -- macro errors + = GhciMacroAlreadyDefined String + | GhciMacroInvalidStart String + | GhciMacroNotDefined String + | GhciMacroOverwritesBuiltin String + -- module name errors + | GhciModuleNotFound String + | GhciNoModuleNameGuess + | GhciNoModuleInfoForCurrentFile + | GhciNoLocationInfoForModule GHC.ModuleName + | GhciNoResolvedModules + | GhciNoModuleForName GHC.Name + | GhciNoMatchingModuleExport + -- argument parse error + | GhciArgumentParseError SDoc + -- other errors + | GhciCommandNotSupportedInMultiMode + | GhciInvalidArgumentString String + | GhciFileNotFound String + | GhciCommandSyntaxError String -- TODO: [String] for Parameters + | GhciInvalidPromptString + | GhciPromptCallError String + | GhciUnknownCommand String + | GhciNoLastCommandAvailable + | GhciUnknownFlag String [String] + | GhciNoSetEditor + deriving Generic + +data GhciCommandHint + = HelpCommand + | SetEditor + | Overwrite + | MeantOther [String] + + +instance Outputable GhciCommandHint where + ppr = \case + HelpCommand + -> use "?" <+> "for help" + MeantOther suggs + -> "did you mean one of" <> colon <+> nest 2 (hsep (map text suggs)) + SetEditor + -> use "set editor" + Overwrite + -> use "def!" <+> "to overwrite" + where use cmd = "Use" <+> quotes (colon <> cmd) + +instance Diagnostic GhciCommandMessage where + type DiagnosticOpts GhciCommandMessage = NoDiagnosticOpts + type DiagnosticHint GhciCommandMessage = GhciCommandHint + + diagnosticMessage NoDiagnosticOpts = mkSimpleDecorated . \case + GhciMacroAlreadyDefined name + -> "Macro" <+> quotes (text name) <+> "is already defined" + GhciMacroOverwritesBuiltin name + -> "Macro" <+> quotes (text name) <+> "overwrites builtin command" + GhciMacroInvalidStart str + -> "Macro name cannot start with" <+> text str + GhciMacroNotDefined name + -> "Macro" <+> quotes (text name) <+> "is not defined" + GhciModuleNotFound modN + -> "Module" <+> text modN <+> "not found" + GhciNoModuleNameGuess + -> "Couldn't guess that module name. Does it exist?" + GhciNoModuleInfoForCurrentFile + -> "No module info for current file! Try loading it?" + GhciNoLocationInfoForModule name + -> "Found a name, but no location information" <.> "The module is" <:> ppr name + GhciNoResolvedModules + -> "Couldn't resolve to any modules." + GhciNoModuleForName name + -> "No module for" <+> ppr name + GhciNoMatchingModuleExport + -> "No matching export in any local modules." + GhciArgumentParseError ape -> ape + GhciCommandNotSupportedInMultiMode + -> "Command is not supported (yet) in multi-mode" + GhciInvalidArgumentString str + -> text str + GhciCommandSyntaxError cmd + -> "Syntax" <> colon $+$ nest 2 (colon <> text cmd) + GhciInvalidPromptString + -> "Can't parse prompt string. Use Haskell syntax" + GhciUnknownCommand cmd + -> "Unknown command" <+> quotes (colon <> text cmd) + GhciNoLastCommandAvailable + -> "There is no last command to perform" + GhciFileNotFound f + -> "File" <+> text f <+> "not found" + GhciUnknownFlag flag _ + -> "Unrecognised flag" <:> text flag + GhciPromptCallError err + -> text err -- JADE_TODO + GhciNoSetEditor + -> "editor not set" + where + l <:> r = l <> colon <+> r + l <.> r = l <> dot <+> r + + -- JADE_TODO + diagnosticReason _ = ErrorWithoutFlag + + diagnosticHints = \case + GhciUnknownCommand{} + -> [HelpCommand] + GhciNoLastCommandAvailable{} + -> [HelpCommand] + GhciUnknownFlag _ suggs@(_:_) + -> [MeantOther suggs] + GhciNoSetEditor{} + -> [SetEditor] + GhciMacroAlreadyDefined{} + -> [Overwrite] + GhciMacroOverwritesBuiltin{} + -> [Overwrite] + _ -> [] + + diagnosticCode = constructorCode @GHCi + +-- | type index for the ghci diagnostic code namespace +data GHCi + +instance DiagnosticCodeNameSpace GHCi where + type instance NameSpaceTag GHCi = "GHCi" + type instance DiagnosticCodeFor GHCi con = GhciDiagnosticCode con + -- For now we don't recur into any error + type instance ConRecursIntoFor GHCi con = 'Nothing + +type GhciDiagnosticCode :: Symbol -> Nat +type family GhciDiagnosticCode c = n | n -> c where + GhciDiagnosticCode "GhciCommandNotSupportedInMultiMode" = 83514 + GhciDiagnosticCode "GhciInvalidArgumentString" = 68894 + GhciDiagnosticCode "GhciCommandSyntaxError" = 72682 + GhciDiagnosticCode "GhciInvalidPromptString" = 50882 + GhciDiagnosticCode "GhciPromptCallError" = 22747 + GhciDiagnosticCode "GhciUnknownCommand" = 54713 + GhciDiagnosticCode "GhciNoLastCommandAvailable" = 29130 + GhciDiagnosticCode "GhciUnknownFlag" = 15670 + GhciDiagnosticCode "GhciNoSetEditor" = 34086 + GhciDiagnosticCode "GhciMacroInvalidStart" = 64996 + GhciDiagnosticCode "GhciMacroAlreadyDefined" = 93909 + GhciDiagnosticCode "GhciMacroNotDefined" = 40561 + GhciDiagnosticCode "GhciMacroOverwritesBuiltin" = 86201 + GhciDiagnosticCode "GhciFileNotFound" = 31901 + GhciDiagnosticCode "GhciModuleNotFound" = 23305 + GhciDiagnosticCode "GhciNoModuleNameGuess" = 21939 + GhciDiagnosticCode "GhciNoModuleInfoForCurrentFile" = 96587 + GhciDiagnosticCode "GhciNoLocationInfoForModule" = 12769 + GhciDiagnosticCode "GhciNoResolvedModules" = 54909 + GhciDiagnosticCode "GhciNoModuleForName" = 21847 + GhciDiagnosticCode "GhciNoMatchingModuleExport" = 59723 + GhciDiagnosticCode "GhciArgumentParseError" = 35671 ===================================== ghc/GHCi/UI/Info.hs ===================================== @@ -50,6 +50,8 @@ import GHC.Types.SrcLoc import GHC.Types.Var import qualified GHC.Data.Strict as Strict +import GHCi.UI.Exception + -- | Info about a module. This information is generated every time a -- module is loaded. data ModInfo = ModInfo @@ -114,23 +116,19 @@ findLoc :: GhcMonad m => Map ModuleName ModInfo -> RealSrcSpan -> String - -> ExceptT SDoc m (ModInfo,Name,SrcSpan) + -> ExceptT GhciCommandMessage m (ModInfo,Name,SrcSpan) findLoc infos span0 string = do - name <- maybeToExceptT "Couldn't guess that module name. Does it exist?" $ + name <- maybeToExceptT GhciNoModuleNameGuess $ guessModule infos (srcSpanFilePath span0) - info <- maybeToExceptT "No module info for current file! Try loading it?" $ + info <- maybeToExceptT GhciNoModuleInfoForCurrentFile $ MaybeT $ pure $ M.lookup name infos name' <- findName infos span0 info string case getSrcSpan name' of - UnhelpfulSpan{} -> do - throwE ("Found a name, but no location information." <+> - "The module is:" <+> - maybe "" (ppr . moduleName) - (nameModule_maybe name')) - + UnhelpfulSpan{} -> throwE $ GhciNoLocationInfoForModule + (maybe (ModuleName "") moduleName (nameModule_maybe name')) span' -> return (info,name',span') -- | Find any uses of the given identifier in the codebase. @@ -138,7 +136,7 @@ findNameUses :: (GhcMonad m) => Map ModuleName ModInfo -> RealSrcSpan -> String - -> ExceptT SDoc m [SrcSpan] + -> ExceptT GhciCommandMessage m [SrcSpan] findNameUses infos span0 string = locToSpans <$> findLoc infos span0 string where @@ -166,7 +164,7 @@ findName :: GhcMonad m -> RealSrcSpan -> ModInfo -> String - -> ExceptT SDoc m Name + -> ExceptT GhciCommandMessage m Name findName infos span0 mi string = case resolveName (modinfoSpans mi) (spanInfoFromRealSrcSpan' span0) of Nothing -> tryExternalModuleResolution @@ -178,7 +176,7 @@ findName infos span0 mi string = rdrs = modInfo_rdrs mi tryExternalModuleResolution = case find (matchName $ mkFastString string) rdrs of - Nothing -> throwE "Couldn't resolve to any modules." + Nothing -> throwE GhciNoResolvedModules Just imported -> resolveNameFromModule infos imported matchName :: FastString -> Name -> Bool @@ -190,18 +188,21 @@ findName infos span0 mi string = resolveNameFromModule :: GhcMonad m => Map ModuleName ModInfo -> Name - -> ExceptT SDoc m Name + -> ExceptT GhciCommandMessage m Name resolveNameFromModule infos name = do - modL <- maybe (throwE $ "No module for" <+> ppr name) return $ + modL <- maybe (throwE $ GhciNoModuleForName name) return $ nameModule_maybe name - info <- maybe (throwE (ppr (moduleUnit modL) <> ":" <> - ppr modL)) return $ - M.lookup (moduleName modL) infos + -- BÄRBEL_TODO + -- info <- maybe (throwE (ppr (moduleUnit modL) <> ":" <> + -- ppr modL)) return $ + -- M.lookup (moduleName modL) infos + info <- maybe (throwE undefined) return $ + M.lookup (moduleName modL) infos let all_names = modInfo_rdrs info - maybe (throwE "No matching export in any local modules.") return $ + maybe (throwE GhciNoMatchingModuleExport) return $ find (matchName name) all_names where matchName :: Name -> Name -> Bool @@ -218,12 +219,12 @@ findType :: GhcMonad m => Map ModuleName ModInfo -> RealSrcSpan -> String - -> ExceptT SDoc m (ModInfo, Type) + -> ExceptT GhciCommandMessage m (ModInfo, Type) findType infos span0 string = do - name <- maybeToExceptT "Couldn't guess that module name. Does it exist?" $ + name <- maybeToExceptT GhciNoModuleNameGuess $ guessModule infos (srcSpanFilePath span0) - info <- maybeToExceptT "No module info for current file! Try loading it?" $ + info <- maybeToExceptT GhciNoModuleInfoForCurrentFile $ MaybeT $ pure $ M.lookup name infos case resolveType (modinfoSpans info) (spanInfoFromRealSrcSpan' span0) of ===================================== ghc/GHCi/UI/Monad.hs ===================================== @@ -24,9 +24,7 @@ module GHCi.UI.Monad ( runStmt, runDecls, runDecls', resume, recordBreak, revertCAFs, ActionStats(..), runAndPrintStats, runWithStats, printStats, - printForUserNeverQualify, - printForUserGlobalRdrEnv, - printForUser, printForUserPartWay, prettyLocations, + prettyLocations, compileGHCiExpr, initInterpBuffering, @@ -42,7 +40,6 @@ import GHC.Driver.Monad hiding (liftIO) import GHC.Utils.Outputable import qualified GHC.Driver.Ppr as Ppr import GHC.Types.Name.Occurrence -import GHC.Types.Name.Reader import GHC.Driver.Session import GHC.Data.FastString import GHC.Driver.Env @@ -51,12 +48,10 @@ import GHC.Types.SafeHaskell import GHC.Driver.Make (ModIfaceCache(..)) import GHC.Unit import GHC.Types.Name.Reader as RdrName (mkOrig) -import qualified GHC.Types.Name.Ppr as Ppr (mkNamePprCtx) import GHC.Builtin.Names (gHC_INTERNAL_GHCI_HELPERS) import GHC.Runtime.Interpreter import GHC.Runtime.Context import GHCi.RemoteTypes -import GHCi.UI.Exception (printGhciException) import GHC.Hs (ImportDecl, GhcPs, GhciLStmt, LHsDecl) import GHC.Hs.Utils import GHC.Utils.Misc @@ -82,6 +77,8 @@ import qualified Data.IntMap.Strict as IntMap import qualified GHC.Data.EnumSet as EnumSet import qualified GHC.LanguageExtensions as LangExt +import GHCi.UI.Print + ----------------------------------------------------------------------------- -- GHCi monad @@ -155,9 +152,6 @@ data GHCiState = GHCiState -- "import Prelude hiding (map)" ghc_e :: Bool, -- ^ True if this is 'ghc -e' (or runghc) - - short_help :: String, - -- ^ help text to display to a user long_help :: String, lastErrorLocations :: IORef [(FastString, Int)], @@ -360,36 +354,6 @@ unsetOption opt = do st <- getGHCiState setGHCiState (st{ options = filter (/= opt) (options st) }) -printForUserNeverQualify :: GhcMonad m => SDoc -> m () -printForUserNeverQualify doc = do - dflags <- GHC.getInteractiveDynFlags - liftIO $ Ppr.printForUser dflags stdout neverQualify AllTheWay doc - -printForUserGlobalRdrEnv :: (GhcMonad m, Outputable info) - => Maybe (GlobalRdrEnvX info) -> SDoc -> m () -printForUserGlobalRdrEnv mb_rdr_env doc = do - dflags <- GHC.getInteractiveDynFlags - name_ppr_ctx <- mkNamePprCtxFromGlobalRdrEnv dflags mb_rdr_env - liftIO $ Ppr.printForUser dflags stdout name_ppr_ctx AllTheWay doc - where - mkNamePprCtxFromGlobalRdrEnv _ Nothing = GHC.getNamePprCtx - mkNamePprCtxFromGlobalRdrEnv dflags (Just rdr_env) = - withSession $ \ hsc_env -> - let unit_env = hsc_unit_env hsc_env - ptc = initPromotionTickContext dflags - in return $ Ppr.mkNamePprCtx ptc unit_env rdr_env - -printForUser :: GhcMonad m => SDoc -> m () -printForUser doc = do - name_ppr_ctx <- GHC.getNamePprCtx - dflags <- GHC.getInteractiveDynFlags - liftIO $ Ppr.printForUser dflags stdout name_ppr_ctx AllTheWay doc - -printForUserPartWay :: GhcMonad m => SDoc -> m () -printForUserPartWay doc = do - name_ppr_ctx <- GHC.getNamePprCtx - dflags <- GHC.getInteractiveDynFlags - liftIO $ Ppr.printForUser dflags stdout name_ppr_ctx DefaultDepth doc -- | Run a single Haskell expression runStmt ===================================== ghc/GHCi/UI/Print.hs ===================================== @@ -0,0 +1,85 @@ +module GHCi.UI.Print + ( printForUserNeverQualify + , printForUserGlobalRdrEnv + , printForUser + , printForUserPartWay + , printError -- TODO + , printGhciException + ) where + +import qualified GHC +import GHC.Types.Name.Reader +import GHC.Types.SourceError +import GHC.Types.SrcLoc +import GHC.Types.Error +import GHC.Driver.Monad +import GHC.Driver.Env +import GHC.Driver.Session +import GHC.Driver.Errors +import GHC.Driver.Config.Diagnostic + +import GHC.Utils.Logger +import GHC.Utils.Error +import GHC.Utils.Outputable +import qualified GHC.Types.Name.Ppr as Ppr (mkNamePprCtx) +import qualified GHC.Driver.Ppr as Ppr + +import Prelude hiding ((<>)) +import System.IO + +import GHCi.UI.Exception + + +printForUserNeverQualify :: GhcMonad m => SDoc -> m () +printForUserNeverQualify doc = do + dflags <- GHC.getInteractiveDynFlags + liftIO $ Ppr.printForUser dflags stdout neverQualify AllTheWay doc + +printForUserGlobalRdrEnv :: (GhcMonad m, Outputable info) + => Maybe (GlobalRdrEnvX info) -> SDoc -> m () +printForUserGlobalRdrEnv mb_rdr_env doc = do + dflags <- GHC.getInteractiveDynFlags + name_ppr_ctx <- mkNamePprCtxFromGlobalRdrEnv dflags mb_rdr_env + liftIO $ Ppr.printForUser dflags stdout name_ppr_ctx AllTheWay doc + where + mkNamePprCtxFromGlobalRdrEnv _ Nothing = GHC.getNamePprCtx + mkNamePprCtxFromGlobalRdrEnv dflags (Just rdr_env) = + withSession $ \ hsc_env -> + let unit_env = hsc_unit_env hsc_env + ptc = initPromotionTickContext dflags + in return $ Ppr.mkNamePprCtx ptc unit_env rdr_env + +printForUser :: GhcMonad m => SDoc -> m () +printForUser doc = do + name_ppr_ctx <- GHC.getNamePprCtx + dflags <- GHC.getInteractiveDynFlags + liftIO $ Ppr.printForUserColoured dflags stdout name_ppr_ctx AllTheWay doc + +printForUserPartWay :: GhcMonad m => SDoc -> m () +printForUserPartWay doc = do + name_ppr_ctx <- GHC.getNamePprCtx + dflags <- GHC.getInteractiveDynFlags + liftIO $ Ppr.printForUser dflags stdout name_ppr_ctx DefaultDepth doc + +printError :: GhcMonad m => GhciCommandMessage -> m () +printError err = printError' (const NoDiagnosticOpts) $ singleMessage (mkPlainErrorMsgEnvelope (UnhelpfulSpan UnhelpfulInteractive) err) + +-- | Print the all diagnostics in a 'SourceError'. Specialised for GHCi error reporting +-- for some error messages. +printGhciException :: GhcMonad m => SourceError -> m () +printGhciException err = printError' initGhciPrintConfig (GhciGhcMessage <$> (srcErrorMessages err)) + +printError' :: (GhcMonad m, Diagnostic a) => (DynFlags -> DiagnosticOpts a) -> Messages a -> m () +printError' get_config err = do + dflags <- getDynFlags + logger <- getLogger + let !diag_opts = initDiagOpts dflags + !print_config = get_config dflags + liftIO $ printMessages logger print_config diag_opts err + + +initGhciPrintConfig :: DynFlags -> GhciMessageOpts +initGhciPrintConfig dflags = GhciMessageOpts + { ghcMessageOpts = initPrintConfig dflags + , ghciCommandMessageOpts = NoDiagnosticOpts + } ===================================== ghc/ghc-bin.cabal.in ===================================== @@ -68,6 +68,7 @@ Executable ghc GHCi.UI GHCi.UI.Info GHCi.UI.Monad + GHCi.UI.Print GHCi.UI.Exception GHCi.Util Other-Extensions: ===================================== linters/lint-codes/LintCodes/Static.hs ===================================== @@ -1,4 +1,5 @@ {-# LANGUAGE BlockArguments #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE GeneralisedNewtypeDeriving #-} {-# LANGUAGE TypeApplications #-} @@ -26,7 +27,7 @@ import GHC.Driver.Errors.Types import GHC.Types.Error ( DiagnosticCode(..) ) import GHC.Types.Error.Codes - ( constructorCodes ) + ( GHC, constructorCodes ) -- ghc (API usage) import GHC @@ -77,7 +78,7 @@ import Language.Haskell.Syntax.Module.Name -- | The diagnostic codes that are statically reachable from the -- 'GhcMessage' datatype. staticallyUsedCodes :: Map DiagnosticCode String -staticallyUsedCodes = constructorCodes @GhcMessage +staticallyUsedCodes = constructorCodes @GHC @GhcMessage -------------------------------------------------------------------------------- ===================================== linters/lint-codes/Main.hs ===================================== @@ -67,7 +67,7 @@ listOutdatedCodes famEqnCodes = do -- -- Assumes we are in a GHC Git tree, as we look at all testsuite .stdout and -- .stderr files. -testCodes :: Map DiagnosticCode ( FamEqnIndex, String, Use ) -> IO () +testCodes :: Map DiagnosticCode ( FamEqnIndex, String, Use ) -> IO () testCodes famEqnCodes = do ------------------------------ ===================================== testsuite/tests/ghci/scripts/T10508.stderr ===================================== @@ -1,4 +1,3 @@ - :1:15: error: [GHC-83865] • Couldn't match type: a0 -> a0 with: [Char] @@ -8,5 +7,8 @@ In the first argument of ‘return’, namely ‘id’ In the expression: return id In the second argument of ‘(.)’, namely ‘(\ _ -> return id)’ -unknown command ':macro' -use :? for help. + +: error: [GHCi-54713] + Unknown command ‘:macro’ + use :? for help + View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e738c19d8c366b9779ae8f9e73360431f6222f6...8c1acd064a461c60b248226942845fe704c6b404 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5e738c19d8c366b9779ae8f9e73360431f6222f6...8c1acd064a461c60b248226942845fe704c6b404 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 21:50:01 2024 From: gitlab at gitlab.haskell.org (Vladislav Zavialov (@int-index)) Date: Wed, 31 Jul 2024 17:50:01 -0400 Subject: [Git][ghc/ghc][wip/sand-witch/types-in-terms] Simplify, add comments Message-ID: <66aab189649b2_b6466a5110811457c@gitlab.mail> Vladislav Zavialov pushed to branch wip/sand-witch/types-in-terms at Glasgow Haskell Compiler / GHC Commits: ef0a33b8 by Vladislav Zavialov at 2024-08-01T00:49:29+03:00 Simplify, add comments - - - - - 7 changed files: - compiler/GHC/Hs/Expr.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/ThToHs.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/Language/Haskell/Syntax/Extension.hs Changes: ===================================== compiler/GHC/Hs/Expr.hs ===================================== @@ -381,14 +381,14 @@ type instance XEmbTy GhcTc = DataConCantHappen -- A free-standing HsEmbTy is an error. -- Valid usages are immediately desugared into Type. -type instance XQual GhcPs = NoExtField -type instance XQual GhcRn = NoExtField -type instance XQual GhcTc = DataConCantHappen - type instance XForAll GhcPs = NoExtField type instance XForAll GhcRn = NoExtField type instance XForAll GhcTc = DataConCantHappen +type instance XQual GhcPs = NoExtField +type instance XQual GhcRn = NoExtField +type instance XQual GhcTc = DataConCantHappen + type instance XFunArr GhcPs = NoExtField type instance XFunArr GhcRn = NoExtField type instance XFunArr GhcTc = DataConCantHappen ===================================== compiler/GHC/Parser/PostProcess.hs ===================================== @@ -107,7 +107,7 @@ module GHC.Parser.PostProcess ( ecpFromPat, ArrowParsingMode(..), withArrowParsingMode, withArrowParsingMode', - setTelescopeBndrsNamespace, + setTelescopeBndrsNameSpace, PatBuilder, hsHoleExpr, @@ -844,7 +844,8 @@ mkGadtDecl loc names dcol ty = do setRdrNameSpace :: RdrName -> NameSpace -> RdrName -- ^ This rather gruesome function is used mainly by the parser. --- When parsing: +-- +-- Case #1. When parsing: -- -- > data T a = T | T1 Int -- @@ -856,6 +857,13 @@ setRdrNameSpace :: RdrName -> NameSpace -> RdrName -- > data [] a = [] | a : [a] -- -- For the exact-name case we return an original name. +-- +-- Case #2. When parsing: +-- +-- > x = fn (forall a. a) -- RequiredTypeArguments +-- +-- we use setRdrNameSpace to set the namespace of forall-bound variables. +-- setRdrNameSpace (Unqual occ) ns = Unqual (setOccNameSpace ns occ) setRdrNameSpace (Qual m occ) ns = Qual m (setOccNameSpace ns occ) setRdrNameSpace (Orig m occ) ns = Orig m (setOccNameSpace ns occ) @@ -1984,7 +1992,7 @@ instance DisambECP (HsExpr GhcPs) where return $ mkMultExpr pct t mkHsForallPV l telescope ty = return $ L (noAnnSrcSpan l) $ - HsForAll noExtField (setTelescopeBndrsNamespace varName telescope) ty + HsForAll noExtField (setTelescopeBndrsNameSpace varName telescope) ty checkContextPV = checkContextExpr mkQualPV l qual ty = return $ L (noAnnSrcSpan l) $ @@ -2143,9 +2151,11 @@ This depends on the enabled extensions: ViewPatterns, RequiredTypeArguments => view pattern ViewPatterns, NoRequiredTypeArguments => view pattern -The decision how to parse the arrow pattern is captured by the -`ArrowParsingMode` data type. Naively, one might expect to see the following -definition: +The decision how to parse arrow patterns (p1 -> p2) is captured by the +`ArrowParsingMode` data type, produced in `withArrowParsingMode` and +consumed in `mkHsArrowPV`. + +Naively, one might expect to see the following definition: -- a simple (but insufficient) definition data ArrowParsingMode = ArrowIsViewPat | ArrowIsFunType @@ -2208,18 +2218,27 @@ withArrowParsingMode cont = do withArrowParsingMode' :: DisambECP b => (forall lhs. DisambECP lhs => ArrowParsingMode lhs b -> PV (LocatedA b)) -> PV (LocatedA b) withArrowParsingMode' = withArrowParsingMode -setTelescopeBndrsNamespace :: NameSpace -> HsForAllTelescope GhcPs -> HsForAllTelescope GhcPs -setTelescopeBndrsNamespace ns forall_telescope = case forall_telescope of - HsForAllInvis x invis_bndrs -> HsForAllInvis x (map set_bndr_ns invis_bndrs) - HsForAllVis x vis_bndrs -> HsForAllVis x (map set_bndr_ns vis_bndrs) +-- When a forall-type occurs in term syntax, forall-bound variables should +-- inhabit the term namespace `varName` rather than the usual `tvName`. +-- See Note [Types in terms]. +-- +-- Since type variable binders in a `HsForAllTelescope` produced by the +-- `forall_telescope` nonterminal have their namespaces set to `tvName`, +-- we use `setTelescopeBndrsNameSpace` to fix them up. +setTelescopeBndrsNameSpace :: NameSpace -> HsForAllTelescope GhcPs -> HsForAllTelescope GhcPs +setTelescopeBndrsNameSpace ns forall_telescope = + case forall_telescope of + HsForAllInvis x bndrs -> HsForAllInvis x (map set_bndr_ns bndrs) + HsForAllVis x bndrs -> HsForAllVis x (map set_bndr_ns bndrs) where set_bndr_ns :: LHsTyVarBndr flag GhcPs -> LHsTyVarBndr flag GhcPs - set_bndr_ns (L l bndr) = L l $ case bndr of - UserTyVar x flag rdr -> UserTyVar x flag (set_rdr_ns rdr) - KindedTyVar x flag rdr kind -> KindedTyVar x flag (set_rdr_ns rdr) kind + set_bndr_ns (L l bndr) = + L l $ case bndr of + UserTyVar x flag rdr -> UserTyVar x flag (set_rdr_ns rdr) + KindedTyVar x flag rdr kind -> KindedTyVar x flag (set_rdr_ns rdr) kind - set_rdr_ns (L l (Unqual occ)) = L l (Unqual occ{occNameSpace = ns}) - set_rdr_ns rdr = rdr + set_rdr_ns :: LocatedN RdrName -> LocatedN RdrName + set_rdr_ns (L l rdr) = L l (setRdrNameSpace rdr ns) -- | Ensure that a literal pattern isn't of type Addr#, Float#, Double#. checkUnboxedLitPat :: Located (HsLit GhcPs) -> PV () ===================================== compiler/GHC/Tc/Errors/Types.hs ===================================== @@ -6812,11 +6812,13 @@ data TcRnNoDerivStratSpecifiedInfo where -> LHsSigWcType GhcRn -- ^ The instance signature (e.g @Show a => Show (T a)@) -> TcRnNoDerivStratSpecifiedInfo +-- | Label for syntax that may occur in terms (expressions) only as part of a +-- required type argument. data TypeSyntax - = TypeKeywordSyntax - | ContextArrowSyntax - | FunctionArrowSyntax - | ForallTelescopeSyntax + = TypeKeywordSyntax -- ^ @type t@ + | ContextArrowSyntax -- ^ @ctx => t@ + | FunctionArrowSyntax -- ^ @t1 -> t2@ + | ForallTelescopeSyntax -- ^ @forall tvs. t@ deriving Generic typeSyntaxExtension :: TypeSyntax -> LangExt.Extension ===================================== compiler/GHC/Tc/Types/Origin.hs ===================================== @@ -751,9 +751,9 @@ exprCtOrigin (HsUntypedSplice {}) = Shouldn'tHappenOrigin "TH untyped splice" exprCtOrigin (HsProc {}) = Shouldn'tHappenOrigin "proc" exprCtOrigin (HsStatic {}) = Shouldn'tHappenOrigin "static expression" exprCtOrigin (HsEmbTy {}) = Shouldn'tHappenOrigin "type expression" -exprCtOrigin (HsQual {}) = Shouldn'tHappenOrigin "constraint context" -exprCtOrigin (HsForAll {}) = Shouldn'tHappenOrigin "forall telescope" -exprCtOrigin (HsFunArr {}) = Shouldn'tHappenOrigin "function arrow" +exprCtOrigin (HsForAll {}) = Shouldn'tHappenOrigin "forall telescope" -- See Note [Types in terms] +exprCtOrigin (HsQual {}) = Shouldn'tHappenOrigin "constraint context" -- See Note [Types in terms] +exprCtOrigin (HsFunArr {}) = Shouldn'tHappenOrigin "function arrow" -- See Note [Types in terms] exprCtOrigin (XExpr (ExpandedThingRn thing _)) | OrigExpr a <- thing = exprCtOrigin a | OrigStmt _ <- thing = DoOrigin | OrigPat p <- thing = DoPatOrigin p ===================================== compiler/GHC/ThToHs.hs ===================================== @@ -1187,16 +1187,18 @@ cvtl e = wrapLA (cvt e) cvt (ConstrainedE ctx body) = do { ctx' <- mapM cvtl ctx ; body' <- cvtl body ; return $ HsQual noExtField (L noAnn ctx') body' } - cvt exp - | ForallE tvs body <- exp = forall_builder tvs body mkHsForAllInvisTele - | ForallVisE tvs body <- exp = forall_builder tvs body mkHsForAllVisTele - where - forall_builder tvs body build_forall_tele - = do { tvs' <- cvtTvs tvs - ; body' <- cvtl body - ; let tele = setTelescopeBndrsNamespace varName $ - build_forall_tele noAnn tvs' - ; return $ HsForAll noExtField tele body'} + cvt (ForallE tvs body) = + do { tvs' <- cvtTvs tvs + ; body' <- cvtl body + ; let tele = setTelescopeBndrsNameSpace varName $ + mkHsForAllInvisTele noAnn tvs' + ; return $ HsForAll noExtField tele body' } + cvt (ForallVisE tvs body) = + do { tvs' <- cvtTvs tvs + ; body' <- cvtl body + ; let tele = setTelescopeBndrsNameSpace varName $ + mkHsForAllVisTele noAnn tvs' + ; return $ HsForAll noExtField tele body' } {- | #16895 Ensure an infix expression's operator is a variable/constructor. Consider this example: ===================================== compiler/Language/Haskell/Syntax/Expr.hs ===================================== @@ -260,6 +260,80 @@ extension field, The typechecker keeps HsRecSel as HsRecSel, and transforms the record-selector Name to an Id. -} +{- Note [Types in terms] +~~~~~~~~~~~~~~~~~~~~~~~~ +Types-in-terms is a notion introduced by GHC Proposal #281. It refers +to the extension of term syntax (HsExpr in the AST, infixexp2 in Parser.y) +with constructs that previously could only occur at the type level: + + * Function arrows: a -> b + * Multiplicity-polymorphic function arrows: a %m -> b (LinearTypes) + * Constraint arrows: a => b + * Universal quantification: forall a. b + * Visible universal quantification: forall a -> b + +This syntax can't be used to construct a type at the term level because `Type` +is not inhabited by any terms. Its use is limited to required type arguments: + + -- Error: + t :: Type + t = (Int -> String) + -- Not supported by GHC, `tcExpr` emits `TcRnIllegalTypeExpr` + + -- OK: + s :: String + s = vfun (Int -> String) + -- Valid use in a required type argument, + -- see `expr_to_type` (GHC.Tc.Gen.App) + where + vfun :: forall t -> Typeable t => String + vfun t = show (typeRep @t) + +In GHC, types-in-terms are implemented by the following additions to the AST of +expressions and their grammar: + + -- Language/Haskell/Syntax/Expr.hs + data HsExpr p = + ... + | HsForAll (XForAll p) (HsForAllTelescope p) (LHsExpr p) + | HsQual (XQual p) (XRec p [LHsExpr p]) (LHsExpr p) + | HsFunArr (XFunArr p) (HsArrowOf (LHsExpr p) p) (LHsExpr p) (LHsExpr p) + + -- GHC/Parser.y + infixexp2 :: { ECP } + : infixexp %shift { ... } + | infixexp '->' infixexp2 { ... } + | infixexp expmult '->' infixexp2 { ... } + | infixexp '->.' infixexp2 { ... } + | expcontext '=>' infixexp2 { ... } + | forall_telescope infixexp2 { ... } + +These constructors and non-terminals mirror those found in HsType + + HsType | HsExpr + -------------+----------- + HsForAllTy | HsForAll + HsFunTy | HsQual + HsQualTy | HsFunArr + +The resulting code duplication can be removed if we unify HsExpr and HsType +into one type (#25121). + +Per the proposal, the constituents of types-in-terms are parsed and renamed +as terms, and forall-bound variables inhabit the term namespace. Example: + + h = \a -> g (forall a. Maybe a) a + +To ensure that the `a` in `Maybe a` refers to the innermost binding (i.e. to the +forall-bound `a` and not to the lambda-bound `a`), we must consistently use the +term namespace `varName` throughout the expression. We set the correct namespace +using `setTelescopeBndrsNameSpace` in GHC.Parser.PostProcess and GHC.ThToHs. + +`exprCtOrigin` returns `Shouldn'tHappenOrigin` for types-in-terms because +they either undergo the T2T translation `expr_to_type` in `tcVDQ` or result +in `TcRnIllegalTypeExpr`. +-} + -- | A Haskell expression. data HsExpr p = HsVar (XVar p) @@ -574,14 +648,23 @@ data HsExpr p | HsPragE (XPragE p) (HsPragE p) (LHsExpr p) -- Embed the syntax of types into expressions. - -- Used with RequiredTypeArguments, e.g. fn (type (Int -> Bool)) + -- Used with @RequiredTypeArguments@, e.g. @fn (type (Int -> Bool))@. | HsEmbTy (XEmbTy p) (LHsWcType (NoGhcTc p)) - | HsQual (XQual p) (XRec p [LHsExpr p]) (LHsExpr p) - + -- | Forall-types @forall tvs. t@ and @forall tvs -> t at . + -- Used with @RequiredTypeArguments@, e.g. @fn (forall a. Proxy a)@. + -- See Note [Types in terms] | HsForAll (XForAll p) (HsForAllTelescope p) (LHsExpr p) + -- Constrained types @ctx => t at . + -- Used with @RequiredTypeArguments@, e.g. @fn (Bounded a => a)@. + -- See Note [Types in terms] + | HsQual (XQual p) (XRec p [LHsExpr p]) (LHsExpr p) + + -- | Function types @a -> b at . + -- Used with @RequiredTypeArguments@, e.g. @fn (Int -> Bool)@. + -- See Note [Types in terms] | HsFunArr (XFunArr p) (HsArrowOf (LHsExpr p) p) (LHsExpr p) (LHsExpr p) | XExpr !(XXExpr p) ===================================== compiler/Language/Haskell/Syntax/Extension.hs ===================================== @@ -448,8 +448,8 @@ type family XTick x type family XBinTick x type family XPragE x type family XEmbTy x -type family XQual x type family XForAll x +type family XQual x type family XFunArr x type family XXExpr x View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef0a33b84666ba8610dc2809ef0cd23f6486cdaf -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef0a33b84666ba8610dc2809ef0cd23f6486cdaf You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at gitlab.haskell.org Wed Jul 31 22:57:36 2024 From: gitlab at gitlab.haskell.org (Marge Bot (@marge-bot)) Date: Wed, 31 Jul 2024 18:57:36 -0400 Subject: [Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: Deriving-via one-shot strict state Monad instances Message-ID: <66aac160cdfc4_4a6d72a1408770c1@gitlab.mail> Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 1aec9036 by Rodrigo Mesquita at 2024-07-31T18:57:06-04:00 Deriving-via one-shot strict state Monad instances A small refactor to use deriving via GHC.Utils.Monad.State.Strict Monad instances for state Monads with unboxed/strict results which all re-implemented the one-shot trick in the instance and used unboxed tuples: * CmmOptM in GHC.Cmm.GenericOpt * RegM in GHC.CmmToAsm.Reg.Linear.State * UniqSM in GHC.Types.Unique.Supply - - - - - dbd27faa by doyougnu at 2024-07-31T18:57:06-04:00 Rts linker: add case for pc-rel 64 relocation part of the upstream haskell.nix patches - - - - - 3c261bd7 by doyougnu at 2024-07-31T18:57:07-04:00 RTS linker: aarch64: better debug information Dump better debugging information when a symbol address is null. Part of the haskell.nix patches upstream project Co-authored-by: Sylvain Henry <sylvain at haskus.fr> - - - - - 6e0f8d23 by Rodrigo Mesquita at 2024-07-31T18:57:08-04:00 base: Add haddocks to HasExceptionContext Fixes #25091 - - - - - 43bd0117 by Sylvain Henry at 2024-07-31T18:57:11-04:00 Only lookup ghcversion.h file in the RTS include-dirs by default. The code was introduced in 3549c952b535803270872adaf87262f2df0295a4. It used `getPackageIncludePath` which name doesn't convey that it looks into all include paths of the preload units too. So this behavior is probably unintentional and it should be ok to change it. Fix #25106 - - - - - 2b8606d5 by Matthew Pickering at 2024-07-31T18:57:11-04:00 driver: Fix -Wmissing-home-modules when multiple units have the same module name It was assumed that module names were unique but that isn't true with multiple units. The fix is quite simple, maintain a set of `(ModuleName, UnitId)` and query that to see whether the module has been specified. Fixes #25122 - - - - - 0fc5339c by sheaf at 2024-07-31T18:57:18-04:00 PMC: suggest in-scope COMPLETE sets when possible This commit modifies GHC.HsToCore.Pmc.Solver.generateInhabitingPatterns to prioritise reporting COMPLETE sets in which all of the ConLikes are in scope. This avoids suggesting out of scope constructors when displaying an incomplete pattern match warning, e.g. in baz :: Ordering -> Int baz = \case EQ -> 5 we prefer: Patterns of type 'Ordering' not matched: LT GT over: Patterns of type 'Ordering' not matched: OutOfScope Fixes #25115 - - - - - 22 changed files: - compiler/GHC/Cmm/GenericOpt.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/SysTools/Cpp.hs - compiler/GHC/Types/Unique/Supply.hs - compiler/GHC/Utils/Monad/State/Strict.hs - libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs - rts/linker/PEi386.c - rts/linker/elf_reloc_aarch64.c - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs - testsuite/tests/driver/multipleHomeUnits/all.T - + testsuite/tests/driver/multipleHomeUnits/unitSame1 - + testsuite/tests/driver/multipleHomeUnits/unitSame2 - + testsuite/tests/pmcheck/complete_sigs/T25115.hs - + testsuite/tests/pmcheck/complete_sigs/T25115.stderr - + testsuite/tests/pmcheck/complete_sigs/T25115a.hs - testsuite/tests/pmcheck/complete_sigs/all.T Changes: ===================================== compiler/GHC/Cmm/GenericOpt.hs ===================================== @@ -5,6 +5,7 @@ -- -- ----------------------------------------------------------------------------- +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -26,7 +27,8 @@ import GHC.Cmm.Opt ( cmmMachOpFold ) import GHC.Cmm.CLabel import GHC.Data.FastString import GHC.Unit -import Control.Monad +import Control.Monad.Trans.Reader +import GHC.Utils.Monad.State.Strict as Strict -- ----------------------------------------------------------------------------- -- Generic Cmm optimiser @@ -67,19 +69,7 @@ pattern OptMResult x y = (# x, y #) {-# COMPLETE OptMResult #-} newtype CmmOptM a = CmmOptM (NCGConfig -> [CLabel] -> OptMResult a) - deriving (Functor) - -instance Applicative CmmOptM where - pure x = CmmOptM $ \_ imports -> OptMResult x imports - (<*>) = ap - -instance Monad CmmOptM where - (CmmOptM f) >>= g = - CmmOptM $ \config imports0 -> - case f config imports0 of - OptMResult x imports1 -> - case g x of - CmmOptM g' -> g' config imports1 + deriving (Functor, Applicative, Monad) via (ReaderT NCGConfig (Strict.State [CLabel])) instance CmmMakeDynamicReferenceM CmmOptM where addImport = addImportCmmOpt ===================================== compiler/GHC/CmmToAsm/Reg/Linear/State.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternSynonyms, DeriveFunctor #-} +{-# LANGUAGE PatternSynonyms, DeriveFunctor, DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} @@ -52,31 +52,24 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Exts (oneShot) -import Control.Monad (ap) +import GHC.Utils.Monad.State.Strict as Strict -type RA_Result freeRegs a = (# RA_State freeRegs, a #) +type RA_Result freeRegs a = (# a, RA_State freeRegs #) -pattern RA_Result :: a -> b -> (# a, b #) -pattern RA_Result a b = (# a, b #) +pattern RA_Result :: a -> b -> (# b, a #) +pattern RA_Result a b = (# b, a #) {-# COMPLETE RA_Result #-} -- | The register allocator monad type. newtype RegM freeRegs a = RegM { unReg :: RA_State freeRegs -> RA_Result freeRegs a } - deriving (Functor) + deriving (Functor, Applicative, Monad) via (Strict.State (RA_State freeRegs)) -- | Smart constructor for 'RegM', as described in Note [The one-shot state -- monad trick] in GHC.Utils.Monad. mkRegM :: (RA_State freeRegs -> RA_Result freeRegs a) -> RegM freeRegs a mkRegM f = RegM (oneShot f) -instance Applicative (RegM freeRegs) where - pure a = mkRegM $ \s -> RA_Result s a - (<*>) = ap - -instance Monad (RegM freeRegs) where - m >>= k = mkRegM $ \s -> case unReg m s of { RA_Result s a -> unReg (k a) s } - -- | Get native code generator configuration getConfig :: RegM a NCGConfig getConfig = mkRegM $ \s -> RA_Result s (ra_config s) ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -329,10 +329,12 @@ warnMissingHomeModules dflags targets mod_graph = -- Note also that we can't always infer the associated module name -- directly from the filename argument. See #13727. is_known_module mod = - (Map.lookup (moduleName (ms_mod mod)) mod_targets == Just (ms_unitid mod)) + is_module_target mod || maybe False is_file_target (ml_hs_file (ms_location mod)) + is_module_target mod = (moduleName (ms_mod mod), ms_unitid mod) `Set.member` mod_targets + is_file_target file = Set.member (withoutExt file) file_targets file_targets = Set.fromList (mapMaybe file_target targets) @@ -343,7 +345,7 @@ warnMissingHomeModules dflags targets mod_graph = TargetFile file _ -> Just (withoutExt (augmentByWorkingDirectory dflags file)) - mod_targets = Map.fromList (mod_target <$> targets) + mod_targets = Set.fromList (mod_target <$> targets) mod_target Target {targetUnitId, targetId} = case targetId of ===================================== compiler/GHC/HsToCore/Monad.hs ===================================== @@ -356,16 +356,16 @@ initTcDsForSolver thing_inside = do { (gbl, lcl) <- getEnvs ; hsc_env <- getTopEnv + -- The DsGblEnv is used to inform the typechecker's solver of a few + -- key pieces of information: + -- + -- - ds_fam_inst_env tells it how to reduce type families, + -- - ds_gbl_rdr_env tells it which newtypes it can unwrap. ; let DsGblEnv { ds_mod = mod , ds_fam_inst_env = fam_inst_env - , ds_gbl_rdr_env = rdr_env } = gbl - -- This is *the* use of ds_gbl_rdr_env: - -- Make sure the solver (used by the pattern-match overlap checker) has - -- access to the GlobalRdrEnv and FamInstEnv for the module, so that it - -- knows how to reduce type families, and which newtypes it can unwrap. - - - DsLclEnv { dsl_loc = loc } = lcl + , ds_gbl_rdr_env = rdr_env + } = gbl + DsLclEnv { dsl_loc = loc } = lcl ; (msgs, mb_ret) <- liftIO $ initTc hsc_env HsSrcFile False mod loc $ updGblEnv (\tc_gbl -> tc_gbl { tcg_fam_inst_env = fam_inst_env ===================================== compiler/GHC/HsToCore/Pmc/Solver.hs ===================================== @@ -36,6 +36,7 @@ import GHC.Prelude import GHC.HsToCore.Pmc.Types import GHC.HsToCore.Pmc.Utils (tracePm, traceWhenFailPm, mkPmId) +import GHC.HsToCore.Types (DsGblEnv(..)) import GHC.Driver.DynFlags import GHC.Driver.Config @@ -51,11 +52,14 @@ import GHC.Types.Unique.DSet import GHC.Types.Unique.SDFM import GHC.Types.Id import GHC.Types.Name -import GHC.Types.Var (EvVar) +import GHC.Types.Name.Reader (lookupGRE_Name, GlobalRdrEnv) +import GHC.Types.Var (EvVar) import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Types.Unique.Supply +import GHC.Tc.Utils.Monad (getGblEnv) + import GHC.Core import GHC.Core.FVs (exprFreeVars) import GHC.Core.TyCo.Compare( eqType ) @@ -97,6 +101,7 @@ import Data.List (sortBy, find) import qualified Data.List.NonEmpty as NE import Data.Ord (comparing) + -- -- * Main exports -- @@ -1959,13 +1964,16 @@ generateInhabitingPatterns mode (x:xs) n nabla = do -- No COMPLETE sets ==> inhabited generateInhabitingPatterns mode xs n newty_nabla Just clss -> do - -- Try each COMPLETE set, pick the one with the smallest number of - -- inhabitants + -- Try each COMPLETE set. nablass' <- forM clss (instantiate_cons y rep_ty xs n newty_nabla) - let nablas' = minimumBy (comparing length) nablass' - if null nablas' && vi_bot vi /= IsNotBot - then generateInhabitingPatterns mode xs n newty_nabla -- bot is still possible. Display a wildcard! - else pure nablas' + if any null nablass' && vi_bot vi /= IsNotBot + then generateInhabitingPatterns mode xs n newty_nabla -- bot is still possible. Display a wildcard! + else do + -- Pick the residual COMPLETE set with the smallest cost (see 'completeSetCost'). + -- See Note [Prefer in-scope COMPLETE matches]. + DsGblEnv { ds_gbl_rdr_env = rdr_env } <- getGblEnv + let bestSet = map snd $ minimumBy (comparing $ completeSetCost rdr_env) nablass' + pure bestSet -- Instantiates a chain of newtypes, beginning at @x at . -- Turns @x nabla [T,U,V]@ to @(y, nabla')@, where @nabla'@ we has the fact @@ -1979,13 +1987,13 @@ generateInhabitingPatterns mode (x:xs) n nabla = do nabla' <- addConCt nabla x (PmAltConLike (RealDataCon dc)) [] [y] instantiate_newtype_chain y nabla' dcs - instantiate_cons :: Id -> Type -> [Id] -> Int -> Nabla -> [ConLike] -> DsM [Nabla] + instantiate_cons :: Id -> Type -> [Id] -> Int -> Nabla -> [ConLike] -> DsM [(Maybe ConLike, Nabla)] instantiate_cons _ _ _ _ _ [] = pure [] instantiate_cons _ _ _ 0 _ _ = pure [] instantiate_cons _ ty xs n nabla _ -- We don't want to expose users to GHC-specific constructors for Int etc. | fmap (isTyConTriviallyInhabited . fst) (splitTyConApp_maybe ty) == Just True - = generateInhabitingPatterns mode xs n nabla + = map (Nothing,) <$> generateInhabitingPatterns mode xs n nabla instantiate_cons x ty xs n nabla (cl:cls) = do -- The following line is where we call out to the inhabitationTest! mb_nabla <- runMaybeT $ instCon 4 nabla x cl @@ -2002,7 +2010,54 @@ generateInhabitingPatterns mode (x:xs) n nabla = do -- inhabited, otherwise the inhabitation test would have refuted. Just nabla' -> generateInhabitingPatterns mode xs n nabla' other_cons_nablas <- instantiate_cons x ty xs (n - length con_nablas) nabla cls - pure (con_nablas ++ other_cons_nablas) + pure (map (Just cl,) con_nablas ++ other_cons_nablas) + +-- | If multiple residual COMPLETE sets apply, pick one as follows: +-- +-- - prefer COMPLETE sets in which all constructors are in scope, +-- as per Note [Prefer in-scope COMPLETE matches], +-- - if there are ties, pick the one with the fewest (residual) ConLikes, +-- - if there are ties, pick the one with the fewest "trivially inhabited" types, +-- - if there are ties, pick the one with the fewest PatSyns, +-- - if there are still ties, pick the one that comes first in the list of +-- COMPLETE pragmas, which means the one that was brought into scope first. +completeSetCost :: GlobalRdrEnv -> [(Maybe ConLike, a)] -> (Bool, Int, Int, Int) +completeSetCost _ [] = (False, 0, 0, 0) +completeSetCost rdr_env ((mb_con, _) : cons) = + let con_out_of_scope + | Just con <- mb_con + = isNothing $ lookupGRE_Name rdr_env (conLikeName con) + | otherwise + = False + (any_out_of_scope, nb_cons, nb_triv, nb_ps) = completeSetCost rdr_env cons + in ( any_out_of_scope || con_out_of_scope + , nb_cons + 1 + , nb_triv + case mb_con of { Nothing -> 1; _ -> 0 } + , nb_ps + case mb_con of { Just (PatSynCon {}) -> 1; _ -> 0 } + ) + +{- Note [Prefer in-scope COMPLETE matches] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We prefer using COMPLETE pragmas in which all ConLikes are in scope, as this +improves error messages. See for example T25115: + + - T25115a defines pattern Foo :: a with {-# COMPLETE Foo #-} + - T25115 imports T25115a, but not Foo. + (This means it imports the COMPLETE pragma, which behaves like an instance.) + + Then, for the following incomplete pattern match in T25115: + + baz :: Ordering -> Int + baz = \case + EQ -> 5 + + we would prefer reporting that 'LT' and 'GT' are not matched, rather than + saying that 'T25115a.Foo' is not matched. + + However, if ALL ConLikes are out of scope, then we should still report + something, so we don't want to outright filter out all COMPLETE sets + with an out-of-scope ConLike. +-} pickApplicableCompleteSets :: TyState -> Type -> ResidualCompleteMatches -> DsM DsCompleteMatches -- See Note [Implementation of COMPLETE pragmas] on what "applicable" means ===================================== compiler/GHC/HsToCore/Types.hs ===================================== @@ -53,9 +53,9 @@ data DsGblEnv = DsGblEnv { ds_mod :: Module -- For SCC profiling , ds_fam_inst_env :: FamInstEnv -- Like tcg_fam_inst_env - , ds_gbl_rdr_env :: GlobalRdrEnv -- needed *only* to know what newtype - -- constructors are in scope during - -- pattern-match satisfiability checking + , ds_gbl_rdr_env :: GlobalRdrEnv -- needed only for the following reasons: + -- - to know what newtype constructors are in scope + -- - to check whether all members of a COMPLETE pragma are in scope , ds_name_ppr_ctx :: NamePprCtx , ds_msgs :: IORef (Messages DsMessage) -- Diagnostic messages , ds_if_env :: (IfGblEnv, IfLclEnv) -- Used for looking up global, ===================================== compiler/GHC/SysTools/Cpp.hs ===================================== @@ -263,11 +263,17 @@ generateMacros prefix name version = -- | Find out path to @ghcversion.h@ file getGhcVersionPathName :: DynFlags -> UnitEnv -> IO FilePath getGhcVersionPathName dflags unit_env = do - candidates <- case ghcVersionFile dflags of - Just path -> return [path] - Nothing -> do - ps <- mayThrowUnitErr (preloadUnitsInfo' unit_env [rtsUnitId]) - return (( "ghcversion.h") <$> collectIncludeDirs ps) + let candidates = case ghcVersionFile dflags of + -- the user has provided an explicit `ghcversion.h` file to use. + Just path -> [path] + -- otherwise, try to find it in the rts' include-dirs. + -- Note: only in the RTS include-dirs! not all preload units less we may + -- use a wrong file. See #25106 where a globally installed + -- /usr/include/ghcversion.h file was used instead of the one provided + -- by the rts. + Nothing -> case lookupUnitId (ue_units unit_env) rtsUnitId of + Nothing -> [] + Just info -> ( "ghcversion.h") <$> collectIncludeDirs [info] found <- filterM doesFileExist candidates case found of ===================================== compiler/GHC/Types/Unique/Supply.hs ===================================== @@ -4,6 +4,7 @@ -} {-# LANGUAGE CPP #-} +{-# LANGUAGE DerivingVia #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE UnboxedTuples #-} @@ -41,6 +42,7 @@ import Control.Monad import Data.Word import GHC.Exts( Ptr(..), noDuplicate#, oneShot ) import Foreign.Storable +import GHC.Utils.Monad.State.Strict as Strict #include "MachDeps.h" @@ -304,6 +306,8 @@ uniqFromSupply (MkSplitUniqSupply n _ _) = mkUniqueGrimily n uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily n : uniqsFromSupply s2 takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily n, s1) +{-# INLINE splitUniqSupply #-} + {- ************************************************************************ * * @@ -320,12 +324,7 @@ pattern UniqResult x y = (# x, y #) -- | A monad which just gives the ability to obtain 'Unique's newtype UniqSM result = USM { unUSM :: UniqSupply -> UniqResult result } - --- See Note [The one-shot state monad trick] for why we don't derive this. -instance Functor UniqSM where - fmap f (USM m) = mkUniqSM $ \us -> - case m us of - (# r, us' #) -> UniqResult (f r) us' + deriving (Functor, Applicative, Monad) via (Strict.State UniqSupply) -- | Smart constructor for 'UniqSM', as described in Note [The one-shot state -- monad trick]. @@ -333,17 +332,6 @@ mkUniqSM :: (UniqSupply -> UniqResult a) -> UniqSM a mkUniqSM f = USM (oneShot f) {-# INLINE mkUniqSM #-} -instance Monad UniqSM where - (>>=) = thenUs - (>>) = (*>) - -instance Applicative UniqSM where - pure = returnUs - (USM f) <*> (USM x) = mkUniqSM $ \us0 -> case f us0 of - UniqResult ff us1 -> case x us1 of - UniqResult xx us2 -> UniqResult (ff xx) us2 - (*>) = thenUs_ - -- TODO: try to get rid of this instance instance MonadFail UniqSM where fail = panic @@ -356,30 +344,12 @@ initUs init_us m = case unUSM m init_us of { UniqResult r us -> (r, us) } initUs_ :: UniqSupply -> UniqSM a -> a initUs_ init_us m = case unUSM m init_us of { UniqResult r _ -> r } -{-# INLINE thenUs #-} -{-# INLINE returnUs #-} -{-# INLINE splitUniqSupply #-} - --- @thenUs@ is where we split the @UniqSupply at . - liftUSM :: UniqSM a -> UniqSupply -> (a, UniqSupply) liftUSM (USM m) us0 = case m us0 of UniqResult a us1 -> (a, us1) instance MonadFix UniqSM where mfix m = mkUniqSM (\us0 -> let (r,us1) = liftUSM (m r) us0 in UniqResult r us1) -thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b -thenUs (USM expr) cont - = mkUniqSM (\us0 -> case (expr us0) of - UniqResult result us1 -> unUSM (cont result) us1) - -thenUs_ :: UniqSM a -> UniqSM b -> UniqSM b -thenUs_ (USM expr) (USM cont) - = mkUniqSM (\us0 -> case (expr us0) of { UniqResult _ us1 -> cont us1 }) - -returnUs :: a -> UniqSM a -returnUs result = mkUniqSM (\us -> UniqResult result us) - getUs :: UniqSM UniqSupply getUs = mkUniqSM (\us0 -> case splitUniqSupply us0 of (us1,us2) -> UniqResult us1 us2) ===================================== compiler/GHC/Utils/Monad/State/Strict.hs ===================================== @@ -4,7 +4,7 @@ -- | A state monad which is strict in its state. module GHC.Utils.Monad.State.Strict ( -- * The State monad - State(State) + State(State, State' {- for deriving via purposes only -}) , state , evalState , execState @@ -78,8 +78,10 @@ pattern State m <- State' m forceState :: (# a, s #) -> (# a, s #) forceState (# a, !s #) = (# a, s #) +-- See Note [The one-shot state monad trick] for why we don't derive this. instance Functor (State s) where fmap f m = State $ \s -> case runState' m s of (# x, s' #) -> (# f x, s' #) + {-# INLINE fmap #-} instance Applicative (State s) where pure x = State $ \s -> (# x, s #) @@ -87,10 +89,20 @@ instance Applicative (State s) where case runState' m s of { (# f, s' #) -> case runState' n s' of { (# x, s'' #) -> (# f x, s'' #) }} + m *> n = State $ \s -> + case runState' m s of { (# _, s' #) -> + case runState' n s' of { (# x, s'' #) -> + (# x, s'' #) }} + {-# INLINE pure #-} + {-# INLINE (<*>) #-} + {-# INLINE (*>) #-} instance Monad (State s) where m >>= n = State $ \s -> case runState' m s of (# r, !s' #) -> runState' (n r) s' + (>>) = (*>) + {-# INLINE (>>=) #-} + {-# INLINE (>>) #-} state :: (s -> (a, s)) -> State s a state f = State $ \s -> case f s of (r, s') -> (# r, s' #) ===================================== libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs ===================================== @@ -52,6 +52,19 @@ import GHC.Internal.Base import GHC.Internal.Show import GHC.Internal.Exception.Context +{- | +A constraint used to propagate 'ExceptionContext's. + +GHC will automatically default any unsolved 'HasExceptionContext' constraints to an +empty exception context, similarly to 'HasCallStack'. + +NOTE: The fact that @HasExceptionContext@ is defined as an implicit parameter is +an implementation detail and __should not__ be considered a part of the API. +It does however mean that any implicit parameter `?exceptionContext :: ExceptionContext` +will be subject to defaulting, as described above. + + at since base-4.20.0.0 +-} type HasExceptionContext = (?exceptionContext :: ExceptionContext) {- | ===================================== rts/linker/PEi386.c ===================================== @@ -2096,6 +2096,15 @@ ocResolve_PEi386 ( ObjectCode* oc ) *(uint32_t *)pP = (uint32_t)v; break; } + case 14: /* R_X86_64_PC64 (ELF constant 24) - IMAGE_REL_AMD64_SREL32 (PE constant 14) */ + { + /* mingw will emit this for a pc-rel 64 relocation */ + uint64_t A; + checkProddableBlock(oc, pP, 8); + A = *(uint64_t*)pP; + *(uint64_t *)pP = S + A - (intptr_t)pP; + break; + } case 4: /* R_X86_64_PC32 (ELF constant 2) - IMAGE_REL_AMD64_REL32 (PE constant 4) */ { intptr_t v; ===================================== rts/linker/elf_reloc_aarch64.c ===================================== @@ -326,7 +326,8 @@ relocateObjectCodeAarch64(ObjectCode * oc) { ELF64_R_SYM((Elf64_Xword)rel->r_info)); CHECK(0x0 != symbol); - CHECK(0x0 != symbol->addr); + if(0x0 == symbol->addr) + barf("0x0 address for %s + %ld of type %ld in %s for relocation %d in section %d of kind: %d\n", symbol->name, rel->r_addend, ELF64_R_TYPE((Elf64_Xword)rel->r_info), OC_INFORMATIVE_FILENAME(oc), i, relaTab->targetSectionIndex, oc->sections[relaTab->targetSectionIndex].kind); /* take explicit addend */ int64_t addend = rel->r_addend; ===================================== testsuite/tests/count-deps/CountDepsAst.stdout ===================================== @@ -218,6 +218,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/count-deps/CountDepsParser.stdout ===================================== @@ -240,6 +240,7 @@ GHC.Utils.Lexeme GHC.Utils.Logger GHC.Utils.Misc GHC.Utils.Monad +GHC.Utils.Monad.State.Strict GHC.Utils.Outputable GHC.Utils.Panic GHC.Utils.Panic.Plain ===================================== testsuite/tests/driver/multipleHomeUnits/T25122/T25122.hs ===================================== @@ -0,0 +1 @@ +module T25122 where ===================================== testsuite/tests/driver/multipleHomeUnits/all.T ===================================== @@ -71,6 +71,11 @@ test('multipleHomeUnits_shared', [extra_files([ 'A.hs', 'unitShared1', 'unitShar test('multipleHomeUnits_shared_ghci', [extra_files([ 'shared.script', 'A.hs', 'unitShared1', 'unitShared2']), extra_run_opts('-unit @unitShared1 -unit @unitShared2')], ghci_script, ['shared.script']) +test('T25122', + [ extra_files( + [ 'T25122', 'unitSame1', 'unitSame2']) + ], multiunit_compile, [['unitSame1', 'unitSame2'], '-v0 -fhide-source-paths -Werror -Wmissing-home-modules']) + ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame1 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=s1 ===================================== testsuite/tests/driver/multipleHomeUnits/unitSame2 ===================================== @@ -0,0 +1,3 @@ +T25122 +-iT25122 +-this-unit-id=u2 ===================================== testsuite/tests/pmcheck/complete_sigs/T25115.hs ===================================== @@ -0,0 +1,28 @@ +{-# LANGUAGE EmptyCase #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} + +module T25115 where + +import T25115a ( ABC ) + +-- Check that we don't suggest to use the 'Foo' pattern synonym from +-- T25115a, as it is not imported (even though the import of T25115a +-- has brought into scope all COMPLETE pragmas from that module). + +foo :: Bool -> Int +foo = \case {} + +bar :: Bool -> Int +bar = \case + True -> 3 + +baz :: Ordering -> Int +baz = \case + EQ -> 5 + +-- Check that we do still suggest something for ABC, even though +-- all constructors are out of scope. + +quux :: ABC -> Int +quux = \case {} ===================================== testsuite/tests/pmcheck/complete_sigs/T25115.stderr ===================================== @@ -0,0 +1,25 @@ +[1 of 2] Compiling T25115a ( T25115a.hs, T25115a.o ) +[2 of 2] Compiling T25115 ( T25115.hs, T25115.o ) +T25115.hs:14:7: warning: [GHC-62161] [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a \case alternative: + Patterns of type ‘Bool’ not matched: + False + True + +T25115.hs:17:7: warning: [GHC-62161] [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a \case alternative: Patterns of type ‘Bool’ not matched: False + +T25115.hs:21:7: warning: [GHC-62161] [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a \case alternative: + Patterns of type ‘Ordering’ not matched: + LT + GT + +T25115.hs:28:8: warning: [GHC-62161] [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a \case alternative: + Patterns of type ‘ABC’ not matched: T25115a.Foo + ===================================== testsuite/tests/pmcheck/complete_sigs/T25115a.hs ===================================== @@ -0,0 +1,9 @@ +{-# LANGUAGE PatternSynonyms #-} + +module T25115a ( pattern Foo, ABC ) where + +pattern Foo :: a +pattern Foo <- _unused +{-# COMPLETE Foo #-} + +data ABC = A | B | C ===================================== testsuite/tests/pmcheck/complete_sigs/all.T ===================================== @@ -32,3 +32,4 @@ test('T18960', normal, compile, ['']) test('T18960b', normal, compile, ['']) test('T19475', normal, compile, ['']) test('T24326', normal, compile, ['']) +test('T25115', [extra_files(['T25115a.hs'])], multimod_compile, ['T25115', '']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/847e805265f2fe06c1fb68abf1b009b5bb2e74d1...0fc5339c37e69fdb4bda12469fd99b7bf5c6e884 -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/847e805265f2fe06c1fb68abf1b009b5bb2e74d1...0fc5339c37e69fdb4bda12469fd99b7bf5c6e884 You're receiving this email because of your account on gitlab.haskell.org. -------------- next part -------------- An HTML attachment was scrubbed... URL: